What doc shows which hardware Timer(0,1,2) controls which Nano PWM pin?

This question is similar to no PWM on MEGA2560 timer 2...with PWM.h v5..since arduino 1.6.0, but that question does not answer the question about which document tells you which timer controls which PWM. It's left as the Arduino init() function in wiring.c sets every timer pin to use PWM. (setting the timer count-countrol registers for each timer to 0 for timer 1A, 1B, 2A, 2B)

The Atmel328p datasheet stops at the 328p pins, which unless I'm missing something doesn't translate in which Dx pin the timer is attached to on the Arduino nano.

The reason I ask is I ran into an issue using Timer1 to drive a 20Hz pacing interrupt while attempting to drive a 3-color LED using PWM on pins D9-11 (D11 works fine, so it looks like the conflict is in D9-D10).

Is there an arduino nano doc that shows how the timers are distributed among the Dx PWM pins?

(this may be better migrated to "Programming", but since it was related to a hardware reference I chose the "Official Hardware" forum -- feel free to migrate it if that is in error)

Hi @drankinatty.

You can see the mapping between the pin identifiers used in the ATmega328P datasheet and the Arduino pin numbers by looking at the pinout diagram that is available on the Nano's documentation page:

https://docs.arduino.cc/hardware/nano/

Or if you prefer, you can also refer to the source code here:

The Arduino pin number is the index of those arrays.

Ooooh,

Bingo - light-bulb-on! I had stared at the pinout 20 times, and just didn't snap to the Pxy being the chip pin. (my "ID-10-T" error for the day)1. That makes the pieces all fit together. Thank you.

Yikes, so D9 is timer1A, D10 is timer1B and D11 is timer2A if I'm reading PB1,2,3 correctly. That explains why PWM on D11 was fine when using Timer1, but the other two were quite unhappy.

Keep timer1 as the pacing timer and move the 3-color LED PWM to D5, D6 and D11, and all works fine. Thanks again.

footnotes:

    • just remove the punctuation and all will be clear.

You are welcome. I'm glad if I was able to be of assistance.

Regards, Per