Previously, LPC800 used peri_driver, which can be applied to 9bit usart.
But now the driver created by sdk builder can't be applied.
It's too complicated and resource-intensive for small MCUs.
The sdk should keep lower-level drivers, like the STM's LL driver.
Hi @Alex_Tsai
May I ask which chip from the LP800 series you are using.
Sorry, to use 9-bit USART on LPC800 with the NXP SDK, you’ll need to modify the provided driver or directly manipulate the USART peripheral registers, as the current SDK-generated drivers may not natively support 9-bit mode.
BR
Harry
The chip I'm currently using is LPC824M20JDH20.
Hi @Alex_Tsai
I checked the LPC82x User manual.
The USARTs support the 9 data bits.
But this demo is not included in the SDK.
You’ll need to modify the provided driver.
You can refer to the lpc55s16 9 bit example.
BR
Harry
The fundamental problem is that the fsl_usart of LPC800 does not suitable.
Many code modifications may be required, such as the following
In USART_TransferHandleIRQ() function
uint8_t tmpdata = (uint8_t)base->RXDAT;
The data type is limited to 8 bits.
I'm not sure which version of the SDK you are using.
There is USART_Enable9bitMode() in your posting, but not in the SDK v2.16.
I also cann't see the USART_TransferSendNonBlocking() function in your posting.
USART_TransferSendNonBlocking() function it will start interrupt, but the ISR have bug, the type will be limited to 8bit.
Refer to fsl_usart.c line.896.
Hi @Alex_Tsai
Sorry, the code is lpc55s16 Usart 9bit interrupt transfer demo.
The lpc824 doesn't support the 9bit usart demo.
So I suggest you can refer to lpc55s16 Usart 9bit interrupt transfer demo and modify the lpc824 usart demo.
BR
Harry
I don't think it's a problem with the demo code, but NXP needs to fix the fsl_uart.c bug.