IRRemote, PWM conflicts

I’m using the IRRemote library ( to receive input from a universal remote. This is working correctly, and my input pin is 2 on the Arduino Uno.

Additionally, I have a display made up of a few strings of LEDs. These are powered by a bcd-7 segment converter and a uln2003 darlington transistor set. This also works correctly and occupies pins 3,4,6,7,8,11,12, and 13 (It’s 4 pins for the bcd and 4 pins to address which segment of the 4 character display).

Finally, I can adjust the brightness of the display by setting the PWM on a few pins which cycles the bcd-7 segment converter blank pin. The pins I’m using are 9,10, and 5. This also works correctly.

However, when the brightness is anything but 255, the IRRemote library starts receiving invalid codes to the point where the remote no longer works because it can’t read a successful code in time.

I’m confused because IRRemote library uses timer2, which should only affect PWM on pins 3 and 11, and while I’m using 3 and 11 for digitalwrite commands, I’m only using 5, 9, and 10 for PWM analogwrite commands.

Is there something I’m missing with the timers and interrupts and PWM that causes PWM usage < 255 on pins 5,9, or 10 to affect Timer2 and its ability to read the remote?


The problem with using libraries is that you don't know what they are doing. You can open them up and look at the source code and see what timers they are accessing. Is the blanking PWM signals synchronised to the multiplexing of the seven segment displays? It needs to be to avoid any trouble. It would help if you posted the code (using the # icon in the reply box).