/*------------------------------------------------------------ 74hc138 pa5\6\7 异码器 74hc595 pa2\3\4 串转并
------------------------------------------------------------*/ void main(void) { uchar k,i,j,l; PORT_init();
while(1) {
for(i=0;i<8;i++) { k=~tab[buff[7-i]]; for(j=0;j<8;j++) { if((k&0x80)!=0) PORTA|=0b10000; else PORTA&=~0b10000; PORTA|=0b1000; PORTA&=~0b1000; //产生移位信号 k=(k<<1); }
PORTA&=0x1f; PORTA+=(i<<5); //74HC138译码
PORTA|= 0b100; PORTA&=~0b100; //数据输出到并行口上 delay(2000); 请问给串口付值的语名是那个????? |