Showing posts with label avrdude. Show all posts
Showing posts with label avrdude. Show all posts

Saturday, May 18, 2013

USBasp programmer with avrdude(Linux)


    After success full  implementation of  serial programmer, I turned to make a USBasp programmer .The firmware is downloaded from USBasp official site.In this tutorial we will see how to use AVRdude for burning hex files into AVR microcontroller using USBasp. USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed. In my circuit only use the six pins(MOSI,MISO,SCK,RESET,GND,+5V) from the usbasp to target microcontroller, It is little different from actual circuit in official site. No need of external +5V power supply to target microcontroller. The circuit is given below


USBasp programmer

NOTE:The fuse bits for 12Mhz crystal  HFUSE=0xc9 and  LFUSE=0xef  burn explicitly to  atmega8 using serial programmer(any programmer).It is very important, the USBasp programmer cannot work with default fuse bits. The command for setting the fuse bit:

avrdude -c ponyser -p m8 -P /dev/ttyS0 -U lfuse:w:0xc9:m -U hfuse:w:0xef:m

For reading the current fuse bit in atmega8:

avrdude -c ponyser -p m8 -P /dev/ttyS0 -U hfuse:r:high.bin:b -U lfuse:r:low.bin:b