[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Timer precision on at91rm9200
- Date: Wed, 31 Oct 2007 08:32:21 +0100
- From: jrochat at netplus.ch (Rochat Joël)
- Subject: Timer precision on at91rm9200
Think you for your response !
I've took a look int clock.c and I don't understand why the function
Clock_driver_support_initialize_hardware use the SLCK_FREQ to calculate how
many tick muss be count. Why not use the MAIN_FREQ oscillator ?
For exemple
I want a 10 khz timer with this definition :
#define CONFIGURE_MICROSECONDS_PER_TICK 100
the calcul in the Clock_driver_support_initialize_hardware function to know
how many times I have to count is :
st_pimr_reload =
(((BSP_Configuration.microseconds_per_tick * slck) + (1000000/2))/ 1000000);
st_pimr_reload = 3.7768 but whith an integer it is 3 !
There is a relative big difference between the timer calculated ans the
timer I wanted.
How can I manage to have a better result ?
Think you again
Joel R.