jruibarroso
Joined: 07 Jan 2006 Posts: 64 Location: Braga
|
Please help with problems reading day and dow on DS1307 |
Posted: Thu Mar 03, 2011 10:40 pm |
|
|
I use this driver DS1307 founded on drivers directory of CCS http://www.ccsinfo.com/forum/viewtopic.php?t=23255
connected DS1307 as follows :
pin 1: Crystal 32.768Khz
pin 2: Crystal 32.768Khz
pin 3: V + bat
pin 4: GND
pin 5: SDA pull-up resistor 4.7 K to +5V
pin 6: SCL pull-up resistor 4.7 K to +5V
pin 7: NC
pin 8: +5V
Vbat is 3.0 V.
I write once during program this date and hours eg.: ds1307_set_date_time(04,03,11,1,23,59,30)
1 - 4/03/2011 23:59'30 and if I wait for 0:00:00 just for test, date and dow will increase, day now is "5" and dow is "2" but if I remove power from pic, the reading date will be:
day->"0"
dow->"7"
month ->"03"
year ->"11"
0 - 0/03/2011 0:00'xx
It seems that is now handling very well with day and dow values
any ideas, please ? |
|