Trigger UART INTERRUPT with Cy_SCB_UART_PutArray() & Cy_SCB_UART_GetArray()

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

cross mob
notAnumber
Level 1
Level 1
50 sign-ins 5 questions asked 5 replies posted

Hello,

In one of my files I have a while-loop which puts an array into the UART using Cy_SCB_UART_PutArray() and in another file I am receiving it with  a while-loop using Cy_SCB_UART_GetArray().

Transmit
Cy_SCB_UART_PutArray(UART_HW, buffer, sizeof(buffer));
Cy_SCB_UART_ClearTxFifoStatus(UART_HW, CY_SCB_UART_TX_NOT_FULL);

 

Receive

uint8_t rxBuffer[5];
cy_rslt_t result;

result = Cy_SCB_UART_GetArray(UART_HW, &rxBuffer, sizeof(rxBuffer));

    if(result != CY_SCB_UART_RX_NO_DATA)
    {
        for(int i = 0; i < sizeof(rxBuffer); i++)
        {
            printf("%c\r\n", (char) rxBuffer[i]);
        }
    }
 
But now I want a interrupt to be triggered when something is transferred. Or rather if there is something to receive instead of using a while-loop to poll for incoming data. 
 
But I can't get it to work.
My ISR function which I created is never triggered. Can the functions trigger a interrupt? Or do I need to use Cy_SCB_UART_Transmit() & Cy_SCB_UART_Receive() instead? I tried them and they are triggering the ISR. 
 
But I rather use the other functions. 
0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

notAnumber,

From the code fragments you included it is difficult to tell why your ISR is not being executed.

Is it possible to include your entire project in this thread?

Just to let you know if you weren't already familiar:  Functions like xxx_GetArray() and xxx_PutArray() are blocking functions.  In other words, they will not exit the function and proceed in the rest of the code until ALL the bytes are received or transmitted.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
1 Reply
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

notAnumber,

From the code fragments you included it is difficult to tell why your ISR is not being executed.

Is it possible to include your entire project in this thread?

Just to let you know if you weren't already familiar:  Functions like xxx_GetArray() and xxx_PutArray() are blocking functions.  In other words, they will not exit the function and proceed in the rest of the code until ALL the bytes are received or transmitted.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes