当前位置:网站首页>51 MCU tmod and timer configuration
51 MCU tmod and timer configuration
2022-07-03 09:56:00 【Yiao】
One ,TMOD Configuration of
1. Timing mode GATE=0 TMOD=0X01(T0 Operation mode 1) TMOD=0X02(T0 Operation mode 2) TMOD=0X10 (T1 Operation mode 1) TMOD=0X20 (T1 Operation mode 2)
2. Count mode GATE=0 TMOD=0X05(T0 Operation mode 1) TMOD=0X06(T0 Operation mode 2) TMOD=0X50(T1 Operation mode 1) TMOD=0X60(T1 Operation mode 2)
Two . Assign initial value to
notes :51 SCM timer commonly used 1 Or the way 2 Method 1 can load the total number 65536 Method 22 can load the total number 256
Example of assignment
Use 51 Timer calculation software can save time 1.
1. Adopted by 1 Use timer 0 The way 1, timing 1ms.1ms=1000us, therefore 65536-1000=64536. Convert to 16 The forbidden number is 0XFC18;
TH0=(65536-1000)/256;
TL0=(65536-100)%256;
or
TH0=OXFC;
TL0=0X18;
2. Adopted by 2 Use timer 0 The way 2, timing 0.1ms,0.1ms=100us, therefore 256-100=246, Convert to 16 Into the system for 9C;
TH0=0X9C;
TL0=0X9C;
边栏推荐
- 一个可执行的二进制文件包含的不仅仅是机器指令
- When you need to use some functions of STM32, but 51 can't realize them, 32 naturally doesn't need to learn
- CEF download, compile project
- STM32 external interrupt experiment
- The new series of MCU also continues the two advantages of STM32 product family: low voltage and energy saving
- Uniapp realizes global sharing of wechat applet and custom sharing button style
- 嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
- Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?
- MySQL 数据库基础知识(系统化一篇入门)
- How MySQL modifies null to not null
猜你喜欢
Uniapp realizes global sharing of wechat applet and custom sharing button style
【顺利毕业】[1]-游览 [学生管理信息系统]
【順利畢業】[1]-遊覽 [學生管理信息系統]
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
Development of fire evacuation system
STM32 external interrupt experiment
NR PUCCH format0 sequence generation and detection mechanism
Vector processor 9_ Basic multilevel interconnection network
Notes on C language learning of migrant workers majoring in electronic information engineering
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
随机推荐
JS foundation - prototype prototype chain and macro task / micro task / event mechanism
Project cost management__ Cost management technology__ Article 8 performance review
Definition and use of enum in C language
[keil5 debugging] warning:enumerated type mixed with other type
[successful graduation] [1] - visit [student management information system]
STM32 interrupt switch
PIP references domestic sources
Design and development of biological instruments
CEF download, compile project
el-table X轴方向(横向)滚动条默认滑到右边
UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding
[22 graduation season] I'm a graduate yo~
没有多少人能够最终把自己的兴趣带到大学毕业上
Hal library sets STM32 clock
Which language should I choose to program for single chip microcomputer
Vector processor 9_ Basic multilevel interconnection network
手机都算是单片机的一种,只不过它用的硬件不是51的芯片
Getting started with JMX, MBean, mxbean, mbeanserver
Education is a pass and ticket. With it, you can step into a higher-level environment
Fundamentals of Electronic Technology (III)_ Chapter 2 principle of amplification circuit__ Crystal triode and field effect triode