An AVR Programmer that rocks!

With the latest Sparkfun shipment arrival, a very much waited little helper was able to be put together – finally! 🙂

Since I started using AVR microcontrollers I’ve been using the AVR-PG1B serial programmer from Olimex built according to this datasheet. 

It was built in such way that I can plug it in a breadboard directly, and I used it with the great avrdude with the following sequence (example for an ATmega8515, 10MHz crystal and serial port /dev/ttyUSB0):

>avr-gcc -mmcu=atmega8515 -DF_CPU=1000000UL -g -O1 -o file.elf file.c
>avr-objcopy -j .text -j .data -O binary file.elf file.bin
>avrdude -c ponyser -p m8515 -P /dev/ttyUSB0 -U flash:w:file.bin:r -U hfuse:w:0xc9:m -U lfuse:w:0xef:m

Or just the last line, if using Eclipse with the AVR plugin.

The bad side about this programmer is the speed. It just takes toooooo long to program – I was taking something like 3min to program and verify…:-/

Now the fast USBasp is in town! 🙂 I couldn’t find an ATmega(4)8 in the shops near me so I ordered a couple from Sparkfun. This is a super simple to put up programmer that worked at the first try 🙂

Shown here as I have it working in a breadboard right now before it migrates to perforated board and then PCB. After the components were correctly put in a breadboard and the firmware was programmed (using the serial programmer mentioned before ihih) I just connect the USB cable to the computer and the red led went on! After testing that it could program (green led lights up when working), time for a little tweak for using it without being root – found here. Niiiiiice 🙂

In the end, I’m using it in Eclipse with:

>avrdude -p m8515 -c usbasp -P -e -u -U flash:w:file.hex:a -U lfuse:w:0xee:m -U hfuse:w:0xd9:m

and it programs in about 2 seconds…supa cool!

NOTE: Which wires are needed as a minimum to program an AVR with USBasp? MOSI, RESET, SCK, MISO and GND!!! (all the smart people out there ignore this obvious fact…it’s just a self reminder!)

Advertisements
  • Trackback are closed
  • Comments (0)

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: