We present a method that uses two groups of fringe patterns on one grating for phase-measuring profilometry. A two-frequency grating is projected onto the object. The high frequency is N (N = 3, 4, 5, :...) times greater than the low frequency. Using a proper phase shift, we calculated the wrapped phases of the two frequencies. When the linearity of the two phases are considered, an accurate phase of the high frequency can be unwrapped. Because the low frequency is N times more insensitive to height discontinuity, the system is more tolerable to height discontinuity.