This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM library issues

So, here is an interesting and fun one: I am using a module with the nRF52832 to control an LED driver with a PWM, we 
According to the documentation http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Flib_pwm.html&cp=4_0_0_3_34 the PWM Duty cycle is from 0 - 100… but when setting the duty cycle to 100 the LED driver is not turning completely off, actually is about 5% on… even more interesting and fun, I played with greater numbers than 100 (because why not?) and surprise… I don’t only can set duty cycles to 500 or more but the LED driver does turn off… 
Just to be clear, this doesn't happen on the dev boards, but on the LED driver with the nRF52832.
So I went trough the code and I cant see any restriction to the duty cycle on the PWM library… I can set more than 100 without any error popping up… May I ask if you have any information about it?
And then…
Next interesting and fun issue:
At the moment: Duty cycle 0 has brightness 100% and Duty Cycle 100 (or 500 etc…) has brightness Minimun…
I would assume that setting the pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_LOW; should invert the polarity of the PWM….? But that is not working… any idea how can I make cycle = 0 = brightness = 0 and cycle = 100 = brightness = 100?
Related