2 Replies Latest reply on Nov 5, 2017 6:21 AM by kikw_2616236

    Timer Interrupt - timing delay problem



      i am testing timer Interrupt


      1. environment

        kit : CY8CKIT-042-BLE-A

        mcu : CY8C4248LQI-BL583 ( PSOC4 )

        Psoc Creator 4.1


      2. Timer Setting

        Clock input - 12MHz

        Period - 48,000

        On terminal count

        Timer pulse toggle : every 4ms --> Oscillocope CH1 - Yellow

      3. Function Generator pulse toggle : every 5ms --> Oscillocope CH4 - Green



      I want precise pulses but there is a time delay

      50us delay per pulse

      How to make precise pulses?


        • 1. Re: Timer Interrupt - timing delay problem

          There are two issues.


          1) The Timer component counts the 12MHz clock from ZERO to 48000.  So, the period of the timer is 48,001  If you want to get a 48,000 cycle period result, 47999 should be set to the period value.


          2) In your project, you are using the 48MHz IMO as the HFCLK clock which is used as the source clock of the 12MHz clock.


          The accuracy of the IMO is +/-2%.  So, the accuracy of the 12MHz is +/-2% too.


          If you want to generate more accurate Timer interrupt, Use the External Crystal Oscillator (ECO) clock as the HFCLK.


          Now, You can use more accurate 24MHz clock as the HFCLK.




          • 2. Re: Timer Interrupt - timing delay problem

            thanks Noriaki

            It works well.

            I understood about clock system