Unable to upload to ATmega1284p using MCP2221 usb to UART controller

Hi I am unable to upload sketch to Atmel mega1284p using a mcp2221 usb to uart converter IC.

I have a simple code prints “message received” It works to program the Mega1284p using arduino nano as ISP. But not using the MCP2221 over usb. I took a long time and eventually errors out. I tried pressing reset button on ATMega while uploading, I tried swapping TX and RX. I double checked COM port. Please help.

See pics for setup and connections. My setup is similar to the attached Schematic.
Thanks!

HowWhen: It works to program the Mega1284p using arduino nano as ISP.

When you do that it erases the bootloader. After doing that you need to do a Tools > Burn Bootloader before you can go back to uploading via the MCP2221 again.

Thanks Pert! it worked. spent a week trying to figure out. Has there been a way to implement an automatic reset switch on the ATMEGA1284P?

I'm glad to hear it's working now!

The auto-reset circuit on the ATmega1284P is the same as on any of the other AVR chips. You just need to connect DTR from the USB to TTL serial adapter to the reset pin on the ATmega1284P via a 0.1 uF capacitor.