SCB UART Internal Interrupt access

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

cross mob
Anonymous
Not applicable

Hello!

   

My goal is to store 16 byte message that comes from an ESP8266 module via UART (so data in AT command format). I am using a PSoC 4 Pioneer board, and my resource use requires that I use the SCB block for UART communication. The example code/project provided for working with the UART SCB block, seems to gather data one char at a time and isn't very helpful if you need to do other tasks. 

   

The method that makes the most sense to me is to utilize the RX-FIFO-not-empty ISR (seen in the advanced tab on the UART configuration) when data is detected to store the RX buffer and check it for the message. However, when I change the RX buffer size to something large enough to grab the message in one go, the SCB block changes to an internal interrupt only mode. From what I have read this is basically because the resources are needed to stitch together the buffer from the 4 bit at a time FIFO.

   

I am not sure how to trigger a custom ISR using CY_ISR_PROTO(),  (I think it would involve the UART_RX_FIFO_STATUS_REG somehow) The datasheet for refers to the function SCB_SetCustomInterruptHandler() but I am not sure that it wouldn't mess up the automatic functions required to move data from the rx FIFO into a large buffer. 

   

Any help connecting the dots, or resources on internal interrupts with PSoC 4 would be appreciated.

   

Also, storing the data from a buffer seems like a fairly common task, so if anyone can point me in the direction of a better/more efficient technique, or beginner friendly resource it would be much appreciated.

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

There is a SCB_SetCustomInterruptHandler() API which would allow to get control first. See datasheet but that might not be too helpful.

   

When the Rx buffersize in the component is larger than the FIFO depth (16 bytes when byte mode is checked) the internal interrupt is selected and a buffer of the requested size gets allocated. All transfers from FIFO to buffer are maintained by the component, char reads are fulfilled from buffer. There is an API named SCB_SpiUartGetRxBufferSize() which returns the number of bytes in the buffer (not the size) which you might use to decide whether your message is complete.

   

 

   

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        snyderk1, Check if this SCB UART Rx demo for PSoC4 will work for you http://www.cypress.com/comment/389231#comment-389231   
0 Likes
Anonymous
Not applicable

Bob -  I was not successful with the SCB_SetCustomInterruptHandler()  but figured out another way to do it. Thanks for your input!

   

Odissey1 -Thanks for your Rx demo! it helped clarify a bunch of stuff

0 Likes