当前位置:网站首页>《单片机原理及应用》—定时器、串行通信和中断系统
《单片机原理及应用》—定时器、串行通信和中断系统
2022-07-01 08:21:00 【涛涛呐~】
一、并行IO口使用
51单片机有4组IO口,可以对IO口进行并行输入和并行输出8位数据,且IO口可以按位方式使用。
keil软件编程调试窗口如下:
二、定时器计数器工作原理及方式
51单片机内部有T0和T1两个定时器,也是加法计数器。
模式寄存器TMOD,控制定时器的工作模式

每个定时器有16位数据,
其中方式2是8位自动置位计数器,高八位可以自动装载初值;
方式3只有定时/计数器T0才有。
三、定时器/计数器的编程
1、采用查询方式处理

2、采用中断方式

单片机定时器最多可以定时65536us,可以用集合软件计数和定时器实现大于65536us的定时;
四、串行通讯
根据信息传送的方向分为:单工、半双工和全双工三种
分为串行通信和并行通信;分为同步通信和异步通信
高速串行通信一般采用同步通信;
51单片机是标准的数字电路芯片,其输入输出引脚符合TTL电平规则(高电平为3-5V,低电平为0-1V)
为提高串行通信的可靠性,人们定义了各种新的通信电平标准,形成了RS422、RS232和RS484三种异步串行通信电平协议。

五、中断系统

边栏推荐
- [force deduction 10 days SQL introduction] Day9 control flow
- [getting started] input n integers and output the smallest K of them
- golang中的正则表达式使用注意事项与技巧
- 01 numpy introduction
- 程序员养生宝典
- 谈谈数字化转型的几个关键问题
- [getting started] intercepting strings
- Provincial election + noi Part VII computational geometry
- MATLAB小技巧(23)矩阵分析--模拟退火
- leetcode T31:下一排列
猜你喜欢
随机推荐
SPL-安装与基本使用(二)
初学者如何正确理解google官方建议架构原则(疑问?)
Leetcode T40: 组合总和II
[introduction] approximate value
XX攻击——反射型 XSS 攻击劫持用户浏览器
Stack implementation calculator
Provincial election + noi Part III tree problems
shardingSphere
谈谈数字化转型的几个关键问题
How to prevent the other party from saying that he has no money after winning the lawsuit?
事务方法调用@Transactional
XX attack - reflective XSS attack hijacking user browser
To prevent "activation" photos from being muddled through, databao "live detection + face recognition" makes face brushing safer
SPL installation and basic use (II)
The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies
Yolov5 advanced six target tracking environment construction
empirical study and case study
[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order
MATLAB【函数和图像】
《MATLAB 神经网络43个案例分析》:第30章 基于随机森林思想的组合分类器设计——乳腺癌诊断









