Hello team, Recently I had a project where I had to control a motor using PWM. In general things worked pretty well, but I've met an issue when I need to stop PWM as soon as possible. My custom board is based on SAMv7 and uses the standard NuttX PWM driver. The issue with the SAMv7 PWM peripheral is that when a PWM stop is issued the PWM generation is not stopped immediately, but waits at the end of the current cycle. I'm not sure if that is unique to SAMv7, so maybe you can give feedback about the other platforms. Initially I tried to replace stop by keeping PWM running and updating config to have 0% duty cycle, but that still waits till the end of the current cycle to apply. The SAMv7 PWM has a signal override capabilities, so I used that instead of stopping the PWM. I've extended the "struct pwm_info_s" structure and included an override field there, but feel that it might not be the best approach.
I would appreciate your advices on what is the best way to integrate output override feature into existing PWM driver. Best regards, Petro