CH341 340 USB->Serial

obroni

Member
Just a heads up, I purchased one of these adapters the other day only to find that it didn't work for me. For £3 off ebay it was a stunning deal though. I run Linux on both my desktop and laptop. Out of curiosity I tried it on my laptop and to my surprise it worked.

Now my laptop is running the alpha/beta of the upcoming Ubuntu 10.04 release. It turns out that BREAK support was added in the Linux Kernel 2.6.32 for this adapter. Sweet!!!

Thought anybody looking for a cheap adapter may find this useful.
 

hippy

Technical Support
Staff member
Another issue with purchasing generic "USB to serial" leads is that what one supplier sells one day may not be the same as they supply the next, what's shown may not be exactly as delivered, the chip inside or drivers supplied may differ and may not support PICAXE use.

This is one of the reasons that we recommend the AXE027 download cable as it is manufactured to our specification, and you don't need to also purchase or build an AXE026 9-way to jack lead to use the standard download socket.
 

SAborn

Senior Member
I have bought a dozen of these and have not have a problem with their use and have used them with data logging as well as programming and the benifit of the 9 pin D socket it can also be used with other serial equipment where the AXE027 can not.

Ebay link for the supplier i bought from and at less then Au$3.50 landed in you letterbox you cant go wrong.

http://cgi.ebay.com.au/ws/eBayISAPI.dll?ViewItem&item=250512172218

These also work with Vista, as not all cables come with a driver compatiable for Vista.

If anyone is interested all these cables with the green plugs are made by Ritmo and if you go to the Ritmo web site there is drivers listed there should you loose the disc or are having problems.
The suppliers will not tell you this as they are sold as a no name brand but rest asured they are made by Ritmo.

You MUST use the driver on the disc or the Ritmo driver or it will not work.
You must use the same usb socket each time or you will need to reinstall the driver for each usb socket used, as it will assign a different com port number for each usb socket.
 

manuka

Senior Member
SAborn: Very good "down under" find! I've every respect for the official PICAXE USB-D9, but of course one never has enough of them when needed. Some of my most frustrating times running PICAXE courses have arisen when attendees turn up with new laptops, & a cable picked up at Jaycar etc on the way. Predictably ages are often wasted trying to get action, with the whole PICAXE experience soured as a result.

The only workaround has been to keep using a swag of D9 fitted y2k era W98 Toshiba laptops. Naturally credibility is questioned with such old clunkers-at this adapter price I can now lay in a crate of them & switch to some nifty netbooks! Stan

Any other Kiwis fancy joining in a bulk cable order ?
 

MartinM57

Moderator
Ok, so I splashed GBP2.75 (delivered) on the fleaBay one.

Could I get it to work on Win7 x64 Ultimate - not a chance. Gave up after 2 hours :(

Could I get it to work on WinXP on my Acer Aspire One - well seemingly first time using the HL-340.exe file on the CD that installed it as a CH340.

Seems to program OK, but a simple looping SERTXD program seems to result in 80% garbled data in teh Terminal window, Re-installed, re-booted etc, no joy :(

It's probably going in the bin...
 

obroni

Member
Hmm strange, maybe the drivers are not as update on the windows platform as Linux.

I just tried echoing data for 5 minutes to the terminal with not a single error.

If you fancy testing with Ubuntu, you can download a Live CD which you boot from so it won't effect your current OS. The beta can be obtained from here:-

http://releases.ubuntu.com/10.04/
 

SAborn

Senior Member
manuka
I find the cables cheap enough to include with any kit board i send to anyone as i to found every one has a serial port until they go to plug into it and find out no they dont.
Then is the call of what do i do now!!
I cant even buy a serial cable or the plugs to make one for $3.50.

As for the linux users this might be of some help to you, and was posted on a different forum.
I know nothing about linux so i have no idea of what it all means.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

It is recognized as /dev/ttyACM0 and you use axepad as user, then you must chmod the device as root:
sudo chmod 777 /dev/ttyACM0



and then you can use it as simple user.

If not, then use lsusb command and note down your VID/PID numbers of your device and do the following commands as root:

sudo mknod /dev/ttyUSB0 c 188 0
sudo mknod /dev/ttyUSB1 c 188 1
sudo /sbin/modprobe usbserial vendor=0xxxxx product=0xxxxx
sudo chmod 777 /dev/ttyUSB0

where vendor is VID number (e.g. 0xAB03)
and product is PID number (e.g. 0x000A)

Now you can select /dev/ttyUSB0 as your serial port... (sometimes will be USB1...)

You must use all commands again every time you reboot your linux, or only last command every time you disconnect your device...

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 

MartinM57

Moderator
Nope, no luck on another 'proper' (i.e not NetBook) WinXP laptop - exactly same results :(

Strange that it seems to program, but just won't receive from SERTXD normally...
 

SAborn

Senior Member
MartinM57

Is it an old slow computer you are using, as i tried a usb serial cable on a 12volt pc from the win98 era running xp now, and i the same prob with sertxd but if i use the com port no problem.

Its NOT the cable as when i use it on a faster computer i have glitch free data.

I think it is a timing issue with slow computers or a problem with usb1 ports.

Others have reported a simular problem with using old junk computers as data loggers with usb to serial cables.

Try the cable on a pc with a usb2 port and the problem should go away.
 

MartinM57

Moderator
My work laptop, which shows identical problems, is an Intel Core Duo T7300 at 2Ghz with 2Gb of RAM with a "Intel ISH8 Family USB2 Enhanced Host Controller - 2836" entry under "Universal Serial Bus controllers" in Device Manager...which I understand indicates that all my USB ports are USB 2.0
 

SAborn

Senior Member
The only other thing i have done is to turn off all power saving to the usb port but doubt this will make any difference in your case.

My trusty $3.00 cables from China have been logging data now for weeks without a problem.

As your adaptor is not a cable type from what i can gather, i wonder if the cable used between the adaptor and the picaxe is the cause of the problem and is picking up interferance.
Have you tried a different cable there as it might need to be shorter in length or a screened cable.
If its a home made cable than twisted pairs like in cat5 cable might work and use 2 pairs with each pair having a ground wire.

You could try downloading the driver again from the makers web site as there might be a error in the driver you are using, as someone else reported changing usb ports fixed their problem which would have meant reinstalling the driver for that port.

It be worth trying to sort it out before bining it.
Nothing ventured nothing gained.
 
Top