WB_PWM8 - Initialization
Frozen Content
The following steps outline the basic procedure to initialize the WB_PWM8 Controller ready for operation. You will need to re-initialize the Controller after each external reset.
- Write the required value for the pulse width to the PWMRG register
- Write the required low-order byte of the pre-scale value to the PWPLO register
- Write the required high-order byte of the pre-scale value to the PWPHI register
- Write the necessary value to the Control register (PWCON) to enable the Controller and interrupts. For example, to enable the controller and all interrupts, the following bits must be set:
pwen
(PWCON.0) – enable the Controllerpien
(PWCON.1) – global interrupt enableprie
(PWCON.2) – enable pre-scaler counter interruptpwie
(PWCON.3) – enable PWM counter interrupt.
- The value written to the PWCON register would therefore be 0Fh.