![]() |
Forum Index : Microcontroller and PC projects : WAKEUP Problem
Author | Message | ||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2949 |
Hi All, As you know I am a bit of a tyro with programming but I am having a problem with SLEEP and WAKEUP I am using a wakeup input (GND to pin 16) to bring the MM out of SLEEP mode This works but after a wakeup command I cannot seem to reinstate the sleep command See this small snippet of my cut down code to demonstrate. premain: print "PREMAIN Processed" settick 3000, TimUp, 1 main: ? "MAIN LOOP" pause 500 goto main: TimUp: print "SLEEP Triggered" Settick 0,0,1 'disable timer CPU SLEEP ? "WAKEUP Detected" goto premain: On a RUN the program shows that PreMain: was processed which setup a settick of 3 seconds then I get 7 iterations of Main Loop before the settick sends the program to the SLEEP routine as proven by SLEEP being printed on the display.. This works and a gnd on the wakeup pin awakens the processor and executes the Premain process again but the settick command doesnt seem to reinitialise after the MM has woken from a sleep (the words MAIN continue endlessly) Is this a bug or just a Dumb-Mik problem? Yes I am using GOTO commands and I am sure there are other methods but that is the way my brain works.. FYI I am using v5.3.1 and a 28pin chip. Kind Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
TimUp is an interrupt routine so you should have a IRETURN at the end of it. Geoff Geoff Graham - http://geoffg.net |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2949 |
Thanks Geoff, Ahh Of course !!!. See I told you I was a tyro.. It works now.. Makes sense to me.. Now to put it into my water program.. Which works well and just needs a method of saving on battery drain. Appreciate the quick response. Kind Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
greybeard Senior Member ![]() Joined: 04/01/2010 Location: AustraliaPosts: 172 |
It's probably all those beers and the nanna naps you've been having that are the problem with the sleep and wakeups ![]() |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2949 |
@Greybeard, You might be right, I have now got my water tank/( beer vat ) ![]() I had a lot of fun with my portrait mode linear gauge and testing with the distance sensor taped to a chair measuring the LITRES from the sensor to the door.. Geoff has put so much graphic support that it was simple to draw gauges etc all that was needed was the maths to convert 30cm to equate to 2000lt and 188cm as 0lt and convert the calculated litres to a vertical gauge. Thank you Geoff and for helping me with the last part that stumped me so much. Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |