16 Motor Control PWM (PWM)
Operation and Configuration Tips
This section provides the operational tips and set-up options for the fault handler submodule.
Fault signals coming from pads are sampled and synced in the GPIO matrix. In order to guarantee the success-
ful sampling of fault pulses, each pulse duration must be at least two APB clock cycles. The fault detection
submodule will then sample fault signals by using PWM_clk. So, the duration of fault pulses coming from GPIO
matrix must be at least one PWM_clk cycle. Differently put, regardless of the period relation between APB
clock and PWM_clk, the width of fault signal pulses on pads must be at least equal to the sum of two APB clock
cycles and one PWM_clk cycle.
Each level of fault signals, FAULT0 to FAULT2, can be used by the fault handler submodule to generate fault
events (fault_event0 to fault_event2). Every fault event can be configured individually to provide CBC action,
OST action, or none.
• Cycle-by-Cycle (CBC) action:
When CBC action is triggered, the state of PWMxA and PWMxB will be changed immediately according to
the configuration of registers
be indicted when the PWM timer is incrementing or decrementing. Different CBC action interrupts can be
triggered for different fault events. Status register
is on or off. When the fault event is no longer present, CBC actions on PWMxA/B will be cleared at a
specified point, which is either a D/UTEP or D/UTEZ event. Register
at which event PWMxA and PWMxB will be able to resume normal actions. Therefore, in this mode, the
CBC action is cleared or refreshed upon every PWM cycle.
• One-Shot (OST) action:
When OST action is triggered, the state of PWMxA and PWMxB will be changed immediately, depending
on the setting of registers
configured when PWM timer is incrementing or decrementing. Different OST action interrupts can be
triggered form different fault events. Status register
tion is on or off. The OST actions on PWMxA/B are not automatically cleared when the fault event is
no longer present. One-shot actions must be cleared manually by negating the value stored in register
PWM_FHx_CLR_OST.
16.3.4 Capture Submodule
16.3.4.1 Introduction
The capture submodule contains three complete capture channels. Channel inputs CAP0, CAP1 and CAP2
are sourced from the GPIO matrix. Thanks to the flexibility of the GPIO matrix, CAP0, CAP1 and CAP2 can
be configured from any PAD input. Multiple capture channels can be sourced from the same PAD input, while
prescaling for each channel can be set differently. Also, capture channels are sourced from different PADs. This
provides several options for handling capture signals by hardware in the background, instead of having them
processed directly by the CPU. A capture submodule has the following independent key resources:
• One 32-bit timer (counter) which can be synchronized with the PWM timer, another submodule or software.
• Three capture channels, each equipped with a 32-bit time-stamp and a capture prescaler.
• Independent edge polarity (rising/falling edge) selection for any capture channel.
• Input capture signal prescaling (from 1 to 256).
Espressif Systems
PWM_FHx_A_CBC_U/D
PWM_FHx_A_OST_U/D
and PWM_FHx_B_OST_U/D. Different actions can be
449
Submit Documentation Feedback
and PWM_FHx_B_CBC_U/D. Different actions can
PWM_FHx_CBC_ON
indicates whether a CBC action
PWM_FHx_CBCPULSE
PWM_FHx_OST_ON
indicates whether an OST ac-
determines
ESP32 TRM (Version 5.2)
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?