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

Servo library should use peripheral clock frequency (80MHz) instead of F_CPU #1789

Closed
mytrain opened this issue Mar 17, 2016 · 0 comments
Closed

Comments

@mytrain
Copy link

mytrain commented Mar 17, 2016

When running the following timer1 configuration, 'timerTick' is still invoked with a period of 50 us whatever the CPU frequency 160Mz or 80Mhz
timer1_isr_init();
timer1_attachInterrupt(timerTick);
timer1_enable(TIM_DIV16, TIM_EDGE, TIM_LOOP);
timer1_write(250);

I assumed that CPU frequency is changed correctly in the IDE as clockCyclesPerMicrosecond() returns 80 (for 80Mhz) or 160 (for 160Mhz).

As consequence (not tested by myself) ServoTimer.h code should not work properly in case of 160Mhz setup.

@igrr igrr changed the title timer1_write not impacted when changing frequency to 160MHz Servo library should use peripheral clock frequency (80MHz) instead of F_CPU Mar 17, 2016
@igrr igrr added this to the 2.2.0 milestone Mar 17, 2016
@igrr igrr closed this as completed Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants