当前位置:网站首页>The basic parallel I/O port of single chip microcomputer development
The basic parallel I/O port of single chip microcomputer development
2022-07-29 23:52:00 【Huawei cloud】
一、题目
Basically parallelI/O口
二、要求
1、画出实验的流程图
2、编写源程序并进行注释
3、记录实验过程
4、记录程序运行结果截图
三、过程及结果记录
按照思路搭建电路图1如下:
图1:实验电路图
实现功能:要求当SW1按键被按下后,D1-D8轮流点亮,点亮时间为100ms,When the button stops,Stop the rotation;再次按下后,continue to rotate.
实验过程:
1. 用ProteusBuild the experimental circuit diagram as above.
2. 将实验代码写入文本文档,并保存成asm文件.
3. Right click on the chip,Select Add source files.
4. 将程序进行编译:单击上方工具栏的source,然后build all,将asm文件编译成hex文件
5. 将可执行文件hexwrite to the chip
6. 点击运行仿真,观察仿真结果,如图2~4所示.
图2:开关断开时,P2 Port all bits are set to1,Diode goes out
图3:When the button switch is closed,The value of the buffer unit is rotated to the left1,The diodes light up sequentially
图4:When the button switch is closed,The value of the buffer unit is rotated to the left1,The diodes light up sequentially
基本思路:
- 进行初始化工作,包括设置堆栈指针SP,将P2 Port all bits are set to1,使P2The light-emitting diodes connected to the port are all extinguished.The buffer unit will be displayed(设为20H 单元)初始化为FEH.(i.e. write in the buffer11111110)
- 从P1口读数据,查看P1.0 位,如果P1.0 位为0,Then execute the following loop:Send the value of the display buffer unit toP2 口,调用100ms 延时程序,Rotate the value of the displayed buffer unit to the left1 位,It is sent back to the display buffer unit.如果P1.0 位不为0 The above loop is not executed.
- 重复上一步的操作
The experimental flow chart can be drawn as follows:
图5:流程图
四、源程序
边栏推荐
- Codeforces Round #245 (Div. 1) A (dfs)
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Brute force recursion to dynamic programming 03 (knapsack problem)
- JetsonNano learning (5) JetsonNano installs PyTorch and Torchvision
- Wincc报表教程(SQL数据库的建立,wincc在数据库中保存和查询数据,调用Excel模板把数据保存到指定的位置和打印功能)
- 【小程序项目开发-- 京东商城】uni-app之自定义搜索组件(下) -- 搜索历史
- 决策树原理及代码实现
- ApplicationContext的三大实现
- Mysql内外连接
- Sentinel入门
猜你喜欢

High Numbers|Calculation of Triple Integral 3|Uncle High Numbers|Handwritten Notes

【小程序项目开发-- 京东商城】uni-app之自定义搜索组件(下) -- 搜索历史

多商户商城系统功能拆解18讲-平台端商家售后
![CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构](/img/6a/0a446eb00fb73275897cbfb336e0b0.png)
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构

windows下 PHP 安装

Install PyCharm on Raspberry Pi

Gao Shu Xia|Triple Integral Exercises|Uncle Gao Shu|Handwritten Notes

go语言(函数、闭包、defer、panic/recover,递归,结构体,json序列化与反序列化)

Hell Diggers Series #1

MQTT over QUIC: The Next-Generation IoT Standard Protocol Brings New Impetus to Messaging Scenarios
随机推荐
全国双非院校考研信息汇总整理 Part.2
「大厂必备」系列之Redis主从、持久化、哨兵
go语言序列化和反序列化及序列化后的json为空和json的key值大写如何改为小写问题
单片机开发之拓展并行I/O口
从面试官角度分析:面试功能测试工程师主要考察哪些能力?
Brute force recursion to dynamic programming 03 (knapsack problem)
接口性能测试方案设计方法有哪些?要怎么去写?
C陷阱与缺陷 第4章 链接 4.2 声明与定义
PyTorch笔记 - Attention Is All You Need (1)
树莓派上安装 wiringPi 2.6 解决 gpio readall 命令的错误
1326. 灌溉花园的最少水龙头数目 动态规划
USACO2008通信线路
[2023 School Recruitment Questions] Summary of Common Interview Questions (7. Common Bus Protocols) (Continuously updated with subsequent interviews....)
devops学习(八) 搭建镜像仓库---jenkins推送镜像
Elementary C language - first understanding of C language
环形链表(LeetCode 141、142)
UE4 制作十字准心+后坐力
LabVIEW为什么在存储VI时死机
MySQL事务(transaction) (有这篇就足够了..)
The latest Gansu construction welder (construction special operation) simulation question bank and answer analysis in 2022




