5

In my design I am using RS232 with DB9 connector in my PCB. idea is to log the data in PC and for programming via serial. Which connector I need to use in my board , it is male DB9 or female DB9. enter image description here

Q1) What connector I need to use in my board male or female Q2) If I use male connector in my board then Pin TO1 will need to connect to pin 2 or pin 3.

4Mhz Crystal
  • 53
  • 1
  • 6
  • What cable do you intend to use? It's your design, right? – Eugene Sh. Jun 17 '16 at 17:00
  • Yes, I am taking this reference design in my board, confuse what type connector to use male or female in my board, also confuse TO1 need to connect to pin 2 or 3 of DB9 – 4Mhz Crystal Jun 17 '16 at 17:02
  • 3
    You didn't get what I mean... It is *your* design, *your* system, so you should know which signal is going where and how you interconnect the components. You might have different serial cables which are totally changing the answer to the question you've asked. They might be male or female on the devices end. And their pinouts will be different as well. – Eugene Sh. Jun 17 '16 at 17:04
  • I will connect this on board DB9 (male or female) to my PC via some cble like male to female , male to male or female to female depend on what i use. – 4Mhz Crystal Jun 17 '16 at 17:09
  • Something to take into consideration as well is if you're supplying power from a connector, exposed pins present a risk (unless protected) for external object(s) to create a short-circuit. – Krunal Desai Jun 17 '16 at 21:13

2 Answers2

18

The original plan when the D-sub connector family was introduced was that equipment would always have female connectors and cables would always have male connectors. The idea was that pins are easily damaged, and it's usually easier to replace a cable than to replace a connector on a piece of equipment. Designations such as "DCE" (data communications equipment) and "DTE" (data terminal equipment) would indicate whether signals such as TXD and RXD were inputs or outputs on the equipment.

However, when the IBM PC came along, they decided to use D-sub connectors for a number of different purposes, so in order to reduce confusion for users, they used a female connector for the printer port and a male connector for the COM (UART) port.

As a result, it has become common to use a male connector on DTE and a female connector on DCE. If you want to connect your device to a PC, you should put a female connector on it so that you can use a straight-through male-to-female cable to plug it in.

And just to be pedantic, the correct designation is "DE-9". "DB" refers to the larger shell used for the 25-pin connector.

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
2

Use Db9 female connector in your board, since PC have DB9 male connector , or if your PC dont have DB9 then you may need to used RS232 to USB converter cable, which has male DB9 port.

Bharav
  • 722
  • 2
  • 7
  • 21
  • It doesn't mean anything. He might have a null-modem cable to interconnect the system.. – Eugene Sh. Jun 17 '16 at 17:25
  • He already mentioned that he need to connect his PC to log the data or for programming only. – Bharav Jun 17 '16 at 17:27
  • So? It can be done very well through a null-modem cable. – Eugene Sh. Jun 17 '16 at 17:27
  • why use a cross over cable( null modem cable), when straight cable can do this job. Also using DB female in PCB does not change the world. – Bharav Jun 17 '16 at 17:33
  • *why use a cross over cable*: Because it's another common type of cables that might be available to the OP? – Eugene Sh. Jun 17 '16 at 17:35
  • ya its common but more costly than straight cable, if the requirement is clear that he need only PC interface then he must use DB9 female to be cost effective. – Bharav Jun 17 '16 at 17:38
  • Really? I don't see a reason for the price difference.. Same number of conductors, similar connectors. Anyway, I believe the OP should consider different options depending on his system-wide view. – Eugene Sh. Jun 17 '16 at 17:41
  • 3
    IMO the usb-serial cable argument is the best: make the board so it can connect directly to a usb-serial cable. That means DB9F on the board. Next step: if you want to extend such a connection, you need a straight M-F cable, and that is also what you want between a PC and the board. So IMO DB9F on the board wins hands down for this situation. (For a 'master' board things would be different.) – Wouter van Ooijen Jun 17 '16 at 17:46