- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using CCG3PA with PSoC Creator. I have a signal being input to pin 10 called Int_Rdy that I would like an interrupt that will trigger on both rising and falling edge of the signal. I would like to be able to read the Int_Rdy signal level from within the interrupt routine. How do I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Allen,
1. You could refer Cypress standard example project to implement Interrupt. This Application can help you understand Interrupt in M0+ core to help you out.
https://www.cypress.com/documentation/application-notes/an90799-psoc-4-interrupts
https://www.cypress.com/documentation/code-examples/ce210558-psoc-4-gpio-interrupt
2. If you just need a example code for both edge, I have a example for your referring.
a. Add a GPIO and ISR type in your project.
b. In your project, You shall add below code into your project.
(1) Interrupt handle function
//LISZ
/*
* Function
*/
void change_xxxx(void)
{
if (GPIO_0_Read() == false)
{
.... //<< Add failing edge function here
}
if (GPIO_0_Read() == true)
{
....//<< Add rising edge function here
}
}
/*
* Interrupt Service Routine to handle the interrupts triggered
* on the falling edge of the GPIO_0 input signal
*/
CY_ISR(GPIO_ISR_handler)
{
GPIO_0_ClearInterrupt(); // Clears any active interrupts attached with the GPIO_0 component
change_xxxx();
}
(2) Initial interrupt
GPIO_0_ClearInterrupt(); // Clears any active interrupts attached with the USER_BUTTON component
/* Sets up the interrupt to function and sets address as the ISR vector for the interrupt */
GPIO_ISR_StartEx(GPIO_ISR_handler);
Best Regards,
Lisa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Allen,
1. You could refer Cypress standard example project to implement Interrupt. This Application can help you understand Interrupt in M0+ core to help you out.
https://www.cypress.com/documentation/application-notes/an90799-psoc-4-interrupts
https://www.cypress.com/documentation/code-examples/ce210558-psoc-4-gpio-interrupt
2. If you just need a example code for both edge, I have a example for your referring.
a. Add a GPIO and ISR type in your project.
b. In your project, You shall add below code into your project.
(1) Interrupt handle function
//LISZ
/*
* Function
*/
void change_xxxx(void)
{
if (GPIO_0_Read() == false)
{
.... //<< Add failing edge function here
}
if (GPIO_0_Read() == true)
{
....//<< Add rising edge function here
}
}
/*
* Interrupt Service Routine to handle the interrupts triggered
* on the falling edge of the GPIO_0 input signal
*/
CY_ISR(GPIO_ISR_handler)
{
GPIO_0_ClearInterrupt(); // Clears any active interrupts attached with the GPIO_0 component
change_xxxx();
}
(2) Initial interrupt
GPIO_0_ClearInterrupt(); // Clears any active interrupts attached with the USER_BUTTON component
/* Sets up the interrupt to function and sets address as the ISR vector for the interrupt */
GPIO_ISR_StartEx(GPIO_ISR_handler);
Best Regards,
Lisa