SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
By using LGPT0 and LGPT1 the timers can generate IR codes with minimal software interaction. By enabling IRGEN.CTL in LGPT0 an AND gate is set between T0C0 and T1C0, the output of this AND gate replaces T0C0. In IR generation mode LGPT0 generates the carrier wave, while LGP1 works as the modulator.
Below is an example on how to set up the timers for IR with a 38 kHz carrier wave.
LGPT0 (Carrier wave generation):
(48MHz)/((PRECFG.TICKDIV+1) × (TGT+1)) = Wanted Frequency (for example, 38kHz)
For example, PRECFG.TICKDIV = 2 and TGT 420. This gives a carrier wave of approximately 38kHz (Theoretically 38.00475kHz).
Configure EVTSVT
LGPT1 (Modulator, example for the NEC protocol)