ATmega328PB stk500_getsync() Upload Error

Hi all,

I have an ATmega328PB chip that I am trying to program, and I have successfully flashed the bootloader via an Arduino Uno running the ArduinoISP sketch. I am using the ATmega328-Testing github repo for the 328PB support. However, when I try to upload the blink sketch to the chip by selecting the 328PB with External Clock/16MHz (I am using a 16MHz resonator), I get the following error:

avrdude.exe: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 2 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 5 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 9 of 10: not in sync: resp=0x1c avrdude.exe: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c

Note that it doesn't say "programmer not responding". As far as the physical setup, the RESET pin on the 328PB is pulled up with a 10k resistor, it has a 16MHz resonator, and I am attaching the MISO/MOSI/SCK pins of the 328PB chip via pins 10-13 of the Arduino Uno as ISP and 3.3V/GND. After loading the Arduino ISP sketch to the Uno by itself, I then select the ATmega328PB Board from the boards manager (json link provided in the github repo) and hitting "Upload". I found that if I use a 10uF cap between RESET and GND of the Arduino Uno, it will say "programmer not responding". I also tried using an FTDI programmer with RX/TX, 3.3V/GND, and DTR to RESET (with and without a .01uF cap), but with the FTDI it always showed "programmer not responding".

Any ideas why I am getting this error message? I've been tackling the 328PB for a while now and would really love to get it working. Thanks for any input you might have!

Try setting the upload baudrate in boards.txt to 115200 instead of 57600. 115200 is the normal rate for optiboot on 328p, but some 328pb bootloader .hex files may have 57600 because that was the max rate that worked on the "Atmel Atmega328pb Xplained mini" dev board.