
Make sure that Programming Mode is set to ISP mode. It may come up as
JTAG mode on some AVR devices.
Side Note: If you want to program using JTAG, set Programming Mode to
JTAG and use hardware JTAG connections – see JTAG Connections section
Check device type matches and try Read Signature Byte. If the result is
000000 or a signature mismatch, then ISP clock is probably too fast for a new
AVR as default is 1MHz ISP speed. Click Settings button and write slower
ISP speeds until it reads signature correctly.
Program Tab
An AVR device must be erased before it is programmed again, as a separate
operation, so check Erase Device before Programming and Verify boxes. If
Input Hex File is blank, set it to your output Hex file. Remember that C
projects put output in a sub folder called Default, and Create Hex File must be
checked in Project Options. Then click Program button in Flash section.
Fuses Tab
Fuses control the operation of the device. The most important at this stage
are
•SUT_CLKSEL – Default varies with each AVR, but will always be Internal
Resonator (INT RC), running at 1MHz or less. Change this to one of the
External Crystal choices (External Crystal Osc. Or Resonator), 8MHz or
High Frequency, at the bottom of the list. Exact choice does not matter.
•CLKDIV8 – Some AVRs have this fuse to divide clock frequency by 8, so
disable (uncheck) for real clock speed
•JTAGEN – on 40-pin devices, debug is via JTAG and this fuse should be
enabled for Debugging. It will stop PortC acting as normal I/O, so disable
it to use PortC
•DWEN – On AVRs that have DebugWire, this fuse should be disabled for
ISP. The Debugger will set it when required for debugging
•RSTDISBL – On smaller pin count AVRs, this fuse disables Reset for use
as general I/O. DO NOT set this fuse or you will not be able to use ISP
•SPIEN – Do not disable this fuse or ISP will not work
Set up these fuses and use Program and Verify buttons to set and check the
fuses.
Auto
Allows you to do multiple operations by clicking Start button. Easiest way of
reprogramming devices once fuses and other settings have been setup.
Once you are happy that you understand how to program a device, exit the
Programmer screen. Now we will look at debugging. Depending on the AVR
device in your kit, this will either be via DebugWire or JTAG. Read the
appropriate section now, DebugWire for 8, 20 and 28-pin devices or JTAG for
40-pin devices.