-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/atmega2560: reworked timer implementation #5254
Conversation
Small murdock complain...
|
Not true, it currently requires 1MHz or a frequency that can be reached by dividing with a power of two. |
yapp, you are right, the |
So we need to provide |
No, XTIMER_SHIFT needs to be set, probably to "2" (divide by 4), when setting the periph timer to 250khz. XTIMER_SHIFT_ON_COMPARE probably also has to be set. It masks bits when reading two timer values in a row. Some MCU's (the atmega is a candidate) are not fast enough to return two times the same value, so some bits have to be ignored. |
c665f4a
to
c95fb05
Compare
fixed doxygen issue and added missint |
Nice! ACK and go! |
Oh, squash first? |
IMHO no need for squashing, as each commit contains a logical group of changes -> go |
backport needed |
fixes also #5252
The timers were kind of broken (at least did not function correctly). This implementation should now work fine.
NOTE: the periph timer is not able to run at 1MHz (missing prescaler for that), so the
tests/periph_timer
test needs to be adjusted to run the timer either with 2MHz or better with 250khz.Also the xtimer tests will most probably fail, as the xtimer requires the low-level timer to run at 1MHZ.