|
Flying Electron Application Note 1001
In System Programming (ISP) using the Atmel AVRISP mkII
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 AVRISP mkII programmer. The example will use
the Atmel AVRISP mkII 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 AVRISP mkII
- USB Cable (A to B Type)
|
|
|
|
|
Flying Electron FE_M168
Click to Enlarge
|
|
Atmel AVRISP mkII
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 AVRISP mkII" as a reference when following the hardware setup steps.
- Plug the USB cable into the AVRISP2 USB Connector
- Plug the other end of the USB cable into the PC's USB Port Connector
- Connect the AVRISP2 ISP CABLE to the FE_M168 ISP HEADER.
Note: The red stripe of the ISP cable should be facing pin 1 of the FE_M168 ISP HEADER. See the diagram below for correct red stripe orientation.
- Plug the FE_M168's Power Adapter into the FE_M168 POWER JACK
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 performing 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 AVRISP mkII option for the Platform.
Select the USB 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.
|