AnsweredAssumed Answered

Receiving UART data in 9-bit RS-485 mode

Question asked by Ivan Drobyshevskyi on Mar 13, 2017
Latest reply on Mar 13, 2017 by Victor Linnik

Do I understand correctly, that if 9-bit RS-485 mode is enabled, it's only possible to receive frames where address byte is the first one?


It looks so since this mode is enabled via UMCR[0] bit, but:

- if UMCR[1] is 0, "The receiver ignores all data frames (9 th bit = 0) until an address frame is received (9 th bit = 1)."

- if UMCR[1] is 1, "If the received byte is a data or an address byte that does not match the programmed SLADDR character, the receiver will discard these data."


Either way, if first byte received doesn't have 9-th bit set, it apparently will be ignored.


I'm asking since in MDB protocol used in vending machines, only master sends address as a first byte to establish a "session", and subsequent messages don't have address byte at all. With the exception of the problem above, this mode looks perfect for handling MDB protocol, so I'd like to make sure it really can't be used.


On a related note, is there some underlying assumption that master is supposed to only send data, and slave is supposed to only receive data. The following quote might vaguely imply this, but I'm not sure.

"UCR1 = 0x2001 when UART as a master ,
or UCR1 = 0x0201 (or 0x0101) when UART as a slave.
Enable TRDY interrupt when UART as a master, enable RRDY interrupt or DMA
request when UART as a slave."