repost of the repost, I don''t know what went wrong....Clock Help
Archiver
Posts: 46,084
The DS1302 real time clock sourse code from the app notes sets the
clock using this code:-
Day = $02 'Monday
Month = $05 'May
Date = $18 '18th
Year = $98 '1998
Hours = $15 '3:00 PM (in 24-hour mode)
Minutes = $00
Seconds = $00
'GOSUB SetTimeAndDate
I want to set the time from a separate bs2 set up as a programmer,
using serin command.
My code looks like this :-
SERIN 3\12, 16468, [noparse][[/noparse] hours]
SERIN 3\12, 16468, [noparse][[/noparse] minutes]
SERIN 3\12, 16468, [noparse][[/noparse] day]
'hours = $13
'minutes = $14
'day = $7
Month = $12
Date = $03
Year = $02
Seconds = $00
GOSUB SetTimeAndDate
and it doesn't work.
I have noticed that the original code makes the time for the clock
setting a HEX number by preceding the constants with a $ sign,
so i tried the following :-
SERIN 3\12, 16468, [noparse][[/noparse]HEX hours]
SERIN 3\12, 16468, [noparse][[/noparse]HEX minutes]
SERIN 3\12, 16468, [noparse][[/noparse]HEX day]
'hours = $13
'minutes = $14
'day = $7
Month = $12
Date = $03
Year = $02
Seconds = $00
GOSUB SetTimeAndDate
I also tried this at the serout end.
Nothing Works [noparse]:([/noparse]
Can anybody help me
Regards,
Dwain.
clock using this code:-
Day = $02 'Monday
Month = $05 'May
Date = $18 '18th
Year = $98 '1998
Hours = $15 '3:00 PM (in 24-hour mode)
Minutes = $00
Seconds = $00
'GOSUB SetTimeAndDate
I want to set the time from a separate bs2 set up as a programmer,
using serin command.
My code looks like this :-
SERIN 3\12, 16468, [noparse][[/noparse] hours]
SERIN 3\12, 16468, [noparse][[/noparse] minutes]
SERIN 3\12, 16468, [noparse][[/noparse] day]
'hours = $13
'minutes = $14
'day = $7
Month = $12
Date = $03
Year = $02
Seconds = $00
GOSUB SetTimeAndDate
and it doesn't work.
I have noticed that the original code makes the time for the clock
setting a HEX number by preceding the constants with a $ sign,
so i tried the following :-
SERIN 3\12, 16468, [noparse][[/noparse]HEX hours]
SERIN 3\12, 16468, [noparse][[/noparse]HEX minutes]
SERIN 3\12, 16468, [noparse][[/noparse]HEX day]
'hours = $13
'minutes = $14
'day = $7
Month = $12
Date = $03
Year = $02
Seconds = $00
GOSUB SetTimeAndDate
I also tried this at the serout end.
Nothing Works [noparse]:([/noparse]
Can anybody help me
Regards,
Dwain.