From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22112 invoked by alias); 22 Jun 2006 14:35:17 -0000 Received: (qmail 22100 invoked by uid 22791); 22 Jun 2006 14:35:15 -0000 X-Spam-Check-By: sourceware.org Received: from server.cct.co.uk (HELO SERVER.cct.co.uk) (195.11.24.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Jun 2006 14:35:10 +0000 Received: from 192.67.84.200 ([192.67.84.200]) by SERVER.cct.co.uk ([10.10.10.1]) with Microsoft Exchange Server HTTP-DAV ; Thu, 22 Jun 2006 14:35:10 +0000 Received: from software.cct.co.uk by server.cct.co.uk; 22 Jun 2006 15:35:07 +0100 From: David Fernandez To: Moussa Ba Cc: Gary Thomas , birahim.fall@elsys-design.com, ecos-discuss@ecos.sourceware.org In-Reply-To: <449AA52A.8060004@embedded-zone.com> References: <200606210919.AA273809616@elsys-design.com> <1150980960.29450.10.camel@software.cct.co.uk> <1150981517.29450.15.camel@software.cct.co.uk> <449A9855.3060009@mlbassoc.com> <1150983812.29450.27.camel@software.cct.co.uk> <449AA52A.8060004@embedded-zone.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 22 Jun 2006 14:35:00 -0000 Message-Id: <1150986907.29450.45.camel@software.cct.co.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR DENOMINATOR X-SW-Source: 2006-06/txt/msg00227.txt.bz2 On Thu, 2006-06-22 at 10:11 -0400, Moussa Ba wrote: > Thank you for the replies, the way I have used RTC_PERIOD is that my > CPU_CLOCK is at 32MHz, while I prescale the timer by a factor of 8 hence > yielding at timer clock of 4Mhz, therefore my RTC_PERIOD is > 4,000,000/DENOMINATOR or 40,000. I use this value to preload my 16 bit > timer with 65536 - 40000 with automatic reloading of this value, this > essentially gives me the 10ms tick. > You could define a RTC_FREQUENCY with that value of 4000000 (in Hz) in the cdl, then you especify the PERIOD as calculated { ...FREQUENCY / ...DENOMINATOR }. That way you get some differentiation between the CPU frequency and the hw. timer frequency. You can put a default_value { ...CPU_CLOCK / 8 }... > I think David makes a valid point that it would help to put platform > specific values, however, these are also dependent on the hardware timer > setup. Though, this can be made specific to timer clocks (prescaler > values that is). > No problem, if there are more than one way to set your timer, you can put a PRESCALER option in a platform-variant cdl or in a configuration template, or just in a configuration file that you import... Or you can just put the RTC_FREQUENCY option in there. Anyway, the thing of the timer that defines the OS sw. timers can be considered a essential parameter for the platform, so when doing the platform cdl and the code you choose the best/more flexible method yo have available, and define parameters and constrains to avoid wrong values. For example you can put a legal_values in DENOMINATOR as {1 to (...RTC_FREQUENCY / 65535) }. David. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss