DS1307 RTC All In One Reader & Programmer.
Posted: Mon Apr 20, 2015 2:56 pm
I have just Purchased a few RTC modules from 4tronix for £3.20 each:
DS1307 Datasheet
Only took a couple of days to arrive and shop owner does answer any queries you have very quickly indeed!
You can purchase at a cheaper price from china, but I did not want to complicate things with additional charges like import TAX!
So stuck with UK.
Modules include rechargeable battery which when charged can allow RTC to keep time with no external power from 9 to 17 years!
So I thought I would create an all in one RTC reader and programmer.
All that's required are:
Two Momentary switches (using EB007 Eblock),
Microcontoller (using EB006 V9 Eblock)
LCD (using EB005 Eblock)
A suitable power supply
Either 2.54 mm Headers (usually male & min of 2 single Rows of 4 if not using square wave o/p) or 4 wires.
The connections are:
GND
Vcc = +5V (supply range is 4.5 to 5.5V)
SDA = Serial DAta = Port C5 with attached flowchart.
SCL = Serial CLock = Port C4 with attached flowchart.
Only using the above settings so USBEE Eblock can decode I2C signals.
When Hardware is first powered up, If DS1307 is correctly programmed you should see the following format: None of the three modules I purchased was correctly programmed so the time was not running at all.
If you want to set a new time and date then press switch on A0 (Enter function).
you should then see the abbreviation SUN Flashing: Any values flashing is enabled for adjustment up (switch connected to A1).
Every time you press A1 then Day will increment: SUN MON TUE WED THU FRI SAT SUN MON etc.
When correct day is set, press enter switch to start next char flashing.
Again pressing adjustment up switch (A1) to increment tens, of Date.
Pressing enter will cause units of dates to flash etc.
If you realise after enter you have made a mistake, then long pressing enter (for a second or more) should make the previous car flash again for adjustment.
When the last char is flashing (second units) as soon as enter is short pressed the RTC should be updated with new time and date: Flowchart is the first version, so may not be perfect.
I have added some error catches.
For example if you don't increment date and still shows DD then it should not allow you to short press enter and go to MM.
Caution:
If connections to RTC module are nor correct or only GND is removed for example then registers will be corrupt.
This will force the time to be invalid and seconds will stop altogether.
Only solution is to program with correct valid time.
Martin
Only took a couple of days to arrive and shop owner does answer any queries you have very quickly indeed!
You can purchase at a cheaper price from china, but I did not want to complicate things with additional charges like import TAX!
So stuck with UK.
Modules include rechargeable battery which when charged can allow RTC to keep time with no external power from 9 to 17 years!
So I thought I would create an all in one RTC reader and programmer.
All that's required are:
Two Momentary switches (using EB007 Eblock),
Microcontoller (using EB006 V9 Eblock)
LCD (using EB005 Eblock)
A suitable power supply
Either 2.54 mm Headers (usually male & min of 2 single Rows of 4 if not using square wave o/p) or 4 wires.
The connections are:
GND
Vcc = +5V (supply range is 4.5 to 5.5V)
SDA = Serial DAta = Port C5 with attached flowchart.
SCL = Serial CLock = Port C4 with attached flowchart.
Only using the above settings so USBEE Eblock can decode I2C signals.
When Hardware is first powered up, If DS1307 is correctly programmed you should see the following format: None of the three modules I purchased was correctly programmed so the time was not running at all.
If you want to set a new time and date then press switch on A0 (Enter function).
you should then see the abbreviation SUN Flashing: Any values flashing is enabled for adjustment up (switch connected to A1).
Every time you press A1 then Day will increment: SUN MON TUE WED THU FRI SAT SUN MON etc.
When correct day is set, press enter switch to start next char flashing.
Again pressing adjustment up switch (A1) to increment tens, of Date.
Pressing enter will cause units of dates to flash etc.
If you realise after enter you have made a mistake, then long pressing enter (for a second or more) should make the previous car flash again for adjustment.
When the last char is flashing (second units) as soon as enter is short pressed the RTC should be updated with new time and date: Flowchart is the first version, so may not be perfect.
I have added some error catches.
For example if you don't increment date and still shows DD then it should not allow you to short press enter and go to MM.
Caution:
If connections to RTC module are nor correct or only GND is removed for example then registers will be corrupt.
This will force the time to be invalid and seconds will stop altogether.
Only solution is to program with correct valid time.
Martin