The digital -analog hybrid device is used to achieve the high-precision detection of the grid voltage based on the algorithm of biquadrate Butterworth band pass filter which is achieved by the digital algorithm based on MSP430F169 MCU. Then the fact influencing the filter performance is analyzed by the different quality factor Q. And a voltage zero-crossing modified algorithm is realized by the grid frequency fluctuation based on the phase compensation method. The effect of frequency fluctuation on the output phase is eliminated by the phase feedforward compensation The sampling error of the digital algorithm is compensated by the circuit of RC analog filter.