[Coco] Smartwatch setting from Basic09

Robert Gault robert.gault at att.net
Sat Apr 6 10:14:20 EDT 2013


George Ramsower wrote:
>   I have been using a Coco3 for many years. I love these boxes. My Coco3 is my connection to the world of my life.
>   When I use this to keep track of time keeping things, such as a mechanical clock, I have to adjust for the errors in the SmartWatch.
>   Is there a way to set the smartwatch from basic09?
>   I've attemted this a couple of times but, now I don't remember what I did or why it didn't work. Now I want to start this again to monitor a mechanical clock but, I want to adjust the Smartwatch on a scheduled basis(as I tried before) such as once a day or every few hours. The smartwatch I am using loses time and needs adjusting ocassionally.
>   Is it possible to do that from Basic09? How would this be accomplished? Before, I used "Settime" or "Setime"( can't remember right now) but, that was from the command line. Does the new OS9 clock module allow this or can I use the original clock. I don't really care about the year thing. If it says it's 1913, I'm good with that.
>
>   Suggestions?
>

Setime is an OS-9 command to adjust system time but will have no effect on a 
real time clock (RTC). Your use of smartwatch is confusing as that is a 
copyrighted name for a specific RTC but it seems you may be using it as a 
generic name for all RTCs.

To set an RTC, you must know the specifications of the unit as they require 
different command sequences to both set and read the time. Except for the very 
simple emulations of RTCs in some Coco emulators, the code sequence will be 
complicated enough that an assembly program rather than Basic09 will be your 
best bet.
In addition to sending the correct sequence, you must be sure that the RTC is 
"in memory". For that, you must know which I/O bytes are used and if OS-9 
currently has those bytes available. That is not a trivial matter on a Coco3 and 
you likely may need to reset the GIME and MMU registers. Then there is the issue 
of where the physical location of the RTC is and that may require checking each 
MPI slot.

I have written and sell code that supports the SmartWatch (r) for both Basic and 
OS-9.





More information about the Coco mailing list