沈阳航空航天大学北方科技学院课程设计论文 人行通道流量监测系统的设计
leddata[1]=LEDTable[seg1]; leddata[2]=LEDTable[seg2]; leddata[3]=LEDTable[seg3]; leddata[4]=LEDTable[seg4]; leddata[5]=LEDTable[seg5]; leddata[6]=LEDTable[seg6]; leddata[7]=LEDTable[seg7];
_nop_(); return;
}
void time1isr(void) interrupt 3 using 2 //1.25ms //定时1.25ms,用于数码管显示 { EA=false;
//关总中断
TH1=0xfb;
//11.0592MHz Mode1 1.25mS
初始化 TL1=0x80; EA=true; //开总中断
countt1++;
//计数加1
if(countt1%2==1) //判断时刻 { ledcount++;
//数码管位加1
if(ledcount>=8)
//数码管总共8位
//
第 19 页
沈阳航空航天大学北方科技学院课程设计论文 人行通道流量监测系统的设计
{ }
ledcount=0;
switch(ledcount) { //轮流显示
//第1位数码管
//位控制为最低位为0,共阴极
case 0: P0=0xfe;
_nop_(); WE=off; _nop_(); WE=on;
P0=leddata[0]; _nop_(); _nop_(); DU=off; _nop_(); _nop_(); DU=on;
break;
case 1:
P0=0xfd; _nop_(); WE=off;
_nop_(); WE=on;
P0=leddata[1];
_nop_();
//74hc573有效输出
// 74hc573锁存
//第一位数据输出 ,段码输出
//74hc573有效输出
// 74hc573锁存
//第2位数码管
//位控制为第2位为0,共阴极 //74hc573有效输出
//
74hc573锁存
//第二位数据输出 ,段码输出 第 20 页
沈阳航空航天大学北方科技学院课程设计论文 _nop_(); DU=off;
//74hc573有效输出
_nop_(); _nop_(); DU=on;
//
74hc573锁存
break;
case 2:
//第3位数码管
P0=0xfb;
//位控制为第3位为0,共阴极 _nop_(); WE=off; //74hc573有效输出
_nop_(); WE=on;
// 74hc573锁存
P0=leddata[2]; //第三位数据输出 ,段码输出 _nop_(); _nop_(); DU=off;
//74hc573有效输出
_nop_(); _nop_(); DU=on;
//
74hc573锁存
break;
case 3:
//第4位数码管
P0=0xf7;
//位控制为第4位为0,共阴极 _nop_(); WE=off; //74hc573有效输出
_nop_();
人行通道流量监测系统的设计
第 21 页
沈阳航空航天大学北方科技学院课程设计论文
WE=on;
//
74hc573锁存
P0=leddata[3]; //第4位数据输出 ,段码输出 _nop_(); _nop_(); DU=off;
//74hc573有效输出
_nop_(); _nop_(); DU=on;
//
74hc573锁存
break;
case 4:
//第5位数码管
P0=0xef;
//位控制为第5位为0,共阴极 _nop_(); WE=off; //74hc573有效输出
_nop_(); WE=on;
// 74hc573锁存
P0=leddata[4]; //第5位数据输出 ,段码输出 _nop_(); _nop_(); DU=off;
//74hc573有效输出
_nop_(); _nop_(); DU=on;
//
74hc573锁存
break;
case 5:
//第6位数码管
P0=0xdf;
//位控制为第6位为0,共阴极
人行通道流量监测系统的设计
第 22 页
沈阳航空航天大学北方科技学院课程设计论文 人行通道流量监测系统的设计
_nop_(); WE=off; _nop_(); WE=on;
//
74hc573锁存
//74hc573有效输出
P0=leddata[5]; //第6位数据输出 ,段码输出
_nop_(); _nop_(); DU=off; _nop_(); _nop_(); DU=on;
break;
case 6:
P0=0xBf; _nop_(); WE=off; _nop_(); WE=on;
P0=leddata[6]; _nop_(); _nop_(); DU=off; _nop_(); _nop_();
DU=on;
//74hc573有效输出
//
74hc573锁存
//第7位数码管
//位控制为第7位为0,共阴极 //74hc573有效输出
// 74hc573锁存
//第7位数据输出 ,段码输出
//74hc573有效输出
//
74hc573锁存
第 23 页