Programming the ATmega16 requires several hardware and software tools. We briefly mention
required components here. Please refer to the manufacturer’s documentation for additional details.
Software tools: Throughout the text, we use the ImageCraft ICC AVR compiler. This is an
excellent, user-friendly compiler. There are other excellent compilers available.The compiler is used
to translate the source file (testbench.c) into machine language for loading into the ATmega16.
We use Atmel’s AVR Studio to load the machine code into the ATmega16.
Hardware tools: We use Atmel’s STK500 AVR Flash MCU Starter Kit (STK500) for
programming the ATmega16. The STK500 provides the interface hardware between the host PC
and the ATmega16 for machine code loading. The STK500 is equipped with a complement of
DIP sockets, which allows for programming all of the microcontrollers in the Atmel AVR line.
Programming Procedure
In this section, we provide a step-by-step procedure to program the ATmega16 DIP using the
STK500 AVR Flash MCU Starter Kit. Please refer to Figure 1.5. It should be noted that the
STK500 will be used to program the microcontroller, which will then be placed in the Testbench
circuit.
1. Load AVR Studio (free download from www.atmel.com)
2. Ensure that the STK500 is powered down.
3. Connect the STK500 as shown in Figure 1.5.
4. Insert the ATmega16 into the red 40-pin socket. Note the location of pin 1 in Figure 1.5.
5. Power up the STK500.
6. Start up AVR Studio on your PC.
7. Pop-up window ‘‘Welcome to AVR Studio’’ should appear. Close this window by clicking on the ‘‘Cancel button.’’
8. Click on the ‘‘AVR icon.’’ It looks like the silhouette of an integrated circuit. It is on the second line of the toolbar about halfway across the screen.
9. This should bring up a STK500 pop-up window with six tabs (Program, Fuses, Lockbits, Advanced, Board, and Auto). At the bottom of the Program tab window, verify that the STK500 was autodetected. Troubleshoot as necessary to ensure STK500 was autodetected by AVR Studio.
10. Set all tab settings

