Hi all, Anyone care to share how they use the capture module to monitor pulse streams. Can it be done?? I may be wrong here, but my idea of a capture module is to CaptureLoop: Activate capture function Hardware takes over... { Trigger on a valid edge = auto reset TMR1 = interrupt if required Capture on next valid edge = auto store TMR1 as result = auto disable capture = interrupt if required } [Capture occurred] if TMR1 overflowed Bad pre/post scale factor // > $FFFF Process data goto CaptureLoop The capture module does not appear to work this way as TMR1 is free running. This would(?) give capture scenario as... Monitor capture flag, or interrupt [Capture occurred] { Did TMR1 overflow? No Capture value = TMR1_new - TMR1_old TMR1_old = TMR1_new Process & continue Yes Overflowed once if TMR1_new > TMR1_old Bad pre/post scale factor // > $FFFF else Capture value = $FFFF - TMR1old + TMR1new TMR1_old = TMR1_new Process & continue More than once Bad pre/post scale factor // > $FFFF TMR1_old = TMR1_new Process & continue } regards Tony -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body