OK! That makes sense. I went back and looked at the datasheet again. Makes a lot more sense now! I do have my PWM starting and stopping now. The project is not working yet but I have run into a bit of a wall at this point as I don't have a storage scope or logic analyzer and obviously can't see the entire command pulse train I am sending out to make sure all the timing is right (always seems right no matter how long you look at the code!! 8-) Thanks to all of you that helped answer the PWM question. At this point, I'm starting to think that it might be easier to write the extra code to generate the 38khz just so I can keep my pulse timings more consistant!! I also have to verify that I am using the correct NEC protocol address for the device I'm trying to control (Olympus Evolt E-510 digital SLR camera) Lots of "reverse engineering" has gone into this project so there are lots of unknowns! Thanks again to all, -James > > > Is it an acceptable method to change the TMR2 control and then just > > low the port to make sure the LED is off?? > > James, you have to give control back to the port output latch. If you look > at the schematic for B3 in the manual you'll see that in PWM mode the > output depends on the toggling done by TMR2. Changes made to the > port with eg bcf portb,3 will have no effect > > For example, this code stops PWM with portb,3 high, as the output goes > high when TMR2 = PR2 > > bcf pir1,tmr2if > btfss pir1,tmr2if ;wait for TMR2 to match PR2 > goto $-1 ;loop > bcf t2con,tmr2on ;stop TMR2 > > Output will be high. bcf portb,3 has no effect because it's being over-ridden > by the state of the compare register. Which, as above, is high > > You need to disable PWM mode for the port command to work > > clrf ccp1con ;or clear just bits 3 and 2 > > As noted in the manual, clearing CCP1CON sets the PWM comparator > output to 0. What appears on B3 now is whatever was previously, before > PWM was enabled. You can now use B3 > > bcf portb,3 > > Re-enable PWM by setting bits 3 and 2 of CCP1CON > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist