Easy way to upload sketches to Atmega2560

I did some searching on the interwebz, apparently you can burn bootloader and upload sketches to the Atmega2560 using a Uno board. The problem is I don't have a Uno board that I can remove the microcontroller from, so I'm looking for an easier way. My question is, did anyone here tried this before and found an easier way? Can I somehow completely ditch the Uno board in this scenerio?

https://www.instructables.com/id/ATMEGA2560-Standalone-Using-Arduino-UNO/

That is the link I found explaining the method I talked about above, if anyone's interested.

Edit:
By sketch I mean the sketches we use on Arduino boards, straight outta Arduino IDE. I want to use the Arduino IDE somehow to program an Atmega2560. That's the short version.

Once you’ve burned the bootloader (using an Arduino Uno, for example), all you need is a serial interface between the computer and the ATMega. You can get FT232 clones from China for ~$2. If you add a diode and a 100nF capacitor, you can enable auto reset, and it will work just like any regular Arduino (check the Arduino schematic for the reset details).

Pieter

PieterP:
Once you've burned the bootloader (using an Arduino Uno, for example), all you need is a serial interface between the computer and the ATMega. You can get FT232 clones from China for ~$2. If you add a diode and a 100nF capacitor, you can enable auto reset, and it will work just like any regular Arduino (check the Arduino schematic for the reset details).

Pieter

I can't exactly pinpoint the location for the diode and the cap but I'm sure I can handle that later. I would still be able to use PWM and other stuff right?

RabbitTheDevil:
I can't exactly pinpoint the location for the diode and the cap but I'm sure I can handle that later.

The principle is explained here: A Beginner's Guide to the ESP8266 (Voltages and component values differ, but the principle is the same).
In the Arduino MEGA 2560 Schematic, the components I'm talking about are D3 and C7.

RabbitTheDevil:
I would still be able to use PWM and other stuff right?

Yes.

I assume you mean D3 and C1? C7 is nowhere near D3. Thanks for helping me through this, really appriciated!

C7 is connected between DTR and RST. They didn't draw the full lines, but all lines with the same label are connected.

Oh I got it, right. So do I only need the C7 and D3 or do I also need the rest of the circuit there?

You'll also need some other components, like the pull-up on the reset pin (RN5A), the crystal and caps for the oscillator, decoupling caps on the power supply, etc. You probably don't need C1, it's just extra filtering for the reset line. Not sure what the purpose of RN3D is though. Wouldn't hurt to add it, but it should work without it, because the DTR output should be a push-pull output anyway (in normal use cases).
You probably don't need the power selector (T1, IC7B) and LDOs (IC1, IC6) if you're just going to run it on a breadboard. An LED on pin PB7 is useful for debugging and making sure that the bootloader works. IC4 is replaced by the FT232.

Okay thanks a lot, I'll try to get it to work and resurrect the post if I have problems with it. Meanwhile if anyone wants to pitch in, I'd love to hear what others want to tell as well.

Edit:
Oh and if there is a USB to serial converter that you people think is better than others, or has this whole circuit on the go I'd love to see it as well.

Watch out that you use the right voltages for your chip & other components...
Some may be 3V3, or 5V Vcc - (or less likely other voltages)
Remember 0V/GND is common throughout

lastchancename:
Watch out that you use the right voltages for your chip & other components…
Some may be 3V3, or 5V Vcc - (or less likely other voltages)

Keep in mind that you need at least 4.5V to run the ATmega at 16 MHz. If you decide to run it on 3.3V, you’ll have to use a lower clock speed (8 MHz is very common).

PieterP:
Keep in mind that you need at least 4.5V to run the ATmega at 16 MHz. If you decide to run it on 3.3V, you'll have to use a lower clock speed (8 MHz is very common).

I'm thinking about running it on 5V 15MHz that should be okay.

Edit:
What even is 15MHz? Slippy fingers betray me again! It's 16MHz.

RabbitTheDevil:
I'm thinking about running it on 5V 15MHz that should be okay.

If you really want 15 MHz, check the baud rate error first. There's only a fixed number of prescalers you can use, so the baud rate depends on the clock speed. If the error is too large, you get UART communication errors. If you compile the bootloader (see here), it will probably print the error percentage. If the error is too large, pick a different baud rate, and change the upload speed in the Arduino IDE as well.

RabbitTheDevil:
Edit:
What even is 15MHz? Slippy fingers betray me again! It's 16MHz.

Nevermind then :slight_smile:

RabbitTheDevil:
I did some searching on the interwebz, apparently you can burn bootloader and upload sketches to the Atmega2560 using a Uno board. The problem is I don't have a Uno board that I can remove the microcontroller from, so I'm looking for an easier way. My question is, did anyone here tried this before and found an easier way? Can I somehow completely ditch the Uno board in this scenerio?

https://www.instructables.com/id/ATMEGA2560-Standalone-Using-Arduino-UNO/

That is the link I found explaining the method I talked about above, if anyone's interested.

Edit:
By sketch I mean the sketches we use on Arduino boards, straight outta Arduino IDE. I want to use the Arduino IDE somehow to program an Atmega2560. That's the short version.

some remove the chip.
some hold it in reset.
but Blink or BareMinimum will do. only thing is not execute Serial.begin

Oh can I somehow put the chip in reset (or remove reset) while loading the sketch by hand? At least until I fully figure out the circuit?

RabbitTheDevil:
Oh can I somehow put the chip in reset (or remove reset) while loading the sketch by hand? At least until I fully figure out the circuit?

You can connect a capacitor between reset and ground on the UNO. (Value is not critical, use 10 μF or so). Then connect RX of the UNO to RX of the ATmega, TX of the UNO to TX of the ATmega, connect the power as well. To upload, press upload in the IDE, and reset the ATmega manually right before the RX and TX lights of the UNO start blinking.

Hmm I see. Looks like a decent approach. I think I'll try that out before putting the circuit fully together.

only uplooad a sketch without Serial.begin () and wire the 2560 to Uno RX to RX, TX to TX

EDIT: Pieter is right, you need to prevent the reset, because the Uno bootloader would react on avrdude upload

Just remember that the armega2560 must have a bootloader in order to upload sketches over serial. If you are going to use the atmega2560 in a custom board, it is a good idea to include an ISP reader on the board, both for easy initial programming, and in case a sketch prevents serial programming.