-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation warning for mcpwm_isr_register() (IDFGH-6217) #7890
Comments
Just have seen ESP32-S3 series has a comeback of mcpwm, but a smaller pulse counter. |
Hi @gin66 The MCPWM peripheral does have a lot more interrupts than just capture interrupts. But I remember the driver didn't ever exposed any API for users to use the events like "utez", "utez". I guess you enabled the interrupt by expanding the In ESP-IDF 5.0, the MCPWM driver will be totally re-design, exposing all abilities to user with much extensible APIs. We will provide all the callbacks to user and user don't have to handle the ISR low level stuffs by themselves.
MCPWM peripheral is resource consuming, so in some ESP32 derivates (like ESP32C3), it's not supported. BTW, for stepper motor applications, you can also try the RMT peripheral, you can use it to generate fixed number of pulses. See example https://github.com/espressif/esp-idf/tree/master/examples/peripherals/rmt/step_motor |
Thanks for the feedback. In the FastAccelStepper library, normally the mcpwm driver is only used for basic setup and for the generic interrupt callback. All else (e.g. timer prescaler, interrupt flag management,...) is more or less done by direct register access. This is for me much more convenient and transparent on what is going on. If the IDF 5.0 mcpwm still supports the co-existence of direct register access, then this should be fine. Thanks for the hint to the RMT peripheral. After some deeper look, there should be something possible. And the need for the pulse counter could be gone. Just the 64 entry depth is not very long. Another drawback is the varying device support (8 TX for esp32, 4 TX for esp32-s2, 2 TX for esp32-c3 and 4 TX for esp32s4). This does not make it easy to develop a driver. Nevertheless better than no mcpwm at all on s2/c3.... |
Yes, sure, the register file is always available. Thanks for your trial with RMT, with regard to the RMT entry depth, it can be altered from https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/rmt.h#L75 |
Thanks for reporting, fix is available at e6ee8b2, feel free to reopen. |
I am the author of FastAccelStepper. This provides for esp32 a high speed stepper motor driver (up to 200kStep/s) supporting up to six parallel active motors. This is enabled by the use of mcpwm and pcnt modules of the esp32. While upgrading to espidf 4.4 a deprecation warning has popped up:
Now I have checked for the proposed callback alternative. Apparently this callback only supports the capture events, but not the other great features of the mcpwm module. The library FastAccelStepper relies on interrupts linked to
op0_tea_int_st
,op1_tea_int_st
andop2_tea_int_st
.That's why I request to either NOT deprecate this API call, or add a callback for interrupts related to these
opX_tea_int_st
.BTW: I have noticed, that espressif has dropped the mcpwm modules in all new derivates. This means, espressif does not want its users to use the esp32-derivates for any kind of high performance stepper motor application ?
The text was updated successfully, but these errors were encountered: