1 Reply Latest reply on Sep 6, 2017 2:29 AM by user_1377889

    PWM Interrupt

    mohanraj.ramalingam_2686856

      Hi,

       

         I want to Generate the PWM Interrupt. Here i attached the project which i used. In this first time entering the isr. I generated the PWM Raising Edge interrupt. Could you please help me to solve this issue.

       

      Thanks,

      Mohan Raj R

        • 1. Re: PWM Interrupt
          user_1377889

          You need to issue a PWM_ReadStatusRegister() API in your interrupt handler or you will loop forever because the interrupt cause is not cleared.

          A tip: use isr_StartEx(YourHandler) API and code your own handler. So yyou do not need to fiddle around in the generated files. You can use

           

          CY_ISR(YourHandler)

              UART_PutString("Enter into Output:\r\n");

              UART_PutChar(x+48);

              x++;

              PWM_ReadStatusRegister();

          }

           

          Always try to avoid lengthy / time consuming code in an interrrupt handler because this might stall your system. Your UART output will take ~20ms which is a very long time compared to an 80MHz CPU.

           

          Happy coding

          Bob