Hi Robin,
Please bitCountPerChar to kLpsci9BitsPerChar, the configuration code should like this:
lpsci_user_config_t lpsciConfig = {
#if defined(KL02Z4_SERIES)
.clockSource = kClockLpsciSrcFll,
#else
.clockSource = kClockLpsciSrcPllFllSel,
#endif
.bitCountPerChar = kLpsci9BitsPerChar,
.parityMode = kLpsciParityEven,
.stopBitCount = kLpsciOneStopBit,
.baudRate = BOARD_DEBUG_UART_BAUD
};
Then test it again, your PC will receive the correct data.
Reason: if you enable the parity mode, and still select 8-bit Mode, because the parity still one bit, then the data in the uart wave will be 7 bit data+1 bit parity.
Anyway, when you want to use the parity mode, please select 9 bits mode.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------