didattici:avrdude
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
didattici:avrdude [2018/06/29 13:14] – profpro | didattici:avrdude [2020/06/08 22:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | vedere anche [[didattici: | ||
+ | |||
+ | ======AVRDude====== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | Ogni Arduino ha un proprio microcontrollore e le istruzioni si trovano nel sito Atmel (Instruction set manual). | ||
+ | Questi microcontrollori, | ||
+ | |||
+ | * Avra è un assembler per la famiglia di microcontrollori Atmel AVR 8-bit (RISC) | ||
+ | * Avrdude è una interfaccia da linea di comando per upload e download del codice nella memoria di un microcontrollore | ||
+ | |||
+ | entrambi sono pacchettizzati su Debian | ||
+ | |||
+ | |||
+ | |||
+ | ====Avra==== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | Avra dispone di molti file .inc (uno per ogni tipo di microcontrollore), | ||
+ | |||
+ | Esempio: | ||
+ | |||
+ | collegare un LED sul pin PB5 e ad una resistenza di 220 ohm, poi alla terra. | ||
+ | |||
+ | < | ||
+ | ;hello.asm | ||
+ | ; accende un led sul piedino PB5 (digital out 13) | ||
+ | |||
+ | .include " | ||
+ | |||
+ | ldi r16, | ||
+ | out DDRB, | ||
+ | out PortB, | ||
+ | Avvio: | ||
+ | rjmp Avvio ;relative jump (altrimenti il program counter continua a crescere) | ||
+ | </ | ||
+ | |||
+ | Comando per produrre hello.hex | ||
+ | |||
+ | avra hello.asm | ||
+ | |||
+ | |||
+ | Premere prima il bottone di reset di Arduino e poi eseguire questo comando per caricare il codice eseguibile | ||
+ | |||
+ | avrdude -p m328p -c stk500v1 -b 57600 -P / | ||
+ | |||
+ | * bitrate potrebbe essere -b 115200 | ||
+ | * porta potrebbe essere -P / | ||
+ | |||
+ | Esempio di lettura | ||
+ | |||
+ | avrdude -p m328p -c arduino -b 115200 -P / | ||
+ | |||
+ | < | ||
+ | avrdude: AVR device initialized and ready to accept instructions | ||
+ | |||
+ | Reading | ################################################## | ||
+ | |||
+ | avrdude: Device signature = 0x1e950f | ||
+ | avrdude: reading flash memory: | ||
+ | |||
+ | Reading | ################################################## | ||
+ | |||
+ | avrdude: writing output file " | ||
+ | |||
+ | avrdude: safemode: Fuses OK (E:00, H:00, L:00) | ||
+ | |||
+ | avrdude done. Thank you. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ======== | ||
+ | |||
+ | datasheet ATmega328P http:// | ||
+ | |||
+ | | nome | valore | ||
+ | | Program Memory Type | Flash | | ||
+ | | Program Memory Size (KB) | 32 | | ||
+ | | CPU Speed (IPS) | 20 M | | ||
+ | | SRAM Bytes | 2048 | | ||
+ | | Data EEPROM/HEF (bytes) | ||