Pages: 1 [2] 3   Go Down
Author Topic: ATmega2560 custom board problem  (Read 3546 times)
0 Members and 1 Guest are viewing this topic.
Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, so far I've tried the command line you wrote above which made it complain that it couldn't find the "wide configuration file".
If I gave it the path to the one in arduino (I only have AVRdude through Arduino) it stood for a few second and than gave me the error "stk500_getsync(): not in sync: resp=0x00". What am I doing wrong here?

Thanks for your help so far!

Cheers
Logged

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

Hi.
Your problem seems like one I recently had too:

http://arduino.cc/forum/index.php/topic,156818.0.html

Thanks for your feedback, did your firmwares run on the platform even though you got the verification fail error?

Cheers

Yes, on mine the arduino bootloader was installed correctly, even though the error message appeared.
Have you tried to upload an arduino sketch via serial?
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 30
Posts: 628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I gave it the path to the one in arduino (I only have AVRdude through Arduino) it stood for a few second and than gave me the error "stk500_getsync(): not in sync: resp=0x00". What am I doing wrong here?


Looks like you may have specified the wrong COM# port.  It should be whatever your Uno show up under in the IDE Tools->Serial Port menu.

Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 137
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The best way for me was to use the sketch from Gammon. Give it a try smiley

http://www.gammon.com.au/forum/?id=11635



Logged

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

The best way for me was to use the sketch from Gammon. Give it a try smiley

http://www.gammon.com.au/forum/?id=11635

Thanks, I'll try that later. Is that a sketch that you put on one adruino board to program a bootloader to another board? Specifically made for ATMega2560 it looks like?

Cheers
Logged

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

If I gave it the path to the one in arduino (I only have AVRdude through Arduino) it stood for a few second and than gave me the error "stk500_getsync(): not in sync: resp=0x00". What am I doing wrong here?


Looks like you may have specified the wrong COM# port.  It should be whatever your Uno show up under in the IDE Tools->Serial Port menu.

No, Both Serial port and board model are correct smiley I just recently read about 20 threads around the net all advising to check the correct port  hehe
There is only on port present and thats the one I'm using.

i'm using a Mega board instead of a Uno, the sketch tells the different pins but it may be something else I need to change?

Cheers
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 137
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The best way for me was to use the sketch from Gammon. Give it a try smiley

http://www.gammon.com.au/forum/?id=11635

Thanks, I'll try that later. Is that a sketch that you put on one adruino board to program a bootloader to another board? Specifically made for ATMega2560 it looks like?

Cheers

Well, its an "all in one" sketch. You can upload it to your mega and connect your mega proto to it. It recognizes it and chooses the proper boot loader.

If you get verification errors while using this sketch change the clockdivider to the following

Code:
 // slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV64);

to

Code:
 // slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV128);


Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 30
Posts: 628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i'm using a Mega board instead of a Uno, the sketch tells the different pins but it may be something else I need to change?


Yes, then use this for avrdude instead.
Code:
avrdude -c stk500v1 -PCOM6 -b19200 -p atmega8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex

Logged

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

i'm using a Mega board instead of a Uno, the sketch tells the different pins but it may be something else I need to change?

Yes, then use this for avrdude instead.
Code:
avrdude -c stk500v1 -PCOM6 -b19200 -p atmega8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex


So still same configuration with the Mega as a AdruinoISP and my programmer hooked up to it the way you described before?
But run with the command line you just wrote?

Cheers
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 30
Posts: 628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.
Logged

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

Yes.
Thank you hiduino for all your help so far! The programmer is now updated and I have run through some more tests to pinpoint what the original problem is. Here's a summary so far:

Solved problems:
  • Verification error when uploading bootloader
  • USBasp programmer updated, "set sck" warning gone

Still a problem:
  • Direct uploaded sketches (via programmer) don't run
  • Uploaded sketches via bootloader works only first time then timeout from board, sketch runs fine until chip erase


Uploading of sketches via Bootloader
After the bootloader have been uploaded (now with 100% success rate) I can upload a skech via the serial link to the bootloader one time. This can be directly after the bootloader have been uploaded or after everything have been disconnected and reconnected. One time and then the following attempts receive this timeout message.
Code:
....
         Using Port                    : \\.\COM14
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
....
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done.  Thank you.
Reading the end of the verbose makes you think it is the programmer which in this case is the board/bootloader that is the problem right?

Direct uploading of sketches
So far no attempts have been successful, I have tried the following:
  • Upload via programmer after chip erase (Empty flash)
  • Upload via programmer after Bootloader successfully uploaded
  • Arduino HEX file uploaded via (3th party software) "eXtreme Burner - AVR"
  • Simple blink firmware written in AVR studio


So far It seems like it is not the actual hardware that causes problem, programming in a certain sequence always works out, but it may have to do with how the MCU boots up?

What really makes no sense is that even simple firmware written in AVRStudio won't run but a bootloader will, any ideas?

Cheers!
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 30
Posts: 628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to connect the reset pin on the mega2560 to a capacitor to the DTR or RTS pin on the USB serial adapter.

http://arduino.cc/forum/index.php/topic,154906.msg1164779.html#msg1164779

What kind of serial interface are you using?

« Last Edit: March 31, 2013, 03:30:53 am by hiduino » Logged

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

You need to connect the reset pin on the mega2560 to a capacitor to the DTR or RTS pin on the USB serial adapter.

What kind of serial interface are you using?
Simple, I should have thought about that, Thank you! I use a basic USB-TTL adapter so I have to put in a wire directly to the chip the get the signal out, DTR or RTS doesn't matter?

About the main issue, what can be the problem that firmware or sketches uploaded directly with a programmer won't run?
It most be a simple mistake from my side, maybe something that needs to be set. Disable bootloader maybe?
Do the uploading of the bootloader set something that needs to be changes when not using a bootloader?

I can switch between bootloader and direct programming on my other platforms without changing anything.

Cheers
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 30
Posts: 628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When you upload a sketch directly using a programmer it will normally overwrite the bootloader.  If the sketch doesn't start, it may be because the auto-reset needed.  Did you try a manual reset?  Do you have a reset button?

Logged

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

If the sketch doesn't start, it may be because the auto-reset needed.  Did you try a manual reset?  Do you have a reset button?

I've tried to reset through power cycle but not through Reset, is there a difference? I don`t have a reset button on my board but I will put one in as soon as possible.

I will be away for work until late this week so I'll give your reset idea a try then.


Thank you again, cheers!
Logged

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