The PWM is used to generate a periodic output waveform. This waveform can be switched on or off and its shape can be easily modified, with a user definable period and high time. Programming the PWM is achieved through an AMBA APB interface. Generation of the output waveform is started and stopped by writing to the control register. Once stopped, the output is held high until the next start. The period register is written with the number of system clock cycles required as the period of the waveform and the high time register is written with the number of system clock cycles for which the waveform should be high within each period.