当前位置:网站首页>When STM32 turns off PWM output, it is a method to fix IO output at high or low level.
When STM32 turns off PWM output, it is a method to fix IO output at high or low level.
2022-06-27 04:58:00 【GZZXBCXM2005】
See a lot of people on the Internet asking to stop PWM How to get the fixed output , Record here for reference .
Method 1: Set the duty cycle to 0xffff or 0 Then you can get what you want 0 or 1 Output .
Method 2 : Configure back to general IO mouth , Set it to 0 or 1.
The above two methods are found all over the Internet , But in many cases, it is not convenient to modify our duty cycle , It is necessary to maintain a fixed duty cycle , Just wanted to make PWM The following methods can be used to output or not output .
Method 3:
With TIM14 Of CHI For example
/* Set up GPIO Force output 0 /
TIM_SelectOCxM(TIM14,TIM_Channel_1,TIM_ForcedAction_InActive);
TIM_CCxCmd(TIM14,TIM_Channel_1,TIM_CCx_Enable);
/ Set up GPIO Force output 1 */
TIM_SelectOCxM(TIM14,TIM_Channel_1,TIM_ForcedAction_Active);
TIM_CCxCmd(TIM14,TIM_Channel_1,TIM_CCx_Enable);
The above can make PWM IO Direct output 0 or 1.
/* Restore the original duty cycle PWM Output */
TIM_SelectOCxM(TIM14,TIM_Channel_1,TIM_OCMode_PWM1);
TIM_CCxCmd(TIM14,TIM_Channel_1,TIM_CCx_Enable);
边栏推荐
- neo4j community与neo4j desktop冲突
- 微服务系统设计——服务注册与发现和配置设计
- 015 C语言基础:C结构体、共用体
- DAST 黑盒漏洞扫描器 第六篇:运营篇(终)
- Système de collecte des journaux
- Common programming abbreviations for orbit attitude
- 2022-06-26: what does the following golang code output? A:true; B:false; C: Compilation error. package main import “fmt“ func main() { type
- neo4j图数据库基本概念
- 轨道姿态常用编程缩写
- 021 C语言基础:递归,可变参数
猜你喜欢

微服务系统设计——服务熔断和降级设计

Office VR porn, coquettish operation! The father of Microsoft hololens resigns!

QChart笔记2: 添加鼠标悬停显示

Système de collecte des journaux
![[BJDCTF2020]The mystery of ip](/img/f8/c3a7334252724635d42c8db3d1bbb0.png)
[BJDCTF2020]The mystery of ip

RTP 发送PS流工具(已经开源)

Kotlin compose compositionlocalof and staticcompositionlocalof
![[station B up dr_can learning notes] Kalman filter 1](/img/18/ee21d31f6a118e4e4ad466b55361cc.gif)
[station B up dr_can learning notes] Kalman filter 1

1.5 conda的使用

Kotlin compose implicitly passes the parameter compositionlocalprovider
随机推荐
008 C语言基础:C判断
012 C language foundation: C array
微服务系统设计——API 网关服务设计
STM32关闭PWM输出时,让IO输出固定高或低电平的方法。
[station B up dr_can learning notes] Kalman filter 2
清华大学开源软件镜像站网址
低代码开发平台NocoBase的安装
Log collection system
微服务系统设计——分布式缓存服务设计
微服务系统设计——分布式事务服务设计
015 C语言基础:C结构体、共用体
Edge在IE模式下加载网页 - Edge设置IE兼容性
Penetration test - directory traversal vulnerability
nignx配置单ip限流
【622. 设计循环队列】
018 C语言基础:C文件读写
009 C语言基础:C循环
Web3还没实现,Web5乍然惊现!
Is the truth XX coming? Why are test / development programmers unwilling to work overtime? This is a crazy state
微服务系统设计——统一鉴权服务设计