Sign in Join
Wiki copytemporary

AVR Embedded Tutorial - Various programmers: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## General
22
33### Arduino IDE
44
55The easiest way is to determine the necessary parameters for avrdude is to first program the appropriate AVR with the Arduino IDE.
66
77Please refer to [[AVR Embedded Tutorial - Set up Lazarus for ATmega and ATTiny|Set up Lazarus for ATmega and ATTiny]].
88
99When programming the AVR for the first time, a boot loader is needed and this is best burned with the Arduino IDE.
1010
1111If you want to change the clock frequency or other parameters, you also have to re-burn the boot loader so that these FUSE parameters are also re-written.
1212
1313### Lazarus IDE
1414
1515The parameters which you determined using the Arduino IDE are entered in Lazarus under:
1616
1717- "Project \> Project settings ... \> Compiler commands \> Execute after" is entered.
1818
1919The parameters look something like this for an Arduino Nano:
2020
2121``` bash
2222/home/tux/Programme/arduino-1.8.5/hardware/tools/avr/bin/avrdude -C/home/tux/Programme/arduino-1.8.5/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -Uflash:w:Project1.hex:i
2323```
2424
2525### Install Avrdude
2626
2727If you install avrdude, you can shorten the starting parameter list for Lazarus a lot.
2828
2929#### Linux
3030
3131``` bash
3232 sudo apt-get install avrdude
3333```
3434
3535Note: When it comes to Linux package management, avrdude is usually somewhat older than the current version. Usually this is not a problem unless you are using brand new hardware.
3636
3737### Shortened parameters
3838
3939Since avrdude is in the search path, you can save the entire path specification. The line with avrdude.conf is also not required, since the default avrdude.conf is used, with Linux this is located at /etc/avrdude.conf.
4040
4141``` bash
4242 avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:Project1.hex:i
4343```
4444
4545## Programming via USB
4646
4747Most Arduinos are programmed via USB which looks like this for the following Arduinos:
4848
4949- Arduino UNO:
5050 - avrdude -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -Uflash:w:Project1.hex:i
5151- Arduino Nano, old boot loader (available on most Chinese clones):
5252 - avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -Uflash:w:Project1.hex:i
5353- Arduino Nano, new boot loader (will be used from early 2018):
5454 - avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -Uflash:w:Project1.hex:i
5555
5656## Programming via ISP
5757
5858Arduinos can also be programmed via ISP where the Arduino is connected to an ISP programmer via the 6-pin header. With naked AVR chips, this is done in the same way, only you have to solder the 6-pin connector yourself.
5959
6060### USBasp
6161
62-` Atmega328p or Arduino Nano, with an aspISP programmer. `
62+```
63+ Atmega328p or Arduino Nano, with an aspISP programmer.
64+```
6365
6466#### Linux
6567
6668``` bash
6769 avrdude -v -patmega328p -cusbasp -Pusb -Uflash:w:Project1.hex:i
6870```
6971
7072#### Windows
7173
7274The following driver must be installed <https://zadig.akeo.ie/> - USBasp driver
7375
74-` [Path]\avrdude.exe -v -patmega328p -cusbasp -Pusb -Uflash:w:Project1.hex:i`
76+```
77+ [Path]\avrdude.exe -v -patmega328p -cusbasp -Pusb -Uflash:w:Project1.hex:i
78+```
7579
7680### Arduino ISP
7781
7882Homemade ISP programmer with an Arduino, according to these tutorials:
7983
8084- <https://flazer.de/blog/14/arduino-atmel-flash-station> - with control LEDs
8185- <https://playground.boxtec.ch/doku.php/arduino/attiny> - without control LEDs, or search for "arduino attiny isp" .
8286- ATTiny2313 with modified Arduino as an ISP programmer.
8387
8488``` bash
8589 avrdude -v -pattiny2313 -cstk500v1 -P / dev / ttyUSB0 -b19200 -Uflash:w:Project1.hex: i
8690```
8791
8892### Release the USB port
8993
9094The USB port may be blocked which causes the following error to occur:
9195
92-` avrdude: Warning: cannot open USB device: Permission denied`\
93-` avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'`
96+```
97+ avrdude: Warning: cannot open USB device: Permission denied
98+ avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
99+```
94100
95101With Ubuntu-based Linux you can fix this by installing AVRdude as follows:
96102
97-` sudo apt-get install avrdude`
103+```
104+ sudo apt-get install avrdude
105+```
98106
99107Note: a PC restart may be necessary.
100108
101109## See also
102110
103111- [[AVR Embedded Tutorials]] - Overview
104112
105113---
106114*From the Free Pascal wiki, page "AVR Embedded Tutorial - Various programmers", as it stood on 2021-02-11 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
107115Category: AVR
108116Category: Arduino
109117Category: Embedded
110118Category: Tutorials

Back to history