I am using DS1307 RTC in my project and doing C lang. Code to display time and date in Hyper terminal using RS232. but there I have found a lot problem in programming.
Now I comes to know that DS1307 also work SPI.
Is that true? then how I can use it as SPI and which pin I have to connect of it with controller.
and also please give suggestion related to code of SPI in C lang. for DS1307.
DS1307 works only with i2c protocol. for DS1307 programming in C see the attached file. Change the extension of files accordingly. which microcontroller are you using? UART and other files will be sent accordingly.
DS1307 works only with i2c protocol. for DS1307 programming in C see the attached file. Change the extension of files accordingly. which microcontroller are you using? UART and other files will be sent accordingly.
at89c51 does not have an i2c interface. What you have to do is make a soft i2c by dedication two pins. Read start, stop, ack and NACK signals in i2c. then you would be able to interface DS1307.