Home
What if?
Features
MCUs
Examples
Wireless!
Pictures
Downloads
Purchase!
News
Contact Us

StickOS User's Guide

CPUStick User's Guide

Copyright © 2008-2009 CPUStick.com;
all rights reserved.
Patent pending.

  webmaster@cpustick.com

CPUStick™ and StickOS™ -- Wireless Made Just as Easy!

With the aid of an MC13201 ZigFlea Wireless Transceiver, a simple wireless embedded system, like a remote LED dimmer, can be brought online just as easily as a local embedded system!

It’s as easy as...

  1. set the 2.4GHz zigflea wireless nodeid on each MCU
  2. wire MCU #1 to its embedded circuit
    1. wire MCU #1 pin an0 to the potentiometer
  3. wire MCU #2 to its embedded circuit
    1. wire MCU #2 pin dtin0 to the LED
  4. connect a host computer to the USB interface on MCU #1
  5. write and debug your BASIC control program, live on MCU #1 (see below)
  6. use the 2.4GHz zigflea wireless transport to connect to MCU #2
  7. write and debug your BASIC control program, live on MCU #2 (see below)
  8. run the program on MCU #2
  9. disconnect from MCU #2
  10. run the program on MCU #1

The entire debugging session, including the writing and running of both MCU’s BASIC control programs, is shown below:


(see the examples in text format)

Note that all of this debugging session is occurring on the Hyper Terminal connected to the USB interface on MCU #1!

First we write the program on MCU #1.

  • Notice in line 10 that we declare a local pin variable named “potentiometer” to read the value of the potentiometer, through analog input pin an0, in millivolts.
  • Then, in line 20, we declare a remote pin variable to control the LED on MCU #2 (through MCU #2’s local pin variable!); the “as remote on nodeid 2” indicates that the real variable declaration is found on MCU #2.
  • Then we simply enter an infinite loop reading the value of the potentiometer (again, in millivolts) every 100ms, and writing it to the LED on MCU #2.

We then save the program to flash memory on MCU #1 and configure it to run automatically when the MCU powers up.

Then we remotely connect to MCU #2 and write its program.

  • Notice in line 10 that we declare a local pin variable named “led” to control the LED, through analog output pin dtin0, in millivolts.
  • Then we simply enter an infinite loop, waiting for our local pin variable to be written remotely from MCU #1 every 100ms!

We then save the program to flash memory on MCU #2 and configure it to run automatically when the MCU powers up.

Finally, we run the program on MCU #2, disconnect from MCU #2 by pressing <Ctrl-D>, and run the program on MCU #1.

At this point, adjusting the potentiometer on MCU #1 causes the LED brightness on MCU #2 to be correspondingly adjusted, after a 100ms delay!!!


keywords: rich testardi microcontroller hobby rapid prototype breadboard high-school