I tried your code (the register names are the same) but it didn't work. The datasheet tells me to "Make the CCP1 pin an output by clearing the
TRISIO<2> bit." and your code didn't do that. How do I clear a bit?