Mega (Atmel) 2560 boot up on USB vs Power supply (not a stock Arduino Mega)

Need a little help figuring out an issue.

Atmel 2560 using a CH340E USB to serial converter

-Uploading code and running it while plugged in on USB works fine.
-Running on just 5V power supply does not run code

It is not code error as the simplest code with nothing using the serial port will not run while using power from the 5V power supply.

Example of code that doesnt run:

void setup(void){pinMode(26, OUTPUT);}

void loop(){digitalWrite(26, HIGH);}

The issue does not lie with the power quality of the power supply as it gives 5V up to 3A

I suspect that it lies with the power supply (or the lack thereof) to the CH340E

When plugged in on USB the CH340E is powered by the USB.

When connected to 5V power the CH340E is not powered.

When jumping power to the VCC pin of the CH340E the system works and runs code without being connected to USB power. This is a solution but is it the correct one?

I am trying to figure out what the CH340 is doing when it is un-powered that is causing the board to not run. Is it resetting the Atmel chip over and over? The RTS pin on the CH340E pulls low to reset the Atmel chip at the start of communication. So I am assuming this is going to be low when it is in the off state how ever should it not then only reset the Atmel once when the capacitor charges up and after that the reset voltage should remain constant? (An oscilloscope would probably make this instantly obvious but I don't have access to one at the moment)

Secondly what is the correct practice when it comes to powering the CH340 (or any USB to serial converter on a device) Should it be powered by the the Host or the Device?

Here is the schematic of the board in question
SCH_Schematic2_2023-09-19.pdf (499.1 KB)

Some notes:
-The power selector section of the circuit is not quite correct in that when USB is the only source of power for the board, it does in effect turn it self "off" at the mosfet Q2 and the power on the 5V rail is lower than it should be (a little under 4V). This can be corrected by putting a diode between the power source and 5V rail and having the power for the Q2 gate come from before the diode so it will only pull the gate up when there is actual power coming from the 5V power supply.

Your schematic does not come up. I will take a SWAG and say you need at least 7.5 volts to power via the Vin barrel connector.

Thanks for the response. 5V supplied to the 5V pin. Not connected through the barrel jack. I will try screen shots of the schmatic.

You can google circuit schematics and look how power supplies are configured .
Boards with CH340 will be clones and may be wired oddly

1 Like

Power selector is wrong, look at the Arduino Mega schematic, bottom right section. VUSB should go to P-channel MOSFET drain.

Then how would it be switched off when the board is powered by its 5V input. If the board is running on 5V input then the source of power must be the 5V input and not the USB 5V.

Problem found:
CH340E was drawing power through the RX/TX lines.

Solution will be Some N-channels and diodes to avoid parasitic draw in both directions.

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