View previous topic :: View next topic |
Author |
Message |
Suky
Joined: 17 Jun 2009 Posts: 3
|
Consultation on rate of rtos task execution |
Posted: Wed Jun 17, 2009 8:23 pm |
|
|
The value given in this parameter, that indicates really? Since in a simple example I have made I set up a task to run every 2ms, it is the only task, but I check that runs every 1.7 ms. What can be the problem?
The execution time of task is approximately 2us.
Code: | #include <18F2550.h>
#device adc=8
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL3,CPUDIV1,VREGEN
#use delay(clock=48000000)
#use rtos(timer=0,minor_cycle=1ms)
//******************************************************************************
#use fast_io(b)
#bit Led0=0xF81.0
#task(rate=2ms,max=5us)
void Tarea1(void);
void main(){
set_tris_b(0x00);
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_wdt(WDT_OFF);
setup_comparator(NC_NC_NC_NC);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
Led0=0;
rtos_run ();
}
void Tarea1(void){
Led0=1;
delay_us(2);
Led0=0;
} |
thanks!
PD:My English is bad |
|
|
Suky
Joined: 17 Jun 2009 Posts: 3
|
Re: Consultation on rate of rtos task execution |
Posted: Sat Jun 20, 2009 10:15 am |
|
|
Nobody knows whether it should be so, or am I doing something wrong? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Suky
Joined: 17 Jun 2009 Posts: 3
|
|
Posted: Sat Jun 20, 2009 1:49 pm |
|
|
Thank you for the tip
Best Wishes! |
|
|
|