Hi everyone,
I have a DS1302 RTC and a library that handles the communicating part between the RTC and the Arduino. However if I want to set the day of the week, it always turns out 'Friday' instead of 'Monday' even if I set the DOW to Thursday.
This is the library: Electronics - Henning Karlsen
Does it makes a difference if I change the DOW after I set the date and the time?
In the attachment you can find my .ino file
Cheers,
Dylan
RFSwitchDuinoV2.ino (3.18 KB)
I found out that the DS1302 doesn't work properly... Ordered a better one (DS1307).
Cheers,
Dylan
I think the DOW is calculated from the day-month-year triple?
The DS1307 is an often discussed RTC here and it shows drift.
you might check the DS3232 or DS3234 datasheet as these are more accurate
system
November 10, 2014, 10:43pm
4
Does it makes a difference if I change the DOW after I set the date and the time?
The day of the week is a function of the date. If you set the date, you are BY DEFINITION setting the day of the week.
In what universe can you make Nov 10, 2014 fall on any day other than Monday?
system
November 10, 2014, 11:35pm
5
PaulS:
In what universe can you make Nov 10, 2014 fall on any day other than Monday?
Boom town Rats world where they don't like Mondays?
If you don't set the DOW, the value will become undefined even if you set the date.
I think it just a varaible that counts up when you pass 00:00:00 and goes to zero on sunday.
Cheers,
Dylan
system
November 13, 2014, 12:19am
7
If you don't set the DOW, the value will become undefined even if you set the date.
You are doing something wrong, then. Day of the week is a computed value, not a set value.
PaulS,
On both the 1302 and 1307 the Day of Week is a value in the range 1 to 7 which is stored in its own register. The register is in different positions depending on which RTC you are using.