当前位置:网站首页>《单片机原理及应用》—定时器、串行通信和中断系统
《单片机原理及应用》—定时器、串行通信和中断系统
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三种异步串行通信电平协议。

五、中断系统

边栏推荐
- 谈谈数字化转型的几个关键问题
- 使用beef劫持用户浏览器
- Why are some Wills made by husband and wife invalid
- 01 NumPy介绍
- Yolov5进阶之七目标追踪最新环境搭建
- Transaction method call @transactional
- View drawing process analysis
- Airsim雷达相机融合生成彩色点云
- [staff] high and low octave mark (the notes in the high octave mark | mark range are increased by one octave as a whole | low octave mark | mark range are decreased by one octave as a whole)
- Tita OKR: a dashboard to master the big picture
猜你喜欢

01 numpy introduction

Maneuvering target tracking -- current statistical model (CS model) extended Kalman filter / unscented Kalman filter matlab implementation

CPU design practice - Chapter 4 practical tasks - simple CPU reference design and debugging

使用 setoolkit 伪造站点窃取用户信息
![[getting started] intercepting strings](/img/16/363baa4982408f55493057200bcba5.png)
[getting started] intercepting strings

Using settoolkit to forge sites to steal user information
![Thread safety analysis of [concurrent programming JUC] variables](/img/f9/a3604bec6f7e5317dd2c578da73018.jpg)
Thread safety analysis of [concurrent programming JUC] variables

Redis publish subscription

AES简单介绍

Conception et mise en service du processeur - chapitre 4 tâches pratiques
随机推荐
[getting started] input n integers and output the smallest K of them
Leetcode T39: 组合总和
Transaction method call @transactional
SPL-安装与基本使用(二)
手工挖XSS漏洞
seaborn clustermap矩阵添加颜色块
谈谈数字化转型的几个关键问题
事务方法调用@Transactional
MAVROS发送自定义话题消息给PX4
MATLAB【函数和图像】
【刷题】字符统计【0】
C basic knowledge review (Part 4 of 4)
SPL-介绍(一)
Leetcode t39: combined sum
Rumtime 1200 upgrade: London upgrade support, pledge function update and more
Qt的模型与视图
On June 30, 2022, the record of provincial competition + national competition of Bluebridge
Leetcode T29: 两数相除
Yolov5进阶之六目标追踪环境搭建
[force deduction 10 days SQL introduction] Day10 control flow