konradIC13
Member
Hello,
Does anyone have a 100% working code for initialising, setting date/time and then reading date/time from DS1307 (and storing date/time in variables) written in C using hardware TWI interface at ATmega (most preferably atmega8).
The problem is i want to use DS1307 RTC and before ill start writing things by myself (because always when i check a device with libraries written by someone, and i read them and understand i start writing them from scratch by myself to know them better) i want to make sure i connected RTC in good way and its working (im gonna display it on LCD) and so when ill start writing my own program ill know that if its not working its my code fault and not RTC connection problem.
I tried to to search for it in internet but all i find are I2C libraries but i want something specific for DS1307 since im just starting it and im afraid that when using those I2C general libraries ill mess something up with combination of writing, initialising etc and again i wont know if its not working because of code or because of hardware.
Does anyone have a 100% working code for initialising, setting date/time and then reading date/time from DS1307 (and storing date/time in variables) written in C using hardware TWI interface at ATmega (most preferably atmega8).
The problem is i want to use DS1307 RTC and before ill start writing things by myself (because always when i check a device with libraries written by someone, and i read them and understand i start writing them from scratch by myself to know them better) i want to make sure i connected RTC in good way and its working (im gonna display it on LCD) and so when ill start writing my own program ill know that if its not working its my code fault and not RTC connection problem.
I tried to to search for it in internet but all i find are I2C libraries but i want something specific for DS1307 since im just starting it and im afraid that when using those I2C general libraries ill mess something up with combination of writing, initialising etc and again i wont know if its not working because of code or because of hardware.