a5sk4s
Posts: 9
Joined: Fri Sep 26, 2014 11:09 pm

Reading serial data from external device (rs232 db9 port)?

Fri Sep 26, 2014 11:38 pm

The plan is to use a Raspberry Pi B+ and an USB RS232 converter (e.g., http://www.amazon.com/TRENDnet-RS-232-S ... +converter)

After some research there are a few open questions that I hope to get answered on this forum:

(1) Is the chipset of the converter relevant? Which chipset is recommended?
(2) Do I need a driver? Is a generic Linux driver sufficient? Where would I get drivers otherwise?
(3) Any other pitfalls that I should watch for?

Thanks in advance for any recommendations.

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Reading serial data from external device (rs232 db9 port

Sat Sep 27, 2014 1:50 pm

look here:
http://elinux.org/RPi_VerifiedPeriphera ... 9_adapters

If you want a solution with no chipset / driver worries then use a TTL to RS232 converter with MAX3232 chip (not MAX323). Connects to GPIO - TX & RX & GND & 3V3.
Something like this:
http://www.ebay.com/itm/MAX3232-RS232-S ... 2590d5490f
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Reading serial data from external device (rs232 db9 port

Sat Sep 27, 2014 2:41 pm

Most USB / Serial adapters will work with Linux and the drivers are built into the kernel, BUT the USB on the Pi sometimes has issues with said devices. They are invariably USB 1.1 devices (low speed) and the Pi's USB sometimes has issues with such. (Well, that's got Jamesh back on my case.....)

The aforementioned GPIO solution would be the way I'd go.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

a5sk4s
Posts: 9
Joined: Fri Sep 26, 2014 11:09 pm

Re: Reading serial data from external device (rs232 db9 port

Mon Sep 29, 2014 8:48 pm

Thanks - this is very helpful.

One more question. In case I need a null modem to connect to the device - I know very little about the nature of the rs232 connector on the external device, except that it is female - can I adjust this at the gpio by switching rx/tx or do I need to have an actual null modem between the max3232 and the device? Is there a change of damaging the board by switching rx/tx at the gpio?

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Reading serial data from external device (rs232 db9 port

Mon Sep 29, 2014 10:38 pm

If NULL modem is needed then it must be at the RS232 connector (or RS232 cable).
Swapping the TX or RX, right or wrong, does not also change the driver/ receiver gate it's connected to into an input or into an output. Look at a data sheet and it will make sense.
Momentary connecting TX or RX (GPIO) wrong won't hurt but be sure you don't connect an RS232 driver output to GPIO ever.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

W. H. Heydt
Posts: 12648
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Reading serial data from external device (rs232 db9 port

Tue Sep 30, 2014 1:52 am

A "null modem" is just a cross-over wiring to turn a "data communications device" (DCE) in a "data terminal device" (DTE). It is entirely passive. Any decent book on RS-232C will show you the pins needed to do this.

FYI...at a minimum, RS-232C need TX, RX, and signal ground...and that's IT. Sometimes you are better off without anything else. If you are having trouble, it may be necessary to eliminate frame ground. (I used--30 years ago--to wire my own RS-232 cables.)

W. H. Heydt
Posts: 12648
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Reading serial data from external device (rs232 db9 port

Tue Sep 30, 2014 2:41 am

Regarding the thread title... There is no such thing as a "DB-9" connector. "DB" applies to the DB-25. A 9-pin D-shell connector is a DE-9. (The others in the series are the DA-15, DC-37, and DD-50.)

Return to “Beginners”