kinetis:kinetis_lowputc Fixed parity settings.
Kinetis UART must be placed in 9 bit mode (M=1) with when 8 bit data with parity is required. If left in 8 bit mode (M=0) with parity then D7 of the TX/RX register becomes parity bit. Hence what is called 9-bit or 8-bit Mode Select is a misnomer. 8 bit mode when parity is enabled is realy 7 bit with parity.
This commit is contained in:
parent
f9819e1f5f
commit
b2edfac2dd
1 changed files with 5 additions and 2 deletions
|
|
@ -645,9 +645,12 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||
DEBUGASSERT(parity == 0);
|
||||
}
|
||||
|
||||
/* Check for 9-bit operation */
|
||||
/* Check for 9-bit operation or enter 9 bit mode for 8 bit with parity
|
||||
* see K66 Sub-Family Reference Manual, Rev. 2, May 2015
|
||||
* 59.5.4 Data format
|
||||
*/
|
||||
|
||||
if (nbits == 9)
|
||||
if (nbits == 9 || (nbits == 8 && parity != 0))
|
||||
{
|
||||
regval |= UART_C1_M;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue