07-14-2012 03:03 AM
Hi everyone,
I am trying to read/write data from rtc ds1307 using i2c protocol but i am unable to read or write data.Here i am posting my code.I have tried both the codes but none of them are working.Can anyone please guide me?
07-16-2012 03:13 AM
Hi, habibi
try to use a delay of about 5 ms
Now explain what is what:
1 -. address of the location at which to begin writing data.
2 -. directly to the data itself. we find that the F7 is written in a cell with address 0, F0 in a cell with address 1, F8 is written in the cell with address 2, etc.
3 -. address of the location at which to begin reading data.
4 -. number of cells that must be read
pursuant to paragraph 3 and 4 we read 2,3,4,5,6,7,8 cell
5 -. a slave address of your device (in this case, the memory chips). on page 5 of the above datasheet this address is given: 1010hhh (where x - depending on how you connect the memory. I 0). Then this is the address: 1010000, if translated into a 16-SS get 50.
05-10-2013 10:42 PM
Hi,
I am trying to do the same thing also, but the data read is always 255 (which is the default value i think?). What should i actually connect to the "write data" port? an array? or other things?
Best Regards,
Kent