RS232 hardware handshaking.

Started by onefang, July 03, 2014, 04:36:32 PM

Previous topic - Next topic

onefang

I have received an A13-OLinuXino today to evaluate for a clients project.  An RS232 port with hardware handshaking is required for this project.  Have I missed something, or are all of the RS232 options available for this board entirely missing hardware handshaking?

We could use an USB RS232 adaptor, but I would rather avoid that if we can.  There are two things the hardware handshaking is needed for in this project.  One is the printer, which is a fussy little thing, I've not tried a USB RS232 adaptor for it yet.  Pain in the butt printer, but he selected it before I was involved in the project.  It might do software handshaking, but I REALLY don't want to have to tinker any more with it's fragility to get that to work.  Hopefully using USB wont make it fall to the ground twitching.

The other is not so important, but sometimes the client wants to use the embedded device to field program a PIC chip, and USB RS232 adaptors don't work so well with the PIC programmer we use.  He prefers if he can do so without lugging a laptop around, using the embedded computer for that task.

Plus, this board is being evaluated partly due to the low cost, so keeping costs down by not having to include a USB RS232 adaptor in each device would be good to.  So we would much prefer to have RS232 hardware handshake signals without using an USB adaptor.

Is there maybe some sort of settings that can be done with this FEX thingy that can repurpose some of the UEXT pins to be RS232 hardware handshake pins?  Or some other solution I have missed?

JohnS

You can look at the schematic on Olimex product page and datasheet & Fex guide on there and/or linux-sunxi.org and then see the chip has CTS/RTS.  I've no idea whether Fex etc cover using them as I've never wanted to do that but go for it and let us all know.

John

dave-at-axon

Have a look at the schematic for the A13-REV C and you can see that only UART3 has RTS and CTS but those are used for other functions. As they are used for USB it looks like you are not going to get access to them. Only 1 is brought out to the GPIO-2 connector. The other is internal to the board.

I can't see any RTS and CTS for UART0 or UART1. This is quite normal for a lot of microcontrollers and very few have 5 wire RS232 these days.

Even the A20 that I use only has this on UART2 and 3 of the 8 available.

jmyreen

#3
If I read the A13-SOM512 schematic correctly the UART3 TX, RX and CTS signals are brought out on the GPIO-1 connector, and RTS on the GPIO-3 connector. CTS and RTS are used for USB only if you are using the A13-SOM-WIFI shield. The UART3 TX is hard-wired to a silly LED (LED1), but is also available on GPIO-1, so I assume the pin is able to drive both the LED and a RS-232 buffer. Can somebody at Olimex please confirm this?

Software support is a wholly different matter, and I have no idea if UART3 and the flow control signals are supported in the A13 Linux kernel.

EDIT: sorry, I mixed up the products. I was thinking of the A13-SOM, but this thread is about the A13-OLinuXino.

onefang

#4
According to http://linux-sunxi.org/Fex_Guide#uart_configuration -

"Any of the 8 UART ports can be configured to be either 2 (Only TX/RX) wires, 4 wires (TX, RX, RTS and CTS) or 8 (Full function) ports."

And an example is given -

[uart_para1]
uart_used = 0
uart_port = 1
uart_type = 8
uart_tx = port:PA10<4><1><default><default>
uart_rx = port:PA11<4><1><default><default>
uart_rts = port:PA12<4><1><default><default>
uart_cts = port:PA13<4><1><default><default>
uart_dtr = port:PA14<4><1><default><default>
uart_dsr = port:PA15<4><1><default><default>
uart_dcd = port:PA16<4><1><default><default>
uart_ring = port:PA17<4><1><default><default>


So it's theoretically possible that I could set that up through one of the GPIO connectors.

jmyreen

Quote from: onefang on July 06, 2014, 02:37:44 AM
According to http://linux-sunxi.org/Fex_Guide#uart_configuration -

"Any of the 8 UART ports can be configured to be either 2 (Only TX/RX) wires, 4 wires (TX, RX, RTS and CTS) or 8 (Full function) ports."


On the other hand, according to https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A13-PDFs/A13%20User%20Manual%20-%20v1.2%20(2013-01-08).pdf

the A13 SoC only implements two UARTs: UART1 and UART3. "There are 2 UART controllers: one with TX and RX only, the other with TX, RX, RTS and CTS."

onefang

Quote from: jmyreen on July 06, 2014, 10:04:15 AM
Quote from: onefang on July 06, 2014, 02:37:44 AM
According to http://linux-sunxi.org/Fex_Guide#uart_configuration -

"Any of the 8 UART ports can be configured to be either 2 (Only TX/RX) wires, 4 wires (TX, RX, RTS and CTS) or 8 (Full function) ports."


On the other hand, according to https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A13-PDFs/A13%20User%20Manual%20-%20v1.2%20(2013-01-08).pdf

the A13 SoC only implements two UARTs: UART1 and UART3. "There are 2 UART controllers: one with TX and RX only, the other with TX, RX, RTS and CTS."


According to chapter 19 (Universal Asynchronous Receiver/Transmitter Interface), page 184, of that same document, "Eight modem control lines and a diagnostic loop-back mode are provided."  Later in the same chapter it mentions details of how to deal with those eight modem control lines, including the ones my clients printer needs.  Page 24 has the sentence you quoted.  This board also has UART0, as well as those other two.

Sooooo, some part of the documentation is wrong somewhere.  If no one else has actually tried this, looks like I'm gonna have to get out my soldering iron and experiment.