drivers: pwm: pwm_nrf5_sw: Fix calculation of cycles per second
The nRF5x HF timer base frequency is 16 MHz, not 16777216 Hz. The improved accurracy of the PWM signal was verified with an oscilloscope on a BBC micro:bit. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
parent
ebbb744b03
commit
f5310d5b54
1 changed files with 1 additions and 1 deletions
|
@ -208,7 +208,7 @@ static int pwm_nrf5_sw_get_cycles_per_sec(struct device *dev, u32_t pwm,
|
|||
config = (struct pwm_config *)dev->config->config_info;
|
||||
|
||||
/* HF timer frequency is derived from 16MHz source and prescaler is 0 */
|
||||
*cycles = 16 * 1024 * 1024;
|
||||
*cycles = 16000000UL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue