Scrivere il bootloader arduino senza prgmm AVR

Ragazzi vi voglio segnalare questo articolo che ho scritto sul sito www.gioblu.com si trova in HOME.
L articolo si trova anche qui.
Gioblu.com is for sale | HugeDomains
Secondo me vi sarà molto utile.
Potete trasformare il vostro arduino diecimila, duemilanove o NG in un programmatore AVR semplicemente con 2 programmini a interfaccia grafica.
Questo metodo è stato testato da me sotto windows xp. Settimana prossima provo sotto ubuntu.
Buona lettura e segnalatemi eventuali errori/orrori di ortografia o di concetto.

ciao, io ho degli atmega senza boot loader, i pin X3 a cosa son collegati? immagino al chip dell'USB, ma quali pin? grazie :slight_smile:

edit: ho gli atmega ma non l'arduino board

allora ti serve una board tipo quelle che hanno su sparkfun da usb a ttl232.
allora questi sono quelli dell x3

in pratica devi collegare
miso pin 18 con CTS X3(1)
sck pin 19 con DSR X3(2)
mosi pin 17 con DCD X3(3)
reset pin 1 con RI X3(4)

occhio all alimentazione eh!

grzie, i segnali sulla mia scheda ci son tutti...
Non capisco casa intendi per occhio all'alimentzione... i hai messo paura ;D

non lo so ti ho risposto alle 2:30 quindi boh ci sta che in quel momento fossi da un'altra parte del pianeta!

;D

ultima domanda, anche se per quando risponderai sarà già tardi...il pin 1 (reset) la tengo la resistenza di pull up? e TX/RX li lascio collegati?
io faccio finta di si per entrambi i casi ;D

edit:
Allora, se leggo FUSE ottengo:
FF
FF
07

dalla guida devo mettere:
DA
FF
05

errore:
avrdude.exe: BitBang OK
avrdude.exe: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude.exe: drain OK

ft245r: bitclk 4800 -> ft baud 2400
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes! Invalid device signature.
avrdude.exe: Expected signature for ATMEGA328P is 1E 95 0F
avrdude.exe: reading input file "0xDA"
avrdude.exe: writing hfuse (1 bytes):

Writing | ***failed;
################################################## | 100% 0.18s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xDA:
avrdude.exe: load data hfuse data from input file 0xDA:
avrdude.exe: input file 0xDA contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.02s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
0xda != 0xff
avrdude.exe: verification error; content mismatch

avrdude.exe done. Thank you.

allora ho usato i valori letti, ma "erase write verify" si blocca (win 7)...

ora provo settando avrdude-serjtag con privilegi di amministratore...
niente.. tutto a meraviglia (usando l'opzione -F e i FUSE FF FF 07) fino a che non faccio Erase-Write-Verify... se faccio read(ovviamente in un file a parte) si blocca a metà barra, verify tipo al 2%, erase-write-verify o anche solo write neache parte la barra...
anche senza pullup sul reset, stesso identico comportamento! :o

magari stasera provo con linux, uff :cry:

allora scrivi i fuse che ho scritto nella guida con l'opzione -F e prova a rileggerli in una fase successiva, se sono quelli giusti allora sblocca il fuse di Lock scrivi il bootloader e riblocchi il fuse di lock con i valori scritti.
Il reset va a pullup sempre, ma TX e RX a cosa li hai collegati scusa?

TX/RX erano già collegatoi e li ho lasciati li, magari qualche dato passava di li per caso e mi pareva brutto lasciarlo a se stesso ;D

i Fuse ho provato sia quelli della guida (atmega368P) che quelli letti con read, e solo read funziona. L'unlock era già settato giusto su 3F

si ma hai provato a scriverceli i fuse? io ho fatto prove con gli atmega168, il 328 mi manca. Comunque in linea di principio dovrebbe essere la stessa cosa! Dovrebbe funzionare. Mi posti uno schema o una foto della cosa che stai facendo, magari capisco meglio.
Se non ho capito male tu non usi un arduino, ma un atmega su una basetta fatta da te!

dunque, la foto non l'ho ancora fatta, comunque ho tutto su basetta, i 4 collegamenti dello schema, pullup da 10kohm su reset, alimentazioni quarzo+condensatori +gnd+vcc sul lato reset,2vcc e gnd sull'altro lato. Vcc lo prendo direttamente dall'usb, stessa cosa il GND.
Windows XP da terminale:
leggo fuse:

C:\Documents and Settings\Mauro\Desktop\serjtag-0.3\avrdude-serjtag\binary>avrdu
de.exe -c diecimila -P ft0 -p m328p -t -B 4800
avrdude.exe: BitBang OK
avrdude.exe: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude.exe: drain OK

 ft245r:  bitclk 4800 -> ft baud 2400
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.


avrdude.exe done.  Thank you.

aggiungo -F:

C:\Documents and Settings\Mauro\Desktop\serjtag-0.3\avrdude-serjtag\binary>avrdu
de.exe -c diecimila -P ft0 -p m328p -t -B 4800 -F
avrdude.exe: BitBang OK
avrdude.exe: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude.exe: drain OK

 ft245r:  bitclk 4800 -> ft baud 2400
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATMEGA328P is 1E 95 0F

vabbè si prova lo stesso a scrivere il boot loader:

C:\Documents and Settings\Mauro\Desktop\serjtag-0.3\avrdude-serjtag\binary>avrdu
de.exe -c diecimila -P ft0 -p m328p -U flash:w:ATmegaBOOT_168_atmega328.hex -F
avrdude.exe: BitBang OK
avrdude.exe: pin assign miso 3 sck 5 mosi 6 reset 7
avrdude.exe: drain OK

 ft245r:  bitclk 230400 -> ft baud 115200
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATMEGA328P is 1E 95 0F
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
 ft245r:  bitclk 230400 -> ft baud 115200
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: reading input file "ATmegaBOOT_168_atmega328.hex"
avrdude.exe: input file ATmegaBOOT_168_atmega328.hex auto detected as Intel Hex
avrdude.exe: writing flash (32670 bytes):

Writing | ################################################## | 100% 17.81s



avrdude.exe: 32670 bytes of flash written
avrdude.exe: verifying flash memory against ATmegaBOOT_168_atmega328.hex:
avrdude.exe: load data flash data from input file ATmegaBOOT_168_atmega328.hex:
avrdude.exe: input file ATmegaBOOT_168_atmega328.hex auto detected as Intel Hex
avrdude.exe: input file ATmegaBOOT_168_atmega328.hex contains 32670 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 8.31s



avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x7800
             0x0c != 0xff
avrdude.exe: verification error; content mismatch

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

inutile sottolineare che non va

Prova ad aggiungere alla linea di comando il flag -B 1.0
se l'avr non è mai stato programmato, alcune cose devono essere scritte più lentamente, ed il -B 1.0 serve a questo... (scribe a 2400bps)

che dire... ho rifatto da 0 tutto il circuito, risultato: funziona tutto senza dover uppare il boot loader... ;D

a breve riprovo comunque il processo di upload del bootloader per testare se funziona.
Comunque qualche precisazione sul testo: i link non funzionano, togli il www. davanti

edit: non ancora testa l'upload del boot, ma il micro funziona alla grande... i feel so dumb!