摘要 |
<p>PURPOSE: To realize a rectangular wave generating device, which controls a period and a duty cycle of a rectangular wave and can select the duty cycle by providing two pulse-width registers, a counter, two comparator circuits, a pulse generator and a data bus. CONSTITUTION: A pulse-width register I1, a comparator circuit I2, a counter 3, a comparator circuit II4, a pulse-width register II5, a pulse generator 6 and a data bus 7 are provided, and when a CPU actuates the counter 3, the counter 3 starts counting up of an increment by receiving an input clock. A pulse level of the pulse generator 6 is inverted each time the value of the counter 3 matches the value of the pulse-width register 1 or 5 and the counter 3 is reset when a pulse changes from H to L. Consequently, a programmable rectangular wave generating device is realized so that a period and a duty cycle of a rectangular wave are controlled by a program comparing the values of the pulse-width registers 1 and 5 with the value of the counter 3.</p> |