CH_Frequency and Time measurement driver STM32F4 discovery

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Faisal Mehmood
Posts: 25
Joined: Sat Jan 26, 2013 10:18 pm

CH_Frequency and Time measurement driver STM32F4 discovery

Post by Faisal Mehmood »

I want to find the time in which my loop executes. I am using Time measurement driver. How is ch_frequency related to timing precision??
Curently Ch_frequency is set at 1000 and best time measurement gives 8550. This value increases to 36117 if I increase ch_frequency to 1,000,000.
I want as precise time as possible.
any suggesiton??
Regards
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CH_Frequency and Time measurement driver STM32F4 discove

Post by Giovanni »

CH_FREQUENCY is unrelated.

Time measurement is performed using a real time counter with a resolution equal to the MCU clock.

Interrupts can affect measurements so if you need absolute precision then you need to measure while interrupts are disabled.

Giovanni
Faisal Mehmood
Posts: 25
Joined: Sat Jan 26, 2013 10:18 pm

Re: CH_Frequency and Time measurement driver STM32F4 discove

Post by Faisal Mehmood »

Thnx!
Post Reply