title: blinking an led using timer interrupt (atmega 128)
body: <p>I'm trying to blink an led without using the delay function.
  I came across using the timer interrupt and I tried it, and it compiles fine. But the output is fixed on PORTA = 0x01; so, I believe the ISR function is not working. Is there anything I am missing in the code? Thanks.</p>
  
  <pre><code>#include &lt;asf.h&gt;
  #include &lt;avr/interrupt.h&gt;
  
  volatile unsigned int count=0;
  volatile unsigned int tTime=0;
  
  void port_init(void) {
      PORTA = 0xff;
  }
  
  ISR(TIMER0_OVF_vect)
  {
      TCNT0 = 206;
      count++;
      if (count &lt; 625) {
          PORTA=0x01;
      }
      else if ((count &gt; 625) &amp;&amp; (count &lt; 1250)) {
          PORTA=0x00;
      }
      else {
          count=0;
      }
  }
  
  int main (void)
  { 
      board_init();
      port_init();
  
      TCCR0 = 0x06; //setting dispensing ratio
      TCNT0 = 206; //initial value of register
      TIMSK = 0x01; //enabling interrupt
      SREG=0x80;
  
      DDRA=0xff;
      while(1){
      }
  }
  </code></pre>