Access over 35 million academic & study documents

9 Assuming XTAL = 8 MHz and processor is configured to work with 50

Content type
User Generated
Rating
Showing Page:
1/2
9. Assuming XTAL = 8 MHz and processor is configured to
work with 50 MHz, indicate how long it will take the timer
to timeout given the following case. Compare the cases
and explain why the results and the same or different:
a. Configured as 16-bit timer and the initial value is
0x1FFF
b. Configured as 32-bit timer and the initial value is
0x1FFF
c. Configured as 32-bit timer and the initial value is
0x0001FFF
Solution
The code looks as follows:
CTC
But theres another mode of operation for AVR timers. This
mode is called Clear Timer on Compare Match, or CTC.
Instead of counting until an overflow occurs, the timer
compares its count to a value that was previously stored in
a register. When the count matches that value, the timer
can either set a flag or trigger an interrupt, just like the
overflow case.
To use CTC, you need to figure out how many counts you
need to get to a one second interval. Assuming we keep

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
9. Assuming XTAL = 8 MHz and processor is configured to work with 50 MHz, indicate how long it will take the timer to timeout given the following case. Compare the cases and explain why the results and the same or different: a. Configured as 16-bit timer and the initial value is 0x1FFF b. Configured as 32-bit timer and the initial value is 0x1FFF c. Configured as 32-bit timer and the initial value is 0x0001FFF Solution The code looks as follows: CTC But there’s another mode of operation for AVR timers. This mode is called Clear Timer on Compare Match, or CTC. Instead of counting until an o ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just what I was looking for! Super helpful.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4