This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Timers and RTC timer.


Hi Saty,

>   my board supports total 4 Timers and a RTC Timer. currently  i
> have programmed hal_delay_us() using the Timer2 and the hal_clock_xxxx
> routines using the Timer1.

Sounds OK.

>   when i executed the two-threads.c program i found that when a
> cyg_thread_delay() routine was called..my program was in infinte loop.
> i realized from the eCos reference guide that this function depends on
> the real-time system clock as controlled by the configuration option
> CYGVAR_KERNEL_COUNTERS_CLOCK.

AFAIK, this option is simply there to allow removal of the code if it's not
required.

>   so, i wanted to know, were to add the real-time clock routines..should i
> replace the existing hal_clock_xxx routines using the RTC timer..?

I think you are getting confused between what eCos calls the 'real-time
clock' and the RTC device supported by your hardware. The eCos 'real-time
clock' is a stock (i.e. already there to be used) instance of an eCos
'clock' class. An eCos 'clock' is an object which is tied to a specific
hardware timer resource. The eCos 'real-time clock' is tied to the hardware
timer resource indicated in the HAL_CLOCK_XXXX macros. Therefore, the eCos
'real-time clock' will use Timer 1 in your example above.

> well, my system board uses 32khz to drive the real-time clock in the
> RTC block..and my CPU speed is 192MHz..so, whatz the real-time period.
> is it 1/32khz.. plz some one guide me in calculating this value.

Forget about the RTC device driven by the 32kHz clock in respect of the eCos
real-time clock. If you are having problems delays etc., I would suggest
looking at the configuration and use of Timer 1 in the HAL.

Robert Cragie, Design Engineer
_______________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
http://www.jennic.com  Tel: +44 (0) 114 281 2655
_______________________________________________________________


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]