Go Down

Topic: standalone MEGA 2560 (Read 12102 times) previous topic - next topic

HH75

Can anyone direct me on how to go about for a standalone Mega 2560...

Besides soldering the Atmega 2560 to a PCB board what are the steps to get it working like an arduino mega.


Thanks

qwertysimo


CrossRoads

connect up 16 MHz xtal, two 22pf caps, 10K reset pullup resistor, 100nF/0.1uF caps on the VCC/AVCC pins.
Connect up ICSP header with +5, Gnd, Reset, SCK, MISO, MOSI.
Apply power, bootload with Atmel AVR ISP MKii, or wth Nick Gammon's Arduino as ISP sketch.
http://www.gammon.com.au/forum/?id=11635
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.

HH75

Thanks for the reply.

According to this link http://arduino.cc/en/Main/Standalone, to burn the bootloader do I need both the AVR programmer and the FT232 USB to serial breakout board?

Can I only use the AVR programer alone since it connects to the MISO, MOSI, SCK, RESET of the microcontroller and it has a USB on the other end to connect to PC?

Why is the need for the FT232 breakout board?

Thanks

fungus


Thanks for the reply.

According to this link http://arduino.cc/en/Main/Standalone, to burn the bootloader do I need both the AVR programmer and the FT232 USB to serial breakout board?


No.


Can I only use the AVR programer alone since it connects to the MISO, MOSI, SCK, RESET of the microcontroller and it has a USB on the other end to connect to PC?


Yes.


Why is the need for the FT232 breakout board?


You need it to program the chip after you disconnect MISO, MOSI, SCK, RESET.


Advanced Arduino

HH75

So in another word,

I can use the AVR programmer to burn the bootloader and also to download the software code that I have written for the chip?


hiduino

No, not exactly.  If you download a sketch with the AVR programmer it will overwrite the bootloader.  If all you need is to download the sketch then you can skip the bootloader and just use the AVR programmer for downloading sketches.

The bootloader is only needed if you use it along with the FT232 USB and download the sketch via the FT232 USB connection.  Another use of the FT232 USB is for serial communication to the PC using the serial monitor program.


CrossRoads

Burning a bootloader using the IDE's Tools:Burn Bootloader also sets the fuses for correct operation. Do that first before loading any sketch, even if the sketch is to be loaded via File:Upload Using Programmer (after which the sketch starts after any reset, the bootloader is wiped out).
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.

JoeN


Burning a bootloader using the IDE's Tools:Burn Bootloader also sets the fuses for correct operation. Do that first before loading any sketch, even if the sketch is to be loaded via File:Upload Using Programmer (after which the sketch starts after any reset, the bootloader is wiped out).


My process for programming standalone Atmel processors so far has been to use the AVR ISP II ($35) with the programming software included in Atmel Studio to do the programming.  This will write the ELF file created by Arduino up to the chip over the programming port, and has a section for setting whatever fuses you want.  In addition, you can use it with the AVR Dragon's ($50) High Voltage programming mode to fix bricked chips.  In addition, if you want to use Atmel Studio to actually write code, either programmer will allow you to debug your code running in-system, which is great.
I will never ask you to do anything that I wouldn't do myself.

CrossRoads

I used to use Atmel Studio, but got tired of waiting for it to start up and went back to using the IDE.
Burning the bootloader from there kept the fuses consistent with the Arduino boards.
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.

HH75

Hi guys,

I am an amateur and it is difficult for me to understand...

Do I need to burn the bootloader in the first place? Is it just to set the fuses and in case I need to use the FT232? These fuses refer to??

Can I skip that and proceed to download my software into the chip? Will it work?, of course the sketch is a working sketch on the Arduino?

I will only need the FT232 if I need serial communication with the chip else I don't need it?




CrossRoads

#11
Mar 07, 2013, 08:54 am Last Edit: Mar 07, 2013, 08:57 am by CrossRoads Reason: 1
Browse the data sheet re: the fuses. They do things like determine the clock source, clock speed, etc.
The fuses need be set to use the 2560 as an Arduino Mega.
If you want to use the chip as something else, you could do something as simple as Nothing with the fuses and use the default settings.

If you use an AVR ISP Programmer, you can set the fuses and install a bootloader; this is done via the SPI pins.
You can also download a sketch and not have a bootloader (whether you did anything with the fuses or not) using the AVR ISP Programmer.

If you have a bootloader installed, then you can use a USB/Serial adapter (FT232 chip, CP2102 chip, ATmega16U4 programmed as USB/Serial adapter) to download sketches via the serial interface.

The bootloader installed from the IDE expects the chip to be running at certain speed to sync up with the IDE software on the computer for serial downloads.
The fuses help determine that, along with choice of crystal/resonater for an external clock.

You can of course write your own bootloader to run at different speeds, and make up a matching boards.txt entry for the speeds you are using.

Hope that clarifies things.
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.

hiduino

To clarify a bit further.

Quote
Do I need to burn the bootloader in the first place? Is it just to set the fuses and in case I need to use the FT232? These fuses refer to??


You need to only burn the bootloader once per chip.  Yes to primarily set the fuses, to select the proper clock settings.  The fuses have nothing to do with the FT232, they are not related.

Quote
Can I skip that and proceed to download my software into the chip? Will it work?, of course the sketch is a working sketch on the Arduino?


You can skip the bootloader, if you have done it at least once before(to set the fuses).  You can then download the sketches directly to the chip, using your AVR programmer, as many times as you need for testing.

Quote
I will only need the FT232 if I need serial communication with the chip else I don't need it?


Yes.


HH75

Thanks guys for the clarification.

It has been most informative.


HH75

Hi,
Do you know if I can use this AVR programmer to download my sketch? It is called Pololu USB AVR Programmer.


Thanks

Go Up