Setting up the AvrUsb500 and avrdude
February 24th, 2006I just purchased my AvrUsb500 from tuxgraphics.org. The AvrUsb500 is an open-source (hardware and software) USB programmer for the Atmel AVR microcontrollers. This is just a quick run-down on how to get setup using the AvrUsb500 on a Linux system. In this case, I'm using Fedora Core 4. It is assumed that you have setup your Linux distribution with the GNU tools for AVRs (avr-gcc). If you haven't, you should first read Installing the GNU tools for AVRs.
FTDI Kernel Module (USB Drivers)
The AvrUsb500 programmer uses the FT232BM chip, which essentially allows a USB port to act like a serial port. The "driver" for this chip is in the ftdi_so kernel module. Many, many devices use this chip. Once this kernel driver module has been loaded, USB devices using this chip will show up in your /dev path which programs can read/write to as if it were any other serial file descriptor. For Fedora Core, the devices will show up as /dev/ttyUSBn where n is a number starting from 0.
To check if you have the ftdi module loaded, you can issue this command:
cat /proc/modules | grep ftdi
which should result in something along these lines if the ftdi kernel module is loaded:
ftdi_sio 30793 0 - Live 0xe0c7c000 usbserial 30761 1 ftdi_sio, Live 0xe0c8f000
If the module is loaded, you can just plug in the AvrUsb500 programmer. You should then have the "file" /dev/ttyUSB0 (Fedora and friends) or /dev/usb/tts/0 (some other distributions). If you do NOT have a port, you'll need to load the ftdi kernel module.
I'm taking this from some very old notes, so it may not be entirely accurate, however, loading the kernel module went something like this:
su # become root /sbin/modprobe -v ftdi_sio /sbin/insmod /lib/modules/2.6.11-1.14_FC3/kernel/drivers/usb/serial/usbserial.ko /sbin/insmod /lib/modules/2.6.11-1.14_FC3/kernel/drivers/usb/serial/ftdi_sio.ko
Obviously, you're going to have to modify this for your kernel version (and obviously this is from FC3). I'm using FC4 now and it was basically the same procedure. You can use the command uname -r to determine what kernel version you are using.
Install avrdude
Download the most recent release of the avrdude from http://download.savannah.gnu.org/releases/avrdude/ (avrdude-5.1.tar.gz).
Extract binutils archive:
tar -xzf avrdude-5.1.tar.gz cd avrdude-5.1
Configure and install avrdude:
./configure --prefix=/usr/local/avr make su make install exit
Edit avrdude.conf for the AvrUsb500
Now we need to edit the file /usr/local/etc/avrdude.conf to add the AvrUsb500 to the list of programmers.
First, look for the default port values:
# # Overall avrdude defaults # default_parallel = "/dev/parport0"; default_serial = "/dev/ttyS0";
And change it so that the default_serial is the port we setup in the section: FTDI Kernel Module (USB Drivers):
# # Overall avrdude defaults # default_parallel = "/dev/parport0"; <span style="font-weight: bold">default_serial = "/dev/ttyUSB0"; </span><span style="font-weight: bold"></span>
Then, add an entry for the AvrUsb500 programmer:
# # PROGRAMMER DEFINITIONS # programmer id = "avrusb500"; desc = "Atmel AVR ISP V2 programmer from tuxgraphics"; type = stk500v2; ;
From here, you'll want to test your little programmer to make sure it's all working and that avr-dude is installed correctly.
Categories
Popular Posts
RSS Feeds
Archives