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

strange behavior with Chapter 5 serialOrgan/organ.c #21

Open
ka80 opened this issue Dec 5, 2016 · 0 comments
Open

strange behavior with Chapter 5 serialOrgan/organ.c #21

ka80 opened this issue Dec 5, 2016 · 0 comments

Comments

@ka80
Copy link

ka80 commented Dec 5, 2016

The microsecond delay in organ.c doesn't work for me using avr-gcc 4.8.1.

for (i = 0; i < period; i++) {
    _delay_us(1);
}

The delay is much longer than expected (~7*period). I can get the code to work using _delay_loop_2(), but it's sparked my curiosity trying to figure out what's going on.

In case anybody else is also curious, I started a thread on AVRFreaks to discuss a code fragment that demonstrates the problem.

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

1 participant