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

How to obtain current PWM value?

Hi,

is there any simple way to obtain current PWM value if nrf52 PWM module is used to produce complex waveform from RAM array? The task is to get currently settled value of duty-cycle and to perform some modification of residual data according that value. I didn't find any register containing either pointer to or currently locked value.

  • Hi,

    There is no such register, but if you absolutely need to know which value it is executing from the RAM then you can calculate it in your program. If your app is not doing a manual step, then the PWM pulses depends on the PRESCALER register. You can calculate how many pulses happened after the sequence started event has happened and you will know which value in that sequence it is executing.

Related