Patent ID: 8058932

Claim:
A digital pulse width modulation device, comprising a counter, a first comparator and a second comparator, characterized in that the first and second comparators are connected in parallel with each other and connected in series with the counter, such that the counter is capable of sending a count signal to the first and the second comparators simultaneously, starting a counting procedure when the counter receives a clock (CLK) signal, and transmitting the count signal to the first and second comparators, and if the first comparator receives a pulse duty width signal, the count of the count signal will generate a pulse output of the corresponding duty cycle, and if the second comparator receives a total pulse duty length signal and the count of the count signal reaches a number of the total length, a clear signal (CLR) will be outputted to the counter to reset the counter to zero, so as to achieve the effect of correcting pulse, wherein the first and the second comparators are provided for controlling width of the duty and total length of duty, respectively, and two formulas are obtained as follows: output frequency =input frequency/the total length of duty, and duty ratio =the width of duty/the total length of duty, wherein the digital pulse width modulation device uses a frequency generated by an internal oscillation circuit as a basic frequency, and a sample rate including the total length and the width of the duty to determine a final output frequency by formula of the output frequency =basic frequency/sample rate, and output duty cycle can be high or low according the output sample rate adjusted according to different requirements, so as to achieve the effect of correcting oscillation frequency and the width of duty.