8255A并行口实验完整版.docVIP

  • 3
  • 0
  • 约小于1千字
  • 约 3页
  • 2023-10-15 发布于湖北
  • 举报
- PAGE 177 - 实验任务 8255的PA、PB端口分别连接8位数码管的段码和位码,程序控制数码管滚动显示一串数字。 2. 电路原理图 C语言源程序 #includereg51.h #includeabsacc.h #define uchar unsigned char #define uint unsigned int #define PB XBYTE[0x7001] #define PC XBYTE[0x7002] #define COM XBYTE[0x7003] uchar code DSY_CODE_Queue[]={ 0xc0,0xf9,0xa4,0xb0, 0x99,0x92,0x82,0xf8, 0x80,0x90,0x88,0x83, 0xc6,0xa1,0x86,0x8e }; uchar code DSY_Index[]={ 0xfe,0xfd,0xfb,0xf7, 0xef,0xdf,0xbf,0x7f8 / 0x01,0x02,0x04,0x08, 0x10,0x20,0x40,0x80}; void DelayMS(uint ms) { uchar i; while(ms--) for(i=0;i120;i++); } void main() { uint i,j,k; COM=0x80; while(1) { for(j=0;j40;j++) { for(k=0;k8;k++) { PB=DSY_Index[k]; DelayMS(100); PA=DSY_CODE_Queue[k+1]; DelayMS(1000); } } i=(i+1)%15; } } 仿真结果

文档评论(0)

1亿VIP精品文档

相关文档