当前位置:网站首页>《单片机原理与应用》——并行IO口原理
《单片机原理与应用》——并行IO口原理
2022-07-01 08:21:00 【涛涛呐~】
系列文章目录
提示:以下是本篇文章正文内容,下面案例可供参考
一、单片机并行IO口工作原理
P1口:
P1的IO并行内部结构是由D触发器和锁存器组成
内部总线输入0,触发器输出Q’为1,MOS管导通,输出端输出0;
内部输入1,触发器输出Q’为0,MOS管截至,输出端输出1;
那PI口作为输入端口读取数据就要用到锁存器,读取数据先要保持MOS管截至,则Q’输出0,于是P1口读取外部数据前先要像P1口输出1。
P3口:
P2口:
控制端(0),P2口的工作原理同P1口;
控制端为(1),P2口输出地址总线
P0口:
P0口需要用户外接上拉电阻才能正常工作。
控制端(0),P0作为普通IO口,工作原理同P1口
控制端(1),P0口作为地址/数据复用总线
二、51单片机工作周期和时序
1.时钟电路
无源石英晶体振荡器:
有源晶体振荡器:相对于无源,更加稳定可靠的时钟信号
2.复位方式
复位方式有:上电自动复位和手动按钮复位
3.机器周期和指令周期
机器周期:单片机操作的基本单位,一个机器周期包含有12个时钟周期。
指令周期:计算机取指令到执行完指令的时间为指令周期
三、C51新增的变量类型
特殊功能寄存器sfr定义
C51将单片机常用的特殊功能寄存器和特殊位进行定义,放在“reg51.h”头文件中。
位变量
变量在定义时指出变量的数据类型和存储器类型
四、函数的定义
增加了中断函数的定义
C51定义中断函数时候必须带的后缀名是interrupt m
m取值范围如下所示:
边栏推荐
- [深度剖析C语言] —— 数据在内存中的存储
- Huawei machine test questions column subscription Guide
- OJ input and output exercise
- 一套十万级TPS的IM综合消息系统的架构实践与思考
- Intelligent constant pressure irrigation system
- Intelligent water and fertilizer integrated control system
- [dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)
- C basic knowledge review (Part 4 of 4)
- 【C】 Summary of wrong questions in winter vacation
- Audio-AudioRecord create(一)
猜你喜欢
随机推荐
CPU設計實戰-第四章實踐任務一簡單CPU參考設計調試
There are many problems in sewage treatment, and the automatic control system of pump station is solved in this way
Anddroid 文本合成语音TTS实现
Using settoolkit to forge sites to steal user information
Utiliser Beef pour détourner le navigateur utilisateur
[Yu Yue education] Shandong Vocational College talking about railway reference materials
Leetcode t34: find the first and last positions of elements in a sorted array
Luogu p1088 [noip2004 popularization group] Martians
使用 setoolkit 伪造站点窃取用户信息
[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order
empirical study and case study
Burpsuite -- brute force cracking of intruder
数字转excel的字符串坐标
使用beef劫持用户浏览器
Yolov5进阶之七目标追踪最新环境搭建
如何招到适合自己店铺的淘宝主播
Redis publish subscription
Li Kou 1358 -- number of substrings containing all three characters (double pointer)
深度学习训练样本扩增同时修改标签名称
Download jackson codehaus. org jar - downloading jackson. codehaus. org jar
![[untitled]](/img/b9/6922875009c2d29224a26ed2a22b01.jpg)






![[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)](/img/3e/75a1152f9cdf63c6779fdadec702a0.jpg)
![Thread safety analysis of [concurrent programming JUC] variables](/img/f9/a3604bec6f7e5317dd2c578da73018.jpg)
