The DS1307 is good +/- a few minutes every year.
A CR2032 Battery lasts many years. We've been shipping these for about seven years and haven't needed to change a Battery yet.
Use I2CREAD and I2CWRITE... example...
I2CWrite SDA,SCL,I2CAddress,DataB,[DataA]
where...
I2CAddress=$D0 (the BYTE value address for the device)
DataB is the BYTE value address representing the Register you are writing (usually in the range $00-$07 - see DS1307 Datasheet for what each register contains)
and DataA is the BYTE value that you are putting into the Register.
4K7 pull-up's on SCL and SDA required... a lower value may be required if you have multiple devices on the Bus.
You I2CREAD any time you feel like it... once a second, ten times a second... how ever often you feel like it. Note that you can program the DS1307 to output a pulse every second... you can use that to synchronise your PIC to read and display, or display on interrupt...




Bookmarks