Jonathan Thomson's web journal

DIY USB to Serial Cable For $3! February 21, 2010

Filed under: Electronics — jethomson @ 5:25 am

 

Please take a moment to vote for my entries in the Hack It! and Make It Glow Challenges!

 

Update
Several good, inexpensive, purpose-built USB to serial modules are now available on eBay for around five to six dollars. Just search for PL2303 or CP2102.

Introduction
The Arduino board is a great way for beginners to start learning about developing software for microcontrollers; however it’s cost, while a steal when compared to the initial investment required in the past, can be a little too steep for a do-it-yourselfer who wants to do things cheaply. To be fair there are arduino clones that do lower the price a good bit, but the real cheapskates that don’t mind doing a little extra work can’t help but think they could do it for less. For these penny pinching DIYers setting up an ATmega on a breadboard seems like the way to go until they discover the FTDI USB cable is $20. What a heart breaker! There are slightly cheaper alternatives, but a real scrooge googles on. Well look no further because this article has just what you’ve been looking for.

The trick is to use a Nokia cell phone data cable based on Prolific’s PL-2303. These cables have a USB to Serial TTL converter built right in. They’re available on eBay and DealExtreme and very inexpensive. I got mine for just $2.69 shipped. Data cables DKU-5 or CA-42 will work. This article will focus on the CA-42 containing a PL2303HX rev. A. The methods described here should work in general for cables using different chips.

Preparation
Tools:
    Wire Stripper
    Multimeter
    Anti-static wrist strap

Driver:
    Recent versions of Linux have the driver pre-installed.
    Users of other operating systems may find drivers Prolific’s site.
    Install the driver.

