Programming the RavenUSB
See http://www.atmel.com/dyn/resources/prod_documents/doc8120.pdf for the Atmel quick-start guide. This app-note will be referenced throughout this page.
Using the Bootloader
If you don't have a programming tool, you can use the built-in bootloader to program the FLASH memory.
Find / Install AVR Wireless ToolsBy default the AVR Wireless Tools will be installed to C:\Program Files\Atmel\AVR Tools\AVR Wireless Services. If this folder does not exist make sure the AVR Wireless Tools are installed and fully up to date.
Copy new hex fileCopy the .HEX file to the folder AVR Wireless Tools is installed it (ie: C:\Program Files\Atmel\AVR Tools\AVR Wireless Services). You should see another file named RFUSBSTICK-10_10.hex or similar in the folder. Move that file out of the directory, or rename it to backup.hex.
Rename the new .hex file you just copied in to RFUSBSTICK-10_10.hex.
Launch AVR Wireless Services
Launch AVR Wireless Services from inside AVR Studio, or directly from the Start Menu:
Upgrade Procedure: Using Default Firmaware
From the "Tools" menu select the "Upgrade Usb Stick" option:
Then hit the 'Upgrade' button:
Finally wait for the upgrade to complete:
Then unplug and replug the USB Stick to ensure the code reloads properly.
Upgrade Procedure: Using 15dot4-tools firmware
For this procedure to work, there is one additional step. Before hitting "Upgrade USB Stick", you must hit the "Firmware Upgrade" button on the java control application.
Upgrade Procedure: Using Manual Override
If the upgrade procedure isn't working, you can force the USB stick into upgrade mode. To do so short the following two pins when plugging the stick into the computer:
Once plugged in, then run the upgrade function as in the "Using Default Firmware" section.
Using a Programming Tool
Using a programming tool will require mounting the small 10-pin header on the RavenUSB. This provides the JTAG Programming Port. Then connect for example the JTAG MK-II up:
You can then program the device in AVR Studio. The app-note provides the following description:
- Connect the AVR JTAGICE mkII to the PC.
- Insert the 50-mil to 100-mil adapter to the JTAG probe. Ensure that the adapter is connected with the correct orientation.
- Connect the 50-mil to 100-mil adapter to the RZUSBSTICK. Ensure that pin one on the selected header mates with pin one on the adapter.
- Apply power to the AVR JTAGICE mkII and the attached board (The RZUSBSTICK must be connected to a PC).
- Start AVR Studio and press the Cancel button in the Welcome dialog window.
- From the Tools menu, select Program AVR and Connect.
- Select JTAGICE mkII as platform and then press Connect.
- Open the Program tab. Select the AVR you wish to program (AT90USB1287) from the Device pull down menu.
- Program the flash of the AVR with the correct .hex file.
- Close the STK500 window.
Programming with DFU and Other Upgrades
In programming some Raven USB sticks for some friends without JTAGs, I thought about how to make the process easier. This documents how to add an unbrickable bootloader that works on Linux & Windows.
First, you need to program the generic bootloader in, and get rid of the bootloader that ships with the RavenUSB. This file is called 128X-usb-boot-1-0-1.hex and available from Atmel. You will need to use a JTAG to do so. Note you do not need to solder the 50-mil header onto the RavenUSB, it is enough to simply hold it on an angle as here.
Also enable the 'HBEN' fuse, which activates the hardware bootloader enable pin. This is required.
Next, you will want to have a way of enabling the DFU bootloader. You need to bring the ALE line, which also shares the HBE pin, to ground when you plug in the USB device. You could use a little SMD push-button, but I used a 2-pin female header. Here I am soldering the ALE pin, the other side goes to the USB 'shield' pin (ground):
To program with this system:
- Short the ALE pin to ground, in my example put a small jumper wire
- Plug USB stick in
- You can unplug that grounding plug if you want
- Use either use Atmel FLIP or Open-Source DFU-Programmer
Finally once you are satisfied, put the whole thing in some heat-shrink tubing to keep it safe. This example shows front/back, along with an example of the jumper enabling DFU mode: