Arduino Mega 2560 on pcb

I have made a PCB with ATmega2560 controller. I am using a 16MHz crystal with two 22pF capacitors . Each attached to one of the crystal pin and the other to ground. I have also attached a 1K resistor between reset and VCC pin of controller. I have soldered already programmed ic for blinking leds. It is working. But I want to upload the code using USB-to-TTL. I tried many different ways which includes:

  • pressing the reset button (between GND and RESET pins) till the uploads starts.

  • using a 0.1uF capacitor in the RESET and DTR pin of another Usb-to-ttl converter

  • used another arduino to upload the code

But nothing worked. Kindly help me out if I am missing any important component on the PCB. Or what can I do to upload the code? What could be the problem? A good schematic for ATmega controller would also be appreciated. The schematic I found on the official site didn't worked for me too.

Share the schematic of your design with us.

Was this IC programmed directly with the blinking LED sketch or via an already programmed in bootloader?

The chip needs a bootloader programmed into it and the appropriate fuses set in order to do this. You also need to know which of the 4 serial ports has been designated for the bootloader to use.

In your chematic you missed line 42.

Share the schematic of your design with us.

This is the schematic design.

The IC was programmed with the blinking leds code at different number of pins. It was programmed when the IC is on Arduino Mega board. I programmed it it then just de soldered it. It was working on my designed pcb. The problem is now uploading on my pcb.

I am using RX0 and TX0 of the controller connected to TX and RX of usb to ttl.

If the chip doesn't have a bootloader, you won't be able to upload code. To upload a bootloader, you need to breakout SPI and upload the bootloader using Arduino as ISP

Sorry I didn't get you. Can you point me more clearly what you want to say. Thank you

It has a bootloader on it. I have told in my post that I have desoldered the IC from a working Arduino Mega Board. And now i want to upload the code using usb-to-ttl.

1 Like

What USB to TTL module are you using?

I have tried two usb to ttl modules.

  • FT232RL FTDI with a DTR pin
  • CP2102
    I have also tried another arduino as ISP. But nothing worked for me.

I don't see the traditional 6-pin ICSP header or 6-pin FTDI header.

Your design is missing decoupling capacitors and the reset circuit is incomplete.

For a minimal MEGA2560 design, have a look at the reference design at the bottom of the MegaCore github page.

1 Like

Thank you @markd833 . I will try this solution you gave. It seems helpful.

My schematic worked. Thankyou you all for your help. There was a little fault in soldering. Which i accidently found.Glad you all helped.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.