-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSP1 not working correctly with example code from lgt_LowPower library #317
Comments
In my opinion the source of the problem is, that the LowPower library sets the watchdog timer for sleep, but does not reset it to the previous state after waking up. Maybe the solution is to stop WDT immediately after wake up with |
I tried the sketch as well on a Nano-style board. I pressed the button ~30 times and always got the expected wake-up and not a single reset. There must be something else. However, I have no idea what it could be. @whyameye , how often do you get the reset if you press the button let's say 10 times? |
@wollewald |
Yes, maybe it's related to the pushbutton. @whyameye , to find if the pushbutton is the reason, you could take a second MCU-Board and connect its GND and an I/O pin to the GND and D2 of your Nano style board. Then upload a sketch like this to the second MCU-Board which shall trigger the wake-up:
Would be helpful to see whether you still experience resets. |
I'd second the debounce concern. You have to be extra careful to debounce
an input electronically if you're going to use it as some kind of IRQ input
to a micro. Any other button makes more sense to debounce in software, but
that's not an option for IRQ/wake inputs.
…On Thu, Apr 18, 2024 at 2:55 PM Wolfgang (Wolle) Ewald < ***@***.***> wrote:
Yes, maybe it's related to the pushbutton.
@whyameye <https://github.com/whyameye> , to find if the pushbutton is
the reason, you could take a second MCU-Board and connect its GND and an
I/O pin to the GND and D2 of your Nano style board. Then upload a sketch
like this to the second MCU-Board which shall trigger the wake-up:
void setup(){
pinMode(6, OUTPUT);
digitalWrite(6, HIGH);
}
void loop(){
delay(10000);
digitalWrite(6, LOW);
delay(50);
digitalWrite(6, HIGH);
}
Would be helpful to see whether you still experience resets.
—
Reply to this email directly, view it on GitHub
<#317 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPEX7EV2NPCXYVVLHDTSTTY6AJLLAVCNFSM6AAAAABGNMKGU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRUHE2DONZTGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
First, thanks to all of you for putting some time into helping me with all of this. It is very much appreciated. Using the code from @wollewald I'm still getting the resets. Here's some grepped output with timestamps:
Still using code from @wollewald and adding
Photo of my setup and example code with |
I think the error may be related to the way LGT handles the reset vector: #304 (comment) The lgt_LowPower library using The logicgreen |
I'm not sure I totally understood what to try. I tried changing |
I apologise for the many "solution" variation, I'm not going to be able to try it soon, but here is new one: Inside the ISR put this line
I think this will be the only change needed in the original example program. ( standbyExternalInterrupt.ino ) Anyway, that is strange, @wollewald 's try was error free. |
To add that line, I have to either add If I add I'm still using the automated blink-inspired code running on another LGT8Fx as @wollewald recommended to keep any issues with a physical switch out of the equation and to automate the testing. @wollewald did you experience no issues with your automated code running over 15 min? |
Testing this example with nano style and normally open pushbutton connected between D2 and GND produces erratic results. Sample output varies. Here is one example of serial output from a fresh run. Comments have been added as lines without datestamps:
The text was updated successfully, but these errors were encountered: