cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

HeGi_2497906
Contributor II

I am using a CY8C4244 and have been using PSOC4 for several years now, and have run into a situation that does not make sense.

Setting up a non-dedicated interrupt is not apparently an option, and this is very bad for my design as I cannot have as many dedicated interrupts as is required,

What gives here, why is this not functioning like all other PSOC4s I have used to date?  Please respond ASAP, this is a big issue.

HeGi_2497906_0-1611688750763.png

 

0 Likes
1 Solution
Aashita_Raj
Moderator
Moderator

Hi @HeGi_2497906 ,

Can you please have a look at the project which I have attached here ? In this project,  4 pins (of the same port) are capable of generating an interrupt. Using the PSoC 4 device interrupt register and a variable, we figure out which pin has generated the interrupt and execute the ISR of that pin. I have used CY8C4248LQI-BL583 device to test the program.

You can find four pins in the TopDesign of the project with the dedicated interrupt disabled in the configurator. All the four input pins are connected to port 0. These pins are resistive pull-down pins with initial
drive state LOW and generate an interrupt on rising edge of input signal. In the main function, the interrupt vector table is loaded with the address of the interrupt handler using the CyIntSetVector(0,pin_interrupt_handler) API. When a rising edge of signal is provided on any of the four input pins, an interrupt is generated from port 0 and the program goes to the interrupt handler service routine. Inside the interrupt handler, a flag is set, the port 0 interrupt register value is stored in a variable and the interrupt register bits are cleared. The pending status of the interrupt is also cleared.

When the program returns to the main function, it checks the status of the flag and enters a loop.
Inside the loop, the variable value is checked and depending on the bit which is set, the corresponding pin number is printed on the serial terminal.

Please go through the project once and let us know if this helps. 

Best Regards,

Aashita

View solution in original post

0 Likes
1 Reply
Aashita_Raj
Moderator
Moderator

Hi @HeGi_2497906 ,

Can you please have a look at the project which I have attached here ? In this project,  4 pins (of the same port) are capable of generating an interrupt. Using the PSoC 4 device interrupt register and a variable, we figure out which pin has generated the interrupt and execute the ISR of that pin. I have used CY8C4248LQI-BL583 device to test the program.

You can find four pins in the TopDesign of the project with the dedicated interrupt disabled in the configurator. All the four input pins are connected to port 0. These pins are resistive pull-down pins with initial
drive state LOW and generate an interrupt on rising edge of input signal. In the main function, the interrupt vector table is loaded with the address of the interrupt handler using the CyIntSetVector(0,pin_interrupt_handler) API. When a rising edge of signal is provided on any of the four input pins, an interrupt is generated from port 0 and the program goes to the interrupt handler service routine. Inside the interrupt handler, a flag is set, the port 0 interrupt register value is stored in a variable and the interrupt register bits are cleared. The pending status of the interrupt is also cleared.

When the program returns to the main function, it checks the status of the flag and enters a loop.
Inside the loop, the variable value is checked and depending on the bit which is set, the corresponding pin number is printed on the serial terminal.

Please go through the project once and let us know if this helps. 

Best Regards,

Aashita

View solution in original post

0 Likes