PDA

View Full Version : Serial to USB cable - varying results



brid0030
- 15th April 2010, 15:25
I would like to use a Serial to USB cable to communicate with a PiC16F688 which is running through an RS232 type level converter (actually an ICL2323). If I do straight serial communication with a com port on an older PC, everything works fine all the time. I can also communicate with a palm pilot, no problem. So I've established that straight serial works fine. But when I try serial to USB cables, the results vary from device to device. My first attempts failed utterly--I only got some periodic gibberish on the PC. A colleauge working with the same PIC-driven device also failed to establish communication, but then she tried a different (newer) PC and got it to work. I'm at a loss to see why there should be these discrepancies--serial to usb ought to be pretty simple right? Anyway, I was wondering if you had any insights because I have several people who will be using these devices, and I need to be able to recommend communication setups that work.

One possible clue is flow control. I tried setting up serial communication between a palm pilot and the PC using the serial to USB cable, and I could not get it to work until I messed around with the flow controls. Flow control is not necessary when doing straight serial communication between the same palm and PC.

mackrackit
- 15th April 2010, 15:33
The converters I find most reliable are
U209-000-R from Tripp Lite. They seem to be pretty close to RS232.
Belkins are not reliable, does not have the voltage swing needed by some things.

BrianT
- 16th April 2010, 00:28
Bootloaders seem very time sensitive to the variable delays when using USB to RS232 converters. Colleagues and I have tried at least half a dozen different looking adapters with netbooks, laptops notebooks and desk PCs. NONE gave 100% reliable results. Some mostly work, some never work. They are all Chinese and are generally fine for dumb ASCII communications but whenever accurate timing between sending a character and getting a reply is needed then it's back to an old PC with dedicated RS-232 DB9 connectors.

It was my design practice to always fit an RS-232/TTL port to every design and use the MCSP bootloader for field bugfixes. I have abandoned that now and use the MeLabs U2 USB programmer for all code programming and updates. I have requested Mecanique to have a look at relaxing the timing on the MCSP bootloader but that message sank without trace.

HTH
Brian

Dave
- 16th April 2010, 11:38
brid0030, I only use the products from FTDI and have had no issues using them with bootloaders or normal programming serial communications. We deal with lot's of different inferfaces here at work and the FTDI seems to be one of the best I have found. The bootloading seems to be a bit slower but never fails....

Dave Purola,
N8NTA

Charles Linquis
- 16th April 2010, 13:37
MCLoader does have some issues - especially with USB-serial. I made it work much better by disassembling it, adding a 16 bit delay after the 1st jump vector and before the loader actually started executing and then re-assembling it. I now have something that works all the time. I use only a two-wire connection (I don't control MCLR). It still loads slowly, but at least it always gets started when I turn power on.

brid0030
- 18th April 2010, 05:02
Well, I'm not attempting bootloading, just serin and serout. I'm just gonna buy a few cables and see what works. The option I will put forth to users first is to get a PC card with a com port....or just dust off that old laptop from 6 years ago.

Charles Linquis
- 19th April 2010, 00:21
As long as you are not attempting to bootload, then I think you will have no trouble. I have at least 4 brands of serial-USB adaptors, and all work fine. After you install, you may have to open up Windows Device Manager and go into the driver/properties tab in order to change the com port assigned to the device. I had one that installed itself as Com 12!

brid0030
- 19th April 2010, 04:39
Hey Charles. Thanks, but I don't think it is that simple. I have a 'no name' serial to USB cable that works with other devices, but not with the PIC/MAX232 setup. One of my collaborators reported that there was no readable communication using a radio shack cable and a compaq presario, but she got it to work with the same cable and a newer vista computer. So I don't think all cables and computers are created equal when it comes to serial to usb. I'll post what I learn when I get cables in the mail.

Charles Linquis
- 19th April 2010, 05:21
Maybe you found a bad one. I made a loopback tester that just connects pins 2 & 3. I plug it in, and press a key. If I see an echo, I have the right COM port selected, and it is working.

One thing: I never use any form of hardware handshaking.

keithdoxey
- 19th April 2010, 16:32
Another thing to bear in mind is that if you plug the USB Serial Adapter into a different USB Port (either on the PC or a hub) it will get "reinstalled" as a completely different serial port hence the high com Port numbers some people get upto.

You also cant uninstall a USB Serial port if it isnt physcially connected but you can steal the Com Port number that it was occupying in Device Mangler ;)

