From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16462 invoked by alias); 4 Jun 2008 10:06:40 -0000 Received: (qmail 16451 invoked by uid 22791); 4 Jun 2008 10:06:40 -0000 X-Spam-Check-By: sourceware.org Received: from elasmtp-mealy.atl.sa.earthlink.net (HELO elasmtp-mealy.atl.sa.earthlink.net) (209.86.89.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 04 Jun 2008 10:06:12 +0000 Received: from [75.82.39.242] (helo=PAULD) by elasmtp-mealy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1K3psg-0001Jx-3y for ecos-discuss@ecos.sourceware.org; Wed, 04 Jun 2008 06:06:10 -0400 From: "Paul D. DeRocco" To: "eCos Discuss" Date: Wed, 04 Jun 2008 10:06:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <000a01c8c603$4d825dd0$1c0110ac@ariga> X-ELNK-Trace: bd7d5d4e6f8f652c74cfc7ce3b1ad11381c87f5e51960688caf430dde4b8ef757ef4bdf0b69217f1350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: RE: [ECOS] Re: In trouble of timer operations X-SW-Source: 2008-06/txt/msg00017.txt.bz2 > From: ariga masahiro [mailto:ariga@link-lab.co.jp] > > I am afraid I dig up the same question but I think this is important,at > least for me, > so please forgive my inquiring again. > The problem is return_time of cyg_thread_delay.I am determined to > use TMU1 > as Free-Run Counter(0xffffffff-0) > and made function(HAL_CLOCK_READ1) to read TMU1 clock count.I am affirmed > it's working correctry. > I used it to calculate return time in hipri_test() in timeslice2.c. > I am baffled by the result. > > --testing code > hipri_test(CYG_ADDRESS id) > { > cyg_int32 start; > > while( 1 ) > { > HAL_CLOCK_READ1(&start); > diag_printf("id=hi 0x%x\n",start); > cyg_thread_delay(1); > cyg_thread_delay(2); > } > } > I calculated several cases. > (1) I only used cyg_thread_delay(2) > (2) I used Andrew's proposition of using > cyg_thread_delay(1),cyg_thread_delay(2) like above code. > (3) same as (2) except changed cyg_thread_delay(2) to cyg_thread_delay(20) > (4) only used cyg_thread_delay(20) It's possible that there's something wrong with the timer configuration. However, you won't find it out very easily with diag_printf, because it probably takes longer than 10ms to execute. I don't know what hardware you're using, but most evaluation boards have utility LEDs or output port pins. Instead of outputting a message, toggle a port pin and look at it with a scope or a frequency counter. -- Ciao, Paul D. DeRocco Paul mailto:pderocco@ix.netcom.com -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss