Shop OBEX P1 Docs P2 Docs Learn Events
Pocket Watch Help — Parallax Forums

Pocket Watch Help

ArchiverArchiver Posts: 46,084
edited 2002-08-06 22:30 in General Discussion
Hi All,

Just got a Pocket Watch module, and I can't seem to make sense of the code
supplied with it, or figure it out at all. Guess I'm thick, that'll be no
news to my Mom...

Anyway, anybody have a working example of Pocket Watch code? Just something
that say sets the time and reads out using the debug command. Alarm set and
use would be nice too.

Regards and thanks,

Jonathan Peakall


www.madlabs.info

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 10:05
    Hi Jonathan,

    Here is a code I used to check the Pocket Watch with a BS2-SX
    Don't get confused with lines related to the display, they may be useless...
    it's only for test purpose :-)

    Hope this helps...

    Phil.



    '{$STAMP BS2SX}

    N9600 con $40F0
    N2400 con $43FD
    I con 254
    CLR con 1
    LINE2 con 192
    L1_C7 con 135

    ' clock variables
    ss var byte
    mm var byte
    hh var byte
    dd var byte
    mo var byte
    yl var byte
    yh var byte


    output 0 ' to LCD serial input
    output 1 ' to LED
    output 6 ' to clock FM input
    input 7 ' from clock TM output

    high 6
    pause 1000

    SetTimeExtended:
    ss=0
    mm=10
    hh=7
    dd=22
    mm=7
    yl=00
    yh=20
    SEROUT 6,N9600,[noparse][[/noparse]$55,$10,ss,mm,hh,dd,mm,yl,yh]
    DEBUG "Initialized.",cr

    LoopClock:
    PAUSE 2000

    ReadTimeExtended:
    SEROUT 6,N9600,[noparse][[/noparse]$55,$12]
    SERIN 7,N9600,[noparse][[/noparse]ss,mm,hh,dd,mo,yl,yh]
    DEBUG "Time : ",dec2 hh,":",dec2 mm,":",dec2 ss," ",dec2 mo,"/",dec2
    dd,"/",dec2 yh,dec2 yl,cr

    GOTO LoopClock

    BadReadEx:
    DEBUG "Read Extended bad",cr
    GOTO LoopClock


    loop1:

    pause 500
    high 1
    serout 0,N9600,[noparse][[/noparse]I,CLR]
    pause 300
    low 1
    serout 0,N9600,[noparse][[/noparse]126,"CA MARCHE !"]
    goto loop1



    Original Message
    From: "Jonathan Peakall" <jpeakall@m...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, August 06, 2002 2:22 AM
    Subject: [noparse][[/noparse]basicstamps] Pocket Watch Help


    > Hi All,
    >
    > Just got a Pocket Watch module, and I can't seem to make sense of the code
    > supplied with it, or figure it out at all. Guess I'm thick, that'll be no
    > news to my Mom...
    >
    > Anyway, anybody have a working example of Pocket Watch code? Just
    something
    > that say sets the time and reads out using the debug command. Alarm set
    and
    > use would be nice too.
    >
    > Regards and thanks,
    >
    > Jonathan Peakall
    >
    >
    > www.madlabs.info
    >
    >
    > 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/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 14:49
    Phil,

    Thanks for the help! It still isn't working quite right..

    When I use your code, it stalls at the serin command I marked with *** in
    the ReadTimeExtended function. If I remove it, the code loops on, but of
    course doesn't update the time.

    Could I have a bad module?

    Thanks again,

    Jonathan Peakall


    > '{$STAMP BS2SX}
    >
    > N9600 con $40F0
    > N2400 con $43FD
    > I con 254
    > CLR con 1
    > LINE2 con 192
    > L1_C7 con 135
    >
    > ' clock variables
    > ss var byte
    > mm var byte
    > hh var byte
    > dd var byte
    > mo var byte
    > yl var byte
    > yh var byte
    >
    >
    > output 0 ' to LCD serial input
    > output 1 ' to LED
    > output 6 ' to clock FM input
    > input 7 ' from clock TM output
    >
    > high 6
    > pause 1000
    >
    > SetTimeExtended:
    > ss=0
    > mm=10
    > hh=7
    > dd=22
    > mm=7
    > yl=00
    > yh=20
    > SEROUT 6,N9600,[noparse][[/noparse]$55,$10,ss,mm,hh,dd,mm,yl,yh]
    > DEBUG "Initialized.",cr
    >
    > LoopClock:
    > PAUSE 2000
    >
    > ReadTimeExtended:
    > SEROUT 6,N9600,[noparse][[/noparse]$55,$12]
    > ***SERIN 7,N9600,[noparse][[/noparse]ss,mm,hh,dd,mo,yl,yh]
    > DEBUG "Time : ",dec2 hh,":",dec2 mm,":",dec2 ss," ",dec2 mo,"/",dec2
    > dd,"/",dec2 yh,dec2 yl,cr
    >
    > GOTO LoopClock
    >
    > BadReadEx:
    > DEBUG "Read Extended bad",cr
    > GOTO LoopClock
    >
    >
    > loop1:
    >
    > pause 500
    > high 1
    > serout 0,N9600,[noparse][[/noparse]I,CLR]
    > pause 300
    > low 1
    > serout 0,N9600,[noparse][[/noparse]126,"CA MARCHE !"]
    > goto loop1
    >
    >
    >
    >
    Original Message
    > From: "Jonathan Peakall" <jpeakall@m...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Tuesday, August 06, 2002 2:22 AM
    > Subject: [noparse][[/noparse]basicstamps] Pocket Watch Help
    >
    >
    > > Hi All,
    > >
    > > Just got a Pocket Watch module, and I can't seem to make sense of the
    code
    > > supplied with it, or figure it out at all. Guess I'm thick, that'll be
    no
    > > news to my Mom...
    > >
    > > Anyway, anybody have a working example of Pocket Watch code? Just
    > something
    > > that say sets the time and reads out using the debug command. Alarm set
    > and
    > > use would be nice too.
    > >
    > > Regards and thanks,
    > >
    > > Jonathan Peakall
    > >
    > >
    > > www.madlabs.info
    > >
    > >
    > > 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/
    > >
    > >
    >
    >
    > 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/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 15:47
    For Jonathon

    If you are using the DS1302 you can not serin/serout data. You have to use
    shiftout/shiftin.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 16:03
    Sid,

    I'm not sure if I am using a DS1302. I know the hardware as: a Pocket Watch
    B and a B2SX board of education. I bet you are right, as it is the serin
    command that is giving me trouble. I'll go read up on the shiftin/shiftout
    commands, but do you or anyone else have a working example?

    Thnaks for your time,

    Jonathan Peakall


    > For Jonathon
    >
    > If you are using the DS1302 you can not serin/serout data. You have to
    use
    > shiftout/shiftin.
    >
    > Sid
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 16:16
    In a message dated 08/06/2002 11:05:29 Eastern Daylight Time,
    jpeakall@m... writes:


    > I'm not sure if I am using a DS1302. I know the hardware as: a Pocket Watch
    > B and a B2SX board of education. I bet you are right, as it is the serin
    > command that is giving me trouble. I'll go read up on the shiftin/shiftout
    > commands, but do you or anyone else have a working example?
    >
    >

    I have the code for the DS1302 if it can be of any help. I suggest you e-mail
    jonwms@a... and ask him if you need to use shiftout/shiftin. If so, I can
    send you the code.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 16:23
    Hello Jonathan,

    The Pocket Watch B is made by a company called Solutions
    Cubed. If you go to their web site at www.solutions-cubed.com they have
    Basic Stamp code examples (yes, you do use the SERIN and SEROUT commands)
    and application notes for direct download under the "Downloads" category.

    Take a look,

    Tim


    At 05:22 PM 8/5/2002 -0700, you wrote:
    >Hi All,
    >
    >Just got a Pocket Watch module, and I can't seem to make sense of the code
    >supplied with it, or figure it out at all. Guess I'm thick, that'll be no
    >news to my Mom...
    >
    >Anyway, anybody have a working example of Pocket Watch code? Just something
    >that say sets the time and reads out using the debug command. Alarm set and
    >use would be nice too.
    >
    >Regards and thanks,
    >
    >Jonathan Peakall
    >
    >
    >www.madlabs.info
    >
    >
    >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/
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 16:27
    Sid,

    Send the code along, I'll give it a whirl. I e-mailed Jon to ask as well.

    Thanks!

    Jonathan Peakall

    >>
    > I have the code for the DS1302 if it can be of any help. I suggest you
    e-mail
    > jonwms@a... and ask him if you need to use shiftout/shiftin. If so, I
    can
    > send you the code.
    >
    > Sid
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 16:57
    Tim,

    I have done that. The SERIN command stalls the program, and if I include a
    "badloop" label, it goes there. So I assume I'm not managing to communicate
    with the POcket Watch. The code example I downloaded from the website does
    the same thing as the code snippet that Phil kindly sent. I am going to call
    Solutions Cubed when they open. Perhaps I have a bad module?.

    Thanks,


    Jonathan Peakall


    >
    > Hello Jonathan,
    >
    > The Pocket Watch B is made by a company called Solutions
    > Cubed. If you go to their web site at www.solutions-cubed.com they have
    > Basic Stamp code examples (yes, you do use the SERIN and SEROUT commands)
    > and application notes for direct download under the "Downloads" category.
    >
    > Take a look,
    >
    > Tim
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 17:11
    In a message dated 08/06/2002 11:28:38 Eastern Daylight Time,
    jpeakall@m... writes:


    > Send the code along, I'll give it a whirl. I e-mailed Jon to ask as well.
    >
    >

    Jonathan, I was in error about the sshiftin/shiftout. Go to the Solutions
    Cubed site and you can dwonload the code.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 17:13
    In a message dated 08/06/2002 11:58:17 Eastern Daylight Time,
    jpeakall@m... writes:


    > have done that. The SERIN command stalls the program, and if I include a
    > "badloop" label, it goes there. So I assume I'm not managing to communicate
    > with the POcket Watch. The code example I downloaded from the website does
    > the same thing as the code snippet that Phil kindly sent. I am going to call
    > Solutions Cubed when they open. Perhaps I have a bad module?.
    >
    > Thanks,
    >
    >
    > Jonathan Peakall
    >

    Jonathan, let me know what happens. I'm curious and would like to add your
    findings to my bundle of "Notes".

    Thanks

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-06 22:30
    If its one of the Solutions Cubed modules, it uses SERIN and SEROUT. Here is
    a link to the datasheet:

    http://www.solutions-cubed.com/Download%20Data/PocketWatchB/pwb_2v4.PDF

    Original Message

    > I'm not sure if I am using a DS1302. I know the hardware as: a Pocket
    Watch
    > B and a B2SX board of education. I bet you are right, as it is the serin
    > command that is giving me trouble. I'll go read up on the shiftin/shiftout
    > commands, but do you or anyone else have a working example?
Sign In or Register to comment.