From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22764 invoked by alias); 22 Feb 2006 09:32:11 -0000 Received: (qmail 22755 invoked by uid 22791); 22 Feb 2006 09:32:10 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Feb 2006 09:32:07 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1FBqLl-0000vS-00; Wed, 22 Feb 2006 10:31:57 +0100 Date: Wed, 22 Feb 2006 09:32:00 -0000 To: "vasantha.rajan" Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20060222093157.GA3433@lunn.ch> Mail-Followup-To: "vasantha.rajan" , ecos-discuss@ecos.sourceware.org References: <200602221433.27107.vasantha.rajan@cranessoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602221433.27107.vasantha.rajan@cranessoftware.com> User-Agent: Mutt/1.5.11+cvs20060126 From: Andrew Lunn X-IsSubscribed: yes 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] CYGNUM_HAL_RTC_PERIOD X-SW-Source: 2006-02/txt/msg00228.txt.bz2 On Wed, Feb 22, 2006 at 02:33:26PM +0530, vasantha.rajan wrote: > > > On Tuesday 21 February 2006 15:09, you wrote: > > Hi Dirk , > > Thanks for your reply...... > > In my previous mail I asked one more question.....but did'nt get reply. > > I will give a test code.... > > int count =1; > > void alarm_handler( cyg_handle_t alarm_handle, cyg_addrword_t data ) > { > printf("value of count:%d\n",count++); > cyg_flag_setbits(&flag,pattern); > } > > void counter_thread(cyg_addrword_t data) > { > while(1) > { > value = 0xfffffffe; > pattern = 1; > mode=CYG_FLAG_WAITMODE_OR ; > cyg_flag_maskbits(&flag,value); > > cyg_alarm_initialize( alarm_hdl, 100 + cyg_current_time(), 0 ); > value=cyg_flag_wait(&flag,pattern,mode); > } > } > > void cyg_user_start() > { > sys_clk = cyg_real_time_clock(); > cyg_clock_to_counter( sys_clk, &counter_hdl ); > cyg_alarm_create( counter_hdl, alarm_handler, > (cyg_addrword_t)&index1, &alarm_hdl, &alarm_obj ); > cyg_thread_create(10, &counter_thread, 0 ,"counter_thread", stack, > STACKSIZE, &handle, &thread); > cyg_thread_resume(handle); > } > > 1. I made CYGNUM_HAL_RTC_DENOMINATOR to 100000, (so that my > clock will trigger for 10us) and in my code if i initialize my alarm to > cyg_alarm_initialize( alarm_hdl, 100000 + cyg_current_time(), 0 ), my alarm > triggered for every 1 sec. > > If I reduce my value given to cyg_alarm_initialize() API to 10000 my alarm > triggered for every 0.1 sec ie, my code > count value increments to 10 for every second and still if reduce my value > to 1000 count value increments to 100 for every second,but if I still > reduce my value to 100 ,I expected the count value should increment to > 1000,but the count value increments upto some 350 approx. > > and if i still reduce my value to 10 or 1 my count only increments to 350 > only...why I am not getting the linear increment????????? Simple. The CPU is 100% busy handling all these interrupts. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss