i used d-ff to get the differnce frequency of two square signals, but the duty is not a half, about 33%. so i want to know why and how to solve this problem, is there any other mothod to get this difference. thanks a lot!
The general solution is to feed the two signals into a mixer, and then use a filter to select the desired output product.
What frequency are your two signals? What type of D-FF is it, and how have you connected it?
If you feed freq1 into CLK and freq2 into D, then the duty cycle of freq2 will be approximately duplicated at the Q output. (By the way, that's how "equivalent time sampling" works in an oscilloscope.)
Re: How to get differece freq. of two different freq. sigals
i used 2 square signals around 100kHz, and both have 50% duty cycle, freq1 to clk and freq2 to d, then the duty of q is about 1/3 and 2/3 alternately which confuse me.
i dont want to use mixer plus filter, maybe a little complicated i think. so any suggestion, do me a favor.
thanks!
That sounds like it should work fine. How close together are your two frequencies?
Are you experienced at troubleshooting, or is this a new adventure for you?
Examine your input signals to be sure they have proper levels, no bad ringing, good rise/fall times, and don't have any small glitches generated from somewhere else in your system. Check for clean power supply too. I'm guessing that some unexpected signal is toggling the flip-flop at the wrong time.