Arduino core structure and timer usage I needed to use TC1 for input capture, but also analogWrite() and an approximate 1 ms interrupt to poll the user interface (encoder, button).

The Arduino Nano's ATmega328p (datasheet, beware: a lot of bit symbol typos) has three timers:


TC0
TC1
TC2


It is not easy to find information on the "Arduino core" structure and it's use of peripherals. The Arduino Reference does not seem to refer to any information. Nor does Arduino Hacking.

Some info can be found on

https://arduino-info.wikispaces.com/Timers-Arduino

but I am not sure it's up to date. For instance, I find disabling TC2 also disables the analogWrite() PWM. 
Trying to use TC0 results in an error, as TIMER0_OVF_vect is already being used ("multiple definition of `__vector_16'").

How can I use the timers (and their interrupts) that are already used for the core?
Here is a summary of all this. On an ATmega328P (Arduino Uno, Nano,
etc.), the Arduino core library uses the timers as follows:


Timer 0


timing and delay functions, using the TIMER0_OVF interrupt
“fast” PWM at 980 Hz on pins 5 and 6 (PD5 and PD6)

Timer 1


“phase-correct” PWM at 490 Hz on pins 9 and 10 (PB1 and PB2)

Timer 2


“phase-correct” PWM at 490 Hz on pins 3 and 11 (PD3 and PB3)



All three timers have their prescalers set to 64. TIMER0_OVF is the
only timer interrupt enabled by default.

Note that libraries can use the timers for their own purposes. Servo
for instance uses Timer&nbsp;1 for doing interrupt-based PWM.