I trying to count the input pulse using the 16 bit counter but my Serial port shows zero. I’m using Arduino mega 2560. and I also want to know what is input capture register and can I use it here.
my code is:
TCNT1 = 0x0000; // counter starts form 0.
TCCR1A= 0x00; //16-bit counter normal mode
TCCR1B= 0x06; //count from falling edge
delay(1000); // count for 1 sec.
TCCR1B = 0x00; // stop counter.
I’m giving square to pin 5.