Pages: [1] 2   Go Down
Author Topic: Arduino ATmega1284p bootloader  (Read 5735 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ;-)
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/

https://github.com/maniacbug/mighty-1284p

:-)
Logged

California
Offline Offline
God Member
*****
Karma: 13
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 06, 2013, 04:04:04 pm by retrolefty » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 06, 2013, 07:07:41 pm by php-freak » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23605
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 06, 2013, 08:27:47 pm by tack » Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23605
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there anyone who have an idea what is wrong?
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2   Go Up
Jump to: