AVRdude
May 30, 2013
AVRdude is the software you run on a linux system to program an Atmel AVR microcontroller.
Some random stuff:
Use "-t" to get into "terminal mode", where AVRdude is giving you a prompt and letting you do
things like examine memory.
For the device I am now working with, I do:
avrdude -p atmega32u4 -c avr109 -P /dev/ttyACM0 -t
Use -U flash:w:file.hex:i to write to flash and program the device.
The final ":i indicates intel hex, which is the default and can be omitted in most cases.
Also the letter "w" (for write) can be replaced by "r" (for read) and "v" (for verify).
To program eeprom, just replace the word "flash" with "eeprom", so you would
use a command like: -U eeprom:w:file.eep.
Note that the ".eep" file is probably in intel hex format also,
so you can omit the :i which specifies the file format.
Intel Hex format
This is a simple ascii file format that has been around since the days of the pyramids.
A line in an intel hex file looks like:
:CCAAAATTCC
- Each line starts with a literal colon, making it easy to recognize these files.
- CC is a count in bytes (in hex) of the data on this line.
- AAAA is an address (big endian) in hex where this data is supposed to go.
- TT is a record type (00, 01, 02, 03, 04, or 05 are allowed).
- -- then we get the data in hex - endianism is not specified!
Each byte is two hex digits.
- CC is a checksum to end the line
- something like a newline ends the line.
- Record type 00 -- a plain old data record
- Record type 01 -- indicates end of file: :00000001FF
Sometimes the address field gives a starting address for the program.
- Record type 02 -- extended segment address record
- Record type 03 -- start segment address record
- Record type 04 -- extended linear address record
- Record type 05 -- start linear address record
You probably won't see the address records unless if you are working with a device that
addresses 64K or less.
A file with only an end of file record is ... an empty file!
Feedback? Questions?
Drop me a line!
Tom's Computer Info / tom@mmto.org