Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Add USB to any PIC project for less then $3

Status
Not open for further replies.
Hi Mike,

After I lost my old Nokia phone, I decided to convert a fake DKU-5 cable, it too used a Prolific 2303 chip. But it took quite a while to figure out how to make it work, of the five wires in the cable, I had to short all the wires together except the black-GND wire to make it act as a loopback in Hyper-terminal. After that I worked out which pairs had to be shorted to enable the chip so it would TX and RX.

However even when it wasn’t working I don’t think the driver reported any errors. (Win XP SP3)

I can try and find my notes if you want to let you know which pairs I shorted together.

Leftfield95
 
Don't connect the tx and rx :) Even though it shouldn't matter, the cable has no series resistors on its I/O's. I would plug it into your PC, open the device in hyperterminal (or another terminal) *then* connect the Tx to Rx.

A while ago I read through the datasheet to work out why it was crashing my machine (turns out I was drawing >200mA from the bus) and I thought I had blown the Tx pin by shorting it to ground. It wasn't the case. All the I/O pins are tristated until the device is opened by the host PC. That is to say, if you plug it into your PC, its asleep until you open the comm port it's been assigned to.

Before then, all I/O pins are tristated, and it doesn't matter how much power you draw from the bus. As soon as you open the device, I 'think' it runs a quick check...which determines if everything is 'ok' then it opens successfully. I reckon linking the tx/rx pins for loopback before opening the device makes it poo itself :)

The cable itself is basic, and nothing much can go wrong. But the Prolific chip can behave quite oddly in certain situations.... no where near as friendly as the FTDI chips. Any situation other than connected to a RS232 level shifter or a standard UART and it seems to misbehave.

Out of interest, I'll try and recreate the error. I've had it before when I've opened the comm port whilst its been connected to certain circuits.

Blueteeth

Edit, I'm using XP SP2 (not SP3)
 
Last edited:
Thanks for the suggestions guys. I installed the driver on my wifes Vista-Home laptop and it does the same thing so I sent a message to Chinese Distributor asking for a replacement. Time will tell if they stand behind this relatively inexpensive product, or not.

I tried with and without TX/RX connected together for 'loopback' and it doesn't make any difference. This particular clone CA-42 has four wires but only three are connected, WHT (Phone TX), GRN (Phone RX), and GND (BLK).

More later, Mike...
 
Last edited:
Hi Blueteeth,

If IRC the tx/rx pins have some resistance on them, they definitely don’t draw 200ma plus when shorted. I think the cable version I have has some buffering on board, the moulded usb plug is way too big to contain just a prolific chip.

According to the web the other two connections are power and aci. The power is for powering external circuits from the Nokia phone and the aci is some sort of signalling for accessories. The power seems to be used to supply the buffer, since if it has no power fed into it the rx pin doesn’t work, but I still get tx signals.

I’m now curious to see what’s inside the moulded plug, I think I’ll sacrifice this one (I have more in a draw at work). I would specifically like to change it to run on 5v logic and supply power to the microcontroller circuit, like the homemade FTDI based one I have.

Leftfield95
 
Ahh leftie, I meant I was drawing 200mA from the bus directly (to power an AVR, some LED's), the reason I thought I had blown the tx was because of my shoddy prototyping (tx line soldered to strip board...with shorts)....I should have made it clear those were two seperate 'mistakes'. My fault bro. lol yes, I'm sure if the tx pin can source/sink 200mA it would be only for a few us before somethign goes pop :)

Also, note, the cable can be modded to allow up to 500mA drawn from the bus. A pin on the chip is read on startup to determine what power level is allowable (100mA limit, or 500mA) one may need to replace the cable coming out of the USB hood though, seems a bit 'thin' for 500mA.

I would open up the plug, mine isn't moulded, just two pieces of plastic snapped together. Its a real basic cable, no eeprom, just the PL2303 (**broken link removed**), a crystal, and some passives. It is possible yours has buffering, mine certianly doesn't. If I find my camera I'll get a pic of the one I have.

Blueteeth
 
Hi Blueteeth/Mike,

So I bit the bullet, and tore the case from the usb connector, the soft rubber outer came off quite easily, but underneath that, the entire board was coated in a soft moulded thermo plastic. It wasn’t too difficult to peel the plastic from the pcb, the results are shown, there is still plastic around the pins of the pl-2303.


