Hi Rocky,
Look on page 11 of the datasheet. The addresses in Hex and the register name under the function column are what you need. I have attached a listing example from a DS1337 program for an example. The datasheet had the same type of setup as this chip. You can't write any data to the RTC if it doesn't know where to put it.
Boy if I'm wrong here I really apologize but I think I'm right. Please let me know.
BobK
Last edited by BobK; - 12th February 2007 at 20:26. Reason: Correct some errors.
Bob,
That's what i have on my code if you look back. Here is a sample take the minutes sample for example:
'Set the time
I2cwrite PORTC.2,PORTC.1,CONTL,$01,[rtcmin] 'minutes
the CONTL is the address of the RTC the $01 is the minutes register and the rtcmin is the value to be put in the register.
I hope you find my mistake.
Thanks
Hi Rocky,
Click on SEARCH and enter DS1337. Look at the post :example code for DS1337, dated 28Oct2004. The program shows the register addresses. If you don't have the addresses setup then the clock can't be set and it will not work properly.
All of the addresses on page 11 of the datasheet need to be setup as constants. Take the list of addresses on the example code I attached on my last reply. Put them into your program and try them. I do understand you also may possibly have other issues with your setup but these constants need to be a part of your program.
BobK
Thanks Bob and all of you who replied to this post. My mistake was simple like usual. The RTC slave address is 7 bits so I added an extra zero to the left to make it 8 but i was wrong the zero should be to the right!
Bookmarks