Thanks James, I didn't see the OUT bit in PWMxCON. This is probably my=20 best bet at this point, though I am noting your other suggestions which=20 will come in handy.. Jim > Having looked at the datasheet (40001819A.pdf), your options would > appear to be; > > 1. read bit 5 "OUT" of PWMxCON, or; > > 2. read a GPIO corresponding to the pin (TRIS configured as output, > but that doesn't stop you reading), or; > > 3. read TMR2 and compare with PWMxDCH:L as you suggest, or; > > 4. use the 16-bit PWM peripheral instead, and use the PWM interrupts, > or; > > 5. use the 16-bit PWM peripheral and read PWMOUT bits. > > On Wed, Feb 22, 2017 at 03:17:22AM -0500, Jim Ruxton wrote: >> I am wanting to know the state of a PWM output ( 1 or 0 ) when I >> receive a specific interrupt. Assuming I am using TMR2 for my 10 bit >> PWM clock. Can I check whether TMR2 is between 0 and the 10 bit >> value of PWMxDCH:PWMxDCL<7:6> to determine if the PWM output is on >> or not when I get the interrupt (within a few cycles)? Otherwise I >> could AND my interrupt signal with my PWM signal before sending it >> to the PIC but would prefer not to add more hardware. Is there a >> more reliable way than reading the Timer value to determine the PWM >> state, I couldn't find a flag bit that gives this info? I am using a >> PIC16F1778 . >> Thanks. >> >> Jim --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .