Dick Tracy only wished he had a watch like this...

Yep it's hardware time again! While today's post is .Net Micro Framework related, it's using hardware that I've not mentioned before, the Texas Instruments EZ430-Chronos watch and a ChipworkX board from GHI Electronics.

Rob Miles shows us just how you can get these two to talk to each other...

Using the Texas eZ430 Watch with the .NET Micro Framework

Some time back I got a Texas Instruments EZ430-Chronos watch. One of my better investments. For only fifty dollars you get an LCD watch which you can program. What’s more, it contains a whole bunch of sensors and can communicate with a host device over a wireless link. Around the same time I got a ChipworkX board from GHI Electronics.

So, one lunch hour I decided to try and make them work together. It turns out to be very easy. The watch has a wireless connector (you can just see the PCB at the top of the picture) that appears as a USB serial port to whatever you plug it into. Since the ChipworkX board has USB hosting and serial port support it was an easy matter to get the two talking. A bit of searching and I found the accelerometer protocol for the watch, and away we went.

image

He has also provided a wrapper for the watch. Here's a code snip;

private void watchControl()
  {
      watchComs.Write(startAccessPoint, 0, startAccessPoint.Length);      while (watchComs != null)
      {
          try
          {
              watchComs.Write(readAccel, 0, readAccel.Length);              int bytesRead = watchComs.Read(buffer, 0, buffer.Length);              if (buffer[0] == 0xff &&
                  buffer[1] == 0x06 &&
                  buffer[2] == 0x07 &&
                  buffer[3] == 0x01)
              {
                  Monitor.Enter(watchLock);
                  watchPos.X = (sbyte)buffer[4];
                  watchPos.Y = (sbyte)buffer[5];
                  watchPos.Z = (sbyte)buffer[6];
                  lastReading = DateTime.Now;
                  successfulReading = true;
                  Monitor.Exit(watchLock);
                  if (NewReading != null)
                  {
                      // Fire off a thread to run any methdos bound to the
                      // new reading event
                      Thread readingThread = new Thread(new ThreadStart(newReadingEvent));
                      readingThread.Start();
                  }
              }
              else
              {
                  successfulReading = false;
              }
          }
          catch
          {
              // just ignore the errors for now
          }
      }
  } 

Okay, so maybe Dick Tracey's watch is still a little cooler (I mean it did have two way communication and all), there's something to be said for this combination... Smiley

Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
    Unsubscribing
    Subscribing

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.