Hello Pavel, if you have a plenty of time, why not try the following: 1. Capture rising edge, enter ISR, read timer for LOW 2. Wait here until falling edge 3. Read time for HIGH, reset timer, leave ISR 4. Do what do you want until 1. Of course, if your duty cycle nears 100% it may be a bottleneck... Imre On Tue, 16 Jun 1998, Pavel Korensky wrote: > Hello, > > just one thing to ask. I would like to use the capture pins on 16C76. > Problem is, that I need to capture the following sequence: > > rising edge, falling edge, raising edge > > and measure time between first rising edge to falling edge and between > first rising edge to second rising edge. Actually, this is a measurement of > PWM duty cycle. > > Problem is, that capture units can be programmed only as either raising or > falling edge interrupt. Is it possible to use following sequence (I suppose > that PWM cycle is slow enough and I have plenty of time) > > 1. Program Capture unit for event on rising edge > 2. Capture rising edge > 3. Program unit for event on falling edge > 4. Capture falling edge > 5. Program unit for event on raising edge > 6. Capture rising edge > 7. Do some calculations > > The 16C7X datasheet is not very helpfull. I am not able to figure out if > this will work. > > Thx for any info. > > PavelK > > > ************************************************************************** > * Pavel Korensky * > * DATOR3 LAN Services spol. s r.o. * > * Modranska 1895/17, 143 00, Prague 4, Czech Republic * > * * > * PGP Key fingerprint: F3 E1 AE BC 34 18 CB A6 CC D0 DA 9E 79 03 41 D4 * > * * > * SUMMA SCIENTIA - NIHIL SCIRE * > ************************************************************************** > >