Join Now Join Now Home

SPARK Project #3, Post#2



Blinking an LED and transmitting text to a serial terminal is not the most exciting thing in the world, but it’s very cool to breathe life into a balky computer even at the most basic level. Also, I have worked with enough development tools know that it can be a lot of work going from first build to basic function. Many vendors like National Instruments, Texas Instruments, and others have recognized the value in making a good first impression while preserving all the power and sophistication available to the user. I do understand that ease of use can be hard to achieve, especially with complex, powerful tools. I own a small Sherline CNC mill that I built up with 3-phase brushless motors, a custom motor controller, and optical limit switches. It was a fun project, especially building the machine and seeing it run for the first time. I use it much less frequently than I would like, but it’s been very handy for many of my projects. The mill is powerful enough for of small projects, and simple enough that I can ignore it for several months without forgetting how to use it. I also have a little experience running large industrial CNC mills. I could make a lot of cool devices if I had a 5-axis commercial CNC machine, but using the machine effectively would require a substantial and continuous investment of time. Given what can go wrong, improper operation resulting from infrequent practice can be disastrous.

I’ve experienced a similar comparison between Windows Embedded CE and other prototyping and development tools I’ve worked with. For simple embedded projects, I use a wide variety of tools, from Arduino to ARM and others. I like to program in C or C++, using assembly only when I have to. I have been known to slip uLinux into projects when I can. These systems are like the Sherline CNC mill. They have limitations, yet are valuable from an ease-of-use perspective. Windows Embedded CE is more like the large industrial CNC mill - very powerful once time has been invested.



My previous project ran headlong into those challenges. I wanted to control an iRobot Create using Windows Embedded CE, but I couldn’t get my program to control a com port on my iCop eBox computer. There are two com ports on the eBox. Windows Embedded CE uses the first by default to send diagnostic messages to a host computer. This is a very nice feature built into the Windows Embedded environment. This means that the only com port available for my program to use is COM2, which wasn’t working at all for me. I decided to try using the functioning serial port, COM1 for my program, but that required stopping diagnostic messaging on COM1. There were a number of suggestions regarding how to do that, but none of them seemed to work. After spending a number of hours trying different hacks free COM1 for use with my programs, I exhausted my options and concluded that I might be dealing with a hardware issue. To test that theory, I decided to play with BIOS settings. What would happen if I redirected the interrupt addresses for the two com ports? It was a simple test, and the results were… positive!



Now that serial communication seemed to be working, it’s time to plug in an XBee. There are two options for connection the XBee. First, I can add the FTDI drivers into my Windows Embedded CE operating system image and rebuild the OS and my software. That seemed to add an extra step in the project without even knowing if the XBee will work. My other option is to use the SparkFun XBee serial shield and connect the XBee to the Windows Embedded CE box. At a later point, I would like to add the FTDI drivers, but for now, I already have serial communications working and using the serial port is a more simple step to take. Using the serial port meant that I had to overcome one other small hurdle. My XBee devices are configured with a baud rate of 115200 bps. Windows Embedded CE uses system default settings when the serial port is initially opened, and the default baud rate is set to 9600bps. I needed to change the baud rate in order to send data to the XBee. I was certain that changing the baud rate would be a difficult task, but I quickly found sample code for serial port configuration on MSDN. I copied and pasted the sample code, changed a few settings, including the baud rate, rebuilt my program, and ran it.




Happily, it worked and sent “Hello World” from my iCop eBox to my PC using XBee wireless modules!

Commentary

Text Comments (0)


2010 Challenge
NOW OPEN!
Round 2 ends in:
  Days
  Hours
  Minutes
  Seconds


Key Dates
  • April 27
    embeddedSPARK
    2010 SUMMER
    Challenge Opens
  • June 15
    R1 Closes
  • June 22
    R1 Winners
    Announced
  • August 31
    R2 Closes
  • September 7
    Winners/Finalists
    Announced
  • September 21
    Three Finalists Compete
    LIVE on Stage at
    ESC in Boston
This site hosted for Microsoft by Smooth Fusion, Inc.