1 LED数码管的静态显示 首先了解一下80C51的引脚封装 1~8脚 P1口 9脚 复位端/VPD备用电源输入端 10脚 P3.0口/串行输入 11脚 P3.1口/串行输出 12脚 P3.2口/外部中断0 13脚 P3.3口/外部中断1 14脚 P3.4口/定时计数器0 15脚 P3.5口/定时计数器1 16脚 P3.6口/外部数据存储器读 17脚 P3.7口/外部数据存储器写 18 19 脚 接晶振 32~39 P0口 31脚 总中断 30脚 ALE 输出1/6晶振频率方波脉冲 P21~28 P2口 复位和晶振电路 8段共阴极数码管接法 74HC573</SPAN>锁存器接线方法</SPAN> </SPAN> 8段数码管编码表</SPAN> 编程实验1:让第一位数码管显示数字1 程序 #include //定义头文件 sbit dula=P2^6; //定义段选为P2.6口 sbit wela=P2^7; //定义位选为P2.7口 void main() { wela=1; //位选 开 P0=0xfe; //给P0口送数,让第一位亮。 wela=0; //位选锁存 dula=1; //段选 开 P0=0x06; //让第一位数码管亮1 dula=0; //段选锁存 while(1); } PROTEUS 仿真结果 编程实验2:让六位数码管任意位显示0~F循环 程序: #include //定义头文件 #define uint unsigned int #define uchar unsigned char //宏定义变量类型 void delay (uint); //子程序声明 sbit dula=P2^6; sbit wela=P2^7; //定义位选 段选 sbit d1=P1^0; //定义d1=P1.0口 uchar num; //定义num为uchar类型 uchar code table[]={ //定义数组 0~16 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71,}; void main() //主函数开始 { wela=1; //位选开 P0=0xea; //让6位数码管全亮 wela=0; //位选关 while(1) { for(num=0;num { dula=1; P0=table[num]; //num从0开始数码管累加显示 dula=0; delay(1000); //延时 } } } void delay(uint z) //延时子程序 { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); } PROTEUS 仿真结果 阅读全文>> |
</SPAN></SPAN></SPAN></SPAN></SPAN> 8th Asian Continental/Individual (Open)</SPAN> The Asia Continental Chess Championship is going to take place in Subic Freeport, Philippines. The championship starts on May 12 and it is the qualification for the World Cup scheduled 20 Nov. to 15 Dec. 2009 in Khanty Mansiysk (Russia), and to the Women's World Championship next year. At stake in the tournament is a total of $50,000 in cash prizes for the top 40 places in the Men’s Division and $15,000 in cash prizes for the top 20 in the Women’s Division. Rank after Round 6 top 31: </SPAN> Rk. Name FED Rtg Pts. TB1 TB2 1 GM Sandipan Chanda IND 2558 5,0 2592 2614 2 GM Le Quang Liem VIE 2591 5,0 2531 2540 3 GM Dao Thien Hai VIE 2546 4,5 2584 2610 4 GM Moradiabadi Elshan IRI 2526 4,5 2540 2560 5 GM Ganguly Surya Shekhar IND 2625 4,5 2512 2523 6 GM Antonio ...阅读全文>> |
© 2025 Jinbay.com All rights reserved.
版权所有金海湾。 未经许可,不得转载。