Page 1 of 1

UART Handshaking

PostPosted: Thu May 19, 2011 12:33 pm
by echinyika
How do i configure UART hardware/software handshaking on a Cubesat Kit Development board Rev D?

Re: UART Handshaking

PostPosted: Thu May 19, 2011 1:53 pm
by Andrew
Hardware handshaking requires that you implement a hardware handshake pair (e.g. RTS/CTS) that passes all the way to the host along with Tx and Rx.

On the Dev Board, the DB-9 only passes Tx & Rx (and GND), and connects the various hardware flow control signals in a manner such that flow is always enabled. If you want to run hardware flow control over e.g. a null-modem cable, you'll need to put in your own MAX3221-type chips, to convert Rx, Tx, CTS and RTS all to RS-232-level signals, provide a connector, etc. This could be done on a user module that plugs into the CSK Bus.

In order to do hardware flow control to the USB and/or the MHX, you need to fit R2 & R6 (USB) and R10 & R75 (MHX) so that the flow control signals can reach the USB and/or MHX from the flight processor. Then, you have to explicitly control those I/O pins in software, tied to the UART code.

Currently, the Pumpkin UART code does not support hardware or softare flow control. You'd have to extend it to do so.

Software handshaking requires that the receiver send an XOFF character before it is overrun, and that the transmitter stop transmitting when it gets the XOFF character. XON re-enables the flow.

Again, you'd have to write software to emit the required XON/XOFF characters. But no hardware is required beyond the pre-existing Tx and Rx lines.

In HyperTerminal, you can select hardware or software handshaking as property of the connection.

See e.g. http://www.lammertbies.nl/comm/info/RS-232_flow_control.html for more general info.