More documentation detail required for floating timer

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

cross mob
User8683
Level 4
Level 4
First like received
Hello,

I am interested in using the floating timer value to increase precision of my ADC timing frequency. However, I am having trouble understanding the description in section 16.2.12.2 Prescaler Usage of the XMC1100 guide. The description seems incomplete and there are a few English errors such as "The period over time of the counter becomes:" which I believe is meant to be "Over time, the period of the counter becomes" which make it tough to read. Also, I am not sure how the period calculation would change if the difference between PSIV and PCMP was increased or reduced. A more generic formula might help with the understanding. Any direction would be appreciated.

Thanks,

Jason
0 Likes
2 Replies
Not applicable
Hi Jason,

How would you like to use the floating prescaler in your case?

Basically, in floating prescaler mode, the prescaler value will be increase by one automatically when the timer overflow.
This means, the prescaler could start with high resolution but short period time and keep increase to a longer period time with less resolution.

In order to calculate the period, it will be the timer value times the resolution time.

For example, the fccu4 is 64MHz and the initial prescaler is set to 0x01 (fccu4/2), and timer overflow every 50000 count.
The resolution for fcc4/2 = 31.25ns, so the period for the first prescaler will be 50000 x 31.25ns = 1.5625ms.
Then the resolution for the next prescaler will be fccu4/4 = 62.5ns. The period for this prescaler will be 50000 x 62.5 = 3.125ms
so this calculation continue till the prescaler reach the compare match or the capture is triggered.
Then the total period will be adding up all the period for the each prescaler. (i.e.: 1.5625ms + 3.125ms + .... )

longtimer wrote:
Also, I am not sure how the period calculation would change if the difference between PSIV and PCMP was increased or reduced. A more generic formula might help with the understanding. Any direction would be appreciated.


PSIV refers to the initial prescaler value which means the prescaler it will return upon compare match or capture trigger.
So if you change this value, means you can skip the calculation of the period before this prescaler.

PCMP refers to the prescaler for the compare match value.
For example, you want to have your timer compare match at prescaler fccu4/4, then you need to set the Floating Prescaler Shadow register CC4yPPCS.PCMP to 0x02.

I hope this cleared your doubts..
0 Likes
User8683
Level 4
Level 4
First like received
I am planning to use the floating prescaler to get a specific sampling frequency for the ADC. This explanation does help and I would suggestion that you provide it to the documentation team to improve the manual.

Thanks,

Jason
0 Likes