From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6708 invoked by alias); 5 Jun 2008 06:14:50 -0000 Received: (qmail 6700 invoked by uid 22791); 5 Jun 2008 06:14:49 -0000 X-Spam-Check-By: sourceware.org Received: from pop132.ocn.ne.jp (HELO pop132.ocn.ne.jp) (60.37.31.215) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jun 2008 06:14:30 +0000 Received: from ariga (p1110-ipbf5210marunouchi.tokyo.ocn.ne.jp [118.8.156.110]) by pop132.ocn.ne.jp (OCN) with SMTP id m556EQvq004127; Thu, 5 Jun 2008 15:14:26 +0900 (JST) Message-ID: <001301c8c6d3$66400590$1c0110ac@ariga> From: "ariga masahiro" To: "eCos Discuss" , "Paul D. DeRocco" Cc: "Andrew Lunn" References: Date: Thu, 05 Jun 2008 06:14:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.3138 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/msg00023.txt.bz2 Hello Paul,Andrew and others, Thank you,Paul,for valuable suggestion. I re_calculated by toggling LED and measured signal's duration on osilloscope. result (1) only used cyg_thread_delay(2) -- 20.2millisec (2) cyg_thread_delay(1),cyg_thread_delay(2) -- 30.1millisec (3) same as (2) except changed cyg_thread_delay(2) to yg_thread_delay(20) -- 212millisec (4) only used cyg_thread_delay(20) -- 201millisec I am confirmed in thinking that since CYGNUM_HAL_RTC_DENOMINATOR=100, system clock is running 100Hz,1 tick perid = 10millisec,and if I wish to run system clock 200Hz I should change CYGNUM_HAL_RTC_DENOMINATOR to 200. But according to your mail, it raised another puzzlement. > However, you won't find it out very easily with diag_printf, because it > probably takes longer than 10ms to execute. At first,I couldn't get it. Because if diag_printf takes over 10ms, simply calculated results ought be longer, but on the contrary it took far shorter than expected. So I deliberately inserted HAL_CLOCK_READ1(&start); diag_printf("id=hi 0x%x\n",start); in above each test(after led_toggle function) and investigated how it affects duration time. To my very astonishment as far as looking signals on osilloscope there are no differences ! Two functions takes no time at all as far as looking to signals. Can you resolve this wonder. Please enlighten me. Masahiro Ariga >> 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