Hello everybody,
I started a Project for a Load Slammer Probe. This is why I use an Arduino (ATmega328P with ATmega16U2). I want to use the m16u2 for programming the m328p via usb.
For that I loaded the recommended firmware "Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex" and for m328P I choose optiboot. When I try to program my PCB via usb, the PC recognize it as Arduino UNO, but the process of loading it in the chip fails.
Do you have any recommendations?
Hi @janharm245 .
I'm not sure I understand what you mean by this. Did you flash the Optiboot bootloader to the ATmega328P chip?
Yes, I do. I flashed the optiboot on the m328P via ISP with an Arduino Mega Board.
Please post the verbose output of a failed upload. you have to enable show verbose output during upload under file->preferences in the IDE; preferably disable show verbose output during compilation .
Hi, @janharm245
Welcome to the forum.
Is there a reason you didn't just use some headers on your PCB and plug a Nano into it, instead of re-inventing the wheel?
Tom....
Thank You, @TomGeorge
Actually there is a reason. I have to get the PCB in a relatively small housing so my space in hight is limited.
The process of flashing the firmware and the boot loader finishes with no problems. If I try to program the chip via ArduinoIDE, I get something like:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync) attempt 1 of 10: not in sync: resp=ØxØ0
...
jim-p
September 22, 2025, 9:39am
8
Are you using a USB-C to USB-C cable?
Can you please post the entire schematic with a higher resolution.
Full verbose output of the upload would have been appreciated. We can e.g. check if you selected the correct board (Uno), now we just have to hope that you did.
Next step would be to run the loop back test . Problem might be that you do not have easy access to the needed pins (except for the rest) so you will need to make a plan.
1 Like
Yes, I'm using a USB-C to USB-C cable. This is the entire schematic. The wire at the bottom of the schematic is just a digital Output.
Here is a picture with better resolution:
jim-p
September 22, 2025, 11:59am
11
This may not be the entire problem but the CC pins on the USB-C connector need to be connected to ground through a 5.1K resistor, one for each pin.
jim-p
September 22, 2025, 12:05pm
12
The CSTNE16M0V53C000R0 is a resonator and does not require external load capacitors or resistor.
This is probably the problem.
1 Like
Hi, @janharm245
Do you have a oscilloscope?
Tom....
Hi, @TomGeorge
Yes, i have.
This is the full output from ArduinoIDE:
Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\HAJ5HI\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10808 -build-path C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466 -warnings=none -build-cache C:\Users\HAJ5HI\AppData\Local\Temp\arduino_cache_515849 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\HAJ5HI\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10808 -build-path C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466 -warnings=none -build-cache C:\Users\HAJ5HI\AppData\Local\Temp\arduino_cache_515849 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\sketch\\Blink.ino.cpp" -o nul
Generating function prototypes...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\sketch\\Blink.ino.cpp" -o "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\sketch\\Blink.ino.cpp" -o "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\sketch\\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\wiring_pulse.S.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\hooks.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\WInterrupts.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\wiring_analog.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\wiring_pulse.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\wiring_digital.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\wiring_shift.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\wiring.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\WMath.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\Print.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\abi.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\CDC.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\HardwareSerial2.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\WString.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\new.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\IPAddress.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\USBCore.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\Tone.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\PluggableUSB.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\HardwareSerial1.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\HardwareSerial0.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\main.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\HardwareSerial3.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\Stream.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\HardwareSerial.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466\core\core.a
Gebauter Kern wird archiviert (zwischengespeichert) in: C:\Users\HAJ5HI\AppData\Local\Temp\arduino_cache_515849\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/Blink.ino.elf" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466\\sketch\\Blink.ino.cpp.o" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/core\\core.a" "-LC:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466" -lm
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/Blink.ino.elf" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/Blink.ino.eep"
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/Blink.ino.elf" "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/Blink.ino.hex"
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\HAJ5HI\\AppData\\Local\\Temp\\arduino_build_279466/Blink.ino.elf"
Der Sketch verwendet 930 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM8 -b115200 -D -Uflash:w:C:\Users\HAJ5HI\AppData\Local\Temp\arduino_build_279466/Blink.ino.hex:i
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM8
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x89
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x89
avrdude done. Thank you.
Problem beim Hochladen auf das Board. Hilfestellung dazu unter http://www.arduino.cc/en/Guide/Troubleshooting#upload.
I will try to get rid of the capacitors that i place at the resonator. Maybe thats the whole problem.
I removed the caps from the resonator but i have still the same error.
I checked the output while i flash the bootloader: I can only flash the bootloader or detect the chip via AVRDUDE when i choose 19200 baud. All other baudrates over this don't work and finishes with the same error shown above (Programmer is not repsonding).
janharm245:
Yes, i have.
Use it to check if the control IC has clock on its pins.
Lets see if the controller is even being clocked.
Tom....
I measured the Pins XTAL1 and XTAL2. There is a nice Sinus with Peak to Peak Voltage of about 1,5V. So the resonator does his job.
I set the fuses to L: 0xFF, H: 0xDE, E: 0xFD for external 16MHz.
I also think its weird that i can only communicate with my m328P via 19200 baud. All above sends not in sync: programmer is not responding...
jim-p
September 26, 2025, 8:04am
20
Did you add the resistors?
If you use a USB-A to USB-C cable you don't need the resistors.
I solved it: I used an Arduino Mega2560 as ArduinoISP for flashing the chips.
In this sketch, the baudrate was set to 19200. I completely overlooked that.
// Configure the baud rate:
#define BAUDRATE 19200
//#define BAUDRATE 115200
// #define BAUDRATE 1000000
So all i burned with that Arduino as ISP was automatically set to 19200 baud. I changed that to 115200 and tried again to burn the bootloader for ATmega328P with 115200 baud and it worked. Now i can use the schematic as custom Arduino Uno!
I don't know if i need the capacitors for the resonator, but it definetely also works without.