cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

chmoc_1567941
New Contributor

i working on one project which has dynamic configuration.

   

i used UART for communication...my uart is in base profile and other all module are in layer 1 and layer 2.

   

Now i want to use ISR in UART..is that possible to use??? 

0 Likes
Reply
1 Reply
SampathS_11
Moderator
Moderator

Hello Chirag,

   

It is possible to use the UART ISR. UART has two ISRs: one for Tx and another for Rx. Under the source files, you will find a file called UARTINT.asm.

   

In this file find the label _UART_TX_ISR. Below this line you will find commented out text as shown below

   

 ;---------------------------------------------------
   ; Insert a lcall to a C function below this banner
   ; and un-comment the lines between these banners
   ;---------------------------------------------------
   
   ;PRESERVE_CPU_CONTEXT
   ;lcall _My_C_Function
   ;RESTORE_CPU_CONTEXT
   
   ;---------------------------------------------------
   ; Insert a lcall to a C function above this banner
   ; and un-comment the lines between these banners
   ;---------------------------------------------------

   

You can un-comment the three lines as indicated above, and modify the lcall to point to your function handling Tx interrupts. Do provide a leading underscore for your function name. Note that your function is not strictly an ISR. It is a function which is called from an ISR, but will serve the purpose.

   

 

   

Find the label  _UART_RX_ISR.Below this line you will find commented out text as shown below

   

   ;---------------------------------------------------
   ; Insert a lcall to a C function below this banner
   ; and un-comment the lines between these banners
   ;---------------------------------------------------
   
   ;PRESERVE_CPU_CONTEXT
   ;lcall _My_C_Function
   ;RESTORE_CPU_CONTEXT
   
   ;---------------------------------------------------
   ; Insert a lcall to a C function above this banner
   ; and un-comment the lines between these banners
   ;---------------------------------------------------
   ;@PSoC_UserCode_END@ (Do not change this line.)

   

You can un-comment the three lines as indicated above, and modify the lcall to point to your function for handling Rx interrupts. Do provide a leading underscore for your function name. 

   

Sampath

0 Likes
Reply