Embedded Systems & Firmware
A timer counts a 16 MHz clock divided by 16 with a prescaler and raises an interrupt every 1000 counts. What is the interrupt interval?
- A1 µs
- B1 ms
- C16 ms
Show answer and explanation
Answer: B. 1 ms
Dividing 16 MHz by 16 gives a 1 MHz timer clock, so one count is 1 µs. An interrupt every 1000 counts gives an interval of 1 µs × 1000 = 1 ms. A prescaler divides a clock that is too fast so the timer can count over a useful range. A 1 ms interrupt is commonly used for timekeeping, reading switches and the RTOS tick.
- A. 1 µs is the time of a single count.
- B. Correct. 1 µs × 1000 = 1 ms.
- C. The prescaler divides by 16 rather than multiplying.