Arduino Forum

Forum 2005-2010 (read only) => General => Frequently-Asked Questions => Topic started by: xl97 on Jun 15, 2010, 08:19 am

Title: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 15, 2010, 08:19 am
Thanks for reading..

I am trying to make my own FTDI cable/programmer so I can upload sketches to my breadboard Arduino projects (without using my true Arduino board, swapping chips..etc)

So I order a CA-42 cable form China..  installed drivers, got my com port number..etc

cut my cable in half..and started to continuity trace my pinouts

PHONE END: (cable color, wire# underneath)

bl     wh    gr     or

8-----7-----6-----5-----4-----3-----2----1

according to all the tuts for the 'pins outs:
http://www.uchobby.com/index.php/2009/10/04/diy-usb-to-serial-cable-for-3/#more-492

http://jethomson.wordpress.com/2010/02/21/diy-usb-to-serial-cable-for-3usd/

http://www.kwartzlab.org/blog/dw/2010-04-23/reverse-engineering-cheap-ardu

and the Nokia pinout chart:
http://pinouts.ru/CellularPhones-Nokia/nokia_pop_pinout.shtml

5        USB Vbus        Also act as USB power detection? Should be connected to USB pin 1 in usb data cable. (USB Vcc +5V)
6       FBus Rx/USB D+       USB exists only in some models*. Should be connected to USB pin 3 in usb data cable. (USB DATA+)
7       FBus Tx/USB D-       USB exists only in some models*. Should be connected to USB pin 2 in usb data cable. (USB DATA-)
8       GND       Data GND (USB GND)

so to re-cap

GND     TX          RX         ?? (USB Vbus) ??

|           |            |            |

bl          wh         gr          or

|            |            |            |

8---------7---------6---------5---------4---------3---------2--------1

I have no clue what the Orange wire/USB Vbus line is for.. (not used? possibly clipped and moved/re-soldered for a further reset or power line to Arduino chip?)

anyways..

I switch my meter to check voltage..

clip black to GND and red to:

Orange wire: (USB Vbus)
nothing

Green wire: (RX)
3.18v

White wire: (TX)
nothing

Black wire: (GND)

Should I be concerned that my TX line isnt giving out 3.3v line in the tuts?  And why isnt it?

Also anyone explain to me about the USB Vbus wire?

I did tie both the the RX & TX lines.... open Hyper terminal and infact get text on the screen.. however it wasnt being duplicated (although I dont believe I had on echo default)

can I try to 'upload' a sketch to my chip as is?

should I cut out USB plastic housing end and solder on both a reset wire and 3.3v wire?

Alternately.. I also have a DKU-5 cable to work with if this FAILS.


thanks for any help.

Title: Re: Another DIY FTDI cable question/help thread.
Post by: raron on Jun 15, 2010, 11:00 am
Quote
cut my cable in half.

Hope you cut it near the phone end, so you get a longer cable.

Quote
I did tie both the the RX & TX lines.... open Hyper terminal and infact get text on the screen.. however it wasnt being duplicated (although I dont believe I had on echo default)

Also cut the RX-TX connection while in hyperterminal, and verify that you dont get any echo / text back.

Dont measure voltage, measure continiuty on the "phone end" of the cable, to map out the connector to wire color. Seems like you have done this though. So according to your map, wh (white? pin 7, TX) goes to the arduino RX. gr (green? pin 6, RX) goes to arduino TX.

But I would use 1k ohm resistors from the arduino TX and RX, just in case you switch wires and get an output to an output..

Also, is your arduno 5V or 3.3V? If 5V, you should use the 10k - 15k voltage divider as pr the schematics in your first link, on the arduino TX output, which goes to the green wire (RX) on the cable.

If you don't have an auto-reset, you would have to figure out when to press the reset button before / right after trying to upload a sketch. Depends on the bootloader. I find it usually works if I press "upload", then the reset button right after. A one-handed operation.

I have a DKU-5 btw.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 15, 2010, 05:16 pm
lol..  ok it wasnt 'exactly' in half.. I only cut about 1-2 inches form the PHONE end..

I also 'did' break the RX/TX connection while in hyper terminal (no text showed).. re-connected them..letters again..

Im just concerned with the NO 3.3v coming from TX?

I get NOTHING from the (white) TX wire.. but the RX wire does in fact come in/display a bit 'lower' than 3.3v (actually 3.1xv something)

but according to the tuts.. TX should be giving me 3.3v?? something to be concerned about?


My Arduino Duemilanove, I believe, is 5v (powered off USB)


You stated this:
Quote

If 5V, you should use the 10k - 15k voltage divider as pr the schematics in your first link


Im new to all electronics.. what is a 10k-15k voltage 'divider'?
I didnt see mention of anything 'extra' (such as resistors, or voltage dividers).. almost every tut shows just using straight wires soldered to the PCB?


Id like at least like to add the RESET wire.. so I can avoid having to the hit the button manually..but its not a deal breaker..

my final part is the power? do I run a 5v feed form the PCB to the Atmel/Arduino/breadboard?

I suppose I need to crack open the USB end now right? and try to figure out where the 5v feed is?

Thanks in advance for any help.


edit:

Im also curious as to why my cable has 4 wires.. (like the tutorial in the link).. but their images state pin4 is 3.3v OUT..

I dont have a wire for pin4?

I 'do' however have a wire (orange) on pin5.. (but, again, outputs nothing when metered for voltage)

I have a DKU-5 cable if it would be easier?  LOL


--------------------------------------


ok..(talking outloud here.. hopefully someone will chime in..ro re-reading things on screen will make it 'click')  LOL


this link:
http://pinouts.ru/CellularPhones-Nokia/nokia_pop_pinout.shtml

Nokia Pinout


8        GND        Data GND (USB GND)


traced/metered = check (GND)

7        FBus Tx/USB D-        USB exists only in some models*. Should be connected to USB pin 2 in usb data cable. (USB DATA-)

traced/metered = check (no vOUT)

6        FBus Rx/USB D+        USB exists only in some models*. Should be connected to USB pin 3 in usb data cable. (USB DATA+)


traced/metered = check (3.1xv OUT)


I 'believe' all 3 of the wires above are correct in color, tracing in continuity tests..etc


** again only question is the TX line is NOT putting out 3.3v when metered????????



the last portion of confusion comes from following the tutorials where 'they' have a wire on pin4..

where as in my cable I have a wire on pin5

4        V Out / VDD+        Connected to pin 3 in DKU-2 usb data cable / For Hansfree (ex. HS-23): microchip power supply

5       USB Vbus       Also act as USB power detection? Should be connected to USB pin 1 in usb data cable. (USB Vcc +5V)



I suppose I'll try to do a continutiy test on the phone side again for the pin4 -5 to make Im 100% correct here..

why would there NOT be a 5v feed? its usb cable/powered...no?

and what exactly is this pin5 output?

should I crack open the USB case and solder the ORANGE (pin5) lead to the V Out / VDD+ of where it states the pin4 is/should be?

that way my orange line will be the 5v/V++ feed power to the Arduino/chip?

and while Im in there (somehow) find the RESET pad.. and run a
another wire to the arduino/chip as well?

Thanks








Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 17, 2010, 06:28 am
bump..

ok.. so I took apart my cable.. I have 4 wires soldered to the prolific clone...

doesnt look any of the pics..so I couldnt follow them exactly..

WIRE   --  PCB -- ATMEL

BLACK -- GND --  GND on breadboard
WHITE --  RX  --  TX on chip
GREEN --  TX -- RX on chip
RED  -- 5v -- v++ rail on breadboard

I open Arduino IDE..

choose 328 chip
make sure Im on the new COM5 port

I open a sketch,...verify...  when I uploaded..

I see the I/O size text come up..I hit switch on breadboard to auto re-set..


I get this error in Arduino IDE:

Binary sketch size: 896 bytes (of a 30720 byte maximum)

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

is there a different setting I need to set?..

anyone wanna help on the RESET on this PCB..maybe I can add that to the chip (auto reset)



I know Im getting power to the board/chip..cause the BLINK sketch is flashing..


I tested my rest button..it seems to 'stop/kill' the blink sketch form running (like killing power)..as soon as I let go...its back to blink though almost immediately.. wouldnt it need a second to load/run again?



not sure how to get a sketch form IDE to breadboard Ateml with Arduino bootloader on it...

if I run a sketch in my Arduino..replace chip..works as it should..  but can NOT get this FTDI cable to work to save my life.. =(

am I missing a step here?

thanks


Title: Re: Another DIY FTDI cable question/help thread.
Post by: lemming on Jun 17, 2010, 08:26 am
I was looking at doing this a while back and just saved myself the trouble by buying one of these.

http://www.moderndevice.com/products/usb-bub

For $15.00 it does 3.3 and 5.0 volt levels and allows you a choice of pinouts and power to your breadboard Arduino clone.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: pluggy on Jun 17, 2010, 12:42 pm
From my own experience and from numerous threads on here regarding the subject, whether you get a cheap Ebay Nokia type USB cable to work with a arduino is a lottery.  

I'm with lemming, the FTDI breakout board as sold by Moderndevices or the very similar one by Sparkfun is painless in comparison.

http://www.sparkfun.com/commerce/product_info.php?products_id=9115
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 17, 2010, 07:11 pm
Yeah I was hoping I could 'somehow' get the DIY FTDI cables to work

either the CA-42 which I tried already..or the DKU-5 exta one I have laying around..

man....lol

I have NEVER gotten a DIY parallel programmer to work for flashing bootloader to blank chips.

never got DIY MAX232 serial converter to work either..

after getting my 'real' Ardunio and using it as a programmer for bootloading the chips..

I (now) cant get the DIY FTDI cabls to upload sketches to it...


(Im not so luck with the DIY cables eh?...lol.. usually I make all my cables for my projects..etc)

thanks
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 18, 2010, 05:08 am
Well I didnt give up guys...

and I got it working..
I re-checked the 4 wires I 'do' have on there.. and they were correct..

so I read some posts.. and started to give it some more 'tries' and adjusting my 'manual' reset button timing..and I got it working!

So thanks to everyone who replied..

my only/last question is.. (two parter) =)

a.) how can I go about finding the RESET pad to solder a wire to? and when it just goes to pin1 right?  same as the manual reset button?

