Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Enabling DTR (pin 4)

The ADC Pi is an Analogue to Digital converter for the Raspberry Pi

01/06/2017

Posted by:
Jason

Jason Avatar

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

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

01/06/2017

Posted by:
andrew

andrew Avatar

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

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

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

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

That should be ok.

05/06/2017

Posted by:
Jason

Jason Avatar

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

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.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout