|
Flying Electron Application Note 1000
In System Programming (ISP) using the Atmel STK500
Background
In this application note, we will be demonstrating how to perform an In System Program (ISP) operation to
program new firmware into an AVR microcontroller using the Atmel STK500 programmer. The example will use
the Atmel STK500 programmer connected to a Flying Electron FE_M168 development board which uses an Atmel
AtMega168 AVR microcontroller. This application note can also be used as a reference for programming other
development boards which use an AVR microcontroller and support ISP programming.
Parts Needed
- Flying Electron FE_M168
- Atmel STK500
- Serial Cable
|
|
|
|
|
Flying Electron FE_M168
Click to Enlarge
|
|
Atmel STK500
Click to Enlarge
|
|
Software Needed
- Atmel AVR Studio 4
(See Application Note 0200 for detailed installation instructions)
Hardware Setup
Note: Please use the figure below labeled "Flying Electron FE_M168 ISP
Programming with Atmel STK500" as a reference when following the hardware setup steps.
- Turn the STK500 POWER SWITCH to OFF
- Plug the STK500's Power Adapter into the STK500 POWER JACK
- Plug the serial cable into the STK500 RS232 CTRL Serial Port
- Plug the other end of the serial cable into PC's Serial Port
- Remove the STK500 VTARGET JUMPER
- Unplug the FE_M168's Power Adapter from the FE_M168 POWER JACK
- Disconnect any accessories connected to FE_M168 PORTB unless accessories are specified to be safe for
ISP Programming.
Note: If in doubt, disconnect all accessories connected to FE_M168 PORTB.
- Use a 6 conductor ISP cable to connect STK500 ISP6PIN HEADER and FE_M168 ISP HEADER.
Note: The red stripe of the ISP cable should be facing pin 1 of both headers. See the diagram below for correct red stripe orientation.
- Plug the FE_M168's Power Adapter into the FE_M168 POWER JACK
- Turn the STK500 POWER SWITCH to ON
ISP Programming Procedure Interactive Tutorial
The interactive tutorial below will graphically demonstrate how to use the Atmel AVR Studio 4 application
to perform an ISP programming procedure on an AVR microcontroller. The tutorial uses a Flying Electron
FE_M168 development board as the target to be programmed, but the tutorial is applicable to all AVR microcontrollers.
The example firmware being programmed into the AVR microcontroller is from the Flying Electron Application
Note 1003 (LED Simple Example). Please see the Flying Electron Application Note 1003 for hardware setup
information if you are interested in seeing the programmed example firmware run on real hardware.
Click on the image of the interactive tutorial to start the tutorial.
ISP Programming Procedure Quick Reference
Below is a quick reference for the steps taken in the interactive tutorial for performaing an ISP programming
operating using Atmel AVR Studio 4.
- Launch AVR Studio 4.
The Welcome to AVR Studio 4 dialog will appear.
Click the Cancel button on the Welcome to AVR Studio 4 dialog.
- The AVR Studio 4 application window will appear.
Click the Con button on the main application toolbar.
The Select AVR Programmer dialog will appear.
Select the STK500 or AVRISP option for the Platform.
Select the Auto option for the Port.
Click the Connect... button.
- The STK500 dialog will appear.
Click on the Program tab if the Program tab is not already shown.
Select the ATmega168 option in the Device dropdown if not already selected.
- Click on the Advanced tab.
Click on the Read Button to read the Signature Bytes of the AVR microcontroller.
Confirm that the Signature Bytes returned match the selected device.
- Click on the Fuses tab
Check or uncheck fuse options to set the desired fuses.
CAUTION: DOUBLE CHECK YOUR FUSE SETTINGS BEFORE CLICKING THE PROGRAM BUTTON!
SETTING THE WRONG FUSES CAN DISABLE ISP PROGRAMMING CAPABILITIES WHICH MAY REQUIRE A
HIGH VOLTAGE PARALLEL PROGRAMMING OPERATION TO RESTORE ISP PROGRAMMING CAPABILITIES.
Click on the Program button to program the fuse options.
- Click on the Program tab
Click on the browse "..." button in the Flash section of the Program tab to bring up the browse dialog.
Select the .HEX file containing the data to program into the AVR using the browse dialog.
Click on the Program" button.
AVR ISP Programming is now complete.
|