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

nrf52832 SDK13 PWM cant change duty cycle at first period

hello ,everyone

I was confused by a PWM problem for a long time , on nrf52832 SDK13 ,i wanna change the PWM duty cycle every period ,but now i find can not change it at first period but is correct operate at subsequent period

the waveform shows that the second period is same with the first period , the third one and consecutive is invert channel 0 and channel 1 correctly

appendix the descriptive picture . image description

appendix the code of pwm handler image description

is a bug for the pwm driver ?

thanks for your attention

Parents
  • Hi,

    Could you explain this some more ?

    You have 3 PWM channels. Is the pwm signal correct on any of these channels ?

    i wanna change the PWM duty cycle every period

    What do you mean by this? You want to continuously change the duty cycle[%] to a different value after each period ? and for all channels ? Should this change be the same for all the channels ?

    How should the PWM signal look like?

  • hi, i want to generate a Periodically changing PWM waveform : the duty cycle has 2 value : 40% and 0%,channel0 is the opposite of channel1,channel2 is same of channel 1; duty cycle will switch value at every period finish. from the picture,you can see period 3,period 4...is change correctly ,but period 2 wrong looks like PWM can not change duty cycle(change RAM in pwm_handler) at first period finish,but the rest of period is change as expected

Reply
  • hi, i want to generate a Periodically changing PWM waveform : the duty cycle has 2 value : 40% and 0%,channel0 is the opposite of channel1,channel2 is same of channel 1; duty cycle will switch value at every period finish. from the picture,you can see period 3,period 4...is change correctly ,but period 2 wrong looks like PWM can not change duty cycle(change RAM in pwm_handler) at first period finish,but the rest of period is change as expected

Children
No Data
Related