b.) what would a possible 6th wire be used for?? (I see some have 6?)

Thanks

Title: Re: Another DIY FTDI cable question/help thread.
Post by: mreza on Jun 21, 2010, 12:31 am
Quote
a.) how can I go about finding the RESET pad to solder a wire to? and when it just goes to pin1 right?  same as the manual reset button?

Here you can read all about it and the RESET too, how to find the DTR (Reset pin) at PL-2303 chip in Nokia CA-41 wire:
http://jethomson.wordpress.com/2010/02/21/diy-usb-to-serial-cable-for-3usd/

(http://jethomson.files.wordpress.com/2010/02/ca-42_board_small.jpg?w=450&h=453)
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 21, 2010, 06:32 pm
Yeah I read that article.. (even linked to it in the first post) ;)

however.. my PCB does NOT look the same..and in fact has a big blob o resin over the chip..and I dont see any other chips..or chip numbers to verify anything.

is it possible that these boards just dont HAVE a reset??
Title: Re: Another DIY FTDI cable question/help thread.
Post by: pluggy on Jun 21, 2010, 07:33 pm
The DTR will be in there, under the resin, the chances you can find it and tap into it without destroying the whole thing are nil.  If its just the reset thats the problem, you can press the manual reset at the right time and it should go.  I find hitting reset after clicking upload at the point it reports the sketch size works for me.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 21, 2010, 08:33 pm
damn.. I was afraid it might be under there.. and if it is..its NOT a through hole/via as I dont see it under the board either..

