A phase mask interferometer is developed to photo-write gratings with arbitrary Bragg wavelength. In this system, the gratings are inscribed by the UV interference fringes derived from two rotatable prisms, where the phase mask is used as a beam splitter. Furthermore, when the undersides of two prisms with the vertex angle defined by the #61617;1 diffraction angle of phase mask and the refract index of the prism are parapllel each other, the phase mask initializes the reference quantity of Bragg wavelength. As the shift of Bragg wavelength is 1 nm, the maximum rotation angle of the prism is ~1 degree, and the minimum rotation angle is ~2.4 minute. By contrasting with the rotation angle ~23 second/nm of the mirror in Talbot interferometer, the rotation precision of the prisms is decreased by two or three orders of magnitude in this phase mask interferometer. Instead of many phase masks with different grating periods, the phase mask interferometer writes grating with the inscribed wavelength of 1450~1600 nm via a phase mask and two rotatable prisms.