Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Prossima revisione | Revisione precedente | ||
notes:avr.programming [12/04/2012 00:51] 127.0.0.1 external edit |
notes:avr.programming [04/06/2016 12:31] (versione attuale) alez [AVR Programming quick guide] |
||
---|---|---|---|
Linea 5: | Linea 5: | ||
**The matter: upload a compiled code file (.hex) into the avr's flash memory.** | **The matter: upload a compiled code file (.hex) into the avr's flash memory.** | ||
+ | Use a Makefile to do all the work. Download it [[talks:avr-microcontrollers#makefile|here]]. | ||
+ | In the makefile: | ||
+ | * change/add source files; | ||
+ | * change your project name; | ||
+ | * change part name (for example atmega16); | ||
+ | * change programmer type and port. | ||
+ | Use ''make'' to compile, ''make hex'' to generate firmware in the format read by the programmer, ''make writeflash'' to program the AVR. | ||
+ | I have also added ''make fuse'' that should be adjusted in the Makefile, to write the fuse byte(s). | ||
+ | ===== Notes ===== | ||
+ | |||
+ | Atmega64 : remove compatibility flag when programming, otherwise lot of registers won't work and the code will crash. | ||
+ | |||
+ | i.e. extended fuse bits should be 0xFF | ||
+ | |||
+ | ''avrdude -p m64 -P /dev/parport0 -c stk200 -U efuse:r:-:h'' | ||
+ | |||
+ | will output 0xfd, so let's do | ||
+ | |||
+ | ''avrdude -p m64 -P /dev/parport0 -c stk200 -U efuse:w:0xFF:m'' |