Reply To: Microsecond variable Delay in MikroC

Home Forums Microcontrollers PIC Microcontroller Microsecond variable Delay in MikroC Reply To: Microsecond variable Delay in MikroC

#11251

Ligo George
Keymaster

It is very difficult to obtain accurate variable microsecond delay function. Make the oscillator clock frequency as high as possible and you can use Delay_Cyc() in MikroC which creates delay based in clock cycle. You may also try creating your own delay function like the following (following code is not calibrated for microsecond).

void Delay(unsigned int i)
{
    for(;i>0;i--)
    {
    }
}
string(7) "9898001"