Loading...
Pages: [1] 2 3   Go Down
Author Topic: standalone MEGA 2560  (Read 1094 times)
0 Members and 1 Guest are viewing this topic.
Singapore
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

Guidelines for 328 apply to 2560 as well. See http://arduino.cc/en/Tutorial/ArduinoToBreadboard.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 242
Posts: 16504
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

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

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
Logged

Valencia, Spain
Offline Offline
Edison Member
*
Karma: 65
Posts: 2246
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

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

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?

Logged

Wahiawa, Hawaii
Offline Offline
Sr. Member
****
Karma: 11
Posts: 362
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 242
Posts: 16504
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Samplefinger
Offline Offline
God Member
*****
Karma: 8
Posts: 819
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Latest Sampling Scores: ATXMEGA64A3U-MH x3, ATXMEGA256A3U-MH x3, SST38VF6404-90-5C-EKE x3, SST38VF6402-90-5C-EKE x3, PGA870 x3, THS770006 x3

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 242
Posts: 16504
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

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

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?



Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 242
Posts: 16504
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 07, 2013, 02:57:14 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Wahiawa, Hawaii
Offline Offline
Sr. Member
****
Karma: 11
Posts: 362
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

Thanks guys for the clarification.

It has been most informative.

Logged

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

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


Thanks
Logged

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