girgis adly
New Member
dear all
i write a code for programming pic using micro C
void main()
{
TRISB=0;
LOOP:
PORTB=0;
Delay_us(447);
PORTB=0B00100110;
Delay_us(2717);
PORTB=0B00100101;
delay_us(3889);
PORTB=0B00100110;
delay_us(2667);
PORTB=0;
delay_us(777);
PORTB=0B00011010;
delay_us(2667);
PORTB=0B00011001;
delay_us(3889);
PORTB=0B00011010;
delay_us(2667);
PORTB=0;
delay_us(388);
goto loop;
}
i want the instruction to run (exceed) after 447 micro second but when i run the programe in protus programe the instruction run after 464 micro second i know it is a little difference but i want to know why this shift in time occur and how i can calculate it and the time the processor take to exceed the instruction i use 8 MHZ crystal (oscillator) and pic18f452
thanks for all
i write a code for programming pic using micro C
void main()
{
TRISB=0;
LOOP:
PORTB=0;
Delay_us(447);
PORTB=0B00100110;
Delay_us(2717);
PORTB=0B00100101;
delay_us(3889);
PORTB=0B00100110;
delay_us(2667);
PORTB=0;
delay_us(777);
PORTB=0B00011010;
delay_us(2667);
PORTB=0B00011001;
delay_us(3889);
PORTB=0B00011010;
delay_us(2667);
PORTB=0;
delay_us(388);
goto loop;
}
i want the instruction to run (exceed) after 447 micro second but when i run the programe in protus programe the instruction run after 464 micro second i know it is a little difference but i want to know why this shift in time occur and how i can calculate it and the time the processor take to exceed the instruction i use 8 MHZ crystal (oscillator) and pic18f452
thanks for all