[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RES: ERC32 clock counter incorrect
- Date: Fri, 6 Mar 2009 14:30:45 -0300
- From: wendell.silva at compsisnet.com.br (Wendell Pereira da Silva)
- 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 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://rtems.rtems.org/pipermail/rtems-users/attachments/20090306/d0f7456a/attachment.html