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.

373件の閲覧回数
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 返信

361件の閲覧回数
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 件の賞賛