Dtynin
DIIDevHeads IoT Integration Server
•Created by Dtynin on 7/11/2024 in #code-review
Why isn't my AVR microcontroller controlling motor speed with PWM using Zephyr?
@Middleware & OS Hello guys, I'm attempting to control a motor's speed using PWM on my AVR microcontroller running Zephyr. I've set up the PWM peripheral and device tree configuration, but the motor does not respond to PWM signals. The PWM peripheral has been configured in prj.conf. I also created the device bindings in the device tree source file (dts), then wrote a code to generate PWM signals to control the motor. I expect the motor to change its speed in response to the PWM signals. Specifically, varying the duty cycle should result in corresponding changes in motor speed. The motor I'm using is a Mabuchi RS-540 series. The issue I'm having is that the motor is not responding to the PWM signals. What could be the reason for this, and how can I debug it?
this is my code snippet:
5 replies