MiniCore
MiniCore copied to clipboard
ATmega328PB | Uploading a sketch via serial stops bootloader from working
I have made a couple of minimal configuration boards for ATmega328P with a 16mhz crystal, 15k reset pull-up and a filtering capacitor. Only when using the PB variant (with all the board settings being proper), when burning the bootloader, everything is fine, until when I upload an empty sketch for the first time after burning the bootloader, that works. Second time trying to upload the sketch and the ATmega328PB stops responding. MiniCore v2.1.3 I tried the following:
- Checking if the crystal is oscillating
- Burning a bootloader and trying to upload at different clocks: 16ext, 8int, 2int
- Tricking it into using a 328P variant bootloader
- Trying different bootloader serial speeds
- Trying different CP2102 adapters (with a 200nf (works on every atmega) capacitor between MCU reset and adapter DTR pin)
- It's not just this 328PB in particular (made a board from scratch for it, same problem)
- Downloading the hex file from flash and comparing 1 - after burning the bootloader, 2 - after burning the bootloader and then uploading an empty sketch. The bootloader bytes at the end remain untouched, only the empty sketch bytes are added in the second one
- Connections are correct since first sketch uploads fine