RS485 support
Posted: Sun Jan 04, 2015 5:01 am
Methinks a handy feature would be RS485 support for the uart. This would most likely be an option that would nominate a gpio to act as the rx/tx select for the RS485 transceiver (like a max485 et al). Usually a logic '1' is tx.
Depending on the actual part implementation it could be simple or a little trickier. When there is data in the queue to send, the gpio bit is set high, then the data sent. When there is no more data to send and the uart has actually clocked out all the bits, then the gpio is set low. Hopefully the uart has a tx complete bit/interrupt rather than just a tx buffer empty bit/interrupt - otherwise the timer needs to be used to predict the end of the last byte of transmission based on the baud rate.
Depending on the actual part implementation it could be simple or a little trickier. When there is data in the queue to send, the gpio bit is set high, then the data sent. When there is no more data to send and the uart has actually clocked out all the bits, then the gpio is set low. Hopefully the uart has a tx complete bit/interrupt rather than just a tx buffer empty bit/interrupt - otherwise the timer needs to be used to predict the end of the last byte of transmission based on the baud rate.