2

I have a recording device with a 9 pin dsub connector for control.
Pin 1 == Ground Pin 2 == TxD Pin 3 == RxD Pin 5 == S. Ground 4&6-9 == NC

I'd like to use the 40pin header on a raspberry pi B+ to send commands to this device.

What is the cleanest way to connect these pins to a DSub connector?

A cable with a male DE-9 connector on one end and wires connected to an IDC on the other is what I have in mind but I'm not sure how well the wire gauges match or where to order the parts.

Any advice?

3 Answers 3

2

You most likely want an interface based on the MAX3232, the 3.3 V version of the old MAX232 chip. Several ways to do this:

  1. Most Raspberry Pi specific are HATs such as the AB Electronics Serial Pi Plus. It attaches to the GPIO header directly.
  2. Slightly less specific, but considerably cheaper are interfaces like this RS232 to TTL adapter. These use generic jumper wires rather than a dedicated GPIO header.
  3. If you want to see what all is going into your serial interface, this article breadboards the circuit out: Raspberry Pi Serial Console With MAX3232CPE. MAX?232-style chips use an annoying (to construct, but essential for their charge pump's operation) array of capacitors, so it's usually cheaper to get someone else to put them on a board for you.

You can never guarantee the voltage levels that come out of an RS-232 port. Unless you've got the full technical spec, assume ±12 V.

2
  • Never did get this to work, I used a MAX3232 chip to adjust voltage levels but didn't get any response from the device. Thanks anyway.
    – Dave
    Jan 26, 2015 at 18:15
  • Did you set up the serial port correctly? I.e. Baud rate, number of data bits (7 or 8), parity (Odd, Even or None), stop bits (1 or 2)? If the two devices on either end don't agree on these you won't get much response!
    – SlySven
    Dec 4, 2015 at 16:14
1

You need to determine the electrical characteristics of the device you want to talk with.

If it's a D-type connector it may be an RS232 type connection, typically signalling with +/- 12 volts or more. You should never connect a device with more than 3.3V or less than 0V to a Pi gpio.

0

Despite the comment by @joan above, most RS232 actually operate as 5V. If you look at Wiki you will see articles describing this. It is however NOT advisable to connect direct to GPIO which is 3.3V and has NO protection.

It is possible to build a simple buffer to do the job, but it is probably easier to purchase one of the cheap adaptors such as in https://raspberrypi.stackexchange.com/a/15870/8697 If you search this site you will find lots of answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.