Select the transmit output pin by writing the appropriate value to the RxyPPS
register.
Enable the asynchronous serial port by clearing the SYNC bit and setting the SPEN bit.
If 9-bit transmission is desired, set the TX9
control bit. That will indicate that the eight Least Significant data bits are an
address when the receiver is set for address detection.
Enable the transmission by setting the TXEN control bit. This will cause the TXxIF interrupt bit to be set.
If interrupts are desired, set the TXxIE interrupt enable bit of
the PIEx register.
An interrupt will occur immediately provided that the GIE and
PEIE bits of the INTCON register are also set.
If 9-bit transmission is selected, the ninth bit will be loaded
into the TX9D data bit.
Load 8-bit data into the TXxREG
register. This will start the transmission.
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.