Calculation of Period Count for CCU4 Timer !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi, I am confused with the calculation involved in the period count. By basic understanding, if i am not wrong, period count is calculated as below...

Count = Frequency x Delay;


I am sending 100(ms) as time delay and prescalar as 64. I am not getting correct time delay. Am I doing calculation in correct way ?
0 Likes
1 Reply
Not applicable
Hi Salman11053,

I am not clear about the desired delay. Are you using the CCU4 as a timer to count to this desired delay?

If this is the case...
Desired delay = time to count for the CCU4 ( this is to be converted to frequency)
Frequency = CCU4 frequency = Clock frequency/ Prescaler factor
Count = Period value for the CCU4, PRS

Then, the formula will be
Count = (Frequency / Desired delay in frequency) -1


The Capture and Compare Unit 4 (CCU4) is a very versatile unit and can be used to generate PWM output with dedicated on and off time. It can be used as a counter or as a timer to generate events.. periodically. You may wish to refer to the CCU4 application note that gives examples on how to use the CCU4. The link is provided here:

http://www.infineon.com/cms/en/product/microcontroller/32-bit-industrial-microcontroller-based-on-ar...


Regards,
Daryl
0 Likes