Go Down

Topic: Arduino ATmega1284p bootloader (Read 8 times) previous topic - next topic

php-freak

Hi,

I ordered the 1284p a few days ago and I would now burn a bootloader to chip. I only have the Arduino Mega 2560 and the Arduino UNO. Is there any good tutorial how to do that? I read a lot about this but nothing really helps...

Thank you very much!

PS: Sorry for my bad english ;-)


spcomputing

Another good one is Nick's programmer:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=11635&page=1

It is very fast.  What kind of clock are you going to use (Crystal, Resonator or Internal)?

php-freak

Sorry for the late reply, it took some time to get all the components...

Thank you for the latest link. i was able to flash a bootloader to my 1284p. Now I want to upload some code but it fails.

Here is a picture where you can see my setup:

https://www.dropbox.com/s/llqm0x68c8m4aeo/20130106_205943.jpg

I bought a cheap FTDI programmer but it should do the work. I get this error: avrdude: stk500_getsync(): not in sync: resp=0x00

I selected the Mighty 1284p, 16MHz using Optiboot as board and Arduino as ISP as programmer.

Thank you very much for your help!

retrolefty

#4
Jan 06, 2013, 10:00 pm Last Edit: Jan 06, 2013, 10:04 pm by retrolefty Reason: 1
What programmer you select is not revelant in the normal uploading the IDE uses. What you have to do is make sure you select the proper com port number for the FTDI uses in the tools menu. Fix that first and then if it still doesn't work you may have rec and tx wires reversed on the FTDI to 1284p chips, reverse them and try again.

Lefty

php-freak

#5
Jan 06, 2013, 10:04 pm Last Edit: Jan 07, 2013, 01:07 am by php-freak Reason: 1
Thank youf or your reply.

I swap RX and TX, now I get this error messages:

Quote
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51


Com Port should not be the problem, I have only one (the FTDI). the FTDI is blinking, when I upload a sketch, so this looks right.

CrossRoads

You need some decoupling caps on the VCC/AVCC pins.
You also need to connect FTDI's input pin CTS to Gnd so it knows the chips is waiting for data.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

tack

#7
Jan 07, 2013, 02:24 am Last Edit: Jan 07, 2013, 02:27 am by tack Reason: 1
EDIT: Sorry, I see from your picture that it looks like you have DTR and a cap connected for auto reset. It might still be worth trying the manual reset way though to rule reset issues out.

You might have had it round the correct way to start but have you got auto reset wired correctly for your FTDI?

If no auto reset then you'll have to manually reset the 1284P at the right point in the compile/upload process. Have a reset switch wired, or a jumper ready on the RST pin to touch to GND. When you see the compiler finished and the IDE showing 'Compiled xxxxx blah blah blah' then count 'One, Two' and reset the 1284P. It's just a matter of getting the timing right.

When you reset the bootloader starts first and waits to see it any new code is being sent to the MCU. If it has transfer on the UART pins then it facilitates a write of the code into the Flash space. If there is no communication after a short time the it hands over to the currently installed sketch to run.

So, when sending the new sketch via your FTDI you have to reset so that the bootloader becomes active to accept the upload. One normal boards there is an auto reset circuit that the IDE can control, via the FTDI, to initiate the reset at the right time.

retrolefty


You need some decoupling caps on the VCC/AVCC pins.
You also need to connect FTDI's input pin CTS to Gnd so it knows the chips is waiting for data.


Why do you say that is a requirement? I note that on a Duemilanove schematic the FTDI CTS pin just goes to a floating pad. I think only if the arduino IDE requested to the PC FTDI USB software driver to use hardware handshaking would you have to deal with the CTS pin on the FTDI chip.

Lefty

CrossRoads

I connect it because the Promini has the CTS pin grounded.
The FTDI Basic connects the CTS header pin to the FTDI CTS pin.

So, used or not, that's the way I connect it, and I never have problems with USB/Serial interfacing.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

retrolefty


I connect it because the Promini has the CTS pin grounded.
The FTDI Basic connects the CTS header pin to the FTDI CTS pin.

So, used or not, that's the way I connect it, and I never have problems with USB/Serial interfacing.


Grounding it will not cause a problem, but it is not a requirement, it will work equally well unconnected, that was my only point.

Lefty

php-freak

Yes, thats right, I have caps on both sides (0,1µF). On my FTDI there os GND, CTS, VCC TXD RXD and DTR. I thought DTR is the auto reset pin so I connected DTR to Pin 9 with a 0,1µF cap.

This is my FTDI programmer: http://www.ebay.de/itm/230820610037?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649#ht_500wt_1414

Again, thanks a lot for your help!

php-freak

Is there anyone who have an idea what is wrong?

retrolefty


Yes, thats right, I have caps on both sides (0,1µF). On my FTDI there os GND, CTS, VCC TXD RXD and DTR. I thought DTR is the auto reset pin so I connected DTR to Pin 9 with a 0,1µF cap.

This is my FTDI programmer: http://www.ebay.de/itm/230820610037?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649#ht_500wt_1414

Again, thanks a lot for your help!


First you can use either RTS or DTR as the arduino IDE/AVRDUDE pulses both signals to generate the auto-reset pulse. The oldest auto-resetting arduino boards used RTS, all the newer ones use DTR, but for legacy backwards compatibility the IDE pulses both RTS and DTR signals.
Second, what do you mean by "I have caps on both sides (0,1µF)" ? if the DTR (or RTS) signal has to pass through two series .1ufd caps to get to the reset pin on the avr chip then that is an effective capacitance of .05ufd and may be too small a value to allow the pulse to generate the reset. If that is the case remove one of the two series connected .1ufd caps from the circuit.

Lefty

php-freak

Thank you for the info, I didn't know that RTS and DTR works.

I made a better picture with a higher resoultion and some description: 2,8MB Picture

I have two caps between VCC and GND (AVCC and GND). And there is one cap between Pin 9 (Reset) and DTR. I checked TX and RX, at first it was correct then I swap them so it wasn't correct anymore so know it is the right way but the error message is the same: avrdude: stk500_getsync(): not in sync: resp=0x00

Go Up