# Programming ATMEGA328P with an USB-UART adapter

I'm having trouble using this USB to serial converter to program my ATMEGA328P. Let me show my steps below:

1. I have bootloaded the ATMega328 using the Arduino as an ISP.
2. I then used the Arduino as an ISP to program the ATMega with a blinky sketch. This worked perfectly and I was able to get it working.
3. I then installed the USB to serial converter with this wiring:

I have tried using a 10k pull-up resistor on the RST pin of the ATMEGA328P, and I have also tried without the pull-up resistor.

On the IDE side. I simply open the Arduino IDE, and open a blinky sketch. I then select the correct COM PORT (which shows up correctly), and I select Arduino UNO as my board type. I press upload, and get the following error:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1b


If anyone has any tips, then that would be greatly appreciated!

Thanks for the help.

Edit 1:

Hello, in response to some comments here are my first debugging steps:

1. I have reburned the bootloader onto the ATMEGA328 successfully

2. After burning the bootloader, I did NOT upload any sketches using the Arduino.

3. I tried to use the USB to serial converter I have (link in the first line of this questions) and I keep getting the following error:

avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xcf

My settings in the arduino IDE can be seen below:

I have also tried the following settings:

I have tried to click the upload arrow, and I have also tried to go to sketch -> upload using programmer.

My board is wired exactly like this image below:

• What are your command line arguments to avrdude? If it's saying stk500_recv programmer is not responding, maybe it's trying to use the "-c stk500" programmer instead of the ft232 programmer "-c 2232HIO"? See nongnu.org/avrdude/user-manual/avrdude_4.html for the valid options for the avrdude -c programmer-id command-line argument. Oct 14, 2021 at 1:57
• @MarkU if you follow his link, you'll find that he isn't using ftdi at all. It's just a CP2102 based USB-UART bridge. Oct 14, 2021 at 19:06

I have bootloaded the ATMEGA328 using the arduino as an ISP.

I then used the arduino as an ISP to program the Atemga with a blinky sketch. This worked perfectly and I was able to get it working.

When you use arduino as ISP to program the atmega328p, you ERASE (overwrite) the bootlader, since arduino as ISP works like an Atmel-ICE. To retain the bootloader, you need to (first burn the bootloader as you did) and then upload by ONLY using usb to serial converter.

To make sure that your usb to serial converter also works (at least the Tx/Rx lines), upload a sketch that sends characters to the PC and ckeck if they show up.

If you want to know that the reset line (RST side of the capacitor) works, you can put an oscilloscope on the RST side (close to mcu) and check the oscilloscope when you try to upload code using usb to serial. The line should go from 5V to ~2.5V for a milisecond or so and rise again. This resets the mcu, activating the bootloader.

If this does not work, you need to show us your whole schematic diagram, as I am unsure of how is your wiring of your atmega328p exactly. Also, knowing the fuses of the atmega would also be useful.

• Hi thanks for all the help. I tried to put the Bootloader back on and then not use the ISP to program it. However, this still does not work. Please see edit 1 for more details.
– user297725
Oct 15, 2021 at 23:44
• I see your edit 1: When you use bootloader/usb to upoad your code, You programmer is not "Atmel ICE", its AVRISP mk|| Oct 16, 2021 at 5:31