1 2 Previous Next 22 Replies Latest reply on Sep 11, 2018 2:43 AM by user_13463998

    simple Timer (one shot), programm-code interrupt?

    user_1_2651671

      Hello, I have difficult to setup a simple Timer.

       

      I use the Timer counter component with Clock + interrupt (isr_Timer1) on the interrupt connection.

       

      I want simply be able to start the timer (one shot timer) and after the timer has finished, a interrupt function should be called and in this function I want switch off an LED.

       

      follow Code does not works:

       

      int main()

      {

      ...

       

      LED_Write(0u); // Switch On LED

      ISR_Start(); Timer1_Start(); // start Timer + Interrupt isr_Timer1, ???

      ...

      }

       

       

      CY_ISR(Timer1)

      {

        LED_Write(1u); //Switch OFF LED after Timer has generate an Interrupt

      }

       

      what's wrong?

       

      thank you.

        1 2 Previous Next