Standard wiring Serial DE9
Bobb Fwed
Posts: 1,119
I am looking for what the standard wiring is for a DE9 (9-pin) D-sub connector is. I have the male end and I am trying to connect it to a device that is normally connected to a computer's serial port.
All I know is the incoming serial line is supposed to have 22kohm resistance. I'm pretty sure pin 5 is ground.
The important pins I am looking for are in and out, but is there also other wiring to let the device know the cable is plugged in or anything like that?
I am wiring it to a propeller, is there any special precautions I should take to protect my device?
All I know is the incoming serial line is supposed to have 22kohm resistance. I'm pretty sure pin 5 is ground.
The important pins I am looking for are in and out, but is there also other wiring to let the device know the cable is plugged in or anything like that?
I am wiring it to a propeller, is there any special precautions I should take to protect my device?
Comments
pin signal
2 TxD (output from MCU)
3 RxD (input to MCU)
5 Ground
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Per Wikipedia:
"signal levels of ±5 V,±10 V,±12 V, and ±15 V are all commonly seen depending on the power supplies available within a device. RS-232 drivers and receivers must be able to withstand indefinite short circuit to ground or to any voltage level up to ±25 volts."
If you're talking about wiring pins from a standard serial adapter directly to a Propeller, I think you're heading for big trouble. You will want to build a MAX 232 circuit to bring the Serial levels to appropriate TTL 5V/0V levels, and then use a 1K resistor going to the Propeller chip I/O pin to compensate for the fact that the Propeller uses 3.3V.
I'm using a couple of these kits:
www.awce.com/rs1.htm
but you'll find that you can build the circuit on protoboard for considerably less $$.
Attached is a diagram of the pins that I've found useful.
Post Edited (sylvie369) : 1/20/2009 7:44:17 PM GMT
propeller.wikispaces.com/Two-Resistor+Serial+Interface
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
And to confirm with someone else, pin 2 out (from µC), pin 3 in (to µC), and 5 common ground?
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Max3232 as stated earlier.
I like to keep all serial stuff simple and 3 wires. If you use max3232s (or 232s) on every board/box etc it doesn't matter if you muddle all the wires up or power one board up and not the other as rs232 can handle that. Simple rule of thumb - 3 wires pins 2,3,5 and if the plug is male the data comes out of pin 3 and if it is female it comes out of pin 2. When data comes out of a pin the volts should be resting negative, so if you have a male plug and no data is coming out you should measure -9 or -12V or similar.
Sometimes you need to loop back the other pins. Eg if you are using a PC terminal program to talk to a board eg a propeller or picaxe then hypterterminal will not work until it gets a signal to say it can send. You can make sure you tell it to always send by wiring pins 1 4 and 6 together and wiring pins 7 and 8 together. I do this on all plugs (ie female) ones that connect to PCs because it will always work then. Hyperterminal has 3 types of comms - hardware, xon/xoff and none. Select none.
If you join pins 1.4.6 and join pins 7.8 on all plugs, and wire pins 2,3,5 through, it greatly simplifies all the things that can go wrong. The main problem then is wiring a male to a male plug or a female to female, and in that case, just cross over pins 2 and 3.
Here's one of the better sites with lots of pictures.
On Computer (DTE)
pin 2 - RXD
pin 3 - TXD
pin 5 - GND
On Propeller (DCE)
pin 2 - TXD
pin 3 - RXD
pin 5 - GND
So if I want my device to detect when another device is plugged in, I can...? Feed 3.3V in to pin 7 and check for it on pin 8?
Re feeding 3.3V into a pin - is that via a max3232? Because while 3.3V is a valid RS232 voltage, 2.5V isn't and 0V certainly isn't.
Post Edited (Dr_Acula (James Moxham)) : 1/22/2009 6:07:01 AM GMT