migrating from mega2560 to standalone 2560

Hi All :slight_smile:

Pretty newbe on the arduino stuff :wink:

I have a question about migrating to a standalone 2560 from the Arduino Mega2560.
Since I have a bunch of 2560's it would be great to migrate some projects from the mega board to the standalone 2560's.
Started off with a simple blinky sketch, uploading with the arduino as ISP using avrdude. This works great - atleast, my blinky goes a bit faster than every second (prolly a qrystal - using a 16Mhz or a maybe a wrong fuse setting).
But when I try to upload a 'hello world' lcd sketch, it aint working (blinking square only), I followed the pinmap of arduino to connect the lcd to the standalone 2560 - but nothing :frowning: the sketch is working like it should on the arduino tho (lcd displaying 'hello world').

Am I something missing here? Do I need a bootloader to run this kind of sketches or is there another problem arising?
Could it be something with using avrdude? When using Arduino IDE (if possible) are the fuses set correctly for the 16Mhz crystal (or resonator)?
Is there a possabilaty the lcd sketch isn't working b'cuz of the crytal instead of a resonator like the arduino has?

Hopefully someone can answer my (rather dumb?) questions :slight_smile:

Thanx in advance!

How'd you make a standalone 2560?

Do I need a bootloader to run this kind of sketches or is there another problem arising?

No.

When using Arduino IDE (if possible) are the fuses set correctly for the 16Mhz crystal (or resonator)?

16MHz is the standard frequency for an Arduino, so that should be OK.

Is there a possabilaty the lcd sketch isn't working b'cuz of the crytal instead of a resonator like the arduino has?

If you got blink to work then the frequency is good, anyway using a resonator will have no affect on the LCD.

Are you saying that the sketch and tha LCD work with a standard Arduino Mega?

If so then you have a hardware problem with your board.


Rob

Graynomad:

When using Arduino IDE (if possible) are the fuses set correctly for the 16Mhz crystal (or resonator)?

16MHz is the standard frequency for an Arduino, so that should be OK.

If you got blink to work then the frequency is good, anyway using a resonator will have no affect on the LCD.

Are you saying that the sketch and tha LCD work with a standard Arduino Mega?

If so then you have a hardware problem with your board.


Rob

Thanx for yer reply Rob.

The blinky is working, only its blinking like a mad man :stuck_out_tongue: so freq is not set correct...
I'm using avrdude to burn the sketch to the 2560, I think (I'm sure) the freq is not set correctly - e.g not to 16Mhz.
Wondering if/when this is the case, the lcd sketch aint working properly due to the wrong freq setting?
At the moment I'm not using arduino IDE to upload thru ArdinoISP to atmega2560 but avrdude, so i'm missing some fuse settings i think.

When I take a look-see to other tutorials, e.g arduino-on-a-breadboard, the boards.txt is altered for this setup to work.
Basically this is exact what I'm trying to accomplish here, but with another atmega. Is it save to alter this snippet for use with the atmega2560?

As for the hardware problem, there isn't much hardware involved :wink: (triple checked if all legs of the 2560 are properly soldered to the pads)
Looking at the diagram of the Mega2560 there are no components between the processor and the header pins used. unles i'm missing out some located elsewhere.

My 'standalone' consists of a processor on a pcb with headers and decoupling caps on the vcc's and ground. Rest of the hardware, crystal and his caps, are located momentarily for test on a breadboard. If all works out I make a custom pcb for the project, thus moving all to the custom pcb. The processor is beeing kept on his own small adapter pcb.

@CrossRoads: see above :wink:

When i'll go and try to alter my boards.txt, is there anything i can mess-up and brick or damage my 2560? Other stuff to be carefull about?

Thanx in advance

If you mess up boards.txt, generally things just won't go.
Worst case, get an Atmel AVR ISP MKii, easy way to read back all fuses, lock bits, EEPROM, flash, set bootload size, etc.
Its one of the handiest tools I have for programming.

This is one of the better prices I have seen on it.

http://www.newark.com/atmel/atavrisp2/avrisp-programmer/dp/68T2065?Ntt=avrisp+mkii
Could also try here with coupon code Voucher Code "ship22", 15% off thru July 9.

