For example, to switch the parity setting from odd to even numbers from the 3rd byte, can I change the parity (UARTCON bit 2 = 0) to even in a transmit interrupt as the 2nd byte of data is transferred from the transmit buffer register to the transmit shift register? [2005/03/01]
If you switch the parity after the start bit is output, the parity bit of the data being output at the time will not be affected, and the change will apply from the next output parity bit.
In the above example, because the start bit of the 2nd byte has already been output at the time of the 2nd byte transmit buffer empty interrupt, the parity switch will be reflected from the 3rd byte.
The parity switch must occur before the start bit of the 3rd byte is output. Care is required since the timing of the parity switch may vary depending on the contents of the transmit buffer empty interrupt routine as well as other interrupts. (#104799)