<aside> <img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> Relevant Notes/Resources:

8 Timer Functions

Registers (Page 1 - 2)

</aside>



1. Timer Initialization

The first half of the problem is setting and clearing the bits according to the given settings listed above for the following registers.

Untitled

  1. TEN = 1 : The timer needs to be turned on to actually use the timer counter.
  2. TFFCA = 1 : To enable timer fast flag clear.

Untitled

  1. TOI = 0 : To disable timer overflow interrupt.
  2. TCRE = 0 : To disable counter reset a successful OC4 — counter free runs.
  3. PR2...PR0 = 100 : To set the TCNT prescaler to 16.

Untitled

  1. IOS4 = 1 : To select channel 4 and configure as an output-compare channel; the number at the end of the bit indicates the channel.
  2. IOS7...IOS5 = 0 and IOS3...IOS0 = 0 : By default, at reset, it is set to 0.

Untitled

  1. OM4 OL4 = 01 : To select toggle PT4 pin.
  2. OM7...OL5 = 0 : By default, at reset, it is set to 0.