MCPWM ===== Overview -------- ESP32 has two MCPWM units which can be used to control different motors. Block Diagram ------------- The block diagram of MCPWM unit is as shown. :: __________________________________________________________________________ | SYNCSIG FAULT SIG CAPTURE SIG | | 0 1 2 0 1 2 0 1 2 | |___________________________________________________________________ G | INTERRUPTS<-----+ | | | | | | | | | | P | | | | | | | | | | | | I | ________|_|___|___|_____________|___|___|_________|___|___|_________ | O | | | | | | | | | | | | | | | | | | | | | | | | | | M | | | | | __v___v___v__ __v___v___v__ | | A | | | | | | | | | | | T | | | | | | FAULT | | CAPTURE | | | R | | | | | | HANDLER | | | | | I | | | | | | | |___________| | | X | | | | | |___________| | | | | | | | | | | | ____v___v___v____ ____________________ | | | | | +---------+ | | +------------+ |--------->|PWM0A| | | | Timer 0 | | | | Operator 0 | | | | | | | +---------+ | | +------------+ |--------->|PWM0B| | | | | | | | | | | +---------+ | | +------------+ |--------->|PWM1A| | | | Timer 1 | |------------------->| | Operator 1 | | | | | | | +---------+ | | +------------+ |--------->|PWM1B| | | | | | | | | | | +---------+ | | +------------+ |--------->|PWM2A| | | | Timer 2 | | | | Operator 2 | | | | | | | +---------+ | | +------------+ |--------->|PWM2B| | |_______________| |__________________| | |_____| | | | MCPWM-UNIT 0/1 | |___________________________________________________________________| Application Example ------------------- Examples of using MCPWM for motor control: :example:`peripherals/mcpwm`. API Reference ------------- .. include:: /_build/inc/mcpwm.inc