Pages: [1] 2 3 ... 11   Go Down
Author Topic: Help in programming the Atmega1284 with maniacbug-mighty-1284p.  (Read 22007 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

~Tom~

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply. smiley 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...
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you post a picture of your circuit?
Logged

~Tom~

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Image attached..


* UploadingSketchesTo1284P.png (77.98 KB, 894x604 - viewed 199 times.)
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: December 30, 2012, 09:17:54 am by retrolefty » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Upstate NY
Offline Offline
Full Member
***
Karma: 2
Posts: 184
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Upstate NY
Offline Offline
Full Member
***
Karma: 2
Posts: 184
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

The connection is right in my circuit. smiley 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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 480
Posts: 18722
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies, guys. smiley

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

Will try that.. thanks smiley
Logged

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

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...
« Last Edit: January 15, 2013, 08:58:26 pm by InitialForce » Logged

Pages: [1] 2 3 ... 11   Go Up
Jump to: