f1c_nonos
f1c_nonos copied to clipboard
f1c100s udelay()
I made the following code, but it only outputs 333khz not 500khz :
while(1){
//make blink on pin E0
PIN_E0_HIGH();
udelay(1);
PIN_E0_LOW();
udelay(1);
}
can you fix it sir
I have a very simple implementation of udelay. Change this function: void udelay (u32 us) { for(u32 tmp = ctr_us + us; ctr_us < tmp; ) {}; }
I have used this code, with avs timer init just make 300khz void udelay (u32 us) { for(u32 tmp = ctr_us + us; ctr_us < tmp; ) {}; }
and if I use timer0 the result is worse under 200khz