Mike, K8LH
- 19th April 2010, 17:55
I do it a bit differently and so I am able to connect even the lowliest 8-pin 12F683 project to USB for a modest $2.68 investment (plus the cost of connectors).

I use a 'clone' Nokia CA-42 cell phone cable (USB to TTL level serial) available from one of several different Chinese vendors on eBay which uses the Prolific PL-2303 IC instead of an FTDI IC. Here's one of the vendors I use; Nokia CA-42 + CD, $2.68 (http://cgi.ebay.com/USB-DATA-CABLE-CA-42-CA42-CD-FOR-NOKIA-7260-6101-6100_W0QQitemZ320481013758QQcmdZViewItemQQptZPDA_A ccessories?hash=item4a9e282ffe)

http://usih.merchantrunglobal.com/ImageHosting/ViewImage.aspx?GlobalID=1003&MerchantID=616&ImageID=1638&DisplaySize=400&ListingID=63814

I cut off the connector on the cell phone end of the cable and replace it with a 3.5mm "stereo" plug. I wire up the WHT (phone Tx), GRN (phone Rx), and BLK (ground) wires. I put a matching 3.5mm "stereo" jack on my PIC project boards and I'm in business (no MAX232 or equivalent level shifter IC required). Please note that there is no 5v wire in the cable (bummer!).

I've been using a 3.5mm "serial port" jack on my project boards for years (to save space) along with a simple two transistor RS232-to-serial adapter cable. Now I have the luxury of using those project boards with the RS232-to-serial adapter cable or the new USB-to-serial adapter cable.

http://www.wowway.com/~mmclaren/CA-42%2016F88%20Bootloader.PNG

The image above is of a successful serial bootloader download using my CA-42 USB-to-Serial cable.

Regards, Mike, K8LH

keithdoxey
- 19th April 2010, 18:49
Great tip Mike.

Looked a bargain at $2-68 then I discovered it INCLUDED shipping !!!!

Got 2 on the way to me now :)

rmteo
- 19th April 2010, 19:02
I cut off the connector on the cell phone end of the cable and replace it with a 3.5mm "stereo" plug. I wire up the WHT (phone Tx), GRN (phone Rx), and BLK (ground) wires. I put a matching 3.5mm "stereo" jack on my PIC project boards and I'm in business (no MAX232 or equivalent level shifter IC required). Please note that there is no 5v wire in the cable (bummer!).

Regards, Mike, K8LH
Do you know if perhaps other signals are available on this cable - in particular RTS and CTS? Thanks.

Mike, K8LH
- 19th April 2010, 20:02
Well, it's kind of a "good news" and "bad news" situation, I'm afraid...

The PL-2303 circuit board on the "business end" of the cable includes pads for 3.3v (<50ma), 5v (<100ma), RTS, CTS, etc. but since the cable is molded you have to cut away the blue plastic molding and the black rubber potting underneath to access to the circuit board. Here's what you end up with;

http://www.wowway.com/~mmclaren/PL-2303.PNG

It seems that each new generation of clone cables are cheaper then the last. If you check out the original Jonathan Thomson article (http://jethomson.wordpress.com/2010/02/21/diy-usb-to-serial-cable-for-3usd/) that caught my attention you'll find that earlier versions of the cable had a removable shell at the USB end and had more wires to work with and so that's kind of a bummer(!).

Regards, Mike

rmteo
- 19th April 2010, 20:09
Thanks for the info and the link.