If you use the HPWM command you don't need to mess with Timer2. PBP handles this for
you automatically.

If you need hardware PWM for a frequency not supported by the HPWM command, then
you need to set everything up manually.