Guys: I have a conundrum that is proving a little difficult to solve. I need to generate a waveform and then measure the resultant wave after its been through the unit its testing. It's a stream of 6 x 1.5mS pulses with 50Us gaps that repeats every 20mS. That then feeds a widget that stretches the 50Us gaps to 200Us and adds a trailing edge 200Us period. And inverts the whole thing. This is the unit being tested. Generating the pulse stream is easy. A simple timer loop is called every 20mS from an interrupt driven loop. The capture module is then enabled before each sequential pulse or gap to measure and compare with a windowed reference value. The good results stored in a couple of flags and converted into go / no go lamps after 13 consecutive loops.=20 This shows up the latency in the ISR as the periods get stretched by differing amounts according to which interrupt was called. There are three Tmr1 for the 1Us clock for the capture module, Tmr2 for the 20Ms tick to drive the main calling loop these are both the same length and then there i= s the capture module.... That is a lot longer and variable as the leading and trailing edge take differing times....=20 This is stretching the 50Us periods by as much as 50Us.=20 Does anybody have any suggestions to combat this latency ??? It's a F648A with internal 4mhz Osc Thanks in advance Steve --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .