10 years, 1 month ago.

Can we add a way to use a gpios to control rs485 transceiver direction with MODSERIAL

Hi Erik

Can we add a way to use a gpio (or a complimentary pair) to control rs485 transceiver direction with MODSERIAL

It can be done by manually setting "Tx mode pin" before putting anything in the buffer. Then using a TxEmpty callback, which blocks on txIsBusy finally clearing "Tx mode pin"

This would probably be better done by the class it's self doing something like psuedo code

if (! txIsBusy) callback("TxPreStart")

Then another callback for TxGoneIdle

This would make application code easier to read, and prevent bugs where the initial set of the mode pin is missed etc.

Using callbacks for set and clear makes a lot of sense, as in some applications it may only be one pin, in others 2. Then in the case of the board I am currently working with it is a sequence of pins to set or clear a bit on an external latch.

Question relating to:

Be the first to answer this question.