[ECOS] CYGNUM_HAL_RTC_PERIOD
Andrew Lunn
andrew@lunn.ch
Wed Feb 22 09:32:00 GMT 2006
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
More information about the Ecos-discuss
mailing list