MG32L003 Standard Peripherals Firmware Library
|
****************** (C) COPYRIGHT 2023 megawin Technology ******************* * @file TIM/TIM1_PWM_ComDeadBreak/readme.txt * @author megawin Application Team * @version V0.0.5 * @date 13-August-2024 * @brief Description of the GPIO TIM1_PWM_ComDeadBreak example. ****************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, MEGAWIN SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM * THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. ******************************************************************************
This example describes how to use TIM1 complementary channel, dead zone insertion, and brake functions.
In this example, Main clock is configured at 24MHz.
TIM1_CH1 PD4 Output PWM waveform with frequency of 10KHz and duty cycle of 42%.
TIM1_CH1N PD5, as the complementary output channel of CH1, outputs PWM waveform with frequency of 10KHz and duty ratio of 58%.
The deadband insertion value is 11, the operating frequency of TIM1 is 24MHz, and the deadband insertion time is 458ns.
TIM1_BKIN PC5 as the input source of brake signal, the high level is effective, when the brake signal input is high, the PWM output
is suspended, PD4, PD5 keep the low level, and the output is resumed when the brake signal is low.
In order to make the program work, you must do the following :
Run the example