Frequency measurement with TIMER1 capture unit

Back to start page

Frequency measurement - period time measurement

One can measure the frequency by measuring the time period T and invert the value, f = 1/T.

Configure the Capture unit


TIMER1 with capture unit, simplified block diagram.

16-bit counter TIMER1 has a Capture register. At positive or negative edge (acoarding to choice) at pin ICP1/PB0, the value of TIMER1 is stored in the ICR1 register. Flag bit ICF1 indicates when this has happened.

Are you missing a signal generator? The program has been combined with the  tmr0pwm.c  program generating a 7812 Hz test signal that you can measure!

The full program is available here:


Back to start page

 


William Sandqvist    willsandqvist@gmail.com