From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Ling Su Cc: eCos discussion Subject: Re: [ECOS] Regarding to eCos on VRC4373 Date: Wed, 10 Jan 2001 14:17:00 -0000 Message-id: <3A5CDF65.2B5EC6BC@redhat.com> References: <006401c07a8f$c6c9f490$0201a8c0@raccoon> <3A5BB04A.38F502F8@redhat.com> <005e01c07ad5$5ba58210$0301a8c0@leopard> <3A5C9902.4BE2B9F7@redhat.com> <00b801c07b51$ca308a00$0201a8c0@raccoon> X-SW-Source: 2001-01/msg00168.html Ling Su wrote: > > > It is in clock ticks, which are platform-specific. You can use the kernel > > API functions at > > http://sources.redhat.com/ecos/docs-latest/ref/ecos-ref.9.html > > > > Specifically, look at the definition of cyg_resolution_t, and notice you > > can use cyg_clock_get_resolution( cyg_real_time_clock ) to get a > > cyg_resolution_t for your real-time-clock. > > > > A shortcut given that you know the platform is to look at the CDL for the > > vrc4373 which includes the fields CYGNUM_HAL_RTC_NUMERATOR and > > CYGNUM_HAL_RTC_DENOMINATOR which correspond to the fields in the > > cyg_resolution_t. This is 1000000000 and 100 respectively, giving > > 10,000,000 ns/tick == 10 ms/tick. > > > Thanks, Jifl, > > If I need a timer faster than 10ms/tick, could I increase denominator or > decrease the numerator? I can it is a caculated value, user can not specify. > How could I change them and what is the consequences? Edit the source. The numerator and denominator describe what the setting is. They are not the setting itself. The setting itself if CYGNUM_HAL_RTC_PERIOD - that's what gets programmed into the timer chip. You would then change the numerator and denominator to reflect that. You will need to work out yourself what the values for the period, numerator and denominator that you want are. Jifl -- Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine