Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f1c100s udelay() #7

Open
satar1980 opened this issue Nov 11, 2024 · 2 comments
Open

f1c100s udelay() #7

satar1980 opened this issue Nov 11, 2024 · 2 comments

Comments

@satar1980
Copy link

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

@minilogic
Copy link
Owner

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

@satar1980
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants