lpuart idle line detection takes up to 2.3ms

Showing results for 
Search instead for 
Did you mean: 

lpuart idle line detection takes up to 2.3ms

Contributor IV


I am using an imx RT1020 evk board, and just found out that it takes rather long to get an idle line interrupt.

I am using LPUART3 with DMA (in 9bits mode).


In the RM I read 



So the peripheral waits for 1 full byte to be all 1s, including start and stop bit. But that would be a bit over 1ms. Right? 


So why is the idle line interrupt only set after 2.3ms? 

Is there a way to decrease this time?



0 Kudos
2 Replies

NXP TechSupport
NXP TechSupport

Hi @bp1979 

I hope that you are doing well!

The first things that come into my mind are consider :  code overhead ;  the speed  of current clock provided to the  UART peripheral ;  and the desired baud rate  . Are you taking as starting point  any of our SDK demo examples? I want to get more context on the settings that you are performing .

All the best 


0 Kudos

Contributor IV

Hi @diego_charles 

Code overhead is not the case. I am simply toggling a pin in the interrupt handler so that I can plot the entry of the interrupt handler in my logic analyzer.

    void LPUART3_IRQHandler(void)
        uint32_t status            = LPUART_GetStatusFlags(LPUART3);
        uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART3);

        if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) &&
            (0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts)))
			GPIO1->DR ^= (1UL << 23);
			GPIO1->DR ^= (1UL << 23);


			GPIO1->DR ^= (1UL << 23);
			GPIO1->DR ^= (1UL << 23);


In the image I posted in my first message you can see that after the last character is received on rx (yellow), it takes up to 2.3ms to toggle the pin (blue). 

Uart initialization:

        lpuart_config_t config;
        config.rxIdleType   = kLPUART_IdleTypeStopBit;
        config.rxIdleConfig = kLPUART_IdleCharacter2;
        config.baudRate_Bps = _baudRate; // 9600 for LPUART3
        config.enableRx = _canRead; // true for LPUART3
        config.enableTx = true;

        // Initialize the uart with default config and both rx and tx enabled
            _instance, // LPUART3
            BOARD_DebugConsoleSrcFreq()); // freq = 80000000


I am seeing the behavior in my real application. I have no doubt it will behave identical in SDK examples. 

The idle line flag seem to wait until 2 (9bit) bytes are read as "all ones". I would expect it would only wait for 1 byte.

Any ideas why it behaves this way? 

Any idea how to influence that behavior?

Many thanks in advance!



0 Kudos