|
The ProcessorThe Datalink contains a custom Motorola 6805 processor which performs all of the watch functions. This turns out to be a very convenient thing as the 6805 is well documented and actually pretty fun to program (IMHO). If you are looking for technical information, I tend to look to Motorola's 6805 home page and to the instruction set card Oxford University Computing Laborator's Microprocessor reference card. All of my work has been done with just these two information sources. To summarize the 6805, it has two 8-bit registers (A and X) and a small number of addressing modes. Since it has a 15 bit address bus, you are left with the interesting problem of using a register as a pointer. To deal with this, you have to resort to self modifying code. If you are only having to point to a small amount of memory, you can also use the indexed mode where the register is an offset from some base location. Of course, if you only have to point to things in the first 256 bytes of ram, you can pretend that a register might be a pointer. ToolsUnfortunately, there really aren't a lot of tools out there for creating wristapps... While there are free assemblers available on Motorola's 6805 home page, you will find that the lack of support for Timex's character set can be a bit limiting. Even more problematic is that you have to figure out how to get the program to the watch in order to run it. My solution has been to write my own assembler which creates the .zap file format that is understood by the Datalink software on the PC. This DLZap program is pretty braindead in many ways and has quite a few bugs associated with refreshing the screen. It also is limited to creating apps only for the 150 or the 150s one at a time. If you want to create an app which runs on both watches, you have to combine them by hand. I am working on a newer tool which doesn't have the refresh bugs (yeah, right :-) and automatically creates both the 150 and the 150s applications. Hopefully, this should be available in a couple of weeks. (Like I ever got a chance to actually finish it , but read on :-). ASM6805 (2 months later)Instead of fixing the refresh problems in DLZap, I realized that I needed something to address all of the work I was having to do to create wristApps and make it a bit easier (and hopefully more reproducible). I have gone and created a new version of the DLZap program which takes .zsm files and outputs the proper .zap file. Basically in a nutshell what it does is:
You can download the setup program for the beta here. The .ZSM file FormatSo, what is the .ZSM file format? It is nothing more than a standard .ASM file with a couple of comment lines at the beginning. For example the header for TIPCALC would be: ;Name: Tim Calculator ;Version: TIPCALC1 ;Description: The tip calculator - by John A. Toebes, VIII ; ;Press the set button to enter the amount. When in set mode, press the MODE button to switch between dollars and cents mode. ;Press the set button to go back to the display mode. The tip amount will scroll across the bottom of the screen as 15%, 20% and then 10% in sequence. ; ;When in display mode, pressing the prev or next buttons will enter the set mode automatically on the dollars amount. ; ;TIP: Download your watch faster: Download a WristApp once, then do not send it again. It stays in the watch! ;HelpFile: watchapp.hlp ;HelpTopic: 106 The keywords are immediately after the semicolon and before the colon. The only recognized keywords are HEADER, NAME, VERSION, DESCRIPTION, HELPFILE, HELPTOPIC, and PARENT. It uses the VERSION keyword to identify the name of the created wristapp. The remaining information is just copied into the .ZAP file for use by the Timex software. In the process of doing this, I discovered that the last digit of the first line of a .ZAP file (the line that looks like TDL0405971) indicates whether the app is a 150-only app (last digit =1) or a 150/150S Dual app (last digit=2). To compile a Wristapp, you need a header file which defines all of the routines that you might call. FOr now, I have two versions of the same file - Wristapp.i which I put into two separate directories: |