> Feed the CLC with the CWG output Unfortunately CWG is not a permitted CLC input and I don't believe you can intercept the CWG output before the pins Comparators and PWM are permitted CLC inputs though, so perhaps a suggestion below might work. A reply I was composing as you replied --------------------- > Do you now see what I mean now? Hi James, yes I do now, as per my later reply You'll appreciate that I don't have a chip to play with and can only try and help via the datasheet It seems to me that as you can't modify the output of the CWG module before it gets to the pins, you could use those pins and the PWM pins as inputs to s/w, eg by reading the LAT registers or a physical loopback, for example to generate INT interrupts or even possibly into the comparator inputs The s/w can then use instruction logic to get what you want on a different pair pins If you used the comparators then perhaps something like this - Two PWM pins are for driving the H-bridge. (Actually only one pin at a time is PWM, the other is I/O) The CWG pins are connected (wired) to a pair of comparator pins Depending on the state of the comparator outputs (ie the CWG and its pin states), you set a pin to output either PWM or as a high/ low general purpose I/O. You'd have to alternately assign the two pins as either PWM or I/O So you still have the automated waveform generation, with s/w to modify it for output. During normal operation the PWM would be turned off, the s/w copying the CWG pins' states to those alternate pins now both assigned as I/O There are several ways you can determine the state of the CWG pins and process that. I think that the modules alone aren't capable of doing what you want on their own, you need some s/w intervention Joe ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2016.0.7690 / Virus Database: 4627/12748 - Release Date: 08/04/16 --=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 .