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.
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 description is as follows.
||Connection pin- ATMEGA16
|MOSI||Master Out Slave In||6|
|MISO||Master Out Slave In||7|
The connection is to be made as follows.
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‘.
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.
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.
Some popular fuse settings are as follows.
|Low Fuse||High Fuse
|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.
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