>Your method crossed my mind too, but I didn't expect it would work >with a 20kHz PWM signal. I will at least need an antiparallel diode >across the resistor of the RC to let the capacitor discharge >immediately at low state of the PWM signal. Else, the delayed pulse on >the output of the AND gate will have the same delay at turnoff too. Or >am I missing something here? I wonder if you really need a full 1uS, as you really only need enough time to stop the two transistors in the totem pole from conducting simultaneously, and with suitable gate drive they should switch faster than this. Let me try some ASCII art -----\ input drive ----------------| \ | | & \ R | / +-------| / | |----/ C | ground now consider what happens when the input drive signal is low, the output of the gate will be low as both inputs are low. When the input drive goes high, one input of the gate will go high, but the other input will not go high until the input has been high for a time determined by the RC time constant. Therefore the output will not go high until a delay determined by RC has occurred. Now with the output high, when the input drive goes low, the output will go low immediately (subject to gate delay) as one input has now gone low. Provided the input drive stays low for a period greater than the RC time constant the situation in the previous paragraph will hold when the drive goes high again. As someone else mentioned it may be worth putting a diode across the R to discharge the C when the input is low. If you do not wish to use an RC and have spare gate packages available then these could certainly used between the two pins as mentioned by someone else. This is a valid technique for determining edges on wave forms by replacing the AND gate with an XOR gate, although typically 3 or 4 gates in series would be used for the delay in this case. The verification of this is left to the student :) -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics