Problems with DS1302
imekon
Posts: 6
I'm having issues with a DS1302 I have wired to a Propeller chip - usually when I hook up to the board with a prop clip, the clock appears to be lagging behind a few minutes (in one case several hours). Yesterday, it was about 20 minutes ahead!
I've also seen the clock stop ticking. I'm using DS1302_full, like this:
I did make a small change to DS1302_full, to turn off the tickle charging of the 3.2v battery attached
I've also seen the clock stop ticking. I'm using DS1302_full, like this:
{ The DS1302 Real Time Clock } RTC_CLOCK = 5 RTC_IO = 6 RTC_ENABLE = 7 { Start the RTC } rtc.init( RTC_CLOCK, RTC_IO, RTC_ENABLE ) rtc.config
I did make a small change to DS1302_full, to turn off the tickle charging of the 3.2v battery attached
PUB config ''Config DS1302. Call once after DS1302 power-up. ''Usage: rtc.config write(command(clock,ctrl,w),0) 'clear write-protect bit write(command(clock,sec,w),0) 'clear clock halt bit (MSB of seconds register) write(command(clock,sec,w),0) 'set 24h mode 'Trickle charger setup - OFF write(command(clock,tc,w),0) 'Examples of other useful config and control commands 'write(command(clock,sec,w),%1000_0000) 'set clock halt bit 'write(command(clock,ctrl,w),%1000_0000) 'set write-protect bit 'write(command(clock,sec,w),read(command(clock,sec,r))&%1000_0000) 'set 24h mode bit without resetting the other 7 bits
Comments
You might try disconnecting the 3.2V battery and seeing if that makes the problem go away (presuming you're using it as the backup, not as the primary power source).