35.2.3.2 Address Mode Receive
The UART receiver is enabled for asynchronous address operation by configuring the following control bits:
- RXEN = 1
- MODE = 0100
- UxBRG = desired baud rate
- BRGS = desired baud rate multiplier
- RXPPS = code for desired input pin
- Input pin ANSEL bit = 0
- UxP2L = receiver address
- UxP3L = address mask
- ON = 1
In Address mode, no data will be transferred to the input FIFO until a valid address is received. This is the default state. Any of the following conditions will cause the UART to revert to the default state:
- ON =
0
- RXEN =
0
- Received address does not match
When a character with the 9th bit set is received, the Least Significant eight bits of that character will be qualified by the values in the UxP2L and UxP3L registers.
The byte is XORed with UxP2L then ANDed with UxP3L. A match occurs when the result is 0h, in which case, the unaltered received character is stored in the receive FIFO, thereby setting the UxRXIF Interrupt bit. The 9th bit is stored in the corresponding PERIF bit, identifying this byte as an address.
An address match also enables the receiver for all data such that all subsequent characters without the 9th bit set will be stored in the receive FIFO.
When the 9th bit is set and a match does not occur, the character is not stored in the receive FIFO and all subsequent data is ignored.
The UxP3L register mask allows a range of addresses to be accepted. Software can then determine the sub-address of the range by processing the received address character.