Go Down

Topic: ATmega1284P: End to End using 1.0 IDE (Read 81086 times) previous topic - next topic

bamboosam

Ok so using an AVR MKii with AVR studio 5, I also had to Erase Chip under memories a couple times to get the lock bits to all show No Lock and get the Lock Bit Register to show 0xFF.

I am pretty sure I then burned the bootloader successfully. But now I cant seem to communicate with the chip at all in Arduino IDE via duemilanove as ISP or using an FTDI basic?

avrdude: Send: 0  [30]  [20]
avrdude: Send: 0  [30]  [20]
avrdude: Send: 0  [30]  [20]

... "not in sync: resp=0x00"

In AVR studio 5 I uploaded maniacs 1284p optiboot in "flash" in memories, then after "Erase Chip" I then went into Lock bits and clicked "Program". Everything checked ok.

That is how I burn the bootloader correct? I am just lost as to why I now cant communicate with the chip in Arduiono IDE???

westfw

Did you set the fuse bytes correctly?

bamboosam

I believe so:

Extended -  0xFD
High - 0xDE
Low - 0xFF

bamboosam

I may have a connection tweaked, Ill re-check them tomorrow. But I was able to load an Arduino IDE  compiled .hex in fine using AVR studio. Huh?

bamboosam

Hey CR thanks again that did save me time.

CrossRoads

Glad to help.
I bootloaded 50 cards tonight.
Can't seem to download a sketch tho.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

westfw

I have received PCBs, and have one mostly assembled.  Alas, I don't seem to have any suitable 40pin sockets, so I need a shopping trip :-(

000

Wonderful thread :D Thanx to maniacbug and all other members for putting this great thread thorough.. :D
I had to try for some 2 days to get it to bootload my Atmega1284p Finally it worked... phew!!! :D

Tip for others using Arduino 1.0 I couldnt get it to bootload without this though.
Quote
Note for Arduino 1.0: you need to make one small change to the ArduinoISP code. Find the line in the heartbeat() function that says "delay(40);" and change it to "delay(20);"

Did someone edit the wiki page of AVR ISP today? because I was pretty sure I didnt find it yesterday(Or probably didnt notice). Today I made the change and Voila it worked... (Dont know why though... :) )

Sorry @Crossroads for the late reply. couldnt buy your PCB. I needed a complete assembled board. and I found a dealer in India selling similar boards (Not bootloaded to work with arduino though) http://www.ebay.in/itm/ATMEL-ATMEGA1284P-PCB-ATMEGA644P-ATMEGA32-ATMEGA16-components-/140621576563?pt=LH_DefaultDomain_203&hash=item20bdb2f973 (See attachment for schematics of the board)

So far so good. but the problem starts now. I cant burn programs into it. I used maniacbugs blog to burn the bootloader and it worked fine. Now I am trying to burn blinky program into it but I dont have FTDI breakout boards though to program it. I am trying to program it directly with a Serial cable as shown below.(No interfacing ICs used though. I am guessing the board has RS232 interface from schematics though.)



I am connecting only the pins Rx,Tx, RTS and GND pins of DB9 connector to the board. Is this enough to get it to program the Atmega1284p? (Apparently I cant. seem to be getting      avrdude: stk500_getsync(): not in sync: resp=0x00    errors ). Is DTR pin required? because I saw a mention of that in maniacbug's blog. Any help regarding how to upload programs directly via serial cable?


westfw

The serial signals that you get from an actual rs232 port are inverted and at higher voltage levels than the signals you'd get from an FTDI breakout board or similar.  It won't work, and it might fry your chip.

000

Quote
The serial signals that you get from an actual rs232 port are inverted and at higher voltage levels than the signals you'd get from an FTDI breakout board or similar.  It won't work, and it might fry your chip.


BIt more clarity on the above would be nice.  :) Isnt that why the RS232 interface is there (given in the schematic). Any work around for this?

westfw

Quote
Isnt that why the RS232 interface is there (given in the schematic).
ah.  Yes, I didn't see that.  That should do the inversion and voltage conversion for you, and it should work ok (assuming nothing wrong in the circuitry.)
Your photo show the jumper for autoreset removed; did you have it in there when you were trying to upload sketches?
(It's sorta nice to see circuits with a 'real' rs232 converter chip on there...)

Have you tested it at the various "obvious" loopback spots?
  loop rx to tx on the db9 connection.  You should get things that you type echoed back. *(analog loopback)"
  loop tx to tx on the other side of the conversion circuit, preferably without the chip prsent.  (digital loopnback)
     You should still be geting back echoed data.  The CPU is still not involved.

000

Thanx Westfw tried the loopback test and it failed then got know it must be something wrong with the serial cable. Checked it out and apparently had got the pin numbers wrong. (Counted it in the opposite direction..  XD )Corrected it and the board with Atmega1284p worked :D Yay!!! Thanx for all your support. :D

westfw

Heh.  When working with "real" serial, it's almost ALWAYS the stupid cable being wrong.  USB is SO much nicer...

CrossRoads

#253
Mar 22, 2012, 02:56 am Last Edit: Mar 22, 2012, 03:55 am by CrossRoads Reason: 1
I have two boards, one a wirewrap DIP 1284 that runs at 5V, 16 MHz,
the other a PCB SMD 1284 that runs at 3.3V, 16MHz.

Both show the same results when a maniacbug 1284 bootloader is installed using an ATMega8A based programmer.
See attached.
The DIP board successfully downloads a sketch using an FTDI Basic USB/Serial adapter.
See attached.
The SMD board does not.
See attached.

I am at my wits end trying to figure out why.
The SMD board has 16 MHz resonator. 5V goes thru battery charge control chip, 3.3V regulator, to the '1284.
The bootloader loads okay, so I don't think its a power issue.

Any thoughts/suggestions would be appreciated!
Thanks
Robert/CrossRoads
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

westfw

#254
Mar 22, 2012, 04:43 am Last Edit: Mar 22, 2012, 04:50 am by westfw Reason: 1
Can you confirm that the serial port is working by loading some serial test sketch using the programmer?

[oops.  never mind; I looked at the log, and you're getting "pretty far" in the upload.  Weird.]
It looks similar to the timeout-related problem caused by Arduino-1 and ArduinoISP, though I can't explain why it would work with one board and not the other...

Go Up