MG32L003 Standard Peripherals Firmware Library

TIM1_PWM_ComDeadBreak example

      ****************** (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.
      ******************************************************************************

例程描述

本例程演示如何使用TIM1的互补通道，死区插入，刹车功能。

本例程系统时钟工作在24Mhz。

TIM1_CH1 PD4输出频率为10KHz，占空比42的PWM波形。 TIM1_CH1N PD5作为CH1的互补输出通道，输出频率为10KHz，占空比58的PWM波形。 死区插入值为11，TIM1工作频率为24MHz，死区插入时间为458ns。 TIM1_BKIN PC5作为刹车信号的输入源，高电平有效，当刹车信号输入为高时暂停PWM输出，PD4，PD5保持低电平，刹车信号为低时恢复输出。

目录内容

- TIM/TIM1_PWM_ComDeadBreak/TIM1_PWM_ComDeadBreak.uvprojx MDK5工程文件
- TIM/TIM1_PWM_ComDeadBreak/TIM1_PWM_ComDeadBreak.uvoptx MDK5工程配置文件
- TIM/TIM1_PWM_ComDeadBreak/JLinkSettings.ini Jlink配置文件
- TIM/TIM1_PWM_ComDeadBreak/main.c 主程序

硬件和软件环境

- 硬件平台搭建
  - 芯片管脚连接如下：
    - TIM1_CH1 PD4 连接示波器
    - TIM1_CH1N PD5 连接示波器
    - TIM1_BKIN PC5 连接刹车信号输入源

如何使用？

为了使程序工作，您必须执行以下操作 :

- 使用 MDK5 打开此例程文件夹中的 TIM1_PWM_ComDeadBreak.uvprojx 工程
- 重新编译该工程并下载到目标存储器中

- 运行此例程

  ###
  © COPYRIGHT 2023 megawin Technology