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

PWM library question

Hi Team

I see a post https://devzone.nordicsemi.com/f/nordic-q-a/60261/nrf52-pwm-library-or-driver?ReplySortBy=CreatedDate&ReplySortOrder=Ascending

It said "It is vulnerable to polarity inversions'. Could you help to give more explain about this issue? Thank you

  • Does it mean that if user expect to output a high level, it will actually output a low?
  • this issue happen in what application scenarios?
  • Is it auto recoverable. 
  • Do we have workaround for this issue?

Regards 

Victor

Parents
  • Hey Victor, 

    I believe I spoke out of turn when I said "It is vulnerable to polarity inversions". An earlier version of the PWM library used the GPIOTE TOGGLE task who is vulnerable to polarity inversion if the TIMER is disabled/enabled without controlling the initial state of the GPIOTE. The newer library (nRF5 SDK 15 and newer sdks) uses the SET and CLEAR tasks which are not nearly as vulnerable to polarity inversion as the TOGGLE task. 

    The only vulnerability left is if the user explicitly writes invalid top and duty-cycle values to the TIMER directly, without using the app_pwm API. 

    BR,
    Håkon Holdhus

Reply
  • Hey Victor, 

    I believe I spoke out of turn when I said "It is vulnerable to polarity inversions". An earlier version of the PWM library used the GPIOTE TOGGLE task who is vulnerable to polarity inversion if the TIMER is disabled/enabled without controlling the initial state of the GPIOTE. The newer library (nRF5 SDK 15 and newer sdks) uses the SET and CLEAR tasks which are not nearly as vulnerable to polarity inversion as the TOGGLE task. 

    The only vulnerability left is if the user explicitly writes invalid top and duty-cycle values to the TIMER directly, without using the app_pwm API. 

    BR,
    Håkon Holdhus

Children
No Data
Related