microman171
Member
Hey Guys,
I have a DS1307 hooked up like the datasheet says to do, but it doesn't tick over the seconds. I have used bits of code from: http://www.picaxeforum.co.uk/showthread.php?t=8078, and I can read and write easy enough. I use 10k pull-up resistors.
I DON'T have a crystal. According to the datasheet it is optional. Is this true?
The problem is, the time doesn't update. I write the correct time, and then I can read the time that was written, but the time never changes...
What have I done wrong?
Write:
Read:
Here is a picture of my circuit http://picasaweb.google.com/Microman171/MiscElectronics#5337033668914831698, but I know the only wiring part that could be wrong is the crystal.
I have a DS1307 hooked up like the datasheet says to do, but it doesn't tick over the seconds. I have used bits of code from: http://www.picaxeforum.co.uk/showthread.php?t=8078, and I can read and write easy enough. I use 10k pull-up resistors.
I DON'T have a crystal. According to the datasheet it is optional. Is this true?
The problem is, the time doesn't update. I write the correct time, and then I can read the time that was written, but the time never changes...
What have I done wrong?
Write:
Code:
setup:
HI2CSETUP I2CMASTER, %11010000, i2cslow, i2cbyte
I2C:
hi2cout 0, ($00, $58, $15, $01, $18, $05, $09, %00010000)
Code:
setup:
HI2CSETUP I2CMASTER, %11010001, i2cslow, i2cbyte
display:
'Year
hi2cin 6, (b0) bcdtoascii b0, b1, b2 sertxd ("Yr:", b1, b2)
'Month
hi2cin 5, (b0) bcdtoascii b0, b1, b2 sertxd (" Mo:", b1, b2)
'Day
hi2cin 4, (b0) bcdtoascii b0, b1, b2 sertxd (" Da:", b1, b2)
'Hour
hi2cin 2, (b0) bcdtoascii b0, b1, b2 sertxd (" Time:", b1, b2)
'Minute
hi2cin 1, (b0) bcdtoascii b0, b1, b2 sertxd (":", b1, b2)
'Second
hi2cin 0, (b0) bcdtoascii b0, b1, b2 sertxd (":", b1, b2)
'CR
sertxd (13, 10, 13, 10)
pause 10000
goto display