UART Receive

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

cross mob
ViMD_4181096
Level 1
Level 1
5 likes given First like given

Hi,

May I know the syntax or get the cypress documentation for receiving using UART cable. I am using UART for transmitting and receiving the character. I have tried using this syntax Cy_SCB_UART_GetArray(UART_HW,SerialBuffer,1); but failed to receive the data. Am able to read the output of the task but not able to write it to the PSOC6. Trying to send data from PC to PSOC6 using UART cable. May I get a suggestion as which syntax to be used to receive the data in PSOC which is sent by the PC. 

Thank you in advance,

Warm regards,
Vivekraj MD

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

If you are using PSoC Creator, the Peripheral Driver Library (PDL) document can be accessed from the "Help" menu item as follows.

GS004426.png

The the "Serial Communication Block (SCB)" at the "API Reference" chapter contains the description about the Cy_SCB_UART_GetArray() function.

GS004427.png

The function returns the number of received bytes without waiting for a character received.  This means that you must wait for the API function returns 1 instead of 0 to get a character in a loop like while() statement.

Please consider to use the API function Cy_SCB_UART_GetArrayBlocking() not to make a loop.

View solution in original post

2 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

If you are using PSoC Creator, the Peripheral Driver Library (PDL) document can be accessed from the "Help" menu item as follows.

GS004426.png

The the "Serial Communication Block (SCB)" at the "API Reference" chapter contains the description about the Cy_SCB_UART_GetArray() function.

GS004427.png

The function returns the number of received bytes without waiting for a character received.  This means that you must wait for the API function returns 1 instead of 0 to get a character in a loop like while() statement.

Please consider to use the API function Cy_SCB_UART_GetArrayBlocking() not to make a loop.

Thank you so much! I was stuck with Cy_SCB_UART_GetArray() since a few days and I wasn't receiving the exact output which I was sending. Your suggestion of while() loop helped me out and establish the connection. Am grateful for your help.

Warm regards,

Vivekraj MD

0 Likes