Programming ATmega16/32 using AVR-USBASP

ATmega16 & ATmega32, having Advanced Virtual RISC Architecture are microcontrollers having breadboard friendly 40 pin DIP package.This post is intended to help beginners program ATmega16/32 IC’s using USBASP.

IMG_0013 copy

 


The USBASP is a serial programmer having Serial Peripheral Interface for programming . The programmer consists of 10 pin standard serial connector for connecting to the target board for programming. The USBASP consists of the ATmega8 IC which can be connected through USB port as ELEMENTZ AVR PROGRAMMER by providing suitable driver form here.

The target pinout is as follows

pinout

Pinout description is as follows.

Net Description
Connection pin- ATMEGA16
MOSI Master Out Slave In 6
MISO Master Out Slave In 7
SCK Serial Clock 8
TRST Target Reset 9
TVCC Target VCC 10
GND Ground 11

The connection is to be made as follows.

IMG_0018 copy

After connecting the USBASP programmer to the USB port for the first time user have to locate the driver file from the above said link. On successful  installation the device manager should list device as ‘ELEMENTZ AVR-USB PROGRAMMER‘.

driver

Then connect the AVR Programmer to your project board. A compatible project board can be purchased from this link. For other boards connect the 10 pin connector by making use of the pinout mentioned above.

For programming your IC AVRDUDE GUI is required which can be downloaded from this link.

Open AVRDUDE GUI. Make sure the configuration is done properly according to the picture shown below.

configuration1

Inorder to make external crystal oscillators to work, fuse settings should be changed. Click on fuses tab and provide Low and High Fuse settings, select write and press Execute.

configuration2

Some popular fuse settings are as follows.

Low Fuse High Fuse
Description
E1 99 Factory Default– Works with internal 1 MHz RC Oscillator, JTAG Enabled
FF 99 Factory Default– Works with External 8-16 MHz Crystal Oscillator with JTAG Enabled
FF D9 Factory Default– Works with External 8-16 MHz Crystal Oscillator with JTAG Disabled

 

Program can be loaded to flash memory by providing the hex file in Flash tab. Select the write button and press execute.

configuration3

Other resources and links.

1) Elementz AVR- USBASP Driver — link

2) AVRDUDE GUI — link

3) USBASP Usermanual — link

4) ATMEGA 16/32 Project Board — link

5) USBASP Ebay product — link

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s