Shop OBEX P1 Docs P2 Docs Learn Events
Wiring up a serial port — Parallax Forums

Wiring up a serial port

AltarCrystalAltarCrystal Posts: 10
edited 2008-05-27 15:52 in BASIC Stamp
Sorry for all these dumb questions lately, but here's a quick one.

While I was designing my board, I for some reason thought my computers had female serial ports, and the serial cable I ordered was a M/F. So, I bought a male serial port and began wiring it up. However, just out of curiosity, I decided to double check my computers, and of course, they're both male.

Now, if I use a null modem adapter (F/F), will there's a problem? I remember reading SOMETHING about using a null modem cord/gender adapter, but I can't for the life of me remember what it was about

Comments

  • pwillardpwillard Posts: 321
    edited 2008-05-20 02:43
    Gender Changers will change the plug gender but not the pin layout

    Null Modem will flip the Transmit & Receive pins so two pieces of Data Terminal Equipment (DTE) can talk to each other. Used with two computers talking to each other.· DTE is normally a·MALE·connector. DTE is considered to be the ACTIVE end of a connection.

    Modems, for example, ·are Data Communications Equipment (DCE). DCE connectors are normally female.· By design, DTE equipment is supposed to talk to DCE equipment with no special wiring.· Serial Cables are therefore normally Male to Female straight-though·cables because the·DCE expects·to receive on the·transmit wire·and transmit on the receive wire·with respect to the DTE end of the connection.

    So, to wrap this up... when a DTE (A PC) ·wants to talk to another DTE (A microcontroller)... each device expects to be talking to a DCE device. A NULL MODEM cable emulates a DCE device between the two ends·by crossing over the correct pins.

    Male· DTE· RECV on·PIN 2,· XMIT on·PIN 3, GND on PIN 5

    Female DCE XMIT·PIN 2, RECV on·PIN 3, GND on PIN 5


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    There's nothing like a new idea and a warm soldering iron.
  • AltarCrystalAltarCrystal Posts: 10
    edited 2008-05-20 03:32
    What I found weird was the numbering on the schematic I found to wire up the serial port and the numbering on the serial port it self were reversed. I had originally gone off the schematics, as I didn't know this about serial communication, however, since it's wired like this, I'd need a null modem adapter, right? (Sorry, it's been a long day for me, summer classes started today, twice the length, quadruple the work sad.gif). If so, that's good since that's all I saw last time I was at Radio Shack. I think those guys are tired of seeing me :P
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-05-20 15:24
    If you went by the BOE, the BOE's serial port is wired as a "DCE" device -- like a modem. So, to talk to the BOE board (or a port wired like the BOE board) from a PC serial port, you'll need a STRAIGHT THROUGH (ie NOT "null modem") RS-232 cable.

    You say "my computers" -- so if your second computer is a PC, both ports are "DTE", so you WILL need a 'null-modem' in that case (in fact, a Female-to-Female null-modem cable), to talk from one PC to another PC.
  • AltarCrystalAltarCrystal Posts: 10
    edited 2008-05-20 15:35
    Erm, sorry, I should have been more clear. When I said "my computers", I ment I checked all the computers I own that have serial ports on them, not that I was asking this to connecttwo PCs.

    But thanks! I should have this up and running soon [noparse]:D[/noparse]
  • RatatoskrRatatoskr Posts: 12
    edited 2008-05-27 15:21
    Apologies for necroing this, but to clarify for my purposes:

    I have computer with two serial ports available, one male and one female. I need to hook up two Stamps to it and have them send data.

    Am I correct that the normal m-f cable will work to the female port on the computer, but I'll need a "null modem" f-f cable rather than a f-f adapter to properly send data to the male port on the computer?
  • FranklinFranklin Posts: 4,747
    edited 2008-05-27 15:25
    Are you sure they are both serial ports? I've not seen a frmale serial port on a PC before.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • RatatoskrRatatoskr Posts: 12
    edited 2008-05-27 15:28
    Curses, you're right. That's what I get for not looking closely enough.

    Now I have to figure out how to do it with USBs, then... great, since Java doesn't really support them. Thanks, though, saved me some time.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-05-27 15:46
    Hmm. PC's do have 'female' HDB-15's VGA (High-Density DB-15 has more pins but is the size of a 'normal' DB-9), but of course they won't work for RS-232.

    And I believe the CGA standard uses a female DB-9 connector -- again, useless for RS-232.

    So the "standard" PC RS-232 connector is a DB-9 male, wired as "DTE". Yes, if you haven't got one of those, you'll need a USB to RS-232 converter like Keyspan or FTDI. Which will have a DB-9 male on it.
  • RatatoskrRatatoskr Posts: 12
    edited 2008-05-27 15:52
    Yeah, what I'm running into now is the total lack of Sun support for Java USB I/O. There are a few systems available for Linux, not that that helps me much...

    So I guess it's gonna be back to serial comm. and dropping the second Stamp. Java for that won't be easy either, you'd think it wouldn't kill Sun to support hardware decently.
Sign In or Register to comment.