9 Replies Latest reply on Apr 2, 2018 2:48 AM by amar230292_1754041

    PWM Interrupt Issue

    jeremy_3270776

      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:

       

       

      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!