单片机C语言程序设计:并行数据转换为串行数据
说 明 : 切 换 连 接 到 并 串 转 换 芯 片
74LS165 的拨码开关,该芯片将并行数据以
串行方式发送到 8051 的 RXD 引脚,移位脉
冲由 TXD 提供,显示在 P0 口。
*/
#includereg51.h>
#includeintrins.h>
#includestdio.h>
#define uchar unsigned char
#define uint unsigned int
sbit SPL=P2^5; //shift/load
//延时
void DelayMS(uint ms)
{
uchar i;
while(ms--) for(i=0;i120;i++);
}
评论