title: How to count time in C for ATMega8 with clock 16MHz
body: <p>How to count time in interruption and set is as a global variable ?
  My microcontroller is Atmega8, F_CPU is 16MHz, programming language is C.
  I know few things, that line below is initialization of clock.</p>
  
  <pre><code>TCCR1B |= (1 &lt;&lt; CS10);
  </code></pre>
  
  <p>And this line do, that global variable "a" get value of cycles divided by "xxx". But what value must be assigned to xxx ? </p>
  
  <pre><code>a = TCNT1/xxx;
  </code></pre>
  
  <p>PS1: I want to count last turn of my propeller in propelled LED display and give this value to next interrupt to display image in right way.</p>
  
  <p>PS2: To do delays, I use function: _delay_ms().</p>