usart dynamic length

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

usart dynamic length

2,006 Views
sachinn434
Contributor I

HI all,

i am using a lpc54so18 nxp controller i want usart data transmission with dynamic length how achieve this please help me to solve this and thank you

0 Kudos
Reply
1 Reply

1,957 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

For your current software architecture, pls refer to the example in SDK package:

......\LPC_SDK_MCUExpresso\SDK_2_12_0_LPCXpresso54S018 (1)\boards\lpcxpresso54s018\driver_examples\usart\interrupt_transfer

 

The interrupt transfer example uses interrupt mechanism, for each character, it uses interrupt mode to transfer. In the ISR, the code will check if the predefined size of characters have been transferred, if the predefined size of characters have been completed, the callback function is called, you can write the callback function, set a flag or whatever so that the main can poll the flag to know if the transfer is over or not. But you have to call USART_TransferCreateHandle(DEMO_USART, &g_uartHandle, USART_UserCallback, NULL); so that you can install the callback function.

Hope it can help you

BR

XiangJun Rong

 

 

 

0 Kudos
Reply