UART - how to read 0 (zero)

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

cross mob
Anonymous
Not applicable
    hi...   
   
    I want to read ZERO '0' on the UART receive pin.   
   
    But it giving a ststus of error or no data in the buffer, when I use the functions --  UART_GetChar() and UART_Read _Tx_Data().   
   
    So please help how to read the value '0' on the UART...   
   
        
   
        
   
    thankyou.   
0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Use UART_GetRxStatus() and test for a byte already received and read it with UART_ReadRxData().

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Are you trying to test for the logic state of the pin itself ? Independent

   

of UART framing ?

   

 

   

If this is the case you could poll the pin using - CyPins_ReadPin(pinPC)

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Use the existing UART example project and try to send 0x00 from hyperterminal or vice versa. It would definitely work.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

His stated problem is "I want to read ZERO '0' on the UART receive pin.",

   

not how do I send and receive "0" as a character into the UART buffer.

   

 

   

Regards, Dana.

0 Likes