Pervasa Tutorial: How to Flash Atlas Firmware A Guide to Upgrading or

Pervasa Tutorial: How to
Flash Atlas Firmware
A Guide to Upgrading or
Changing the Atlas Firmware
Programming with the AVRISP mkII and AVR Studio
Since the Atlas platform is built on an Atmel ATmega128L microcontroller, AVR Studio 4 is used
to program the flash and EEPROM memory. As of this writing, the latest version is AVR Studio
4.12 with Service Pack 4 (Build 498).
Downloading AVR Studio
If it is not already installed, download AVR Studio and Service Pack 4 from the following links.
http://www.atmel.com/dyn/resources/prod_documents/aStudio4b460.exe
http://www.atmel.com/dyn/resources/prod_documents/aStudio412SP4b498.exe
45MB
25MB
Installing AVR Studio
First, install the base software. Be sure to click the “Install/upgrade USB Driver” checkbox on the
third screen. This contains the driver for the Atmel AVRISP mkII and JTAGICE mkII
programmers.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 2 of 11
Next, install the service pack. Remember to click the “Install/upgrade USB Driver” checkbox on
the second screen. This adds support for the AVR Dragon.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 3 of 11
Once the installation has finished, reboot the PC. While a reboot is not required, it can be helpful if
the AVR Studio software does not load properly.
Running AVR Studio
Go to Start > All Programs > Atmel AVR Tools > AVR Studio 4. The AVR Studio environment
should now appear. If not, reboot the PC. If it continues to happen, uninstall AVR Studio, reboot,
and reinstall the software.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 4 of 11
The AVRISP mkII Programmer and Atlas Platform Programming Module
An Atmel AVRISP mkII programming is included with the Atlas Programming and Debugging kit.
Preparing the Programmer for First Time Use
Open the box, and remove the programmer and the accompanying USB cable. Plug the other end of
the USB cable into an open USB port on the PC and Windows XP should recognize the
programmer immediately. Click through the “Found New Hardware Wizard” to install the newly
connected hardware.
If the hardware installation went smoothly, a green LED will be illuminated inside the programmer
near the USB connection.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 5 of 11
Connecting the Programmer to Atlas
Attach the programming connector to the ISP_6 header on the Atlas Platform Programming
Module. Ensure the notch on the programming connector matches the notch depicted on the
Programming Module circuit board. Next, connect the Atlas processing module, and power on the
device. A green LED should illuminate on the processing module once power is applied. Similarly,
a second green LED on the AVRISP mkII will also turn on. The Atlas is now ready to be
programmed using AVR Studio.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 6 of 11
In AVR Studio, select Tools > Program AVR > Connect… to bring up the “Select AVR
Programmer” dialog box. Alternately, it is possible to bring up the dialog box from the AVR Studio
environment by selecting the menu button titled “Con.”
The dialog box appears. Select AVRISP mkII for the platform and USB for the port. Click the
Connect… button.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 7 of 11
Firmware Upgrade
If this is the first time the programmer is being used or if the firmware on the device is out of date, a
message box will appear stating that correct operation cannot be guaranteed if a firmware update is
not performed on the AVRISP mkII. Click OK.
At this point, the programmer’s status LED (closest to the programming cable) will be blinking
green and orange. Do not disconnect the USB cable when the programmer is in this state (if this
happens the status LED blinks red and orange; choose Tools > AVRISP mkII Upgrade to manually
upgrade the firmware). In AVR Studio, click “Start Upgrade.” This process takes a few seconds.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 8 of 11
The upgrade only takes a few seconds and, if successful, power cycle the programmer by
unplugging and reinserting the USB cable.
Manual Firmware Upgrade
If at any time the programmer becomes unresponsive or appears to not be working as it should, it is
possible that the firmware on the programmer has become corrupted. To rectify this using AVR
Studio, refer to AVR Studio User Guide option in the Help menu. From there, navigate to ATMEL
AVR Tools Off-Line Help > AVRISP mkII User Guide > Troubleshooting > Manual Firmware
Upgrade.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 9 of 11
Programming Dialog Box
Occasionally, the AVR Studio programming dialog box will fail to automatically detect the
presence of the ATmega128 microcontroller. If this is the case, manually select ATmega128 from
the “Device” drop down box. The majority of the time, though, ATmega128 will already be
selected.
Once selected, click on the “Advanced” tab, and click the “Read” button. The prompts the
programmer to check the signature bytes on the ATmega128 to ensure communication and the
device is working properly. If all is successful, the signature bytes should read 0x1E 0x97 0x02.
The Atlas is almost ready for a firmware update.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 10 of 11
Click on the “Board” tab, choose 2.0 MHz for the “ISP Freq,” and click on the “Write” button. This
enables high-speed programming of the flash and EEPROM on the ATmega128. Without
following this step, the device will still be able to be programmed but the programming will occur
at a lower speed. If any problems are encountered while programming the flash, EEPROM, or Fuse
Bits, set the ISP frequency slower than 2.0 MHz and try again.
Back in the “Program” tab, select the appropriate flash input hex file from the storage location.
Click “Program” and the firmware will be loaded onto the Atlas node. Follow the same procedure
for programming the EEPROM. Unless the “Preserve EEPROM memory through the Chip Erase
cycle (EESAVE)” fuse bit is set, programming of the flash needs to be performed every time prior
to programming the EEPROM.
The software upgrade is now complete. Close the dialog box, and power cycle Atlas.
Pervasa, Inc. · 104 North Main Street, Suite 300, Gainesville FL 32601 · +1 (352) 373-3966 · www.pervasa.com
Page 11 of 11