WB32L003 Standard Peripherals Firmware Library

TIM1_PWM_Input example

      ****************** (C) COPYRIGHT 2023 Westberry Technology *******************
      * @file    TIM/TIM1_PWM_Input/readme.txt
      * @author  Westberry Application Team
      * @version V0.0.4
      * @date    23-April-2023
      * @brief   Description of the GPIO TIM1_PWM_Input 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, WESTBERRY 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 使用PD4管脚进行外部信号频率和占空比的测量 TIM2 输出4路频率相同，占空比不同的PWM波供TIM1测量使用 TIM2_CH1 PB5 10kHz 35% TIM2_CH2 PD6 10kHz 70% TIM2_CH3 PA3 10kHz 28% TIM2_CH4 PC4 10kHz 95%

目录内容

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

硬件和软件环境

- 硬件平台搭建
  - 芯片管脚连接如下：
    - TIM1_CH1 PD4 连接到外部波形管脚(PB5, PD6, PA3, PC4)

如何使用？

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

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

- 运行此例程

  ###
  © COPYRIGHT 2023 Westberry Technology