74hc377怎么写程序

1.谁有74HC245驱动矩阵键盘的程序//以下是键盘扫描及处理子程序 。
uchar kbscan(void)
{
unsigned char sccode,recode;
P3=0x0f; //发0扫描,列线输入
if ((P3 & 0x0f) != 0x0f) //有键按下
{
delay(20); //延时去抖动
if ((P3&0x0f)!= 0x0f)
{
sccode = 0xef; //逐行扫描初值
while((sccode&0x01)!=0)
{
P3=sccode;
if((P3&0x0f)!=0x0f)
{
recode=(P3&0x0f)|0xf0;
return((~sccode)+(~recode));
}
else
sccode=(sccode
2.怎么用C语言给74HC595写一个程序来控制数码管给你个51汇编的164和595的驱动吧 。有悬赏的话,再提供个C51的164和595.悬赏多的话再给个LPC1114驱动的两个595控制2个4位一体数码管的吧 。
DISP:MOV R0,#38H;
MOV R3,#8H;
MOV A,#00001000B;LOOP12:PUSH ACC;
MOV R1,#8H;
LOOP10:RLC A;
CLR CLK_164;
MOV DATA_164,C;
SETB CLK_164;
DJNZ R1,LOOP10;
MOV A,R0;
CJNE A,#3FH,LOOP13;
MOV A,3FH;
JMP LOOP14;
LOOP13:MOV A,@R0;MOVC A,@A+DPTR;
LOOP14:MOV R2,#8H;
CLR RCK0_595;
LOOP11:CLR SCK0_595;
RLC A;
MOV SER0_595,C;
SETB SCK0_595;
DJNZ R2,LOOP11;
SETB RCK0_595;
CALL DELAY50US;
MOV A,#00H;
MOV R2,#8H;
CLR RCK0_595;
LOOP16:CLR SCK0_595;
RLC A;
MOV SER0_595,C;
SETB SCK0_595;
DJNZ R2,LOOP16;
SETB RCK0_595;
POP ACC;
RR A
INC R0;
DJNZ R3,LOOP12;
RET;
【74hc377怎么写程序】

74hc377怎么写程序

文章插图