Connections to breadboard for programming.

Hello everyone, I would like to know if the pins on an Arduino UNO match those of the Arduino Mega 2560.

Here is the setup. I have a Atmega328 chip on a breadboard with boot loader installed and working (blink sketch) now.
I have a Arduino Mega 2560 to use as a programmer.

Normally I have a UNO avail but it is in use for the time being.

I would like to upload new sketches to the BreadBoard 328 using the 2560 to do so. I have not found a good Pinout for this use.

Also what if I wanted to burn the boot loader to a blank328 on a breadboard and again use the mega 2560 to do so?

My confusion is that http://arduino.cc/en/Tutorial/ArduinoISP only shows with an UNO or similar. I have read that the pins needed on the mega could be pins 50 51 52 53 or such. When I look at the data sheet it does not corolate to the mega board pins it only shows the chips pins. So do the chip pins really match the board pins or are some of them remapped in the boot loader?

-What settings would be selected in IDE v. 1 or higher to burn the boot loader to the 328 on the breadboard using the mega to do so, and what pins go to what pins?

-What settings would be selected in IDE v.1 or higher to upload sketches to the 328 on the breadboard using the Mega to do so, and what pins go to what pins?

I had no problems with an UNO but with this Mega I think I may be just reading to deep and causing my self to get mislead.

Thanks for any help folks. Pictures would also be great!

~ Cory ~

Do you want to program the Atmega328 with a USB/TTL programmer in the future? Then you would need the Bootloader.

If not, then you can just use the In Circuit System Programmer (ICSP). It is the dual 3 pin header (between the ATMEGA2560 and Reset Button). Upload Using Programmer with the ICSP of the Mega2560 pinned as such: http://itp.nyu.edu/physcomp/uploads/6pinAVRproghead.jpg

If you have a 6pin ribbon connector, the colored or black side of the ribbon is the side with pin 1 on it. Using the Arduino IDE, you can use the "Arduino as ISP" as a programmer and connect the MISO, MOSI, SCK, RST and Power/Gnd (If Target is powered, else just Gnd) to the pins on the target. Reset needs to go to RST with no capacitor. After programming the Mega2560 as an ISP, you will need to switch the "Board" to 328 Duemilanove. The select your "sketch" and File -> "Upload Using Programmer".

Wow great stuff! Thanks for the fast reply.

spcomputing: Do you want to program the Atmega328 with a USB/TTL programmer in the future? Then you would need the Bootloader.

If not, then you can just use the In Circuit System Programmer (ICSP). It is the dual 3 pin header (between the ATMEGA2560 and Reset Button). Upload Using Programmer with the ICSP of the Mega2560 pinned as such: http://itp.nyu.edu/physcomp/uploads/6pinAVRproghead.jpg

If you have a 6pin ribbon connector, the colored or black side of the ribbon is the side with pin 1 on it. Using the Arduino IDE, you can use the "Arduino as ISP" as a programmer and connect the MISO, MOSI, SCK, RST and Power/Gnd (If Target is powered, else just Gnd) to the pins on the target. Reset needs to go to RST with no capacitor. After programming the Mega2560 as an ISP, you will need to switch the "Board" to 328 Duemilanove. The select your "sketch" and File -> "Upload Using Programmer".

Yes I will do this at a later time with a USB/TTL programmer, but it is good to know I can bypass the boot loader for other projects. :-)

That is exactly what I needed to know. - I do have the 6pin ribbon as an option and just purchased a avr programmer from ladyada as well http://www.ladyada.net/make/usbtinyisp/

-- lets say for examples sake that I only had the Mega2560 a breadboarded 328 and some standard male jumpers. The 328 would be powered via 9 volt battery, has a boot loader and blink program working. I modify the blink sketch to flash at 100 vs 1000 and now get ready to upload it to the 328 using the Mega as ISP.

  • Could I then just use pins...reset, ground, 50,51,52 on the mega and goto chip pins 1, 17, 18, 19 on the 328. Matching of course grd to grd, rst to rst, MISO to MISO, MOSI to MOSI, SCK to SCK and then proceed with uploading sketches and or a boot loader?
  • Another example I saw stated to just connect Rst to Rst Tx to Tx, and Rx to Rx for uploading sketches. Would that work? --- Also most all of them say to use a cap or resistor on rst to grd on the mega, I will try without it and see if that makes a difference. Thanks for the heads up. :-)

I never know exactly what tools I might have with me and like to have other options, even if they are not as simple as your suggested connection method. ;-)

Thanks again for the fast response.

Hrd2rchme:

  • Could I then just use pins…reset, ground, 50,51,52 on the mega and goto chip pins 1, 17, 18, 19 on the 328. Matching of course grd to grd, rst to rst, MISO to MISO, MOSI to MOSI, SCK to SCK and then proceed with uploading sketches and or a boot loader?
  • Another example I saw stated to just connect Rst to Rst Tx to Tx, and Rx to Rx for uploading sketches. Would that work?
    — Also most all of them say to use a cap or resistor on rst to grd on the mega, I will try without it and see if that makes a difference. Thanks for the heads up. :slight_smile:

Yes, you can use jumpers from the Mega pins to the target matching the Gnd/Vcc/RST/MISO/MOSI/SCK, you can put bootloader or skteches on the target Atmega.

No, there is no way to upload a sketch to the target through the mega. Communications do not connect Tx->Tx and Rx->Rx. They must be crossed over. When you transmit, you want a receiver on the other end. The only way Tx->Tx is on a mis-marked board.

Thank you. This helps clear up the things I had read that seemed to be misleading.