Can you post a schematic. It may be simpler to do the detection with reference to the positive rail than the negative rail. If the square wave has fast edges you could differentiate it with a small capacitor and a resistor to give you a string of positive and negative going spikes. You could use the positive spike to set a flipflop and invert the negative spike and use that to clear it. How close to zero does the frequency go ? (1 transition per hour ? 1 transition per century ?) If you give a full description of what you are trying to do there is more chance of having your problem solved. (Which may turn out to be a totally different approach.)
Edit. Yet another idea is to pass the signal through a low pass filter with a cut off of lower than the lowest frequency of the square wave (Assumming this is not really zero.) and use this a the reference voltage for the comparator.
Les.
Edit. Yet another idea is to pass the signal through a low pass filter with a cut off of lower than the lowest frequency of the square wave (Assumming this is not really zero.) and use this a the reference voltage for the comparator.
Les.
Last edited:


