RES: ERC32 clock counter incorrect
Wendell Pereira da Silva
wendell.silva at compsisnet.com.br
Fri Mar 6 17:30:45 UTC 2009
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 don't 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/d0f7456a/attachment-0001.html>
More information about the users
mailing list