USB to Serial not working on custom board, resp=0x0d error

Hello all,

I am attempting to program a Atmega328P using a FTDI USB to serial adapter. I've done this a couple times in the past and am currently running into an issue I can't seem to resolve. On the board i have connections to pair with the adapter: +5V, GND, Rx, Tx, RST, and CST. I simply ground CST and RTS is connected to the ucontroller as shown below.

Before mounting the ucontroller on the board, I burned the Arduino UNO boot loader and programmed the desired script on the chip. Ironically enough, i do the chip programing with a different custom board with another ATMEGA328P, and use the same USB-serial adapter and reset schematic above (which is very weird).

Regardless, after assembly the board works as expected. The program executes, however, when i try and reprogram the chip with the serial adapter I get this error:
"stk500_getsync() attempts # out of #: not in sync: resp=0x0d"

Couple of things I've tried.

  1. Searching the form. Loads of topics on resp=0x00. None seemed to help
  2. I dont suspect the chip is faulty. The chip runs the program as expected. While the chip is mounted on the board, I can reprogram (and/pr re-burn a boot loader) using the SPI and reset pins. Further confirming the chips operation
  3. I tried more recent versions of the boot loader, Aduino Nano (328P and 328p Old Boot loader)
  4. I've tried a different cable.
  5. Checked the connections on the boards and the mounting of components.
  6. Flipped Rx and Tx just to be sure. This results in a different error: resp=0x1d
  7. Measured the reset pin as i tried to reprogram the chip

    This is the node at pin 29. It looks like the chip does get the reset signal. perhaps the timing is wrong? The datasheet says reset voltage is 0.9*Vcc. The scope is indicating almost 0.5sec before the reset pin reaches close to that value. Seems like a lot, but what do i know?

I'm stumped. Any suggestions would be much appreciated. Happy to provide more context.

Hi @AnotherSam.

When you do that, are you performing a sequence like this:

  1. Perform "Burn Bootloader" operation.
  2. Attempt upload via the FTDI.

Or are you instead performing a sequence like this:

  1. Perform "Burn Bootloader" operation.
  2. Perform "Upload Using Programmer" operation.
  3. Attempt upload via the FTDI

I ask because people often fall into the trap of thinking "while I have the programmer connected from burning the bootloader, I might as well also upload my sketch via the 'Upload Using Programmer' feature". The problem with this is "Upload Using Programmer" erases the bootloader from the ATmega328P. If you then attempt a normal upload via serial, the upload will fail with the same error messages you got (though there are other causes of those errors) because no bootloader is present on the ATmega328P.

Thank you so much! in this case I did upload using the programmer in a bit of frustration. I never knew about that overwriting the bootloader. Thanks for taking the time to explain it, everything is working as expected.

You are welcome. I'm glad it is working now.

Regards, Per

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