Someone even did a nice writeup on using it:

Note the steps on the driver - when I used mine, I was programming via AVR Studio 5.
When I tried using it within the IDE, I discovered Windows was using the Jungo driver. I was pointed to a link here in the forum that identified the need for a different driver, which is available in one the Arduino files. Uninstalling Jungo and installing the driver from the IDE files, and I was good to go.

I think these files, from this path:
C:\Arduino-1.0.1\hardware\tools\avr\utils\libusb\bin

avrisp2.cat (168 Bytes)

avrisp2.inf (3.31 KB)

avrisp2.cat (168 Bytes)

Thanx for reply CrossRoads :slight_smile:
Think this AVR ISP mkii is a great option, thanx for pointing it out.

Brings me to a next question....
I was planning to use arduino mega2560 as isp for programming the 2560's, is it possible programming the fuses in this setup? (using avrdude)
Yesterday I tried some stuff messing with the boards.txt in order to write the atmega with the IDE and arduino as ISP hoping fuses would set correctly, but no luck (like you said :wink: )

Also I tried a programmer sketch made by Nick Gammon for burning the bootloader to a 2560, but to no avail.
Verifying the hex written gave me an empty result, no error when programming tho.

This AVR ISP mkii, is it able to wake up a bricked 2560?
On one of my first attempts programming the 2560 with a isp programmer (usbasp) failed to write the fuses after flashing and my 2560 doesn't answer after that...

As for the fuses for the 2560, can I use the fuses like stated in the boards.txt?

Thanx in advance

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

Nick walked me through in this thread how to use his code to load the bootloader from a Mega 2560 to a custom 2560 based board I have. Managed to get to work but I still can't load the firmware for the 8u2. I have an AVR ISP MKii on order and I'm going to send this Pololu programmer back.

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

Nick walked me through in this thread how to use his code to load the bootloader from a Mega 2560 to a custom 2560 based board I have. Managed to get to work but I still can't load the firmware for the 8u2. I have an AVR ISP MKii on order and I'm going to send this Pololu programmer back.

Followed this thread :slight_smile:
Have ordered an AVR ISPmkii also, as pointed out by CrossRoads, hoping it'll make things a bit less problematic.
Think I'll give it another try this weekend, eventually I'll get there :stuck_out_tongue:
Also I found a solution for bricked megas Arduino-based AVR High Voltage Programmer | MightyOhm .
Seems you need to modify some of the sketch and/or the hardware on the shield for use on the 2560's and maybe some mods to get it working on a arduino mega2560 - think its worth trying it.

One question: Why would you want the AVRISP mkii over the Dragon, other than it is a bit cheaper and isn't quite as nerdy (though that can be a feature too).

The Dragon can do the high voltage programming, reset a chip that is bricked because you accidentally disabled the reset line, and also do debugWire.

So what is the advantage of the AVRISP mkii ?

http://store.atmel.com/PartDetail.aspx?q=p:10500053

Seems a little overkill for downloading a bootloader.
I don't have a use personally for all the other stuff.

Maybe a software engineer could use all that stuff.

JoeN:
One question: Why would you want the AVRISP mkii over the Dragon, other than it is a bit cheaper and isn't quite as nerdy (though that can be a feature too).

The Dragon can do the high voltage programming, reset a chip that is bricked because you accidentally disabled the reset line, and also do debugWire.

So what is the advantage of the AVRISP mkii ?

Dragon is a neat board, but didn't see any use for the hardware contained on this board. Also I'm using TQFP packages, no DIPs - still got to buy/fabricate alot of adapters (for 100 pin tqfp its about $60 for an adapter), the AVRISP is suitable for the job. And speaking of 'nerdyness', building a shield to accomplish HVP with the arduino seems more fun to me :stuck_out_tongue:

Using this AVRISPmkII since it got in last week, and must say: I'm very content about the features.
Flashing arduino sketches to the 2560 in a jiffy, and writing stuff in avrstudio for the atmega32.

CrossRoads:
Maybe a software engineer could use all that stuff.

I am a 'software engineer' (c/c++), nope, dont see any use for all that stuff :stuck_out_tongue: always need just another hardware setup (but guess its just me).