Conversation
Adds hardware-specific implementations for the Arduino Zephyr core (ArduinoCore-zephyr), selected via ARDUINO_ARCH_ZEPHYR. Driver PWM (1/2/3/4-PWM) drives the Zephyr PWM timers directly through pwm_set_pulse_dt(): the requested frequency is stored once into a per-pin copy of the channel's pwm_dt_spec, and each update pushes only the pulse width. Pins are resolved from the `pwms`/`pwm-pin-gpios` properties of the board's `zephyr,user` devicetree node, and the timer channel is muxed to the GPIO via init_dev_apply_channel_pinctrl() (as the core's analogWrite does). Pins not mapped to a PWM channel fall back to analogWrite(). 6-PWM is reported as unsupported (no portable hardware dead-time). Inline current sensing uses analogRead()/analogReadResolution(). Low-side sensing is reported as unsupported (needs ADC/PWM sync). Verified on Arduino UNO Q (STM32U585): compiles, uploads, runs the open-loop velocity example, and generates PWM on the timer-mapped pins.
|
Hey @gbr1, Thanks for this. Could you please just add an example code in th examples folder? Just in case someone searches for something similar. |
|
Hi @askuric !!! Thank you! I have just added the example! Could you suggest me a shield/module/combo to use with our boards so I can develop the other feature missing? |
|
Hi @gbr1, So if you want to implement the 6pwm and want a very simple system, you could take something like this: It is a low power 6pwm driver that you can test on the same motor as with mini boards. And the other remaining part would be the low-side current sensing. Basically synchronising the ADC conversion and the Timer outputs. But for that one you can use the mini v2 boards. And you can test everything with the same gimbal motor. I went quickly through your code and it I'm not mistaken the PWM singnals are not center algned, am I right? |
Description
Adds hardware-specific implementations for the Arduino Zephyr core (ArduinoCore-zephyr), selected via ARDUINO_ARCH_ZEPHYR.
Driver PWM (1/2/3/4-PWM) drives the Zephyr PWM timers directly through pwm_set_pulse_dt(): the requested frequency is stored once into a per-pin copy of the channel's pwm_dt_spec, and each update pushes only the pulse width. Pins are resolved from the
pwms/pwm-pin-gpiosproperties of the board'szephyr,userdevicetree node, and the timer channel is muxed to the GPIO via init_dev_apply_channel_pinctrl() (as the core's analogWrite does). Pins not mapped to a PWM channel fall back to analogWrite(). 6-PWM is reported as unsupported (no portable hardware dead-time).Verified on Arduino UNO Q (STM32U585): compiles, uploads, runs the open-loop velocity example, and generates PWM on the timer-mapped pins.
Type of change
Test Configuration/Setup: