Use IOMUXC_SetPinMux() function to switch between lpuart and gpio,sometimes serial start bit miss.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Use IOMUXC_SetPinMux() function to switch between lpuart and gpio,sometimes serial start bit miss.

370 次查看
FanXH
Contributor II
GPIO_init();
LPUART2_init();
while(1)
{
    IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_02_GPIO1_IO18, 0U);
    GPIO_WritePinOutput(GPIO1, 18U, 0);
    use_tmr_delay1ms();
    GPIO_WritePinOutput(GPIO1, 18U, 1);
    IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_02_LPUART2_TX, 0U); 
    LPUART_Send(0x55);
}

Sometimes it's normal like this:

normalnormal

But sometimes it's not normal,it should have some high level before start bit

errorerror

标记 (1)
0 项奖励
1 回复

358 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Hope you are well.

It is important to add the pin configuration when you change between LPUART and GPIO.
The time that pin stays in high from GPIO_Write to LPUART_Send is variable, if you want to keep it consistent I suggest you add a small delay between.

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 项奖励