Setting up ISR for use with UART Rx interrupt

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

cross mob
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

EDIT: I figured it out, I should have been calling U1RX_ISR_Start() to properly enable the interrupt rather than calling U1RX_ISR_Enable() alone.

   

 

   

Hi all,

   

I'm getting started for the first time with using a PSoC 5 (CY8C5668AXI-LP010) and I've got a question about setting up a UART Receive interrupt.

   

I have the UART present and functional (I.E. UART1_PutString works, so the module is operating) but I'm having a tough time getting the interrupt upon receiving a byte to work correctly.

   

I currently have the UART module placed and wired.  the rx_interrupt signal is wired to an interrupt named U1RX_ISR. This interrupt is of type "Derived".  The UART is configured to interrupt on byte received.  The buffer sizes for both RX and TX are 4 bytes.  In the code, I am enabling U1RX interrupt via the U1RX_ISR_Enable() function.  What I am now finding is that sending a character to the UART from my PC is resulting in the code ending up in the IntDefaultHandler.  I presume it's some sort of issue with my U1RX_ISR not linking up properly?  but in that case, how would I go about configuring this interrupt?  Would it be better practice to increase the buffer size and use the internal interrupt?

   

In the code, I am first calling

   

 CyGlobalIntEnable

   

then

   

U1RX_ISR_Enable()

   

and finally

   

UART1_Start();

   

This is my first time working with a PSoC, so I'm still unfamiliar with best practices and exactly how to configure interrupts properly.

   

Thanks in advance for the help.

0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

KTrenholm,

   

attached is example project of using UART for receiving ASCII strings/commands. It also shows basic interaction with UART_RX interrupt.

AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

You can also use the following code example -

   

https://github.com/kmmankad/UART-on-PSoC3

   

Please respond if that helps or not.

0 Likes