I'm quite sure my minimal bredboard setup - just the ATmega328, the quartz, two 22p Cs, a LED and a correct
wired ISP socket is working. I have tested this with my STK500 clone in AVR studio 4 by downloading a .hex
file (actual the Arduino Blink example). AVR Studio reports no error, LED is blinking!
Studio reads the following Fuse / Lock bits:
ext 0xFD
high 0xDA
low 0xFF
all Lock bits set to no
This seems to be the correcht settings. There is no bootloader burned. To my understandig this is not necessary while using an ISP programmer.
Switching over to Arduino I first set upload.using=avrisp in preferences.txt file. There after I started Arduino IDE and start a verbose upload. Here is what I get (btw: board was set to Ard. Duem. / Nano w. ATmega328 port was set to 5 as in AVR studio)
avedude v5.4
using port com5
using programmer stk500v1
ser_open: setting dtr
sent: 0 [0] [20] (3 times)
recv: (blank)
stk500_getsync(): not in sync: resp=0x00
send: Q [51] [20]
recv: (blank)
stk500_disable() protocol error, expected 0x14 resp=0x51
avrdude done. Thank you.
Can someone interpret this protocol and give me a hint what do I have to change to make it running?
Is anyone out there who has managed to use an STK500 compliant programmer in Arduino IDE? How???
I may be wrong, but does the Arduino burn programs in the chips? Or just tries to download through the bootloader?
Or are you trying to burn the bootloader onto the chip?
What puzzles me, is this message:
ser_open: setting dtr
If you are burning the chip, DTR isn't needed. But it's just a guess.
I first set upload.using=avrisp in preferences.txt file. There after I started Arduino IDE and start a verbose upload.
:
avrdude v5.4
using port com5
using programmer stk500v1
What is the avrdude command line shown ? It looks to me like it is NOT using avrisp as the upload protocol. I think you need to change boards.txt (xxx.upload.protocol ?) rather than just the preferences.txt file.
@ bubulindo: avrdude by it self? A lot of confusing parameters. At least for a newbee as me. The fine thing of an IDE is you shouldn't care about. Thank you for the hint. May be you can supply me a simple how-to-do
@ westfw: Yes I quit the IDE before making the changes and restart. With your protocol at hand I tried the following:
1 changing boards.txt: from upload.protocol=stk500 to =avrisp
nothing changed
2 changing programmers.txt: avrisp.protocol=stk500v1 to avrisp
yippee! avrdude protokoll changed to -cavrisp But still can't get in sync
3 changing programmers.txt: avrisp.communication=serial to =usb
I do not know German (or Germanic languages), but this:
avrdude: ser_open(): can't open device "usb": Das System kann die angegebene Datei nicht finden.
makes me believe either you have your serial port open, or your serial port doesn't exist. Which one do you think it may be? Are you running Windows, Linux?
About the avrdude, there's plenty of examples to be used together with the AVR-GCC... you'll need to get a sample Makefile and take it from there. AVR-GCC brings example makefiles too. So, although not easy, it's perfectly possible to get it done.
Hi Westfl,
hi everybody who can help,
still can't upload from within Arduino IDE to a bare e.g whithout a booloader mega328 chip BUT playing around with standalone avrdude - there is a nice GUI on the net - I figure out arduino uses avrdude V5.4 (V5.10 is the current version). In this version there is no support for the mega328 chip - arduino must use a spcial trick :~ Happily the GUI generate and show the avrdude command lines and let you edit them. So I used your avrdude protocol as a guideline and had success! Avrdude load the .hex file generated by arduino (hard to find). Finaly my program runs on the bare bone chip
Qustion now what is wong whith my settings. May I ask you sending me a copy of your ...programmers- ...boards- ...avrdude.config-files and what ever ma bee importand.
Thank you for your patience and advice
MHz
BTW: V5.10 needs a .dll I don't have on my XP system
Qustion now what is wong whith my settings. May I ask you sending me a copy of your ...programmers- ...boards- ...avrdude.config-files and what ever ma bee importand.
hmm. The truth is that I've never used the Arduino IDE to program the bootloader; I always used either the optiboot sourcecode route ("make atmega328_isp") (with the avrdude included with Arduino) or the optisketch stand-alone program...
It is a bit late but for the sake of knowing. I found this little tool called ARP / Arduino Uploader. Very simple and precisely what is needed to burn a file to ATmega chips.
Thank you Marius for the hint. Calling avrdude under my own control (bypassing Arduino IDE) is enlightning. I found the avrdude-gui very usefull. It gives you full control over all the (confusing but never the less importand) parameters. To solve my problem I ended up with an own programmer and board definition.
for your convenience I attach the avrdude-gui-zip
Have fun!