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

    Timer Interrupt - timing delay problem

    goldkwangho_2616236

      hi

      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

      -----------------------------------------------------------------------------------------------------------------------------------------

      problem

      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
          ntan

          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.

          GS003351.png

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

          GS003352.png

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

          GS003353.png

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

           

          Regards,

          Noriaki

          • 2. Re: Timer Interrupt - timing delay problem
            goldkwangho_2616236

            thanks Noriaki

            It works well.

            I understood about clock system