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?
Parents
  • Hi.

    Issue 1:

    Do you have a logic analyzer that you can use to measure what kind of duty cycles the PWM actually produces? When I test the library the signal is constantly high or low if I use duty cycles 0 or >100. If you are using a custom board it could be issues with your design that cause the LED to light up even though it shouldn't. Do you mind uploading your schematic and layout files?

    Issue 2:

    APP_PWM_POLARITY_ACTIVE_LOW is the default polarity so this probably changes nothing. Have you tried APP_PWM_POLARITY_ACTIVE_HIGH? Which one to chose depends on whether your are sinking or sourcing current to your LED. 

  • hey!

    We are doing progress on the private ticket so I will close this one and just continue with the other.

    Thanks!

Reply Children
No Data
Related