Shop OBEX P1 Docs P2 Docs Learn Events
Real Time Clocl Help With Hex Data — Parallax Forums

Real Time Clocl Help With Hex Data

ArchiverArchiver Posts: 46,084
edited 2003-01-05 12:21 in General Discussion
OOPS, I mean that it makes the constant a HEX number, sorry.........
Original Message
From: <dwainsworld@e...>
To: <basicstamps@yahoogroups.com>
Sent: Sunday, January 05, 2003 11:21 PM
Subject: [noparse][[/noparse]basicstamps] Real Time Clocl Help With Hex Data


> Hi Group,
>
> 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 decimal number by preceding the constants with a $ sign,
> so i tried the following :-
>
> SERIN 3\12, 16468, [noparse][[/noparse]dec hours]
> SERIN 3\12, 16468, [noparse][[/noparse]dec minutes]
> SERIN 3\12, 16468, [noparse][[/noparse]dec 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.
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-01-05 12:21
    Hi Group,

    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 decimal number by preceding the constants with a $ sign,
    so i tried the following :-

    SERIN 3\12, 16468, [noparse][[/noparse]dec hours]
    SERIN 3\12, 16468, [noparse][[/noparse]dec minutes]
    SERIN 3\12, 16468, [noparse][[/noparse]dec 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.
Sign In or Register to comment.