Programming 16 bit timer on Atmega328

Atmega328 has one 16 bit timer which is more powerful comparing to 8 bit timers. 16 bit timer is called Timer/Counter1. Counter1 has twice more bits than 8 bit Counter0, so you get more counts leading to longer duration and more precise timings. 16 bit timer has pretty same functionality as Timer0 plus more specific ones. We won’t be discussing Normal, CTC, fast PWM and correct phase PWM modes as these are equivalent to Timer0. But lets focus on fresh things. There we have a new module called Input Capture Unit along with Input Capture Flag (ICF1) interrupt and new waveform generating mode called Phase and Frequency Correct PWM. Continue reading