The pcb uses a PL-2303HX which is 3.3v max, but has a 5v tolerant RX input, the second ic is an em78p153sn which is a 14pin 8bit micro. The whole thing looks quite well made, and looking at the bottom of the pcb, is also used as a charger when the missing components are added. The microcontroller appears to monitor/control the charger circuit as well as some of the serial data lines.

The rx data line has a 4.7k inline resistor and a 220k pullup at the pl-2303.
The tx has a 100ohm inline resistor.

Leftfield95
 

Attachments

  • DKU-5_top..jpg
    DKU-5_top..jpg
    53.2 KB · Views: 1,987
  • DKU-5_bottom..jpg
    DKU-5_bottom..jpg
    58.9 KB · Views: 1,784
Some pics

Oh nice! Looks more complicated than mine. I notice theres only one 'data' wire, perhaps thats the bidirectional line some mobiles use. Hopefully I'll post a pic of the guts of my CA-42 tonight.

Update. Heres front and back of my CA-42 ($0.99 with free shipping from ebay). Stupidly basic,and pity they epoxied the chip eh?
 

Attachments

  • CA42back..jpg
    CA42back..jpg
    43.9 KB · Views: 583
  • CA42front..jpg
    CA42front..jpg
    54.1 KB · Views: 555
Last edited:
I received a replacement cable from the Chinese distributor and got the same "Cannot start. (Code 10)" error on the XP-SP3 laptop (PL-2303 v2.0.13.140 driver) and on the Vista laptop (PL-2303 v3.3.10.140 driver).

Finally got it working on my XP-SP3 laptop last night by using an older v2.0.2.5 driver from here;

**broken link removed**

The Chinese source I used did not provide a driver CD so you might want to purchase $2.68 cables + CD from another Chinese source instead. Here's one that was recommended by one of the guru's over on the Arduino forum;

**broken link removed**



The good news and the bad news

It seems each new generation of CA-42 clones coming out of China is being manufactured cheaper and cheaper. The cables I received have four wires but only three are connected to the PL-2303 at the USB end of the cable (Tx, Rx, and Gnd).

The cables are completely molded so there's no easy way to get at the PL-2303 circuit board but if you decide to cut through the blue plastic and then the black plastic potting underneath you'll find the circuit board shown in the pictures below with relatively easy access to solder pads for the 5v, 3.3v, and other serial signals, like DTR.

In summary, it seems I can have a "pretty" molded $2.68 usb-to-serial cable with just Rx, Tx, and Gnd, wired to a 3.5mm Stereo type plug for my projects, or, I can have an "ugly" adapter without molded USB shell on one end but with access to 5v (<100-ma), 3.3v (<50-ma), and several other serial signals.

More later. Regards, Mike
 

Attachments

  • PL-2303..PNG
    PL-2303..PNG
    514.2 KB · Views: 971
Last edited:
My 16F88 Serial Bootloader now working as a USB serial bootloader... Oh yeah!!!

ca-42-16f88-bootlo-png.41608
 

Attachments

  • CA-42 16F88 Bootlo&.PNG
    CA-42 16F88 Bootlo&.PNG
    29.9 KB · Views: 1,739
Mike,

I had a problem with Prolific drivers when I used a similar adapter. I found a note about revised drivers someplace and they solved my problems. There's a lonk to the drivers on my page here: Simple Signal Generator - 3 - ThrowAwayPIC

I don't recall exactly what the problem was - I think VB couldn't open the com port. Not the same problem but the revised driver may help.

There's also a couple other adapters listed on my page under "useful bits and pieces"...with shipping, they're about the same price and seem to be of decent construction.
 
I found working drivers Jon (post #28) but thank you anyway... I did check out some of the other adapters you recommended but they were more expensive...
 
Last edited:
Got any examples of its use Atom? It's a USB 2.0 spec. So faster thruput.
I'd like to see the circuit for it...also if u have any 16F ASM USART code I'd be grateful.


Thanks,
and Merry Christmas.
 
Last edited:
Got any examples of its use Atom? It's a USB 2.0 spec. So faster thruput.
I'd like to see the circuit for it...also if u have any 16F ASM USART code I'd be grateful.

You mentioned needing UART code in another thread. Have you never done 16F ASM USART code before?
 
Atom you no if you come up with something good and are using the mcp2200 Microchip will let you have a vendor id for like the first 1000 you sell. Which is cool. To get your own id cost big bucks. Just thinking you may want to sell them video viewers. Some day.

Here a great pdf about serial ports stuff
 

Attachments

  • serial.pdf
    139.7 KB · Views: 334
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top