You may use GPIO.2 (CCP1) only and set the duty-cycle (CCPR1L) to its value for the time you need to generate high pulses.
Try a 25-30% duty-cycle value, 50% is too high and makes you loose efficiency.
For a 38kHz carrier, PR2 is 25 which will give you a CCPR1L value of 8 (which is ±30% of "25").
So, if your pattern would be something like 970µs high, 970µs low and 660µs high, it could look like this:Code:.... set CCPR1L to 8 pause for 970µs set CCPR1L to 0 pause for 970µs set CCPR1L to 8 pause for 660µs set CCPR1L to 0 ....




Bookmarks