Abstract

You've got the box, you followed the intro and played the silly demo programs, sent messages between them and thought, "how cute." And now you're wondering what to do next. If you're not wondering what to do next and have a clear idea of how to fiddle with these, forget about reading this and write it for me.

Intro

I often find myself wondering, "so what now," after I've read a bunch of documents and done tutorials, classes and lessons. In this paper, I'm attempting to answer that question.

I'm not an AVR expert, and I don't have a lot of equipment. Let's see, I have an associate's degree in electronics, an old Serial ISP, a meter, a soldering iron and a few tools, an oscilloscope that quit working, and a full-time job that saps about all my energy. I have played with AVRs for several years, and I've made some things that work pretty well, and some that didn't. My expertise is windows and database programming, though I used to work as an electronics technician fiddling with microprocessors and programs back in the days when Z80's were fast and exotic. I know Assembler better than C, so I'll be learning a few things as we go.

Goal

To get to know the raven and bitcloud software well enough to make the raven do what I want. What do I want it to do? Well, I dunno. I like garden trains and run mine by R/C, so maybe a remote for one of my trains. You don't care much about toy trains? Well, the main point of this would be sending messages and fiddling with the Raven hardware, so this article should help you with that. I hate most tutorials that lead you step by step, keystroke by keystroke, to something that doesn't work. Or, if it does work, you still don't know how to make it solve your problem, so this is not going to be a step by step on how to make a remote train controller. Instead, I'll tell you where to find what you need, and how the silly raven works, with some scraps of example code and info on where to put your code. No, I'm not going to suggest you start out at Zigbee.org downloading and memorizing all the specifications. By the time we're done, you might be able to understand a few of those specifications.

First Things First

This section is really here as notes on how I did it, and to point you to the instructions in an Atmel Application Note. Let's start the provided software and play with it. You'll want to go to Atmel's web site and get the BitCloud SDK for ATAVRRZRAVEN. This extracts to an installer, and the installer makes a folder in your computer's "Program Files" folder. To play, you need to

  1. If you haven't, install the USB thingy software:
    1. Attach the RZUSBSTICK to one of the PC's unused USB ports.
    2. After a few seconds the "Found New Hardware Wizard" will pop up.
    3. Check the "No, not this time" option.
    4. Click the Next button.
    5. Verify that "Install the software automatically" option is checked. Press the Next button.
    6. Press the Finish button when the installation has completed.
    7. Done.
  2. Start the RF Services Server . To do this, you need a command prompt. You'll need to navigate to "C:\Program Files\Atmel\AVR Wireless Services". Ok, enough of these silly DOS commands! I made a shortcut on my desktop. The Parameters are the IP address you want it to use and the port. The instructions suggest 127.0.0.1 and 27000, and those seem to work fine for me. When you see a black box that says, "Waiting for client to connect," you're in good shape.

Run the demo program. Atmel put it in your start menu under All Programs-Atmel AVR tools-AVR Wireless Services. You'll see a C in the button bar, click that and put in the IP address and port you put above. The channel Id and "PAN" address it suggests should be fine, unless you have a colleague with a raven who will be pranking you.

Now we got the desktop part of the program working, what about one of the little boards. Oddly, the menu on my Raven board doesn't look much like the manual. Turn one on, and using the little button thingy to navigate, find the NETWORK choice, move right, find JOIN and press the button. You'll see the Raven's "address" appear on the interactive program. Now you can have lots of fun sending messages to your Raven, and if you can find the "COMPOSE" menu on the raven, you can send a message back. Seems to me only a nutcase would send messages this way, but then, I don't text either.

Danger, Will Robinson!

Over the air firmware update does not work. If you do this and kill your raven, so it always says "Waiting for ... bootloader," you'll need to reflash your raven's 1284 processor. (See below)

Ok, it may work now that I've reflashed my ravens, but I'm not going to mess with it again just to find out.

ISP Connectors

If you have a JTAG programmer, you can skip this section. If, like me, you have an ISP programmer, read up.

The raven boards have places to solder ISP connnectors right above the JTAG connectors. These are 6pin pads, and, of course, Atmel included 10pin connectors to solder into them. I broke a couple trying to get 6pin connectors out of them. Oops.

Then there is a mistake on the raven board! The + and - pins for the 1284's ISP connector are not connected. You'll need to add a couple wires to the board.

Then you connect the little adapter connector to your ISP's 6pin cable. I didn't want to clip the extra pins in case I ever needed them, so I just forced it. I have a friend who says, "If it won't go, force it. If it breaks, it needed to be fixed anyway." If you think about it, he's right.

Since I broke a couple of the tiny connectors trying to make them into 6pin connectors, one of my raven boards has the neat little ISP connectors soldered in, and the other has homely 10pin ISP connectors hanging on white wires.

The USB stick

The USB stick has a JTAG connector, but not an ISP connector. Hew boy! Get your magnifier out! I have a magnifier hood and I had to use [b]ALL[/b] my lenses. I used #30 wire wrap wire. Here's how I did it.

  1. Strip the end of your wire.
  2. Tin it right up to the insulation.
  3. Clip it so about 1/2 mm of wire shows.
  4. Hold the tinned wire against the "pin" on the infernally tiny processor.
  5. Heat the wire with your tiniest soldering iron point.
  6. Hope it sticks.
  7. Use some colorful language and go to step 3.

You need pins 11, 12, 13 and 20 of the processor. To make it easier I followed the schematic in the Raven Hardware Guide and soldered the wire to the RF chip's pin where pin 12 goes, so I didn't have to have 3 adjacent wires. I got + and - from the USB connector, which is LOTS bigger and easier to connect. For some strain relief, I put the wires through the holes in the JTAG connector. You can also get the RESET signal on the JTAG connector's pin 6, which is easier than soldering to the processor itself.

Inspect very closely for shorts. I needed to use a bit of solder wick to clean out a short. See that your raven network still works.

Version Trouble!

My USB stick quit working when I downloaded an updated USB driver. This caused much crying, pleading, and a little cursing, until I decided to try reflashing the stick, in case its program was too old for the updated driver. That fixed it.

Update Firmware

Just to be sure your ravens and stick are current, you'll want to update them with the downloaded AVR Raven Firmware. The link above downloads a zip, and you'll find the images in bin\rzraven_fw_images inside that zip.

It takes quite a while to update the two raven processors, so please hook up an external power supply to holes 1 and 12 of the raven board, or you'll be in danger of the batteries going too flat to run your programmer. Polarity doesn't matter, and there's an internal regular good up to 12v.

With the updated firmware, the raven's nose blinks red in a pretty cool way. It didn't do that before. Also, the menus match the documentation now. Before I had to hunt a little and never did find how to read the temperature.

Sample Applications

The Bitcloud User's guide PDF mentions several sample applications. Unfortunately, these are not in the downloaded code, or at least not that I've found. I put the bitcloud SDK at the root of C 'cause "My Documents" seemed to confuse the AVR studio. I think these are the main pieces of program you'll need:

Raven 3290 program C:\BitCloud_ATAVRRZRAVEN_1_6_0\BitCloud\Components\BSP\RAVEN\AT3290P\gcc\AVRRAVEN_3290P.aps

Raven 1284 program C:\BitCloud_ATAVRRZRAVEN_1_6_0\Sample Applications\WSNDemo\WSNDemoApp.aps