I have a piece of interrupt driven code which measures pulse width on both ports (two channel ADXL202 digital pwm output). CCP1 is first set to rising edge, inside of the hit interrupt, it is switched to falling edge, next interrupt CCP2 is selected on rising and last one on CCP2 falling edge. The pulses aren't that fast, but luckily I could regulate the average and maximum pulse width so it's all covered withing one overflow of timer1 so I don't have to do any fancy checking. Wasn't even that hard to set up. Claudio -----Oorspronkelijk bericht----- > Example: > > After enable, > 1st trigger edge: reset TMR1 > 2nd trigger edge: capture, flag and disable. > > Surely this would make it much more usable. Hey yeah - plus if the trigger edges were selectable it would be great for measuring pulse widths. eg: After enable, 1st trigger (+ve edge): reset TMR1 2nd trigger (-ve edge): capture, flag and disable. -- 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