CH340 USB to TTL Converter Module Serial Port

AllyCat

Senior Member
Hi,

Yes, devices based on the CH340 do seem to be able to program PICAXEs. But.....

You do need the 10k - 22k network in almost all circumstances. HOWEVER, you very probably must ALSO connect inverters (TTL/CMOS Gates or transistors) between the serial module and the PICaxe Serial Input and Serial Output pins. This is because "TTL Serial" data is inverted compared with the "normal" RS232/COM port signals used for PICaxe Programming.

Cheers, Alan.
 
Last edited:

cachomachine

Senior Member
Hi AllyCat

Thank you for your reply, you where right about the need to invert the data (Inversion was made with 2 gen. purpose NPN transistors)

Since the CH340 is TTL level, there is no need for the 10k-22k resistor network (inverted tx signal from ch340 is connected directly to the SI pin and inverted SO signal is connected to the ch340 rx pin)

works perfectly

Edit: Tried it with the 10k-22k resistor network and it does not work
 
Last edited:

JimPerry

Senior Member
The 10k/20k combo should still be used - 10K holds low (prevents "floating") and 22K limits current :confused:
 

Technical

Technical Support
Staff member
It should still work with the resistors, make sure you have the 10k on the correct (adapter) side of the 22k.

The 10k is also important for when the adapter is removed after programming, as you will then need a pull down on the serial in pin.
 

AllyCat

Senior Member
Hi,

Yes, as the others have said above, you need to be absolutely sure that the Programming pin will never float high, even when / if the programming cable is disconnected or not powered.

If the 10k + 22k resistors are correctly wired, but it won't program, then perhaps your inverter pullup resistor is too high a value?

Cheers, Alan.
 

Goeytex

Senior Member
I agree that the resistors should be used. However, the standard 10K/22K values are not ideal when using NPN transistors as inverters.

First, the 22K value is a compromise for current limiting 15V RS232 levels while also allowing TTL/CMOS levels to trigger the serin input. This resistor is not really needed at all if the Picaxe and TTL converter are operated at the same voltage. But I would still recommend at least a 200R resistor for some protection.
`
Second, there is no absolute requirement that the pull down resistor needs to be 10K. Its sole function is to prevent the serin pin from floating in the absence of a signal. However, when used with a bipolar NPN as an inverter this resistor becomes the lower part of a voltage divider. 10K can be too low depending upon the value of the collector resistor on the transistor. This can result in a TTL level that is to low to work. I generally use a 2K2 collector resistor and a 22K or 33K pull down resistor. This assures an adequate TTL level to serin.

This all assumes that RS232 Levels will NEVER be applied to the Picaxe for programming.

Attached is the the circuit that I use with a CH340.
 

Attachments

cachomachine

Senior Member
AllyCat and Goeytex, you are both right, I had to go as low as 1k pullup resistor on the SI inverter transistor to make it work with the 10K/22K combo.
I will keep this value as i want it to be compatible with the serial cable.
 
Top