Working with Pocket Watch B
TimN
Posts: 32
Can any provide me with some guidance regarding how to set the time on the Pocket WatchB and turn the alarms on and off?
Thanks
Thanks
Comments
Here's how to Set the Time, you send the following to the PocketWatch FM pin, this will get you 9:00:00 AM, Jan 14, '06·--
SEROUT·14, 84, [noparse]/noparse][color=blue]$55[/color], $00, [color=red]$00, $00, $09,[/color] [color=green]$0E, $01, $06[/color
All that data is hexadecimal
********
I'm assuming that you're using a BS2 (you didn't mention).· Also, the·SEROUT is going out P14 at 9600 bps.·
********
I see that there is also a Set Time Extended, so the above may result in an 06 for the year instead of 2006
The Extended is similar --
SEROUT·14, 84, [noparse]/noparse][color=blue]$55[/color], $10, [color=red]$00, $00, $09,[/color] [color=green]$0E, $01, [/color][color=purple]$05, $20[/color
Since they use 20 & 05, then I guess it's sort of BCD, unlike the other bytes which are HEX.
I think you can use "U" instead of $55, too, if you find that easier to remember --
SEROUT·14, 84, [noparse]/noparse][color=#0000ff]"U"[/color], $10, [color=red]$00, $00, $09,[/color] [color=green]$0E, $01, [/color][color=purple]$05, $20[/color
I've also noticed that in the examples in their PDF they switch baudrate settings (no explanation.)· But it has an auto-baud detector (which is the stated use·for the $55/"U"/SyncByte.)
Post Edited (PJ Allen) : 1/14/2006 6:08:07 PM GMT
Just make sure you are using the proper number for the baudmode parameter in SEROUT.
Regards,
Bruce Bates
You can use the PBASIC Help File to answer questions like that. Here is what that would tell you:
9600 baud 8, N, 1, INVERTED = 16468
9600 baud 8, N, 1, TRUE = 84
Regards,
Bruce Bates
Before you read from it, you have to tell it that you want some data from it.· Their example is -- SEROUT 14, 84, [noparse][[/noparse]$55, $12].· I would use 4800bps, instead, so -- SEROUT 14, 188, [noparse][[/noparse]$55, $12].·
It will send the data requested (i.e., $12 = extended time data) from its TM ("To Master") pin·at the baudrate used in the request (84 = 9600bps, true; 188 = 4800bps, true.)
Have you read any part of the PDF?
I found the demos that were bundled with the PWB a bit confusing myself, so as an excercise I wrote some code for the BSII that would turn the PWB and a Parallax Serial LCD panel into a very basic clock. The code is attached. Hope that helps!
Vern
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks
Tim