So you don’t waste time with a dud cable or bad drivers, you should first check that it’s recognized and assigned a COM port. To do this…

      …in Linux, use the command ‘ls /dev/ttyUSB*’ before and after you plug in the cable. You should notice a new ttyUSB is added after you connect the cable.

      …in Windows, plug in the cable then open up the Device Manager by clicking Start–>Run and typing ‘devmgmt.msc’ followed by Enter. Now find the section named “Ports (COM & LPT)” and click it to expand. There should be a port named something like “Prolific USB-to-Serial Comm Port (COM#)” or perhaps “NOKIA… (COM#)”. Unplug the cable; the cable’s entry in Device Manager should disappear.

Precautions
Never work on a live circuit! Always power off the breadboard and always unplug the cable before making adjustments to either; I’ve tried to remind you of this throughout the article but I may have missed a couple of places. There is a possibility you could damage your computer, some other property, injure or even kill yourself! I’ve tried to be very thorough in my instructions, this however is not an excuse for you to turn off your brain. In no way does this paragraph convey all of the various precautions one should take when working with electricity and electronics. Please read the entire article before you begin to modify the cable. Wear an anti-static wrist strap.

Probing
There are most likely several different manufacturers of these cables because the same model will have a different number and color of wires depending on who you buy it from. Therefore we will have to probe the pins of the phone connector to determine which wires are TxD, RxD, and GND. To do this cut the cable a couple of inches (5 cm) from the phone connector. NOTE: I said the phone connector not the USB connector. Most of the cable should remain attached to the USB connector, but you need to leave enough cable attached to the phone connector to be able to strip the wires and attach an alligator clip (or a terminal block if you like). Strip each wire. Set your multimeter to diode/
continuity, and attach the black probe to a stripped wire. Now probe each of the phone connectors pins with the red probe until your meter beeps. Write down the color of the wire and its corresponding pin number from the picture below. Repeat until you’ve matched each color with a pin number. Not all pins will have a connection. You should double check your work because the wires are very thin and the pins are small and close together.

Pin 6 is the cable’s TxD line, pin 7 is RxD line, and pin 8 is ground. For my cable pin 6 was white, pin 7 was blue, and pin 8 was black. I also had two additional wires, one green (pin 3), one red (pin 4). However, I can almost guarantee your colors will be different so you must perform the steps described above. To be positive we’ve identified the wires correctly we can perform a couple of tests.

Testing
We’re now finished with the phone connector, so now we’ll turn our attention to the remaining cable which has the USB connector. Strip the wires which correspond to pins 6, 7 and 8. Set your multimeter to measure voltage. Attach the black cable to the wire which corresponds pin 8 (GND). Attach the red cable to the pin 6 wire (TxD). Make sure none of the wires are touching one another! Plug in the USB connector. The multimeter should read ~3.3V (I measured 3.5V). Unplug the USB cable. Repeat the previous steps for the pin 7 wire (RxD). The RxD line’s voltage should be less than the TxD line. The other wires are not needed for communicating with your ATmega; nonetheless the pin 3 wire measured 0V and the pin 4 wire measured 3.0V. Your cable may not have a pin 3 or pin 4 wire.

For our second test we’ll temporarily turn our cable into a loopback cable and use a serial communication program to see if we’ve identified the wires correctly. Make sure the cable is unplugged! Twist the RxD and TxD lines together. Make sure none of the other wires are touching one another! Plug the cable in.

_In Debian_
You must determine which device name Linux gives to the cable. For me, since I didn’t have any other USB devices plugged in, Linux gave it /dev/ttyUSB0. If you do ‘ls /dev/ttyUSB*’ before and after you plug in the cable you should be able to determine which device name the cable gets by comparing the outputs. I used screen as my serial communications program.

$ screen /dev/ttyUSB0

Press several keys on the keyboard. If they are displayed, then you have correctly identified the TxD and RxD line. If they are not displayed, you’ve done something wrong, reread and retrace your steps. To exit screen type Ctrl-A \.

_In Windows XP_
The Preparation section explains how to find your cable’s entry in the “Ports (COM & LPT)” of Device Manager. Repeat those steps and make a note of the cable’s COM#. Then launch HyperTerminal:

Start–>All Programs–>Accessories–>Communications–>HyperTerminal

If you’ve never used HyperTerminal answer it’s questions about your location.
When the “Connection Description” dialog comes up give it any name you like
(e.g. loopback). In the “Connect To” dialog change the “Connect using:”
drop down to COM# where COM# is the COM number you made note of above. Click OK.

In “Port Settings” change:

    “Bits per second:” to 115200

    “Data bits:” to 8

    “Parity:” to None

    “Stop bits:” to 1

    “Flow control:” to None

Click OK. Press several keys on the keyboard. If they are displayed, then you have correctly identified the TxD and RxD line. If they are not displayed, you’ve done something wrong, reread and retrace your steps.

Using with Arduino
Once you’ve tested your cable you can make it more permanent by adding crimp-on wire connectors with a 1×6 housing. Look at the instructions for the BBB in the links section to see how to arrange your wires the same way as an FTDI USB cable.

Set up your breadboard with the ATmega chip and it’s supporting components. The Auto-reset input can be ignored and capacitor C1 can be left off. Do not hook up your USB cable just yet. For more examples on how to setup your breadboard see the Links section. You can use any of the ATmega chips supported by Arduino, but it absolutely MUST be pre-programed with a bootloader. Several places sell chips with a bootloader; Modern Device seems to give you the best deal.

Apply power to the breadboard. The LED should blink a couple times. If not you should recheck your setup.

Once you’ve got a working setup, you can try out your cable. Make sure the power is off and the cable is not plugged into the USB port. Hookup the TxD and RxD wires as shown in the schematic. Connect the cable’s GND wire to the breadboard’s GND bus. Plug in the cable, power on the device, and start the Arduino IDE. Under Tools–>Serial Port make sure your USB cable is selected; also make sure you’ve chosen the correct ATmega chip. On the toolbar click the up arrow (Open), go to Digital, and choose Blink. Now we’re ready to try uploading.

A downside of using this type of cable is that auto-reset is not available, so you’ll have to do a manual reset to upload. To do this press down and hold the reset button, click Upload, count off X seconds then release the reset button. If you’ve gotten the timing right, Arduino will say “Done uploading” and the LED will blink continuously. If you release the button too soon the bootloader will timeout before the program gets a chance to be uploaded and you will get an error. If you hold the button too long Arduino will eventually give up and report that the programmer is unavailable. I said “X seconds” above because the timing depends on how fast Arduino runs on your computer. Using a dual boot machine, in Debian I had to count off approximately 5 seconds and in Windows XP I counted only 3. You’ll have to use trial and error and a bit of patience to figure out the right X for you. Getting the timing right can be tricky because the bootloader only listens for a brief period of time. Once you’ve got the correct timing for a manual reset, that’s it, you’re done. Congratulations, you’ve got a basic USB to Serial TTL cable. The next section explains how to make it a lot nicer.

Further Modifications (Optional)
Since these modifications depend heavily on the version of the PL-2303 used and the layout of it’s PCB, this section should not be considered a guide on how to modify your board but as a demonstration of how I modified my board. Earlier in the article I mentioned that my cable had too extraneous wires. I hope you were so lucky as well, because one can be soldered to the USB VCC 5V pad which will allow you to provide USB power to your breadboard, and the other can be soldered (indirectly) to the PL-2303HX’s DTR pin giving you auto-reset! The picture below shows the location of the USB VCC pad and a via that connects to pin 2 of the PL-2303HX (pin name DTR_N). Please note that the section showing the bottom of the board was vertically flipped in GIMP to give a sort of X-ray vision effect. That is, if the top section was overlaid on the bottom all the vias would line up. In reality, when I look at the bottom of the board it does not appear as such.

The casing around the USB connector is not a solid piece but a two part shell. It is easily removed by wedging a spudger (I used a guitar pick) into the seam and gently working the two pieces apart. The shell can also be put back together with little effort. The extraneous wires are colored red and green. I did not unsolder them for fear of breaking some unknown connection, rather I simply clipped them at their pads. There was not enough slack in the wires to reach the new solder points so I removed a section of the cable’s insulation below the strain relief and gently pulled a little slack into the enclosure. (The cable’s foil had to be torn to pull the slack. This is not a big deal since the foil has no connections. You may want to look into connecting the foil to the USB connector’s shield; I didn’t bother.)

Then I soldered the red wire to the square pad to get USB 5V; followed by a quick test providing power to an LED from the cable. Et voila, it works! Unfortunately the cable reports itself as a low power device. This means the maximum current your circuits should draw is 100 mA minus the current required by your cables circuitry. The typical/max operating current required by the PL-2303HX is 20/25 mA. If you try to exceed 100 mA, bad things can happen. My computer limits the current and will not supply more than 100 mA to a normal circuit, though I did blow my meter’s 250 mA fuse when I shorted power and ground. Your computer may beep, reset or even smoke. A (resettable) fuse is highly recommended. See this page for a quick guide on how to check your USB device’s “Power Required” in Windows. In Linux, use “lsusb -v” and search for the “MaxPower” entry associated with your cable to get the same information. If you’ve found a cable that has a “Power Required” of 500 mA, please leave a comment on where you bought it. Auto-reset works by connecting the DTR line to RESET through a capacitor and pulling it low thereby temporarily lowering RESET too. In the picture above you can see that the via just below the silk screened “C6” probably leads to the DTR pin. I did a quick probe to confirms this, then attempted to solder the green wire to the via. It was a bit of a headache. The picture is deceptive; things are much smaller than they appear! What ultimately worked for me was to fill the via with solder, tin the wire, then place the wire over the via and the iron directly on the wire. It’s not a great or even good joint, but auto-reset works nonetheless.

Quite sometime after I first wrote this guide I wired a 24L02 EEPROM to the PL2303HXA. I successfully wrote new device configuration registers settings to the EEPROM using this program. The device configuration registers allow you to change settings like the VID, PID, serial number, and maximum power required (i.e. max. current). I think only the PL2303HXA supports writing to an external EEPROM. Two hints that you have a PL2303HXA are the presence of a crystal and two 4.7k resistors.

Level Translation Note
You may have noticed that the cable’s output level isn’t 5V; it’s 3.3V. So how does it work when the ATmega expects 5V? Well if you’ll look at the ATmega datasheet you’ll see that the minimum input high VIH is 0.6*Vcc, which is 3V when Vcc is 5V. So even though the cable puts out only 3.3V the ATmega still recognizes it as a high. Going the other way, the ATmega TxD pin puts out 5V which is possibly too high for the PL-2303 chip to receive without being damaged. This is why a voltage divider was put on the cables RxD line; 5V*(15/(10+15)) = 3V. For the PL-2303HX rev. A the voltage divider is not necessary because it’s RxD pin is 5V tolerant. Other chip versions may not be; Check their datasheets. If you have a chip with a 5V tolerant RxD pin you’ll get better performance if you leave out the voltage divider because of the inherent parasitics of the resistors.

Request for Comments
Odds are that not all of you will get exactly the same cable that I did, so please share your unique experiences and insights in the comments section. They might help someone else out. Thanks for reading. Good luck!

Acknowledgements
I wish I could say the idea for this project was all my own but most of my inspiration came from Tim Small’s page

Tim Small also provided the picture with the phone connector’s pinout.

Links
Tim Small’s Guide
A Similar Guide
Another Guide Using DKU-5
Data Cable Pinout
FTDI FT232RL Cable
USB Devie “Power Required” Info
Level Translation Article
Arduino Breadboard Setup
ATmega Standalone (Breadboard)
Really Bare Bones Board Arduino Instructions
CA-42 at Deal Extreme
PL-2303 Drivers
PL-2303 Datasheets
ATmega328P Datasheet

 

79 Responses to “DIY USB to Serial Cable For $3!”

  1. […] worked out a way to use a Nokia USB cable at a USB to FTDI cable. He was able to pick up one of these cables for less than $3 delivered. A little probing worked out […]

  2. Ray Says:

    Nice find. Thanks 🙂

  3. tantris Says:

    A really thorough step-by-step writeup with good links.

  4. Bubbles Says:

    Came in through hackaday.
    What a whining bunch they can be, huh?
    Compliments from me aswell on a very good article.
    Especially I’m glad to see such quality photos. Too often there are just a bunch of out of focus smears none of which demonstrate what is being shown.

    Don’t put down that solderiron >)

    • jethomson Says:

      Thanks. I took those with a Canon P&S, a Powershot A75. I’m always amazed at the good close up pictures it will take even with autofocus. I’ve found if I go to manual mode, use a small aperture, a longer exposure, and a small tripod, it’s easy to get nice in focus pictures of PCBs. Studying a picture on your computer beats the hell out of using the magnifer on a Helping Hands.

  5. Stephen (tchnclfl) Says:

    Just saw your post on the Arduino forums. Thought I’d stop by to say thanks! This post was a life saver, and really saved me a LOT of money!

  6. drew Says:

    Hi,
    I got here via hackaday too, although the comments say that this has been done before your article has introduced me (and doubtlessly others) to this technique and I think its a great tutorial.
    Thanks,
    Drew

  7. Eric Says:

    How wonderful!
    I picked up a RS232 IR receiver many years ago and used it to control my computer via virtually any remote. Since my DIY HTPC is lacking a RS232 Port my old Nokia cable is up for a little hack to (hopefully) revive the old IR-receiver… I just love using spare parts and constructing stuff for nearly no cash 🙂

    Thank you!

    • jethomson Says:

      Serial communication with RS232 is different from LVTTL. RS232 uses a negative voltage for a logical 1 and a positive voltage for a logical 0.
      The Nokia cable uses 3.3 V for logical 1 and 0 V for a logical 0. The voltages are different and the logic is inverted.

      DealExtreme has inexpensive and OK quality USB to RS232 adapters.
      http://www.dealextreme.com/details.dx/sku.5859

      IIRC, the web is covered with microcontroller IR receiver projects if you still want to use the Nokia cable.
      I was planning on doing this for my mythbox, but didn’t have to when I got a nice remote from someone
      with a Windows MCE PC that wasn’t using it.

      • Eric Says:

        Thanks for clearing this up for me! *facepalm* Got a bit too excited and did not read the entire spec. Oh well, now I have a reason to invest in a separate Atmega chip and free up the Duemilanove 🙂

        Thanks again for an excellent tutorial!

  8. Is there a store nearby that would also sell the product so I didnt need to have it shupped?

    • jethomson Says:

      Based on comments I’ve read elsewhere and not my own experience if you live in a large city, you will probably be able to find it locally. It will probably cost much more than $3 though.

  9. Victor Says:

    Hi, I bought a CA-42 cable from eBay and it has the same connector with 6 pins. However, mine only has 4 wires, and they connect to 5678 instead of 4 678. Any ideas why?

    • jethomson Says:

      These cables vary a good bit. Some people end up with 3 wire cables while others get 4 or 5 wire ones. There is really no way to tell what you’ll get. For serial TTL communication you really only need pins 6, 7 and 8. According to pinouts.ru pin 5 is USB Vbus, which I call VCC in the article. So it sounds like you already have 5V brought out to the end of your cable. Connect wires 5 and 8 to your multimeter and see if it shows 5V. Please post back with your results.

      • Victor Says:

        Looks like I get nothing through pin 5 and 8, so I left 5 unconnected and I tried bootloading Arduino with the tx rx and ground (I had to supply separate power to the arduino). It worked, but without auto-reset it is a little hard to press reset perfectly.

        Looks like I will have to crack open the case and run my own wires!

      • jethomson Says:

        @ Victor March 14, 2010 at 7:22 pm
        The newest bootloaders don’t listen very long for a program upload because they expect everyone has auto-reset. This means the chip runs the previously uploaded program faster but it also results in a bit of a headache for those that are doing a manual reset upload.

        I think the manufactures buy these cable based on how cheap they are with little concern for how many wires they have. It’s funny that the red wire wasn’t even connected. It’s a bit of gift to you since you can use it for power or DTR.

      • Victor Says:

        My cable appears to have been constructed differently – see pics:


        Outside of the blue layer (I had to use clippers to get it out), there was a black layer also. Both were physically moleded around the circuit board so I managed to break the wires.

        The red wire was not connected to the PCB, only the other 3 were.

        I can easily find out which of the 3 wires went to where, but how should I find the pinouts of the other pins?

      • jethomson Says:

        @ Victor March 14, 2010 at 8:16 pm
        An epoxy blob, yuck! Your board has a crystal, therefore your chip probably isn’t PL-2303HX Rev. D since it uses an internal clock generator.

      • Victor Says:

        According to the datasheet of the SSOP package, pin 1 is TX and pin 5 is RX, and those correspond to the pads on my board. So I guess the numberings is all the same.. and conveniently the DTR pad is on the bottom!

      • jethomson Says:

        @ Victor March 15, 2010 at 2:23 am
        The fact that the 3.3V via is connect to the pad labeled 10 confuses me a little, so I shouldn’t say for certain, but it looks like you have all the other serial lines brought out to nice big solder pads on the bottom of the board. Luck you! I think you can be fairly confident the pad labeled 2 is indeed DTR. Try it and see.

        I have no idea how you can figure out if your RxD pin is 5V tolerant. You could try it and see, but you might smoke it.

        Thanks for sharing your findings. It is absolutely crazy how varied these cables are.

      • Victor Says:

        Just an update on the pin 2 – it isn’t DTR, at least I don’t think it is. When attempting to program, the DTR pin does go low, but it stays low, keeping the Arduino in reset instead of actually resetting the Arduino. So looks like I will do manual resets for now!

      • jethomson Says:

        Take another look at the schematic. Did you use a capacitor between the DTR line and the RESET pin? When DTR goes low the capacitor acts like a short circuit momentarily and therefore the RESET pin goes LOW. After a bit the capacitor charges bringing the RESET pin back up to HIGH.

  10. Hari Says:

    Jonathan,
    I ordered my Nokia cable from HongKong and followed your writeup. My new Arduino USB cable worked great! Thanks for sharing how to do it.

    I blogged and gave you credit here:
    http://g33k.blogspot.com/2010/03/making-my-own-arduino-usb-cable-i-dont.html

  11. Victor Says:

    Thanks, it works. Here is the finished FTDI cable:

    • jethomson Says:

      Cool. It looks like you added CTS too. Good job.

      It appears you put the (magical color changing) reset capacitor directly on the cable. Be aware that most setups put the reset capacitor on the board, so if you use your cable with one of these boards your total capacitance will be effectively halfed and it will hold the reset pin low half as long. This may or may not cause a timing problem when uploading.

      To be absolutely correct it’s not an FTDI cable since it doesn’t have an FTDI chip. The PL2303 cables definitely get the job done though. I wish they could do bitbang.

      Can you do me and all the future readers a favor and measure the maximum current you can draw? I explain how to do this in the article.

  12. […] branding. * I now own two USB to serial port adapters (woo-yay!?). One of them might be adapted like this in the […]

  13. Mac Says:

    Thanks for the great info’…

    The $2.68 CA-42 I received on the 25th seems to be like Victor’s with four wires on pins 5 through 8. The red wire on pin 5 doesn’t seem to be connected to anything. The cable I received however seems to be defective (I get the “This device will not start. (Code 10)” message on both an XP-PRO SP3 laptop and on a Vista-Home laptop) so I guess I’m going to have to try again (argh!).

  14. Lijun Says:

    That is a very good tutorial! One question: is it possible to build a full featured use to serial adapter by this method? I googled around. People usually did it with a 3rd party chip. Thanks.

    • jethomson Says:

      I’m guessing you meant to say a full featured USB to serial adapter; however I don’t know what you mean by that.
      Would you please explain what you mean by full featured?

      • Lijun Says:

        Sorry about the confusion… I notice there are only TX, RX and GND in your tutorial. But if I want a 9-pin RS232 serial port, I may need more pins.

      • jethomson Says:

        Serial communication with RS232 is different from LVTTL. RS232 uses a negative voltage for a logical 1 and a positive voltage for a logical 0.
        The Nokia cable uses 3.3 V for logical 1 and 0 V for a logical 0. The voltages are different and the logic is inverted.

        DealExtreme has inexpensive and OK quality USB to RS232 adapters.
        http://www.dealextreme.com/details.dx/sku.5859

  15. i got a cable, my chip was in an epoxy blob and there was a crystal. it only had GND, TX, and RX, but i ran another wire along the length of it for power. i couldn’t find reset in the epoxy blob. I documented it on my blog and gave you credit: http://captainsolderburn.wordpress.com/2010/05/16/boarduino-and-serial-cable/

  16. Dan Says:

    There is a eeprom attached to the PL-2303 that controls several things including VID, PID, Release No, Serial No, Flow Control, Shutdown / Wakeup and most importantly Current. Depending on the value in the eeprom, the chip will request either 100ma or 500ma.

    Prolific used to have a PL-2303X EEPROM Writer program available as a download on their website that allowed you to change those values. A copy of it is available here:
    http://www.megaupload.com/?d=HMG9JNB9

    I don’t have any CA-42’s at the moment to test this with (they are in the mail from Hong Kong) so if anyone else can try this, post your findings.

    • jethomson Says:

      I looked into this, but my memory is a bit hazy on the details. IIRC you need a special USB board that puts out 6V to program the EEPROM in the rev. D, and it can only be programmed once. The rev. A has a 2-wire EEPROM interface though, and I think if you program an external EEPROM correctly you can tell the PL2303 to report itself as High Power device and therefore get 500 mA from the USB port. I keep meaning to try this but never have. If you get it to work, write back and let us know!

  17. piccyjoe@hotmail.com Says:

    Hi Jonathan,

    I found this the cheapest FTDI based USB to TTL cable. The prolific ones do not work on my laptop (Windows 7 64-bit).

    http://www.tronisoft.com/2472.php

    regards,

    Joe

    • jethomson Says:

      That does look like a good deal if you live in the UK. It appears to work out to around $19 after VAT but without shipping, which is a bit cheaper than the $20 most places charge. It’s even nicer if you consider that eletronics hobbists not residing in the US usually have to pay a premium for components.

    • Aaron Backer Says:

      Hey Joe-

      I had the _exact_ problem. (64bit win7 laptop too) After much googling I came across this:

      http://social.answers.microsoft.com/Forums/en-US/vistahardware/thread/a366f74b-9853-4cae-95c3-4249172951da

      Apparently it’s a _64bit_ windows7 issue.

      I (un/re/un)installed probably 4-5 other drivers before I came across this one. Worked like a charm – the cable was instantly recognized as a serial port, and came up in device manager without the pesky yellow exclamation mark. (and the attendant “will not start” error)

      The link from the above post for the drivers is here:
      http://www.usglobalsat.com/download/546/win_drivers.zip

      I was able to then successfully upload an sketch to my (jeenode) arduino as well as open the serial monitor/read data/etc.

      good luck!
      aaron backer
      aaron dhot backer at the website of gee em ai eye elle dot com. (take that spambots..)

      keywords to hopefully help some other poor soul trying to get the cheap arduino programming cable hack to work:
      cheap arduino serial programming cable
      ca-42 PL-2303 64bit windows7 yellow exclamation point device manager

      • Aaron Backer Says:

        And Jonathan, thanks for an *awesome* tutorial!!

        I already have one of the modern device BUB programmers, and it works a charm. However, the extra serial cable (got my ca-42 off ebay for $3ish) is proving to be very handy while trying to diagnose getting a pair of wireless ‘duinos to talk to each other.

        rock on!
        -adb

      • Aaron Backer Says:

        Additional info:

        my ca-42 knockoff had:
        and epoxy blob covering the chip
        3 wires
        the pads were actually *labelled* – rx, tx, gnd, vcc, and rst…so that made it easy.
        A bunch of weird solder jumpering (tx and gnd were solder jumpered…rst and vcc were blobbed together I think…some other stuff)

        Initially I followed the advice to swap the rx/tx with the connector’s ports…that didn’t work. Guess the pads were labelled intending to actually go to the mcu.

        I had a 6 conductor wire (cat5 8 conductor would have worked too) that I used. Along with 2 superglued-together 3-conductor female connectors as I didn’t have a 6 handy.

        interestingly, my reset/reprogram performance seems to be a bit dodgy so I’m guessing I need to add the reset capacitor someone mentioned in a post above.

        Thanks again. cheers!
        -adb

      • Ray Says:

        Hey Aaron, I have the same Win 7 64bit driver problem, but it seems that the link to the driver you found doesn’t work anymore. Any chance you could send the driver to me or post it somewhere? I would really appreciate it.

      • Aaron Says:

        Ray:
        I love big hard drives…dig around enough and you can find the cruft of ages. (or at least, a few months ago.) Here’s the zip file I pulled from that link: https://rapidshare.com/files/457999944/win_drivers.zip

        good luck!
        -aaron

      • Ray Says:

        Awesome 😀

        Just had to uninstall the old driver, restart and install the one you linked, and it worked.

        Thank you very much 🙂

  18. Jethomson.. excellent tutorial and you are the man of YEAR… You saved me lot of bucks…. Unfortunately i have no good experience with cheap chinese DKU-5 but i have found CA-45 cable the best for me… It has only three wires.. The one i have RED=GND the BLACK=TX and the WHITE=RX…

    The device when attached to window7 it gets COM5 and recognized by windows…you can see the pictures in the following thread..
    http://www.david-laserscanner.com/forum/viewtopic.php?f=9&t=2655&p=16390#p16390

    I really love you for sharing such a great work with us…

  19. Hi Jethomson,
    I open the third party Hyperterminal in window7 and joined the Tx/Rx wires and typed in the window..whatever i typed written on terminal window so diagnostic test was right…
    i got another problem..when i attached the Rx and Tx pins as per your scheme to my Arduino (DIY) ATMEGA 328P chip as you mentioned.. The device manager recognised the device, Hyperterminal recognised the device as COM1, Arduino IDE also recognised the device…
    Hyperterminal window could not open the COM1, i changed the settings from COm1 to COM10 in device manager but hyperterminal recognised the port but can’t open the COMx…

    What may be the wrong?…Again i posted all the pictures in above provided link..as i can’t upload here…

  20. Forget to say that in your schematic of Tx/Rx to Arduino pin is wrongly labelled… The Arduino pins are right labeled but the connections are reversed…

  21. Hi again,
    The CA-45 cable has some problems.. it sends the Data through the serial port alongwith some garbage values.. My arduino recognises both the sent values and garbage with LCD display….

    I do not know how this garbage values comes.. When i connect the Rx/Tx wires and in hyperterminal whatever i typed i get on the window with no garbage… can you help me..

    The Tx voltage= 3.5 and the Rx voltage= 2.5…. I have attcah the resistors 1K, 10K and 15K as per your scheme.. should i change the value?
    Regards

  22. Hi thomson,
    Thanks for the reply… Actually i have programmed the ATMEGA328P to get the serial data already.. for example typing M (sending to Arduino) will move the steppermotor 1step..The same way typing ‘S’ will start the laser scanning process and typing ‘T’ will off the laser, move the motor to original position and stop.

    Currently the problem is i am getting garbage values in the serial communication as described above… sending 10xM to arduino, the result is few M display on LCD and other become garbage characters… why?

    I will request you to please fast scan the following thread and help us the David forum community.
    http://www.david-laserscanner.com/forum/viewtopic.php?f=9&t=2655

    • jethomson Says:

      I read the thread and it appears you discovered the problem was caused by a USB extension cable. The 1k resistor on the Rx pin is for limiting the current through the input protection diode if the Tx line exceeds 5V. The 10k and 15k resistors on the Tx pin form a voltage divider to reduce the 5V output to 3.3V because the cable is 3.3V TTL. My cable works without the 15k resistor because the cable’s USB to serial TTL chip is 5V tolerant.

      In your last post you said “This project abandoned till the cheap alternative available”. I’m not sure what you mean by that, but if you are quitting because you can’t get a DKU-5 cable from ebay, try dealextreme.com

  23. Hi Thomson,
    Thanks for the reply..i almost forgot your this thread and today i tried to check here…
    Thanks for the informations… I will replace the ATMEGA328P with new one, i think its Tx or Rx pins are damaged as i found the problem in my original Arduino board too from which i programmed that chip..

    I will try it again… with the new chip and let you know…

  24. Off-course, dealextreme is my favourite site, but both ebay and dealextreme accept VISA Card under Paypal.. and unfortunately paypal do not provide services to my country ‘The Pakistan’..

    recently purchased a new Arduino from adafruit for programming the chip..

  25. Cmeacham98 Says:

    My cable had ground txd and rxd cables only. And there another cable that was useless. My setup was Black = GND Green = TXD White = RXD. In my case my RXD line had less than a volt going to the multimeter (or a bad connection). Originally I thought the RXD line was a dud but the loopback test proved me wrong 🙂

  26. Arthur Vicente Ribacki Says:

    Does any one have an idea if there is a data cable that uses 5V for the Rx and Tx pins? I would need the exact same thing, but 3.3V is not enought! Thanks!

  27. […] it in the uCHobby blog and decided to do my little take on it (I think the original post is from Jonathan Thomson’s blog. Check out his blog too, he posts some cool […]

  28. […] (EEPROM Writer link on that post is nolonger working however there is a copy at Megaupload via Jonathan Thomson’s Web Journal). I was however unable to get it to recognise the cable and looking on EDA Board appears a special […]

  29. Casper Says:

    Thanks for the great guide. I have managed to get the info from my device (boot), but cannot seem to be able to write to it (terminals won’t allow me to type anything). I have tried flow control settings, but doesn’t seem to be the issue. Any ideas?

  30. […] los dispositivos USB, documentación del chip Prolific 2303, que es el que usa el cable, y algunos “hacks” para activar el reset y la […]

  31. Thanks for this very useful post, now I can complete my project making a EEprome/ I2c programmer via USB and the not the serial one 🙂

  32. […] not much success with uploading sketches to my DIY arduino I found this article on the web. I unearthed an old Sony-Ericsson phone cable out of my wonder-cable-box. Its […]

  33. […] signal levels (3.3V) and not RS-232 (somewhere around 15V). Just as I was considering cutting up a USB phone cable, I realised that I had a full-blown Linux system with a handily accessible serial port that runs at […]

  34. […] TTL handle WITH 3.3v supply – we also managed to get one from a Nokia CA-42 handle as shown here – though flattering tough to mangle a cosmetic bombard […]

  35. […] not much success with uploading sketches to my DIY arduino I found this Article on the web. I unearthed an old Sony-Ericsson phone cable out of my wonder-cable-box. Its […]

  36. Mario Says:

    Was looking for the EEPROM writer util, but since Megaupload is gone that link is now dead.
    Any other locations where the prog can be found?

  37. […] it in the uCHobby blog and decided to do my little take on it (I think the original post is from Jonathan Thomson's blog. Check out his blog too, he posts some cool stuff). The first thing you have to do is go to […]

  38. […] meu próprio tutorial acerca da modificação do cabo (penso que a ideia original veio do blog de Jonathan Thomson. Aproveitem e consultem o blog dele também. Tem algumas coisas interessantes). A primeira coisa […]

  39. Eddy Says:

    Excellent article. Thanks a lot.

  40. Eyüb Bayazit Says:

    Hello,
    Can you share the eprom file(for 24l02 epprom)?
    Thanks

    • jethomson Says:

      Sorry, I don’t have it. The eeprom writer program generates it for you. It has been so long, I’m not sure if it saves the .bin file to disk.
      If you google “eep-pl2303 eeprom writer” you can find screenshots of the options available in the program for creating and writing the rom.


Leave a reply to jethomson Cancel reply