Hi,
I guess the general idea is OK but whether or not a PIC can be used depends on the nominal risetime of the squareware and the resoulution you expect to get out of the measurement. The software overhead involved with using interrupts and starting/stopping the timer will most likely kill it but without any numbers on what a good and bad risetime actually is it's hard to say.First – is it idea about edge detecting OK?
Another option could be to design a window comparator so that its output is HIGH only when the voltage is between 0.5 and 4.75V. The output then drives the TMR1Gate input (on a device that has one of course). This will most likely work "better" than the comparator/software/timer aproach but again it depends on how fast/slow and godd/bad rise time actually is. Are we talking ns or ms?
/Henrik.




Bookmarks