I got a very cheap USBASP programmer for AVR from ebay. Long cable with 10 pin connectors and an adapter from 10 to 6 pin.
To be used for programming an Arduino where the bootloader is not wanted at startup or when it takes too much space in the RAM.
You can program a skecth into an Arduino when the USBASP is connected with the Menu option Sketch: Upload Using Programmer. This also removes the bootloader, making space.
When I connected the USBASP to my Uno and tried this with a sketch, the upload failed with the error:
avrdude: warning: cannot set sck period. please check for usbasp firmware update
Known problem, ol d firmware. Sigh, another job to do. This is what I did to make it work as wanted.
Some googling around and this is my recipy. Based upon a post by Roger Clark,, performed by me on Windows 7.
- Program an Arduino UNO as programmer.
Plug in the Arduino Uno. Note the serial port assigned, COMXX (fill in the number on the next commandlines !).
Start the Arduino IDE (1.6.5 for me, but this will work with older versions also).
From the Examples (on the File menu). Select “Arduino ISP”.
Choose board: Uno and serial port to what you just noted.
Select “Upload” and confirm that the new firmware has been uploaded. - Download the latest version of the USBASP firmware from Thomas Fischl’s site, the designer of the USBASP.
The most recent firmware is usbasp.2011-05-28.tar.gz
Unzip the file in a temp directory and copy usbasp.atmega8.2011-05-28.hex to c:/program files (X86)/arduino/hardware\tools\avr\bin (requires admin privileges!) - Open a command prompt (Run as Adminstrator)in c:\program files (X86)\arduino/hardware\tools\avr\bin
This folder contains the avrdude program that will be used to flash the new firmware. - Close the self program jumper on the USBASP.
On my board there were two empty holes, in which i soldered a jumper.
Connect the Arduino to the programming pins of the USBASP
Make sure you disconnect the USBASP from your computers USB! - Make these connections
Arduino USBASP 5V ———— 2 GND ———— 10 13 ———— 7 12 ———— 9 (MISO) 11 ———— 1 (MOSI) 10 ———— 5 (RESET)
Note the notch on the connector is above pin 3-5-7. The picture above shows the pins in reverse. This is how the connector in the cable seen from the front, where the connections are to be made:
XXX --------------- | 1 3 5 7 9 | | 2 4 6 8 10 | -----------------
Check that avrdude can connect to the USBASPIn the windows command window, typeavrdude -C ../etc/avrdude.conf -c avrisp -P COMXX -b 19200 -p m8 -v
If everything is connected correctly you should see a load of information about the USBASP board that you are about to program, like this
... AVR Part : ATMEGA8 ... avrdude: AVR device initialized and ready to accept instructions
The last message is the sign everything is connected and you have an ATMEGA8 as I have on my USBASP.
If you get an error message about invalid signature, you either have a defective USBASP or you made a wiring error.
- Assuming that AVRDUDE can connect to the USBASP, you can backup the original firmware using the command
avrdude -C ../etc/avrdude.conf -c avrisp -P COMXX -b 19200 -p m8 -U flash:r:original_firmware.bin:r
This should read the firmware and save it to a file called original_firmware.bin (in the same folder as avrdude.exe)
- Now burn the new firmware with
avrdude -C ../etc/avrdude.conf -c avrisp -P COMXX -b 19200 -p m8 -U flash:usbasp.atmega8.2011-05-28.hex
- If the process worked ok and AVDRUDE verified the new firmware, you can disconnect the USBASP from the Arduino.
Remove the self programming jumper and connect it via USB to the PC and attempt to program your target device (using the Arduino IDE). Note that you loose the bootloader when using USBASP, use Nick Gammon’s boot loader program to restore that.
Related posts:
To get to know the Arduino world better I have bought from ebay two kits: 37 in 1 sensor kit and an Arduino kit. Nice bo...
The combination of Arduino, such as the Uno with the ATmel ATmega 328P, and the Raspberry Pi is a natural one. The RPi i...
The Freaduino MEGA 2650 looks a nice board at first view. It is advertised as Arduino MEGA 2650 compatible with many ex...
ASCII ART, to copy into sketches or online. ASCII ART by busyducks UNO ATMEGA 2650 NANO PRO MIN...