PWM frequency settings

- allow to change PWM frequency
- fix PWM resolution