An FPGA prototyping of real-time pattern generator for step-and-scan lithography equipment using Digital Micromirror Device (DMD) is described. It supports IM sample/sec stage position data acquisition for high-speed and high-accuracy pattern generation. It also supports arbitrary pixel-level masking to cancel the effect of DMD manufacturing variability. We have developed the sliding window at the interface of the frame buffer in order to cancel stage fluctuation. We have also developed a fast and small data converter from binary bitmap to DMD format. This pattern generator has been successfully implemented to FPGA Stratix-It EP2S180 with max clock frequency at 123.93 MHz and max DMD frame rate at 1,202 frame/sec.