I'd like to connect a usb to serial cable (converter actually) to tx/rx pin of my arduino.
Usb on one end, DB9 male on the other end.
Since I can not attach dupont wires to my db9 end (pins too close, too big...), I connected a DB9 female to it with loose wires at the end of it.
My problem is that I cannot identify wires.
I believe I found 4 wires to be active.
when I connect them by pairs i get either 6v for some pairs, 13v for some other pairs, and 0v.
My voltmeter could be a bit off I guess and these are probably 5v and 12v.
I can identify which one is positive voltage and which one is negative voltage.
Would you know a way to clearly identify which are TX, RX or GND?
Is 5v ok on my arduino : no risk to fry it?
For 9 pin RS232, pin 2 is Rx, pin 3 is Tx and pin 5 is gnd.
If this cable converts USB to serial, and you want to attach the serial output to your Arduino, you will damage it. The Arduino is not compatible with either the voltages on RS232, nor is it compatible with the signal polarity.
BillO:
For 9 pin RS232, pin 2 is Rx, pin 3 is Tx and pin 5 is gnd.
If this cable converts USB to serial, and you want to attach the serial output to your Arduino, you will damage it. The Arduino is not compatible with either the voltages on RS232, nor is it compatible with the signal polarity.
Do you not have access to normal USB cable?
the 5v voltage wont do it you mean?
what do you mean with the polarity? tx + gnd wire should give me 5v, same for rx + gnd not? and i thouht that then the rx or tx should be my positive wire and gnd my negative wire? or am I completely wrong?
erwanl:
the 5v voltage wont do it you mean?
what do you mean with the polarity? tx + gnd wire should give me 5v, same for rx + gnd not? and i thouht that then the rx or tx should be my positive wire and gnd my negative wire? or am I completely wrong?
Thx,
Erwan
RS232 signals are not normally 0V to 5V, they usually range from -10 to 10 (or more). Also, what I mean by polarity is that RS232 uses a -negative or low voltage to represent a '1' and a high positive voltage to represent a '0'. The Arduino will expect 0V for '0' and between 3.5V-5V for '1'.
erwanl:
the 5v voltage wont do it you mean?
what do you mean with the polarity? tx + gnd wire should give me 5v, same for rx + gnd not? and i thouht that then the rx or tx should be my positive wire and gnd my negative wire? or am I completely wrong?
Thx,
Erwan
RS232 signals are not normally 0V to 5V, they usually range from -10 to 10 (or more). Also, what I mean by polarity is that RS232 uses a -negative or low voltage to represent a '1' and a high positive voltage to represent a '0'. The Arduino will expect 0V for '0' and between 3.5V-5V for '1'.
was indeed the best way to identify my wires...
i now have identified DTR/PIN4, RXD/PIN2, GND/PIN5, TXD/PIN3.
about voltages
dtr+txd=13v
dtr+rxd=6v
dtr+gnd=6v
this above is wierd? not sure dtr is of any use to me anyway...
rxd+txd=0v : normal behavior i assume ?
gnd+rxd=0v : is this normal behavior? rx is low by default?
gnd+txd=6v : normal behavior i assume? tx is high by default?
now question how can i assert for sure whether this is rs232 or ttl?
6.x volts seems too high to be ttl and defo too high for my arduino.
That cable is almost certainly RS232 as that is what it is sold for. It seems funny that DTR is 13V while RX and TX are 6V. All signals are usually the same. Were these measurements made during operation (port open) or while it was just plugged in? If the port was not opened, the signals might not be at their operating levels.
Also, RS232 specifies a negative swing for 'Mark' (logic 1). A lot of equipment made today is happy with 0V, but to be truly compatible with all RS232, it should swing negative.
Even if the voltages could be made to be withing the tolerance of teh ATmeg328 on the Arduino, the polarity of the data will be wrong. You could build a simple RS232 to TTL converter like this for less than a couple of dollars --> avrprogrammers.com -.
DTR, if also converted, can be used to control the Arduino reset.
Again, I'd suggest that an ordinary USB cable would be your best bet, or is that not possible for some reason?
BillO:
That cable is almost certainly RS232 as that is what it is sold for. It seems funny that DTR is 13V while RX and TX are 6V. All signals are usually the same. Were these measurements made during operation (port open) or while it was just plugged in? If the port was not opened, the signals might not be at their operating levels.
Also, RS232 specifies a negative swing for 'Mark' (logic 1). A lot of equipment made today is happy with 0V, but to be truly compatible with all RS232, it should swing negative.
Even if the voltages could be made to be withing the tolerance of teh ATmeg328 on the Arduino, the polarity of the data will be wrong. You could build a simple RS232 to TTL converter like this for less than a couple of dollars --> avrprogrammers.com -.
DTR, if also converted, can be used to control the Arduino reset.
Again, I'd suggest that an ordinary USB cable would be your best bet, or is that not possible for some reason?
i measured voltage with the cable connected.
no operations during that step.
usb on my arduino is fine indeed : i tested a few skeches already reading/writing from/to serial either thru the arduino IDE or thru some delphi applications.
i was just willing to experiment serial communication for some later projects, started to discover rs232 vs ttl in the process.
i now will go back to basics as i feel i have some lackings there (to say the least...).
anyway, thanks a lot to everyone in this thread for that shared knowledge.
this cable by the way comes from my work place to interface routers, switches, etc.