schmadde
Posts: 10
Joined: Thu Aug 28, 2014 4:00 pm

RS232 TTL level shifter with DTE Port?

Fri Oct 31, 2014 10:21 am

I am using my RPi to monitor and control my central heating boiler via RS232. I had bad luck with USB to serial converters so I would like to use the builtin UART of the Raspberry Pi (BTW: is there really only one available?).

For this to work I need a TTL level shifter. I once bought one on ebay for less than 5€ - but it is a DCE connection. My boiler also has a DCE, so I need DTE on my RPi. All others I have found also are only DCE (i.e. the raspberry is the device to be controlled by another host). I would like to avoid having to build such a circuit myself if there is one readily available (I know, its only a MAX232 and a few parts but I cannot print PCBs and I don't like dangling cables) and also I would not like to combine Null modem cables with 2 gender changers.

Does anybody know of a ready made level shifter with DTE (male) connector? I would have assumed this is required quite often, since there are still a lot of devices with RS232 around and controlling other devices is a standard use case of the Raspberry Pi.

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RS232 TTL level shifter with DTE Port?

Fri Oct 31, 2014 12:30 pm

Isn't the term DTE/DCE pretty meaningless if you are breaking the wires out. I thought it was a wiring convention.

The Pi's RXD expects 0-3V3. Anything outside that range will eventually damage the gpio. Similarly TXD pumps out 0 or 3V3.

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

Re: RS232 TTL level shifter with DTE Port?

Fri Oct 31, 2014 1:48 pm

For the TTL to RS232 adapter you MUST get one that has a MAX3232 (not MAX232) chip and power to the MAX3232 MUST be 3V3 (not 5V).

For DTE/DCE, normally when conversion is needed you use a readily available 'gender changer' and probably a NULL modem adapter.

Edit: Sorry I did not read your post carefully.
You would probably have to make your own cables if you don't want to use adapters. Many years ago I used the Serial (DE9) to CAT5 (RJ45) adapters which could be custom wired for the crossover if needed. Don't know if they are still available?
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

schmadde
Posts: 10
Joined: Thu Aug 28, 2014 4:00 pm

Re: RS232 TTL level shifter with DTE Port?

Sat Nov 01, 2014 2:33 am

joan wrote:Isn't the term DTE/DCE pretty meaningless if you are breaking the wires out. I thought it was a wiring convention.
Sure, but I would like to connect the device directly to the db9 connector on the level shifter. I could swap tx and rx cables, but gnd and vcc would still be at the wrong pins.

So it looks like I need to build a custom cable. No big deal but i am amazed that there are a hundred gazillion of different level shifter boards on ebay and all are dce. I would have assumed that the other way round is needed more frequently.

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

Re: RS232 TTL level shifter with DTE Port?

Sun Nov 02, 2014 2:56 pm

Here are Serial adapters that can be configured. Just use standard Cat5 cables between

DB9 FM:
http://www.showmecables.com/product/DB9 ... ?link=YMAL

DB9 M:
http://www.showmecables.com/product/DB9 ... ?link=YMAL

Also there are plenty of TTL adapters on ebay with either Male or Female DB9 but don't know if NULL adapter would be needed?

Male:
http://www.ebay.com/sch/i.html?_from=R4 ... e&_sacat=0

Female:
http://www.ebay.com/sch/i.html?_odkw=ma ... e&_sacat=0
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

schmadde
Posts: 10
Joined: Thu Aug 28, 2014 4:00 pm

Re: RS232 TTL level shifter with DTE Port?

Mon Nov 03, 2014 9:34 am

Hey thanks for the links. I wonder why I didn't find those on ebay since I thought I had the same search pattern. The configurable DB9<->RJ45 adapters also look fine.

Return to “Interfacing (DSI, CSI, I2C, etc.)”