To-do: Explain the different ways of programming a microcontroller, its memory zones, bootloader zone, fuses, etc.
These are the steps to program a microcontroller (e.g. Atmega328p, aka Arduino Pro Mini), preloaded with an Arduino-compatible bootloader directly...
From AVR Studio
- Install avrdude from the WinAVR project, or find its path inside an installation of the ArduinoIDE.
- Open the Atmel Studio IDE.
- Go to the
Toolsmenu and choose
- Add a new one named
avrdude, with its path pointing to the
avrdude.exefile you found in the first step above.
Arguments, write the following (for Arduino Pro Mini, Atmega328p), obviously replacing the path to
avrdude.conf, the serial port name with your own actual values. Alternatively, replace the quoted string between
:iwith the full, absolute path of the final
.hexfile produced by your project compilation.
-C "C:\avrdude\avrdude.conf" -p atmega328p -c arduino -P COM9 -b 57600 -U flash:w:"$(ProjectDir)Debug\$(ItemFileName).hex":i
From a Linux terminal
sudo apt install avrdude
Take the compiled program in
.hexformat and program it with:
avrdude -p atmega328p -c arduino -P /dev/ttyUSB0 -b 57600 -U flash:w:"YOURPROGRAM.hex":i