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