UART Rx status checking

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dafa_1669371
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

Hello 

   

i'm using cy8ckit4245-049 transmitting over uart 

   

i can send using the api UART_WriteTxData also receive using UART_ReadRxData() it works good 

   

but i can't use the read status when i check it never go into the loop

   

i don't know why

   

without the if condition it works good 

   

char status,display; 

   

 for(;;)
    {
        status= UART_ReadRxStatus();
        if(status&=UART_RX_STS_FIFO_NOTEMPTY)

   

// if( UART_RX_STS_FIFO_NOTEMPTY)
        {
          display=UART_ReadRxData();
          LCD_PutChar(display);
         }
    }

0 Likes
1 Solution
dafa_1669371
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

it works just fine now 
it was a bad  hardware connection on the bread board but the code is correct 
thank you 

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

By any chance: did you configure the UART to a bigger larger than 4 bytes? Then the internal interrupt handling probably reads the data before you do, clearing that flag.

0 Likes
dafa_1669371
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

it works just fine now 
it was a bad  hardware connection on the bread board but the code is correct 
thank you 

0 Likes