PWM callback on rising edge

Hi! I am currently working on a project which requires the usage of a PID controller to move a stepper-motor. For this I am calculating some stuff which determines the frequency at which the stepper motor should move. I could implement this behaviour in software, but since the GPIO library already has a pwm function (which has hardware implementation as well) I opted out for using that one. The issue I am facing is that I need feedback every time a rising edge happens (so the motor has moved). I couldn’t find information in the GPIO documentation for such a functionality. Optionally, I can use a wire that loops back to an input pin and detect rising edge this way. However this may be less than ideal. I was wondering whether the GPIO library already has this functionality.

Thanks in advance!

hello user97357,

please also refer to Nano device tree.

there’s look-up table /sys/class/hwmon/hwmon1/pwm_rpm_table for settings PWM values.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.