当前位置:网站首页>STM32 cubeMX HAL-----PWM—改变频率
STM32 cubeMX HAL-----PWM—改变频率
2022-07-27 04:30:00 【W001123456789】
LED1–3
Key1–5
输出PWM波形时,使用2种模式:
sConfigOC.OCMode = TIM_OCMODE_PWM1;
sConfigOC.OCMode = TIM_OCMODE_TOGGLE;
其分别对应于cubeMX中
程序中通过如下改变CCRx:
__HAL_TIM_SET_COMPARE(&htim5,TIM_CHANNEL_1,(uint16_t)CCRTemp);
__HAL_TIM_SET_COMPARE(&htim5,TIM_CHANNEL_2,(uint16_t)CCRTemp);
通过实际输出波形可以看到:
1.改变CCRx后,两种模式的频率均不会变化,频率取决于PSC, ARR,与CCRx无关;
2.改变CCRx对TIM_OCMODE_TOGGLE 无影响,其频率不变,占空比一直都是50%
3.改变CCRx对 TIM_OCMODE_PWM1产生了影响,其频率不变,占空比跟着变化。
边栏推荐
- Visualization domain svg
- Head detached from origin/... Causes push failure
- 【HCIP】重发布、重分布、重分发实验
- 【day02】数据类型转换、运算符、方法入门
- Pinia入门到精通,Pinia使用全流程,包含state,actions,getters,以及如何解构,进行响应,actions使用的多种方法
- Dynamic routing configuration
- 2022杭电多校联赛第三场 题解
- 第4章 Bean对象的作用域以及生命周期
- Shel automatically sets directory permissions
- [final review of software engineering] knowledge points + detailed explanation of major problems (E-R diagram, data flow diagram, N-S box diagram, state diagram, activity diagram, use case diagram...)
猜你喜欢

2022-07-26: what is the output of the following go language code? A:5; B:hello; C: Compilation error; D: Running error. package main import ( “fmt“ ) type integer in
Full revolutionary networks for semantic segmentation (FCN)

Bubble sort (detailed)

ceph操作

Influxdb basic understanding

grid布局

Three cores of Redux

管理信息系统期末复习
深度学习领域图像分割FCN(Fully Convolutional Networks for Semantic Segmentation)

Bo Yun container cloud and Devops platform won the trusted cloud "technology best practice Award"
随机推荐
Standard C language 13
打开编程的大门
Using JSON type to realize array function in MySQL
Session&Cookie&token
Chapter 6: cloud database
Use the kubesphere graphical interface dashboard to enable the Devops function
els_ 画矩形、代码规划和备份
Full revolutionary networks for semantic segmentation (FCN)
Sed output specified line
深度学习领域图像分割FCN(Fully Convolutional Networks for Semantic Segmentation)
使用Unity做一个艺术字系统
[final review of software engineering] knowledge points + detailed explanation of major problems (E-R diagram, data flow diagram, N-S box diagram, state diagram, activity diagram, use case diagram...)
Ref Hook
[construction of independent stations] this website is the first choice for cross-border e-commerce companies to open online stores at sea!
Nacos startup and login
[hcip] redistribute, redistribute and redistribute experiments
2022-07-26: what is the output of the following go language code? A:5; B:hello; C: Compilation error; D: Running error. package main import ( “fmt“ ) type integer in
Install and configure Debian on a wired network
STL 上头系列——list 容器详解
Cloudcompare & PCL match point distance suppression