Professional Documents
Culture Documents
Download and install winavr which includes avrdude from the link below. Note - If AVR studio is installed on you PC, a different driver is used for avrispmk2 and hence avrdude can not be used for programing. http://sourceforge.net/projects/winavr/files/ Once installed, go to command terminal and type avrdude. you should get something like this -
C:\>avrdude -c asdf You should get response similar to below (with list of supported programmers)
C:\>avrdude -c avrisp The response should be similar to this (list of supported micro-controllers) -
Once verified, that you have supported programmer and controller. Next step is to program the microcontroller. For this tutorial, I am using attiny45 and avrisp mkII programmer.
Step - 3: Programming
The syntex of the command is avrdude [options] Where the options are (1) -p To specify which micro-controller to program Example - for attiny 45 uC, the syntax should be avrdude -p t45 (2) -c Type of programmer Example - if using Atmel AVRISP mk II, the syntax should be avrdude -p t45 -c avrisp2
(3) -P Which serial port to use, If using USB device like AVRISP mkII you don't need to include this option or simply use -P usb avrdude -p t45 -c avrisp2 -P usb (4) -U [memory]:r|w|v:[:format]:
[memory] - is either flash or eeprom (or hfuse, lfuse or efuse for the chip configuration fuses r|w|v - means you can use r (read) or w (write) or v (verify) code in memory [:format] - is file format which we will read/write/verify. we will always be using "Intel Hex" format, so use i
Example:
If you wanted to write the file test .hex to the flash memory, the complete syntax will be. avrdude -p t45 -c avrisp2 -P usb -U flash:w:test.hex:i If you wanted to read the eeprom memory into the file "eedump.hex" you would use -U eeprom:r:eedump.hex:i
http://blog.patilprashant.com/2013/12/programming-avr-microcontroller-with.html
http://download.savannah.gnu.org/releases/avrdude/