Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] Re:Watchdog and sleep modes

2004-04-27 by jamie pollock

I am in assembly only, This is why i can't understand what to do to preserve the registers. I have tried storing the data in 0cr1a and r30,r29 ect. but it still wipes it out.I still need to check the mcusr to see if the watchdog is the only reset which is occuring.
If i use eeprom, it will wear it out. I want to have a index of cycles the micro is going through.

Larry Barello <yahoo@barello.net> wrote:
Yep.  This is the most effective way to do a hard reset...  The registers and SRAM shouldn't be affected, but if you are using C the startup runtime will clear everything out for you. The hardware registers (e.g. I/O & peripherals) will be wiped out. 
 
You might get away with a bit of assembly code, intercept the reset vector (can't help you with how...) check to see the reset source and skip the C-runtime init code if it were watchdog.  However, there would be a host of issues to resolve: which C variables need initializing, and which you want to save, etc.  Not a trivial problem.
 
 
-----Original Message-----
From: jamie pollock 


I am using the watchdog to come out of sleep mode. The watchdog seems to work fine ( i can turn it off sucessfully and re-enable it). My trouble is that when the watchdog resets it doesnot resume after the sleep. The controller begins at the reset vector and clears my registers. Is this what it is supposed to do? I think the documentation states that the registers would be intact.



---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/AVR-Chat/
  
   To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


		
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.