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

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

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

770 Views
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

Tags (1)
0 Kudos
Reply
1 Reply

758 Views
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 Kudos
Reply