Need help with ATmega timer

Hello all,
I am trying to write code for ATmega16 using Arduino IDE. I am using the reference from openhardware.ro.
I am using ATmega16 as I need more numbers of pins.

I am trying to use the inbuilt timer1 in CTC mode of Atmega16 but unfortunately its not working.
When I compile the code with AVR studio it works but when compiled with Arduino IDE it does not work…

Arduino IDE version i 1.6.5

Please help.

void setup()
{
  
  usart_init();
  delay(1000);
  sei();


//For 1 second
  TCCR1B |= (1 << WGM12 ); // Configure timer 1 for CTC mode
  TIMSK |= (1 << OCIE1A ); // Enable CTC interrupt
  OCR1A = 31249;
  TCCR1B |=(1 << CS12 );

}



ISR(TIMER1_COMPA_vect)
{
  transmit_string("Here");
}




void usart_init()
{
  UCSRC=(1<<UCSZ1)|(1<<UCSZ0)|(1<<URSEL);
  UCSRB=(1<<RXEN)|(1<<TXEN)|(1<<RXCIE);
  UBRRL = 51;
  UBRRH = 0;

}


void transmit(char data)
{
  loop_until_bit_is_set(UCSRA,UDRE);
  UDR=data;
}

void transmit_string(char *data)
{
  while(*data)
  {
    transmit(*data);
    data++;
  }   
}

krunal2411 wrote (in part):

...unfortunately its not working.
...when compiled with Arduino IDE it does not work..

These statements provide no information. Try again.

The Arduino IDE probably complained about a missing loop() function. It may also have had difficulty with the loop_until_bit_is_set(...) function.

A link to your "...reference from openhardware.ro" might be helpful as well.