I'll take a pic and upload it, if for nothing else, just in case anyone else gets the same type they can follow the the pics..


yeah I do use the manual reset button finally have it timed right every time.. (same as you stated...when sketch size ..etc is displayed in IDE)

but I figured it would be 'nicer' if I could just add that.. its less to eventually add to a final 'board/project'  

Im far from anywhere near that point..lol

I still have a DKU-5 cable I cold check out too I suppose..??

hmmmmm
Title: Re: Another DIY FTDI cable question/help thread.
Post by: mreza on Jun 21, 2010, 10:28 pm
@xl97
I have read your post, but I didn't really looked at these links, anyway your Nokia cable may look like this one:
(http://img26.imageshack.us/img26/4138/dku5back.th.jpg)
As you know there are so many kinds of those cables and I have also seen same hack of this kind cable with a
on board chip too. Some of them has labeled (TX, RX, DTR,...) on board but I guess yours has no labels!
We could much better see it, when you have upload a picture of your cable (board)

Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 21, 2010, 10:35 pm
Yeah its more like one..

on underside has labels/numbers of all pads at edge of PCB.. and a 5v pad label

on top side it has a 'few' labels.  one or two numbers a few via.. and thats about it.

Im not dead in the water.. I can manually reset using the button..but would be a 'full' solution if I didnt have to . :)


