Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Enabling DTR (pin 4)

3058 Views - Created 01/06/2017

01/06/2017

Posted by:
Jason

Jason Avatar

Jason Twitter  Jason Website  

Hi There,I'm trying to receive data from a device that's particularly fussy about the confuguration of hardware flow control over its serial port. Specifically, the Data Terminal Ready pin (4) on the serial port must be set for it to send data.It doesn't look like I can do this in software (correct?) so is there a way to set that pin appropriately using a hardware mod on the Serial Pi board? It looks like I might be after (say) -5v on pin 4.Any ideas?CheersJason.

01/06/2017

Posted by:
Jason

Jason Avatar

Jason Twitter  Jason Website  

Hmm, look like a positive voltage (5v) mught do it.

01/06/2017

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hi Jason

On the Serial Pi Plus, there are two spare channels on the MAX3232 converter chip which are connected to the four solder pads next to the chip. One channel is an input and the other is an output so you should be able to connect the spare output between a GPIO pin and pin 4 on the DB9 connector.

You will need to connect pin 14 on the MAX3232 to pin 4 on the DB9 connector and pin 11 on the MAX3232 to a GPIO pin. You can then use the GPIO pin to switch the output between +5V and -5V which should hopefully work for the DTR input on your serial device.

The photo below shows which pins you will need to connect. It may be worth checking the output of pin 4 with a multimeter to make sure it is working correctly before connecting your device to the port.forum image

05/06/2017

Posted by:
Jason

Jason Avatar

Jason Twitter  Jason Website  

Hi Andrew,Thanks for that, great solution. I'll give it a try today.Can I use this technique to control the CTS pin too? The device I'm working with needs that at -5V before it'll speak to me.CheersJason.

05/06/2017

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

If the CTS pin is operating in the other direction to the DTR pin then it should work as the MAX3232 only has one free channel in each direction.

If you need more than one channel going in any direction then you could use a second MAX3232 chip in a DIP package and put it in the development area on the right side of the board.

05/06/2017

Posted by:
Jason

Jason Avatar

Jason Twitter  Jason Website  

The device I'm working with seems to need DTR at +5V and CTS at -5V. I thought I might just wire DTR (4 pin) to one of the +5V pins in the development area and then use your (nicer) solution to have a GPIO pin and MAX3232 control the CTS pin (-5V.) Sound OK?

05/06/2017

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

That should be ok.

05/06/2017

Posted by:
Jason

Jason Avatar

Jason Twitter  Jason Website  

OK, I'll give it a try.Actually, it's DTR pin 7 and RTS pin 7 (rather than CTS) that I need to control.Thanks for your timeJason.

05/06/2017

Posted by:
Jason

Jason Avatar

Jason Twitter  Jason Website  

I've wired it up and it works well. I can now control the RTS pin on the serial port, (+ or - 5V) using a GPIO pin (in Windows IoT Core.) Very nice.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.