analogWrite not working

Not sure if this will work with your IR system.
Here is a library I wrote for NEC protocol.
Does not use timers, does use interrupts.

https://forum.arduino.cc/index.php?topic=317625.0