View previous topic :: View next topic |
Author |
Message |
Nick Guest
|
Dallas Real Time Clock interrupt question |
Posted: Wed Aug 04, 2004 8:41 am |
|
|
I believe I turned on the SQW with the binary 10010011 / 0x93. Someone in a previous post said I could wake up every second using this OUT/SQW, but it seems it is will waking up many times a second since its a SQW at 32hz.
Wonder if I should do something like an pic internal timer and just sleep and just wake up once a minute.
Here is the datasheet page 9 http://pdfserv.maxim-ic.com/en/ds/DS1307.pdf
Nick |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Aug 04, 2004 8:54 am |
|
|
For a 1 Hz signal you must set bit0 and bit1 both to zero, with both bits set to 1 you will get a 32kHz signal. Change to binary 10010000 / 0x90. |
|
|
Nick Guest
|
|
Posted: Wed Aug 04, 2004 9:04 am |
|
|
Yep
Here is a link that also helps
http://www.ccsinfo.com/forum/viewtopic.php?t=1700&highlight=1307+interrupt
I as you can tell I'm new to pics. Here is a dumb question. Can I tell the pic to sleep for 50 seconds then wake up? I see that I can get it to sleep and wake up on an interupt RB0 attached to the RTC, but that is still way more awake time than I need.
Nick |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Aug 04, 2004 10:40 am |
|
|
Drive timer0 and wake up on overflow. You can preload the timer value to set the number of seconds. |
|
|
|