Abstract:
In view of resource problem caused by using two timers/counters of single-chip microcomputer to realize PWM, the paper proposed a method of using single timer/counter to realize PWM. It gave characteristics of PWM signal and timer/counter of MCS-51 single-chip microcomputer, and detailedly introduced implementation of the method by an example of PWM control of hydraulic proportion valve and analyzed performances of the PWM. The analyzing result showed that the PWM can meet with general application and solves problem of resource shortage of timers/counters in single-chip microcomputer, but frequency, phase accuracy and stability of PWM signal are influenced by interrupt response time in some degree.