void setup() {
  DDRA |= 1<<7;
  TCNT5L= 0x00;
  TCNT5H= 0x00;
  TCCR5A= 0x00; //counter mode of operation
  TCCR5B= 0x06;
}

void loop() {
  PORTA= TCNT5L;
  if((TIFR5 & (1<<TOV5))==1)
  TIFR5= 1<<TOV5;
}