Un PC fa (Ubuntu - nonricordolaversione) progettavo giochini per i figli di mio nipote (sono lo zio, non il bisnonno) usando un Arduino Nano per l'implementazione. Quando il giochino funzionava, caricavo tutto su un Atmega328 standalone a 8MHz di clock interno, più che sufficiente per i miei scopi, recuperando il Nano e miniaturizzando il tutto.
Avevo dedicato una breadboard al caricamento degli Atmega328 con un Arduino Nano dedicato, uno zoccolo a 28 pin e tutte le connessioni già fatte. Mi ero fatto un bigino per non dover ricostruire la procedura tutte le volte.
Sul nuovo PC (Ubuntu 18.04 LTS) ho attualmente la versione 1.8.8 dell'IDE di Arduino e mi trovo bene. Ho riesumato la breadboard e cercato di caricare il bootloader su un Atmega328P vergine.
Prima sorpresa: fra le schede non c'è: "ATmega328" "Bootloader SI/NO" "Clock 8 MHz internal". Una breve ricerca e la trovo su
dove mi fanno scaricare questo file
https://www.arduino.cc/en/uploads/Tutorial/breadboard-1-6-x.zip
con le istruzioni per mettere "breadboard" in "hardware".
Seconda sorpresa: Carico ArduinoISP sul Nano (328p Old Bootloader) e compare questa scritta:
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Fa niente, è un warning. Fra le schede compare "ATmega328 on a breadboard (8 MHz internal clock) su /dev/ttyUSB0". Perfetto. Quello che volevo. Strumenti => Programmatore "Arduino as ISP"; Strumenti => Scrivi il bootloader.
Questo il messaggio di errore:
***failed;
avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xfd instead of 0x05 (double check with your datasheet first).
Vado su board.txt e cambio "efuse" come indicato. Riprovo a caricare il bootloader e questa volta "Caricamento completato".
Però provo a caricare un blink e ottengo questo
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Lo sketch usa 928 byte (3%) dello spazio disponibile per i programmi. Il massimo è 30720 byte.
Le variabili globali usano 9 byte di memoria dinamica.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c
Problema di caricamento sulla scheda. Guarda http://www.arduino.cc/en/Guide/Troubleshooting#upload per suggerimenti
Questo report potrebbe essere più ricco di informazioni abilitando l'opzione
"Mostra un output dettagliato durante la compilazione"
in "File -> Impostazioni"
Domani continuerò a investigare. Per il momento chiedo il vostro aiuto, ma ora vado a nanna.
Ciao,
P.