Atmel AVR USBASP Programming

IMG_0796I thought to try another microcontroller family, Atmel. Got a USBASP Programmer and messed my first Atmel microcontroller by setting wrong fuses. And after some googling I found that I can’t fix it without HVPP(high voltage parallel programming).

Atmel microcontrollers support 3 programming modes.

  1. ISP (In System Programming)
  2. High Voltage Programming
  3. JTAG programming

USBASP uses ISP method. ISP requires the reset pin. In atmel microcontrollers the reset pin can be configured to be used as a I/O pin by setting a fuse. But if you do that you will need high voltage programming circuit to reprogram the microcontroller.

Also for ISP, once the fuses are set corresponding for a clock source, you are required to provide the same clock source for future programming. Otherwise you will need to use high voltage programming. So be careful when setting the fuses.

Connect the USBASP signals (Reset, SCK, MISO, MOSI, VCC, GND) referring to the pin out in the datasheet. AREF and AVCC pins of the microcontroller should be connected to VCC even if you are not using ADC.

I tried several softwares to use with USBASP. Progisp 1.72 seems to be ok.

http://www.4shared.com/file/SKruVF5Y/progisp172.html

Ref – http://getavr.wordpress.com/download/

For Atmega328p using 20MHz crystal set the fuses as follows

CKDIV8  1    //not using internal oscillator anymore
CKOUT   1    //disable clock out on PB0
SUT1    1    //selecting start-up time
SUT0    1    //selecting start-up time
CKSEL3  0    //selecting clock source
CKSEL2  1    //selecting clock source
CKSEL1  1    //selecting clock source
CKSEL0  1    //selecting start-up time

For fuses “1” means unprogrammed while “0” means programmed.
Ref – http://www.atmel.com/Images/doc8271.pdf

Comment if you have problems.

Advertisements

2 thoughts on “Atmel AVR USBASP Programming

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

%d bloggers like this: