f1c_nonos icon indicating copy to clipboard operation
f1c_nonos copied to clipboard

f1c100s udelay()

Open satar1980 opened this issue 1 year ago • 2 comments

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

satar1980 avatar Nov 11 '24 09:11 satar1980

I have a very simple implementation of udelay. Change this function: void udelay (u32 us) { for(u32 tmp = ctr_us + us; ctr_us < tmp; ) {}; }

minilogic avatar Nov 11 '24 23:11 minilogic

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

satar1980 avatar Nov 12 '24 01:11 satar1980