About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Enabling DTR (pin 4)

1014 Views - Created 01/06/2017

01/06/2017

Posted by:
Jason

Users Avatar

Users Twitter  Users 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?

Cheers

Jason.

01/06/2017

Posted by:
Jason

Users Avatar

Users Twitter  Users Website  

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

01/06/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users 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.Post image 

AB Electronics UK Tech Support

05/06/2017

Posted by:
Jason

Users Avatar

Users Twitter  Users 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.

Cheers

Jason.

05/06/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users 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 on the development area on the right side of the board.

AB Electronics UK Tech Support

05/06/2017

Posted by:
Jason

Users Avatar

Users Twitter  Users 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

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

That should be ok.

AB Electronics UK Tech Support

05/06/2017

Posted by:
Jason

Users Avatar

Users Twitter  Users 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 time

Jason.

05/06/2017

Posted by:
Jason

Users Avatar

Users Twitter  Users 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.

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.