AXE033 documentation error

mhalbern

Member
In the documentation for the AXE033:

"To set the correct time after the circuit is first powered up, the current time must be
written to the DS1307 registers. The following example PICAXE program will setup
the time to 11:59:00 on
Thursday 25/12/03.This is carried out by loading the
registers in order from address 00 upwards i.e. seconds then minutes then hours etc.

hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte

i2cout 0, ($00, $59, $11,
$03, $25, $12, $03, $10)
end
"

As best as I can figure, the DAY of the WEEK value ($03) is wrong. For Thursday, the value should be $05.

Is this correct?
 

Technical

Technical Support
Staff member
The start of the week is not defined for the DS1307, so you can use whichever index system (Sat, Sun, Mon etc) for 'day 1' that you choose.
However we agree that $03 is probably not the best example!
 

mhalbern

Member
Indeed.

I was using the Program Editor's RTC Time Setting Wizard to program the DS1307 from the PC's internal clock. Thursday's program value is $05.

Thank you for the prompt reply.
 

grim_reaper

Senior Member
That's probably based on the settings you have on the PC used to run the Wizard.

For Windows 7, if you go to Control Panel --> Region And Language, on the first tab about halfway down, the first day of the week can be selected.

What is yours set to? I'm betting on Sunday :D
 

nick12ab

Senior Member
That's probably based on the settings you have on the PC used to run the Wizard.

For Windows 7, if you go to Control Panel --> Region And Language, on the first tab about halfway down, the first day of the week can be selected.

What is yours set to? I'm betting on Sunday :D
According to the datasheet the value of the day register must be 1 to 7 (not 0 to 6), so in the Rev-Ed example the start day is Tuesday.

It doesn't matter what day it starts on but the days must be in order. The DS1307 simply increments the day register every day and is incapable of working out what the actual day of week is.
 
Top