The crew from AnalysIR has written up an article on Backdoor uPWM Hack on Photon for Infrared signals:
Since we received our Photon several months ago it has been difficult to find a working example of Hardware PWM on the Photon (suiteable for IR signals). Initially, we ported our softPWM approach to the Photon, which is excellent. However, we figured it must be possible to use at least one of the spare UARTs on the Photon to achieve our goal. So first we started prototyping on the Arduino and quickly got a working example with some limitations – only 40 kHz and 33 kHz carrier frequencies were possible with the UART without delving into the registers a bit more. Then we moved the code over to the Photon, leveraging our previous softPWM examples, upgraded with the Arduino code – EUREKA! The Backdoor uPWM Hack on Photon for Infrared signals.
More details at AnalysIR blog.