PWM Interrupt Issue

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

cross mob
Anonymous
Not applicable

Hello!

I'm fairly new to this but have been poking away at the CY8CKIT-050 and it's a pretty cool kit!

I'm currently trying to get both a hardware and software interrupt setup.  I will eventually be varying the PWM time so I have a slow timer setup (so I can adjust my PWM period for anywhere between 1 and 60s, with varying duty cycles).  I am currently having it set to toggle on and off every 1 second.  I have an LED setup to be triggered via the PWM output (LED3) and an LED setup to be triggered by the interrupt (LED4).

Below is my current setup:

pastedImage_0.png

pastedImage_2.png

pastedImage_6.png

pastedImage_7.png

My code looks like this:

CY_ISR(PWM_Interrupt_Handler)

{

    Pin_LED4_Write(~Pin_LED4_Read());   

}

int main()

{

     CyGlobalIntEnable;

     PWM_Start();

     PWM_Interrupt_StartEx(PWM_Interrupt_Handler);

     for(;;)

     {

          // I have other code running in here

     }    

}

I've been trying to do as much reading as I can (in the forums, watching videos on youtube, etc) but I can't seem to find the issue with either my understanding (maybe it's doing exactly what I have it programmed to do but my expectations are wrong) or I'm missing something basic that needs to be enabled for this to be up and working.

Any help someone could give me would be greatly appreciated.  If you need any additional information, please let me know.  Thanks a lot!

1 Solution
Anonymous
Not applicable

hi jeremy,

Just enable "interrupt on terminal count event" too under PWM advanced configuration tab along with interrupt on compare event. Then it works. I don't know why  without that option being enabled, interrupt do not triggered.

View solution in original post

9 Replies