Microseconds sleep with Leon2
Arquer Stephane
stephane.arquer at c-s.cnes.fr
Thu Nov 20 09:02:49 UTC 2008
Hi,
I try to make a specific function to wake up tasks after some hundreds of µ seconds.
I use the timer 2 of a Leon2 with a resolution set to 50µs , but I obtain a rough result with 200µs more than the request time.
Does anybody have an idea ?
I can't load the timer with a value less than 50, a lower value block the execution.
Is it possible to manage an ISR every 10µs ?
I work with rtems 4.8.0 with the patch 4.8.1diff, and a Leon2.
Thanks for help.
sa
/*****/
rtems_isr handleTimer2(rtems_vector_number vector)
{
int i;
TIMER2_TICKS ++;
if (Nbre_Timer_Actifs > 0){
for (i=0; i < MAX_TIMER; i++)
{
if (TAB_Timer[i].actif) {
if (TAB_Timer[i].decompte > 0) {
TAB_Timer[i].decompte--;
} else {
rtems_semaphore_release(TAB_Timer[i].sem_id);
TAB_Timer[i].actif = FALSE;
}
} /*if*/
} /*for*/
}/*if*/
} /*handleTimer2*/
More information about the users
mailing list