Receiving UART data in 9-bit RS-485 mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Receiving UART data in 9-bit RS-485 mode

2,065 Views
ivandrobyshevs1
Contributor II

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."

Labels (2)
Tags (3)
0 Kudos
1 Reply

1,378 Views
b36401
NXP Employee
NXP Employee

Please refer chapter 64.7 "9-bit RS-485 Mode" of i.MX 6Dual/6Quad Applications Processor Reference Manual regarding to 9-bit UART.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos