Timer 1 Counter Mode

Hi everybody, i am using arduino mega 2560 and i wanted to use counter of timer 1 , i have given clock of 100 Hz on pin 11 for timer 1 counter, i have also configured the timer-1 register B and set the CS(clock select) bits but for some reason its not working. Below is my code, would be grateful if any one can point my mistake over here or modify the code to correct it or just give any suggestion. I have also attached the file.

int val;
void setup()
{
startCounting();
}

void loop()
{ 
  val =TCNT1;
  Serial.println(val);
}

void startCounting()  //Encoder FrequencyCounter Start
{
/*  Timer 1 would be used for frequency counter. Using event counter mode of timer.*/ 

TCNT1=0x00;          //Reset Timer 1 Counter.
TCCR1A=0x00;
TCCR1B=0x07;       // To set all pins CSn2,CSn1,CSn0 to use external clock source on Tn Pin. Clock on rising edge.
                                    //pin 11 for timer 1 will be used as an external clock.
}

Counter_Mode.ino (513 Bytes)