当前位置:网站首页>《单片机原理及应用》—定时器、串行通信和中断系统
《单片机原理及应用》—定时器、串行通信和中断系统
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三种异步串行通信电平协议。
五、中断系统
边栏推荐
- 2022.2.15
- Intelligent water supply system solution
- Leetcode T29: 两数相除
- 【华为机试真题详解】判断字符串子序列【2022 Q1 Q2 | 200分】
- Pipeline detection of UAV Based on gazebo
- Keithley 2100 software 𞓜 Keithley2400 test software ns SourceMeter
- MAVROS发送自定义话题消息给PX4
- DID的使用指南,原理
- Manually dig XSS vulnerabilities
- 機動目標跟踪——當前統計模型(CS模型)擴展卡爾曼濾波/無迹卡爾曼濾波 matlab實現
猜你喜欢
Manually dig XSS vulnerabilities
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)
华为机试真题专栏订阅指引
【C】 Summary of wrong questions in winter vacation
On several key issues of digital transformation
Field agricultural irrigation system
[getting started] intercepting strings
seaborn clustermap矩阵添加颜色块
Adding color blocks to Seaborn clustermap matrix
随机推荐
Codeworks round 803 (Div. 2) VP supplement
String coordinates of number to excel
[getting started] input n integers and output the smallest K of them
Data analysis notes 11
factory type_id::create过程解析
程序员养生宝典
Leetcode t34: find the first and last positions of elements in a sorted array
数字转excel的字符串坐标
Pipeline detection of UAV Based on gazebo
SPL installation and basic use (II)
MATLAB【函数和图像】
串口转WIFI模块通信
MATLAB【函数求导】
01 NumPy介绍
Use threejs simple Web3D effect
Leetcode T40: 组合总和II
Transaction method call @transactional
Yolov5进阶之七目标追踪最新环境搭建
Leetcode t31: prochain arrangement
华为机试真题专栏订阅指引