1 2 Previous Next 22 Replies Latest reply on May 17, 2017 2:20 AM by arh

    ISR routine not running

    SumatPurewal

      I want to measure the width of each pulse from an external signal. For this I set up a timer to run continuously,trigger at the rising edge and capture at the falling edge. There is an ISR attached to the interrupt terminal of the timer and is called Channel_1_ISR as can be seen below.

         

      The ISR runs once since the led state is only toggled once but not after that. What am I missing?

       

         

      CY_ISR(Channel_1_ISR_Handler){
         
          Channel_1_Count=Channel_1_Timer_ReadCapture();
          onboard_led_Write(~onboard_led_Read());
          Channel_1_ISR_ClearPending();
      }

         

      int main(void)
      {
          CyGlobalIntEnable;
          onboard_led_Write(~onboard_led_Read());
         Channel_1_Timer_Start();
         Channel_1_Timer_EnableTrigger();
         Channel_1_ISR_Enable();
         Channel_1_ISR_StartEx(Channel_1_ISR_Handler);

         

      for(;;){}

         

      }

        1 2 Previous Next