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

Fix read access for 16bit timer counter registers. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ydirson
Copy link

@ydirson ydirson commented Dec 3, 2011

To get meaningful reading, we must read the low byte
first, so the MCU saves the correct high byte value in
the counter's temporary register (see eg. section 14.2
of the 32u4 datasheet).

To get meaningful reading, we must read the low byte
first, so the MCU saves the correct high byte value in
the counter's temporary register (see eg. section 14.2
of the 32u4 datasheet).
@ydirson
Copy link
Author

ydirson commented Dec 3, 2011

Tested on my 32u4 board, on a project where I emulate several clocks on a single timer, and thus have to save/restore the timer state. Current getCounter() method just does not work.

I hope all AVR8 mcu's share the same behaviour.

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

Successfully merging this pull request may close these issues.

1 participant