Go Down

Topic: Help in programming the Atmega1284 with maniacbug-mighty-1284p. (Read 28279 times) previous topic - next topic

grimreaper

Thanks to Nick Gammon's blog http://www.gammon.com.au/forum/?id=11637, I successfully burned the bootloader on to my 1284P. Since my ftdi cable is en route, i thought i'd burn some programs using my arduino dumilanalov. I removed the atmega328, and took pins from
RX(arduino)-- TXD0(pin15),
TX(arduino)-- RXD0(pin14),
RESET(arduino) -- RESET(pin 9),
5v--5v,
GND--GND

to the 1284p which is on a breadboard.

Then i tried burning a simple sketch.

Code: [Select]
int led = 3;


void setup() {               

  pinMode(led, OUTPUT);     
}


void loop() {
  digitalWrite(led, HIGH);   
  delay(1000);             
  digitalWrite(led, LOW);   
  delay(1000);               
}




I got the following error message when i used AVRISP mk||.
Quote
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: stk500_cmd(): programmer is out of sync


Where did i go wrong?

Tom Carpenter

You need to swap the RX and TX lines over if you are trying to use the built in FTDI chip. (RX means the 328p's RX pin, which means that is the FTDI's TX pin).
~Tom~

grimreaper

Thanks for the reply. :) I swapped the pins like you said and it showed "done uploading", with an error,
Quote
avrdude: stk500_getsync(): not in sync: resp=0x00
. I have an LED conected at pin 4 and there weren't any blinking as well...

Tom Carpenter

~Tom~


retrolefty

#5
Dec 30, 2012, 03:13 pm Last Edit: Dec 30, 2012, 03:17 pm by retrolefty Reason: 1
Image is correct connecting TX to TX and Rec to Rec. However I don't see any connection to the auto-reset circuit from the arduino to the 1284p chip, so the arduino IDE has no way to initate a auto-reset for the 1284p chip to start the bootloader at the proper time. A simple jumper from the arduino board's reset pin to the 1284p reset pin should fix that situation. Try that and let us know how it works.

You may have to also remove the reset pull-up resistor on the 1284p chip as there is already a reset pull-up on the arduino board and having two in parallel may be too low a resistance for the auto-reset pulse to pull the signal low on initiation of the DTR signal.

Lefty

grimreaper

Quote
A simple jumper from the arduino board's reset pin to the 1284p reset pin should fix that situation. Try that and let us know how it works.

You may have to also remove the reset pull-up resistor on the 1284p chip as there is already a reset pull-up on the arduino board and having two in parallel may be too low a resistance for the auto-reset pulse to pull the signal low on initiation of the DTR signal.


Still, got the error, "avrdude: stk500_getsync(): not in sync: resp=0x00".



retrolefty


Quote
A simple jumper from the arduino board's reset pin to the 1284p reset pin should fix that situation. Try that and let us know how it works.

You may have to also remove the reset pull-up resistor on the 1284p chip as there is already a reset pull-up on the arduino board and having two in parallel may be too low a resistance for the auto-reset pulse to pull the signal low on initiation of the DTR signal.


Still, got the error, "avrdude: stk500_getsync(): not in sync: resp=0x00".





That's too bad. The error message just means that AVRDUDE and the bootloader aren't talking to each other. Are you sure you are selecting the proper comm port and board type (1284p) to use in the arduino IDE?

Lefty

grimreaper

Yep. Board is Mighty 1284p 16Mhz using optiboot, and COM port's right...

JoeO


Image attached..

The image shows no connection between the 220 ohm resistor and ground.
Move the wire.

If it still doesn't work, please take a real picture of your hardware and post it here.

grimreaper

Quote
The image shows no connection between the 220 ohm resistor and ground.
Move the wire.


The connection is right in my circuit. :) Plus that shouldn't be a reason why the upload is failing....

JoeO


Quote
The image shows no connection between the 220 ohm resistor and ground.
Move the wire.


The connection is right in my circuit. :) Plus that shouldn't be a reason why the upload is failing....

I know that it will not fix your problem.
But it does show that the image you posted is not what you have wired up.

Nick Gammon

It's hard to debug hardware issues remotely. If I was there I would hook up the logic analyzer. Perhaps an LED and 1K resistor on each of Tx/Rx lines to confirm data is getting through?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

grimreaper

Thanks for the replies, guys. :)

Quote
Perhaps an LED and 1K resistor on each of Tx/Rx lines to confirm data is getting through?


Will try that.. thanks :)

#14
Jan 16, 2013, 02:53 am Last Edit: Jan 16, 2013, 02:58 am by InitialForce Reason: 1
I am having a similar issue, except I am using an FTDI Basic (https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2117341_-1) set for 5v.
It uploaded the blink sketch just fine but anytime I am trying to upload anything larger than 2kb it gives me this error:

Quote
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: stk500_cmd(): programmer is out of sync


Bootloader is functional (Might 1284p) and I followed maniacs schematic write up to the letter: http://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/

Any ideas why I can change and upload the blink sketch as much as I want but as soon as I try to upload a larger file I get the error?

Edit: I am getting RX TX led activity for about 2 seconds than nothing. On smaller sketches this seems to be enough time to get it uploaded before it goes out of sync? I am so lost...

Go Up