摘要 |
The generator stores high and low level pulse width data and generates a square wave signal in a given period and duty cycle being controlled by the program in a microprocessor. The generator comprises pulse width data registers (1,5) for storing the pulse width data, a counter (3), a first comparator (2) for comparing the value of the pulse width data register (1) with the value of the counter, a second comparator (4) for comparing the value of the register (5) with the value of the counter, and a square wave generator (6) for outputting a low level pulse if the value of the counter is equal to the value stored in the register (1) and a high level pulse if the value of the counter is equal to the value stored in the register (5) to provide a square wave in which the period and duty cycle are controlled by the program.
|