当前位置:网站首页>Tim output comparison - PWM
Tim output comparison - PWM
2022-07-27 02:17:00 【Ruomu·】
Catalog
One 、 What is output comparison
1. PWM Related parameters of :
2.PWM Application scenarios of :
3、 ... and . Several modes of output comparison :
Four , Polarity of output comparison
5、 ... and , In the output comparison ,TIM Common functions
6、 ... and , Different channel outputs of the same timer PWM Characteristics :
Preface
Briefly introduce the output comparison , This part is mainly the code part , The next one is passed PWM Breathing lights and PWM Control DC motor to introduce in detail TIM The output comparison function of
One 、 What is output comparison
Output comparison (Output Compare), By comparison CNT And CCR Relationship between register values , To set the output level 1, Set up 0 Or flip operation , Used to output a certain frequency and duty cycle PWM wave form , Every advanced timer and general timer have 4 Two output comparison channels
Be careful : The first three channels of the advanced timer have additional functions of dead band generation and complementary output
Two 、 What is? PWM
The expression of output comparison lies in PWM, and PWM If you've learned 51 I probably know ,PWM It's a pulse width modulation , It is embodied in the system with inertia , The required analog parameters can be obtained equivalently by modulating the width of some columns of pulses , It can be used to adjust the speed of the motor

1. PWM Related parameters of :
frequency :1/T;
Duty cycle :Ton/Ts
The resolution of the : Duty cycle change step
2.PWM Application scenarios of :
PWM The application scenario of must be an inertial system , With LED For example ,LED When it goes out , Due to the persistence of human vision ,LED It won't go out immediately , It has a certain inertia , It will take a short time to go out , For motors , Motor power failure , The rotation of the motor will not stop immediately , It has a certain inertia , It will stop after a while
According to the curve above ,PWM In fact, it can be regarded as the analog quantity represented by the dotted line in the middle
3. Duty cycle
The duty cycle determines PWM The equivalent analog voltage , The smaller the duty cycle , The equivalent analog voltage is closer to the low level , The larger the duty cycle , The equivalent analog voltage is closer to the high level
3、 ... and . Several modes of output comparison :
Timing Freeze mode
Active Set the effective level when equal
Inacktive Set invalid level when equal
Toggle When equal, the level turns
Four , Polarity of output comparison
TIM_OCPolarity_High : High polarity , That is, polarity does not flip ,REF Waveform output directly , Or effective level high level ,REF Is valid , Output high level
TIM_OCPolarity_Low: Low polarity , Namely REF The level is reversed , Or the effective level is low ,
5、 ... and , In the output comparison ,TIM Common functions
four OCinit function , It initializes the output comparison unit with a structure
TIM_CtrlPWMOutputs function , Only use advanced timer , When using advanced timer output PWM You need to call this function , Enable main output , otherwise PWM Will not output normally
middle 1088 To 1100 Some small functions of timer , Below are some functions that change parameters at runtime
among , four TIM_SetCompare Functions are important
TIM_OCStructInit function , Assign initial value to structure
TIM_SetCompare1 This function is used to change the channel separately 1 Of CCR It's worth it
6、 ... and , Different channel outputs of the same timer PWM Characteristics :
Because different channels share a counter , So their frequencies must be equal ;
Their duty cycle , By their own CCR decision , So the duty cycle can be set separately ;
Their aspect , Due to counter update , all PWM Simultaneous jump , So their phases are synchronized ;
for example , If you drive multiple steering gears or DC motors , Use a timer for different channels PWM, That's all right.
边栏推荐
- [explain C language in detail] takes you to play with loop structure (for_while_do while)
- 静态路由缺省路由vlan实验
- Pseudo class of a element
- 7.16 written examination of Duoyi network
- ensp中的简单静态路由
- 2022zui new Tiktok 24-hour round robin live broadcast monitoring (I) live broadcast room start-up monitoring
- 静态路由基础配置(IP地址的规划、静态路由的配置),实现全网可达。
- OSPF协议知识汇总
- Ogeek meetup phase I, together with cubefs, is hot
- Codeforces Round #810 (Div. 2), problem: (B) Party
猜你喜欢

Explain exi interrupt through the counting experiment of infrared sensor

(前缀和/思维)Codeforces Round #806 (Div. 4)F. Yet Another Problem About Pairs Satisfying an Inequality

2022zui新抖音24小时循环值守直播监控(一)直播间开播监控

Introduction to STM32 lesson 1

CAN总线通信应用

2022 latest live broadcast monitoring 24-hour monitoring (III) analysis of barrage in live broadcast room

(CF1691D) Max GEQ Sum

FID index reproduction step on the pit to avoid the pit text generation image FID quantitative experiment whole process reproduction (FR é Chet inception distance) quantitative evaluation experiment s

Gan's training skills: alchemist cultivation plan - generative confrontation network training, participation and improvement

Lesson 5 - key control LED
随机推荐
NAT(网络地址转化协议)
Lecture 4 - explain GPIO_ Write function and related routines
Codeforces Round #807 (Div. 2), problem: (C) Mark and His Unfinished Essay
(题意+详细思路+加注释代码) Codeforces Round #805 (Div. 3)F. Equate Multisets
[FPGA tutorial case 29] the second DDS direct digital frequency synthesizer based on FPGA - Verilog development
选择器的使用语法与场景以及背景图片大小、文字盒子阴影、过度效果的使用方法
Flink1.13.6 detailed deployment method
动态路由ofps协议配置
Vitgan: training Gans with vision transformers
JS -- first understand the naming rules and data types of JS and variables
6.28同花顺笔试
C language implementation of the small game [sanziqi] Notes detailed logic clear, come and have a look!!
MySQL课程2.表的各种查询
2022 latest Tiktok live broadcast monitoring (II) streaming media download in live broadcast room
The basic configuration of static routing (planning of IP address and configuration of static routing) realizes the accessibility of the whole network.
RIP V2 的简单应用(v2的配置、宣告、手工汇总、RIPV2的认证、沉默接口、加快收敛)
Experiment of total connection and star topology of mGRE
定时器中断实验
JS logical operator
【mysql】mysql启动关闭命令以及一些报错解决问题