当前位置:网站首页>Expansion of Parallel I/O Port in Single Chip Microcomputer Development
Expansion of Parallel I/O Port in Single Chip Microcomputer Development
2022-07-29 23:51:00 【HUAWEI CLOUD】
目录
1. 在ProteusThe principle diagram of the environment to establish,如图1所示,并保存为expandIO.DSN文件.
2. Will test code into a text document,并保存为expandIO .asm文件.
3. 输入源程序,Will join the rest of the system source code and compile the source code.
4. 双击芯片,将编译得到的hexFile downloaded to the chip
一、题目
3.2 拓展并行I/O口实验
二、要求
1、Draw a process flow diagram that experiment
2、Write the source program and annotate
3、Document the process
4、Document the program runs results screenshot
三、Process and result record
According to the ideas to build circuit diagram1如下:
图1:实验电路图
实现功能:Control traffic lights
The simulation traffic light control function.
Control the order:
① 南北绿灯亮,At the same time things red light 10s;
② 南北黄灯亮,At the same time things red light 2s;
③ 南北红灯亮,At the same time something green light 10s;
④ 东西黄灯亮,At the same time the north and south red light 2s;
⑤ 重复①~④.
实验过程:
1. 在ProteusThe principle diagram of the environment to establish,如图1所示,并保存为expandIO.DSN文件.
2. Will test code into a text document,并保存为expandIO .asm文件.
3. 输入源程序,Will join the rest of the system source code and compile the source code.
4. 双击芯片,将编译得到的hexFile downloaded to the chip
5. Perform simulation process to observe all directions of traffic lights indicate,Check the function program is correct.
The diagram below with the results of the experiment2~5所示:
图2:南北绿灯亮,At the same time things red light10s
图3:南北黄灯亮,At the same time things red light2s
图4:南北红灯亮,At the same time something green light 10s
图5:东西黄灯亮,At the same time the north and south red light 2s
四、思路
The flow chart is as follows:
图6:实验流程
1. 进行初始化工作,Including set the stack pointerSP,将两个373 All bits are set to the output1,Make all leds put out.
2. Define two latch address: U4的地址是0FE00H, U5的地址是0FD00H
3. 分析4 A state of two373 The output of the data values:假定“南北绿灯亮,At the same time things red light”为状态1,即:Stat1;“南北黄灯亮,At the same time things red light”为状态2,即:Stat2;“南北红灯亮,At the same time something green light”为状态3,即:Stat3;“东西黄灯亮,At the same time the north and south red light”为状态4,即:Stat4.Can analyze its the output of each state.
6. 对于状态1:东西红灯,南北绿灯
① 那么对于U4,There are only two red light,A red light the address of the corresponding place0即可.对应的控制信号是11110011即0F3H
② 对于U5,绿灯亮,Only need to put the corresponding green light0 即可,For high four does not use the port,Also put together0.控制信号为00001100即0CH
图7:状态1下U4和U5的输出
7. 对于状态2:东西红灯,南北黄灯
① 对于U4:The north and the south yellow light、What red light corresponding port place0.So the control signals for the11000011即0C3H
② 对于U5:There is no green light,A useful(低四位)置1,In less than the bit or set of0.So the control signals for the00001111即0FH
图8:状态2下U4和U5的输出
8. 对于状态3:东西绿灯,南北红灯
① 对于U4:To the north and the south red light corresponding port place0,其余位为0.So the control signals for the11111100即0FCH
② 对于U5: To put something green corresponding port0,其余位为1.Pay attention to not use a zero.So the control signals for the00000011即03H
图9:状态3下U4和U5的输出
9. 对于状态4:东西黄灯,南北红灯
① 对于U4:Yellow light things、The north and the south red light corresponding port place0,其余位置1,.So the control signals for the00111100即3CH
② 对于U5:Did not involve green light,So will useful position1即可.So the control signals for the00001111即0FH
图10:状态4下U4和U5的输出
五、源程序
边栏推荐
猜你喜欢
随机推荐
【openlayers】地图【一】
C陷阱与缺陷 第5章 库函数 5.4 使用errno检测错误
2022年最新甘肃建筑八大员(材料员)模拟考试试题及答案
LabVIEW为什么在存储VI时死机
idea设置自动去除未引用(不再引用)的引用
种类并查集(反集),学习T宝代码
C陷阱与缺陷 第3章 语义“陷阱” 3.10 为函数main提供返回值
go语言序列化和反序列化及序列化后的json为空和json的key值大写如何改为小写问题
对数据库进行增删改查操作
Mysql8.0新特性之详细版本
[leetcode] 75. Color classification (medium) (double pointer, in-situ modification)
C陷阱与缺陷 第4章 链接 4.5 检查外部类型
Redis系列:高可用之Sentinel(哨兵模式)
[leetcode] 82. Delete duplicate elements in sorted linked list II (medium)
Apache Doris 1.1 特性揭秘:Flink 实时写入如何兼顾高吞吐和低延时
全国双非院校考研信息汇总整理 Part.7
BEVDetNet:Bird‘s Eye View LiDAR Point Cloud based Real-time 3D Object Detection for Autonomous Drivi
devops学习(八) 搭建镜像仓库---jenkins推送镜像
C陷阱与缺陷 第5章 库函数 5.2更新顺序文件
esp12f + tft 显示图片问题




















