Abstract:A DC motor PWM closedloop control system based on MC9S12XS128 was designed using BTS7970 DC motor drive, motor was controlled using the PWM pulse width modulation, and speed was tested through the photoelectric encoder, and speed measurement and precision control of a DC motor were achieved by incremental PID closedloop feedback control system. DC motor speed was controlled and displayed with buttons and LCD, which provided a good humancomputer interaction. Through the design and hardware test, the result shows that this system can realize the speed of the motor smaller error control and rotational speed.