cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

kikw_2616236
New Contributor II

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

pastedImage_2.png

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?

pastedImage_11.png

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

0 Likes
1 Solution
NoriakiT_91
Employee

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

View solution in original post

2 Replies
NoriakiT_91
Employee

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

View solution in original post

kikw_2616236
New Contributor II

thanks Noriaki

It works well.

I understood about clock system

0 Likes