I am having a problem that I can't seem to solve on my own:
I have an Atmega328p with Arduino bootloader on a pcb that has been working flawlessly for a long time now. I use the Arduino IDE 1.8.9 with a cheap FTDI serial adapter to upload code to the Atmega through the RX/TX pins. Works flawlessly every single time.
UNLESS I connect a hardware debounced button to either digital pins 9 or 10 (atmega pins 15 / 16). Then, I just get three flashes from the RX led on the serial adapter, the upload fails, and that's it. When I disconnect the button with an otherwise unchanged setup. everything works fine.
When I connect the same circuit to digital pins 11, 12, or 13 (atmega pins 17 / 18 /19) I can upload code without issues.
It's a manufactured PCB, the wiring is 100% as defined by the schematic.
Everything works perfectly fine, except for the flashing issue i described in my initial post.
D9 and D10 (pins 15 and 16 on a DIP atmega328p) should be harmless here. However, if the pin 1 marker on the chip package is not so clear then you could misread pins 1 and 2 as pins 15 and 16, that is viewing the chip as rotated through 180 degrees. These pins are reset and RX respectively and connecting a capacitor between these pins and ground would probably show the symptoms you have described
Thanks for the answer, but that isn't the case here. Is really comes down to whether the button is connected to 9 / 10 or not. everything else is the same.
I expected them to be harmless as well, and the fact that the button circuit has no effect when connected to other pins baffles me.
The Atmega is soldered to the board (with pin1 in the right spot), so no room for error there
I don't know if it is the cause of your problem but you should have a 0u1 ceramic decoupling capacitor on the power pins and ground of the ATmega 328p. The capacitor should connected as physically close to the pins as possible.
Thanks for the input. I have a 100nF decoupling cap just next to the uC. However, I keep them in a corner of the schematic sheet, so they don't 'get in my way', that's why they're not in the screenshot I posted.