ERC32 clock counter incorrect
Manuel Coutinho
manuel.coutinho at edisoft.pt
Fri Mar 6 17:47:15 UTC 2009
Hi
The Scalar value is correct, you should subtract one. But on the clock
counter as well (counts from 0 to microseconds per tick minus one).
Ive tested using the GPT timer on ERC32 and it was giving a microsecond in
each clock tick.
Using the -1 patch, it was ok.
Look at the same code of the leon2 and leon3 for example, they also subtract
one unit.
Kind regards
Manuel Coutinho
_____
From: Wendell Pereira da Silva [mailto:wendell.silva at compsisnet.com.br]
Sent: Friday, March 06, 2009 5:31 PM
To: Manuel; rtems-users at rtems.com
Subject: RES: ERC32 clock counter incorrect
Hi Manuel,
Note that -1 is added in ERC32_MEC.Real_Time_Clock_Scalar.
#define Clock_driver_support_initialize_hardware() \
do { \
/* approximately 1 us per countdown */ \
ERC32_MEC.Real_Time_Clock_Scalar = CLOCK_SPEED - 1; \
ERC32_MEC.Real_Time_Clock_Counter = \
BSP_Configuration.microseconds_per_tick; \
\
ERC32_MEC_Set_Real_Time_Clock_Timer_Control( \
ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING | \
ERC32_MEC_TIMER_COUNTER_LOAD_SCALER | \
ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER \
); \
\
ERC32_MEC_Set_Real_Time_Clock_Timer_Control( \
ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING | \
ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO \
); \
} while (0)
I dont think it is a bug. How do you do the verification?
Att.
Wendell.
_____
De: rtems-users-bounces at rtems.org [mailto:rtems-users-bounces at rtems.org] Em
nome de Manuel
Enviada em: sexta-feira, 6 de março de 2009 12:30
Para: rtems-users at rtems.com
Assunto: ERC32 clock counter incorrect
Hi
We have discovered a bug in the ERC32 clock driver (at least for the RTEMS
4.8.0 version).
Currently, the RTC counter is being initialized with (on the ckinit.c file)
ERC32_MEC.Real_Time_Clock_Counter = \
BSP_Configuration.microseconds_per_tick;
This way it is adding an extra microsecond for each clock tick.
The correct set value should be
ERC32_MEC.Real_Time_Clock_Counter = \
BSP_Configuration.microseconds_per_tick - 1;
the other SPARC BSPs (leon2 and leon3) clocks seam ok :)
Kind regards
Manuel Coutinho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20090306/a33b3556/attachment-0001.html>
More information about the users
mailing list