Can only upload code through uart when spi pins are connected to the target uc

I have a weird problem with a circuit i made, which uses ch340 chip for uart communication with a pc, like arduino uses, using atmega168 burned minicore bootloader onto it with uart option enabled, and the pc detects it when i connect it and assigns address to it, but when i click upload with all correct options it just timeouts, programmer not responding error 0x00, but if i connect an arduino to sck, miso, mosi, and reset pins of the uc, the code successfully uploads through uart which is weird, after some probing with oscilloscope i found out that there's something wrong with the reset pin, so if the arduino isn't connected as soon as i click upload the ch340 should go low for approx. 1.3s but it doesn't instead it just pulses until i disconnect power, with the arduino connected the reset pin goes low for 1.3s and the code uploads successfully, but i don't get how the arduino influences anything, because those pins are just floating i didn't set them to do anything also i didn't tie their ground together, anyone have any idea?, also what do you think the problem is, faulty ch340?

The capacitor on the DTR pin is supposed to pulse the Reset pin LOW briefly to reset the processor. Perhaps the line doesn't go low enough to reset? Until the reset happens the bootloader doesn't get control.

Where is the RST signal coming from? Probably on the right side of the schematic that is cut off in the view you posted?

The reset pin is connected to a 10k pull-up, to the RST line that goes to the ICSP header (below the left side of the processor), and to the DTR line that goes through a 100 nF cap to the CH340G in the lower right.

Ok, just wanted to make sure DTR/RST pin wasn’t connected elsewhere with a strong pullup.

The only thing I see out of place is the bypass capacitor on pin 4 (V3) of the CH340G, it should be connected to ground, not +5 volts.

As for why it works with another Arduino connected to the ISP pins, I would see what the scope waveform on RST looks like with the other device connected. Perhaps your 10k pullup is the wrong value or not connected.

The goofy waveform you posted? Most likely mains pickup. Turn your sweep speedup and see if the pulses occur at 50 or 60 Hz, that depends on where on the planet you reside.

I connected v3 pin to gnd through a cap instead of +5v, aref to gnd through a cap and now the code uploads without the arduino connected, it was probably the v3 pin i guess, anyways thanks everyone for the help

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.