当前位置:网站首页>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的输出
五、源程序
边栏推荐
猜你喜欢
随机推荐
idea设置自动去除未引用(不再引用)的引用
BEVDetNet:Bird‘s Eye View LiDAR Point Cloud based Real-time 3D Object Detection for Autonomous Drivi
go语言(函数、闭包、defer、panic/recover,递归,结构体,json序列化与反序列化)
USACO2008通信线路
【openlayers】地图【一】
Brute force recursion to dynamic programming 03 (knapsack problem)
一文看懂拉格朗日乘子法、KKT条件和对偶问题
容器化 | 在 Rancher 中部署 MySQL 集群
学会使用MySQL的Explain执行计划,SQL性能调优从此不再困难
[2023 School Recruitment Questions] Summary of knowledge points and hand-tear code in the written test and interview
全国双非院校考研信息汇总整理 Part.2
Hell Diggers Series #1
devops学习(六)Jenkins 持续部署-版本选择
esp12f + tft 显示图片问题
Qt uses QSortFilterProxyModel for sorting and filtering in QML
容器化数据库必经之道
树莓派上安装 wiringPi 2.6 解决 gpio readall 命令的错误
环形链表(LeetCode 141、142)
全国双非院校考研信息汇总整理 Part.7
Access Modbus TCP and Modbus RTU protocol devices using Neuron



