I'll try and get some pics up tonight when I get home from work.

Thanks   :)
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 22, 2010, 07:55 am
ok..as promised some pics.. crappy ones..but pica none the less.. ;)

hopefully someone can help me not only identify this pcb..but more so..the DTR/RESET pad to jumper off of.

Thanks

(http://dmstudios.net/misc/ftdi_cable/ftdi_bottom.jpg)



(http://dmstudios.net/misc/ftdi_cable/ftdi_top.jpg)


any help is appreciated.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: mreza on Jun 22, 2010, 09:11 am
Well, use a oscilloscope if not a multimeter, connect it to the one pad on PCB, then upload a sketch, do it one by one as soon as you see the activity on the oscilloscop or multimeter, you have find the DTR pad (the activity will apper at the same time you use to push the reset button)
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 22, 2010, 02:11 pm
no scope..

what setting should I used on my meter to test/detect the DTR pad?


Thanks
Title: Re: Another DIY FTDI cable question/help thread.
Post by: mreza on Jun 22, 2010, 07:11 pm
Set your multimeter to -Voltage- measuring, 0 to 10V or lower, if your multimeter has lower measuring, like 0 to 5V is also good.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 25, 2010, 05:13 am
lol..(back again)

when you say I'll see 'activity' on the multimeter when I hit the rest button..what reset button? where?

should I actually have my 'hacked' FTDI cable hooked up to my breadboard/Arduino.. and upload sketches to it..thats how I shoul dbe testing? when I actually upload sketches?

Thanks
Title: Re: Another DIY FTDI cable question/help thread.
Post by: mreza on Jun 25, 2010, 01:29 pm
I didn't acctually say you have to hit the reset botton, I said you will see activity on the multimeter at the very same time that you use to push the reset botton, when you upload a sketch.

Anyway what you have to do to track the DTR pin at your 'hacked cable':
1- Connect the 'hacked cable' to the breadboard/Arduino (as you do it for uploading a sketch)
2- Set the multimeter to the Voltage measuing range and ground the multimeter to 'hacked cable' and breadboard/Arduino.
3- Connect the other prob of multimeter (red) to one of the pads at the 'hacked cable' little PCB (find a pad that has voltage)
4- Now you have to upload a sketck, and look at your multimeter to see activity.

You have to repeat the 3 & 4, with all the pads on the 'hacked cable' little print board (PCB) one by one until you have find the DTR line.

To find the DTR pad at the 'hacked cable' look after the pad which is normally high (has voltag) and become low (for a few seconds) when you upload a sketch.

The Arduino reset pin is connected to the high (5V) thru a 10K resistor, and will be reset when connected to the ground(0V) That's why the DTR line is normally high and to reset the Arduino (when uploading a sketch) the DTR must become low (0V) for a few seconds at the right moment.
When you have find the DTR line, connect it to the reset pin with a 0.1uF capacitor serial in line (look at Arduino schematic)
I hope that could help you and write back about your progress.

PS. this is not a FTDI cable, rather a Prolific's PL2303 chip, the FTDI's chip which is on the Arduino board is FT232RL  
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 25, 2010, 04:45 pm
1- Connect the 'hacked cable' to the breadboard/Arduino (as you do it for uploading a sketch)  -CHECK
2- Set the multimeter to the Voltage measuing range and ground the multimeter to 'hacked cable' and breadboard/Arduino.  -CHECK
3- Connect the other prob of multimeter (red) to one of the pads at the 'hacked cable' little PCB (find a pad that has voltage)  -CHECK
4- Now you have to upload a sketck, and look at your multimeter to see activity.  -CHECK

this was exactly how I had done it..


Quote

To find the DTR pad at the 'hacked cable' look after the pad which is normally high (has voltag) and become low (for a few seconds) when you upload a sketch.


this is what I was missing.. I think I was checking for it to be 'backwards'..

I was thinking when I probe'd the pads..it would state 0v..and then when I uploaded a sketch..and hit the rest button..I would see an INCREASE in voltage (hence resetting the Arduino/chip)

I have prob'd MANY pins.. most are @ 0.00v or 0.01v fluxuating..

and when I uploaded a sketch..only sometimes Id see a slight increase..but when actually TESTED to be the DTR pin/pad..didnt work.


I'll go back and look for the correct behavior now.

thanks
Title: Re: Another DIY FTDI cable question/help thread.
Post by: mreza on Jun 26, 2010, 01:05 am
The cable's (PL-2303 chip) output level is 3.3V, but the voltage level of DTR pin at your cable version is unknown! (it must be 3.3V, when it is not low)
Since there is many different cable version and PCB layout of PL-2303 chip, every cable hack depend on the very same kind cable and PCB layout of the different PL-2303 chip.  

A new approach:
The DTR pin Auto-Reset the Arduino (when uploading a sketch) by pulling the reset pin low (0V) that's way you are going to do the same as you did, but only this time set the multimeter to find the cannectivity. This time look after which pad/pin will be connected to ground(0V) when you are uploading a sketch, you have to be fast, it is only for a few seconds. (it would be more easy if your multimeter has a buzzer)
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jun 30, 2010, 05:00 am
well thanks for the reply/help.. but I dont fully understand what your trying to explain to me =(

I am now confused.. if I am to be looking for a pad that by default is at 3.3v? or is at 0.0v when I meter for voltage output??

When I open the Arduino IDE.. and pick out a sketch to write.. I ground to my breadboard/Arduino.. and use the RED probe to check the open pads & vias on the pcb.

I can find 0.0v pads and anywhere from 1.6v to 5.0v on the PCB..

I if I meter some of the pads as I upload a sketch.. it looks as if 'some' of them either increase a bit or lower a bit (none go to 0v)

but when I try to hook up these pads/vias to the pin1/reset pin..  either my blinking LED (goes off..so something is wrong...and no sketches upload).. or it just doesnt reset the chip for the bootloader to accept the sketch.

Thanks
Title: Re: Another DIY FTDI cable question/help thread.
Post by: Richard-m on Jun 30, 2010, 06:56 am
I have had hit and miss with pin availability on the nokia data cables, but every sony erricsson one I have bought off deal extreme has had something that works for reset available on it, on the underside of the board on an unlabled pin.

I found it as described with probing and opening and closing the port to trigger it changing.

IMO the FTDI cables are better, they have a serial number in them so that you dont have the comport number change in windows depening on how things are enumerated. If you will only ever have the one device connected to the PC then the prolific ones may work for you, but I have several and I have to change things depending on when and where I plug it in on windows.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: doshdance on Jul 22, 2010, 11:09 am
guys.... am a newbie here... sorry for the interruption.

so u guys are saying that the pl2303 can replace the ftdi right?
well will it be ok if use the pl2303 as the ftdi replacement in the arduino 0018?

m not sure i like the darkness in the avrdude!
Title: Re: Another DIY FTDI cable question/help thread.
Post by: Richard-m on Jul 22, 2010, 02:04 pm
If you are inexperianced, then no, get the FTDI one since its more known and suppoted. Once you have the hang of it then the cheap prolific ones are good for other things you want to do, but if you use one then you are basically trying to troubleshoot two things at once, and you wont know if its the cable or something else causing you problems.
Title: Re: Another DIY FTDI cable question/help thread.
Post by: xl97 on Jul 22, 2010, 04:52 pm
hi-

I have 'only' used the Arduino 0018 IDE.


I took one of these CA-42 (pl2303) data cables, soldered the wires to correct pads.. (only 3)

and then used a 'header pin' that plugs into my breadboard.

I throw my Atmel chip in the breadboard, (tons of links/tuts on how to set this up), with crystal, resistors..etc..

main thing is a RESET switch.

I open the IDE....open my sketch..

upload sketch to my chip.. as soon as I see the 'text' at bottom of IDE saying sketch size..etc..

I hit RESET button..  works every time.

Title: Re: Another DIY FTDI cable question/help thread.
Post by: doshdance on Jul 22, 2010, 05:04 pm
first of all... thanx guys..

most of the writings on the pl2303 demonstrates much on the usage of avrdude... which i dont quite familiar.coz i thought avrdude is the only way to go with the pl2303... heh guess i was wrong. so lets tune up the pl2303... hope it my cheap dream will come true.

by the way... ive had  experienced most of the 16 series PICs but not Atmels. i thought i was goin the cheapy way. ive just started on the Arduinos since theres so many experts in the line... so i guess it would be easy for me to learn from the best. looks like it... so far so good.

but wait... u mean its ok if we manually reset the chip without the dtr? or rts? i forgot which one was it...

thanx by the way.