74hc595 串行输出 使用 74HC595串行数据输出问题

\u8bf7\u6559\u5173\u4e8e74hc595\u4e32\u884c\u8f93\u51fa\u4e0e\u5e76\u884c\u8f93\u51fa\u7684\u5173\u7cfb

74HC595\uff1a\u4e00\u4e2a8\u4f4d\u4e32\u884c\u8f93\u5165\u3001\u5e76\u884c\u8f93\u51fa\u7684\u4f4d\u79fb\u7f13\u5b58\u5668

\u4e0d\u662f\u8fd9\u6837\u7684\u3002595\u5728\u8f93\u51fa\u4f7f\u80fd\u65f6\uff0c\u8f93\u51fa\u5e76\u884c\u6570\u636e\uff0c\u4e5f\u5c31\u662f\u4e00\u6b21\u6027\u8f93\u51fa8\u4f4d\u3002\u8be5\u5668\u4ef6\u4e0e164\u4e0d\u540c\uff0c\u5177\u6709\u9501\u5b58\u529f\u80fd\uff0c\u4e00\u822c\u60c5\u51b5\u662f\u5f538\u4f4d\u6570\u636e\u5168\u90e8\u8fdb\u5165\u9501\u5b58\u5668\u540e\uff0c\u518d\u4e00\u6b21\u6027\u8f93\u51fa\u3002\u572812\u811aST_CP\u9ad8\u7535\u5e73\u65f6\uff0c\u79fb\u4f4d\u4fe1\u53f7\u8fdb\u5165\u8f93\u51fa\u5bc4\u5b58\u5668\u3002\u6240\u4ee5\u5e94\u7528\u65f6\u5982\u679cSH_CP\u4e0eST_CP\u76f8\u8fde\uff0c\u8981\u6ce8\u610f\u79fb\u4f4d\u8109\u51b2\u8981\u591a\u4e00\u4e2a\u3002
\u8be6\u7ec6\u60c5\u51b5\u53c2\u960574HC595\u7684PDF\u6587\u4ef6\u8bf4\u660e\u3002

给你一个参考程序——
#include <reg52.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char

sbit SH_CP = P2^0;
sbit DS = P2^1;
sbit ST_CP = P2^2;
uchar temp;
uchar code DSY_CODE[]=
{
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90
};

void Delay(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}

void In_595()
{
uchar i;
for(i=0;i<8;i++)
{
temp <<= 1;
DS = CY;
SH_CP = 1;
_nop_();
_nop_();
SH_CP = 0;
}
}

void Out_595()
{
ST_CP = 0;
_nop_();
ST_CP = 1;
_nop_();
ST_CP = 0;
}

void main()
{
uchar i;
while(1)
{
for(i=0;i<10;i++)
{
temp = DSY_CODE[i];
In_595();
Out_595();
Delay(200);
}
}
}

74HC595:一个8位串行输入、并行输出的位移缓存器



扩展阅读:日本资生堂色谱柱 ... 并行输入输出主要是哪三种 ... m2固态nvme引导不了系统 ... 并行加载串行输出 ... hp msa 2040 用户手册 ... hp msa2040 管理配置 ... 幽门c14值为700严重吗 ... 74hc595的程序写入 ... hg c1400使用方法 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网