OK, last post, I promise.
I felt I had to test see if it worked the way it's intended and it looks like it actually does, whoohoo!
I set up my Rigol DG4162 to output a a single pulse on each of its two channels and then set it up for external trigger. I fed the 60Hz output signal from the PIC to the trigger inputs on the waveform generator. The output of the generator was fed back into the two inputs on the PIC. On the waveform generator I can set the delay between trigger event and output pulse, I set that to 1.5ms for channel 1 and 4.5ms for channel 2:
The scope confirms these settings:
You can see the rising edge of the 60Hz signal on channel 1 (yellow) and then the two pulses at 1.5ms (blue) and 4.5ms (purple) respectively.
I changed the HSEROUT code in the previous post toAnd it saysCode:IF TMR1IF THEN HSEROUT["Timeout before capturing both pulses.",13] ELSE HSEROUT["Time 1: ", DEC4 Time1/5, " us.",13] HSEROUT["Time 2: ", DEC4 Time2/5, " us.",13,13,13] ENDIFIt's not perfect but pretty close. If it's critical it might be possible to tweak some of the error out but I'll leave it at this for the time being.Time 1: 1525 us.
Time 2: 4523 us.
Ryan, let us know if you try it!
/Henrik.




Bookmarks