匿名
未登录
登录
丢石头百科
搜索
查看“使用74LS164将C8051F的串口输出扩为并口输出”的源代码
来自丢石头百科
名字空间
页面
讨论
更多
更多
页面选项
查看
查看源代码
历史
←
使用74LS164将C8051F的串口输出扩为并口输出
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<table border="0" cellpadding="0" cellspacing="0" style="color: rgb(72, 61, 139); font-family: Arial, 新宋体, 微软雅黑; font-size: 12px;" width="780"><tbody><tr><th class="type_483D8B" scope="col" style="line-height: 20px; font-weight: normal; border-top-style: none;" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="120"><tbody><tr><th bgcolor="#698192" class="white_12px_b" height="20" scope="col" style="font-size: 12px; color: rgb(255, 255, 255); line-height: 20px; font-family: Arial, Helvetica, sans-serif;">系统功能</th></tr></tbody></table> 使用74LS164将AVR的串口输出扩为并口输出。 </th></tr><tr><th class="type_483D8B" scope="col" style="line-height: 20px; font-weight: normal; border-top-style: none;" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="120"><tbody><tr><th bgcolor="#698192" class="white_12px_b" height="20" scope="col" style="font-size: 12px; color: rgb(255, 255, 255); line-height: 20px; font-family: Arial, Helvetica, sans-serif;">硬件设计</th></tr></tbody></table> [[File:C8051F_3_2.jpg]] 串行输出扩展为并行输出芯片74LS164控制电路原理图 </th></tr><tr><th class="type_483D8B" scope="col" style="line-height: 20px; font-weight: normal; border-top-style: none;" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="120"><tbody><tr><th bgcolor="#698192" class="white_12px_b" height="20" scope="col" style="font-size: 12px; color: rgb(255, 255, 255); line-height: 20px; font-family: Arial, Helvetica, sans-serif;">软件设计</th></tr></tbody></table> 下面部分从TXT拷出,拷到网页,代码部分缺省了很多空格,比较凌乱,请谅解! //目标系统: 基于C8051F单片机 //应用软件: Silicon IDE / Keil /*01010101010101010101010101010101010101010101010101010101010101010101 ---------------------------------------------------------------------- 实验内容: 使用P2口的LED指示灯查看MCU自己从模拟串口发送的数据。 ---------------------------------------------------------------------- 硬件连接: 将P2口和8位LED指示灯相连。 DVK501(164PrlPort) F320 EX Q0 --------- P2.0 Q1 --------- P2.1 Q2 --------- P2.2 Q3 --------- P2.3 Q4 --------- P2.4 Q5 --------- P2.5 Q6 --------- P2.6 Q7 --------- P2.7 VCC --------- VCC GND --------- GND MR --------- P1.5 A / B --------- P1.6 CLK --------- P1.7 ---------------------------------------------------------------------- 注意事项: (1)若有加载库程序,请将光盘根目录下的“library”下的“C8051F”文件夹拷到D盘 (2)请详细阅读:光盘根目录下的“说明书首页.htm”里的相应产品说明 ---------------------------------------------------------------------- 10101010101010101010101010101010101010101010101010101010101010101010*/ #define _DVK501_F320_EX_ #include <c8051f320.h> #include <../../../../library/C8051F/ws_clock.h> #include <../../../../library/C8051F/ws_delay.h> #include <../../../../library/C8051F/ws_74hc164_port.h> void main(void) { uchar tmp=0; PCA0MD &= ~0x40; XBR1 = 0x40; clock_external(); hc164Init(); while(1) { hc164SetDat(tmp); tmp++; delay_ms(500); } } sbit HC164_DATA = P1^6; sbit HC164_CLK = P1^7; void hc164Init(void) { P1MDOUT |= 0xC0; } void hc164SetDat(uchar dat) { uchar i; for(i=0;i<8;i++) { HC164_CLK = 0; if(dat & 0x80) HC164_DATA = 1; else HC164_DATA = 0; HC164_CLK = 1; dat = dat<<1; } }</th></tr><tr><th class="type_483D8B" scope="col" style="line-height: 20px; font-weight: normal; border-top-style: none;" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="120"><tbody><tr><th bgcolor="#698192" class="white_12px_b" height="20" scope="col" style="font-size: 12px; color: rgb(255, 255, 255); line-height: 20px; font-family: Arial, Helvetica, sans-serif;">系统调试</th></tr></tbody></table> 将74LS164的输出端口Q0--Q7接入LED,用LED指示74LS164输出的数据。 </th></tr></tbody></table>
返回至
使用74LS164将C8051F的串口输出扩为并口输出
。
导航
导航
首页
最近更改
随机页面
MediaWiki帮助
首页
首页
树莓派
主机
配件包
外壳
键鼠
电源
扩展板
显示屏
墨水屏
摄像模块
通信模块
继电器
电机驱动板
游戏机
产品分类
树莓派
Arduino
micro:bit
STM32
Espressif
WiFi模块
蓝牙模块
无线模块
LoRa模块
4G模块
GSM
GPRS
以太网
导航模块
北斗卫星
GPS
LCD
墨水屏
OLED
摄像头
USB模块
串口模块
RS232
RS485
CAN
传感器
温度模块
湿度模块
气压模块
继电器
电机模块
指纹模块
电平转换
音频模块
编程器
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志