AnsweredAssumed Answered

[P2020] Difference between DUART_UIIRn and DUART_ULSR

Question asked by Clément Changeur on Jan 6, 2017
Latest reply on Jan 6, 2017 by alexander.yakovlev

Hi,

 

I'm currently using the P2020 and I have one question about DUART.

When I used the Transmitter Holding Register (IID[3-0] = 0b0010) with the ETHREI interrupt my code work correctly and write the string on my screen. But when I do the same thing but with Line Status Registers (DUART_ULSRn), some characters weren’t show (but step by step it work well).

Here is my code :

 

// pooling on Interrupt ID Registers ( ETHREI interrupt enable )

while(*pString != 0)

{

     *pDUART_UTHR1 = *pString++;

     // polling untill Third priority level is set : IID[3-0] = 0b0010 in Interrupt ID Registers

     // ( ie Transmitter holding register is empty )

     do

     {

           tmpStatus = *pDUART_UIIR1;

     }while((tmpStatus & 0x0F) != IIR_IPRI3);

}

 

// pooling on Line Status Register

while(*pString != 0)

{

     *pDUART_UTHR1 = *pString++;

     // polling until THRE is equal to 1

     // ( ie Transmitter holding register empty)

     do

     {

           tmpStatus = *pDUART_ULSR1;

     }while((tmpStatus & LSR_THRE) == 0);

}

Best Regards,

Clément

Outcomes