首页 数码管显示原理及应用实现

数码管显示原理及应用实现

举报
开通vip

数码管显示原理及应用实现数码管显示原理及应用实现 1.数码管显示原理 (1)数码管外形 图1 单位数码管 图2 双位数码管 图3 四位数码管 (2)数码管内部原理 图4 引脚 图5 共阳极数码管 图6 共阴极数码管 (3)数码管工作电压和电流 红色和黄色的发光二极管的工作电压是2伏的,其他颜色的工作电压都是3伏;一般的发光二极管的工作电流是20毫安。可以使用电阻或者限流二极管来分压。 (4)数码管的检测 一、指针表: ?前提是你的万用表最好是用3V以上电池,因为1.5V不够点亮LED,特别是高亮超高亮的,点亮电...

数码管显示原理及应用实现
数码管显示原理及应用实现 1.数码管显示原理 (1)数码管外形 图1 单位数码管 图2 双位数码管 图3 四位数码管 (2)数码管内部原理 图4 引脚 图5 共阳极数码管 图6 共阴极数码管 (3)数码管工作电压和电流 红色和黄色的发光二极管的工作电压是2伏的,其他颜色的工作电压都是3伏;一般的发光二极管的工作电流是20毫安。可以使用电阻或者限流二极管来分压。 (4)数码管的检测 一、指针表: ?前提是你的万用表最好是用3V以上电池,因为1.5V不够点亮LED,特别是高亮超高亮的,点亮电压高。另外万用表在RX1档或最高档。 ?万用表笔随便一脚,假设红笔, 搭在数码管上任一脚 。黑笔在其它脚上扫过,如果不亮,有可能此管为共阴,可用3法再试。如有一段点亮。黑笔不动, 移动红笔,在其它脚测。如果其它脚 分别都 能点亮,则可以说明黑笔接的是公共脚 ,此管共阳。(指针 表的黑表笔是正电源) ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's ?.表笔更换一下,黑笔先搭一脚,扫红笔。如有一段点亮,红笔不动,扫黑笔。如各段分别点亮,则红笔所接为公共 ,此管共阴。 4.如2、3两法均不亮,可能数码管额定电压较高,也可能数码管是坏的。这时,可用5V电源串一500欧电阻继续测试。 二、数字表: 用二极管档(有个二极管符号的,也作通路档使用),方法同指针表。不过,红表笔所对应的共阳共阴和指针表是相反的。因为数字表的红笔就是正电源。 (5)与单片机的接口 P0口8个LS TTL门电路构成,P1-P3口由4个LS TTL门电路构成。单个LS TTL门电路输出电流约1.2mA,输入电流20mA,总的灌电路一般不超过50mA。 a(三极管驱动 图7 三极管驱动线路(图中有错误) b(专用驱动芯片 U1 201VCCVCCE1011DULAVCC89C52GNDL4039D0VCCP00A192D0DB1138D1Q0D0P10/TP01B183D1DB2237D2Q1D1P11/TP02C174D2DB3336D3Q2D2P12P03D165D3DB4435D4Q3D3P13P04E156D4DB5534D5Q4D4P14P05F147D5DB6633D6Q5D5P15P06G138D6DB7732D7Q6D6P16P07H129D7DB8821SDAQ7D7P17P20INT11322SCLINT1P2174HC573CSDA122318B20INT0P22RS1524FMT1P23U2LCDEN1425CSUSBT0P242013126DIOLAVCCEVCCEA/VPP251011WELAX11927DULAGNDLX1P26X21828WELAX2P27WE1192D0RST910P3.0Q0D0RESETRXDWE2183D1RD1711P3.1Q1D1RDTXDWE3174D2WR1630ALEQ2D2WRALE/PWE4165D32029Q3D3GNDPSENWE5156D4Q4D4WE6147D589C52VDDQ5D5138D6Q6D6CSAD129D7Q7D7 74HC573 ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's 注:位选线,段选线。 2.数码管静态显示 (1)数码管编码 2)静态显示控制程序 ( a(包含头文件 #include b(宏定义 #define uchar unsigned char #define uint unsigned int c(常量定义 sbit cs = P2^6; sbit data = P2^7; uchar code table[]={数码管编码}; d(变量定义 uchar num; e(函数申明 void delayms(uint); f(主函数 void main() { cs = 1; P0 = 0XFE; cs = 0; data = 1; P0 = 0X7F; data = 0; while(1); } g(函数定义 void delayms(uint n) { uint i,j; for(i = n;i > 0;i--) for(j = 110;j > 0;j--); } 3.数码管动态显示 初始化 位选数据有效段选数据有效 第1位位选数据输入第1位段选数据输入 位选数据无效段选数据无效 延时P0口置高消影 4.中断概念 (1)单片机内部中断源 51单片机内部5个中断源INT0->T0->INT1->T1->TI/RI 52单片机内部6个中断源INT0->T0->INT1->T1->TI/RI->T2 (2)单片机中断处理 ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's 主程序中断响应 执行主程序中断请求执行中断 断点处理程序 继续执行主程序 中断返回 (3)中断嵌套 中断响应更高级别中断 主程序 执行主程序中断请求执行中断执行中断断点处理程序处理程序 继续执行主程序 中断返回 (4)中断寄存器 a.中断允许寄存器IE D7 D6 D5 D4 D3 D2 D1 D0 EA -- ET2 ES ET1 EX1 ET0 EX0 EA:全局中断允许位。 ET2:定时器/计数器2中断允许位。 ES:串口中断允许位。 ET1:定时器/计数器1中断允许位。 EX1:外部中断1中断允许位。 ET0:定时器/计数器2中断允许位。 EX0:外部中断0中断允许位。 b.中断优先级寄存器IP D7 D6 D5 D4 D3 D2 D1 D0 -- -- -- PS PT1 PX1 PT0 PX0 PS:串口中断优先级控制位。 PT1:定时器/计数器1中断优先级控制位。 PX1:外部中断1中断优先级控制位。 PT0:定时器/计数器0中断优先级控制位。 PX0:外部中断0中断优先级控制位。 5.单片机的定时器中断 (1)单片机定时器 51单片机内部有两个16位可编程定时/计数器,52单片机多了一个T2。 (2)定时器寄存器 a(工作方式寄存器TMOD D7 D6 D5 D4 D3 D2 D1 D0 GATE C/nT M1 M0 GATE C/nT M1 M0 定时器1 定时器2 ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's GATE:门控制位。 计数器启动与停止仅受TCON寄存器中TRx来控制。 GATE=0,定时器/ GATE=1,定时器/计数器启动与停止受TCON寄存器中TRx和外部中断引脚上的电平状态来控制。 C/nT:定时器模式和计数器模式选择位。 1为计数模式,2为定时器模式。 M1M0:工作方式选择位。 M1 M0 工作方式 0 0 方式0,为13位定时器/计数器 0 1 方式1,为16位定时器/计数器 1 0 方式2,8位初值自动重装的8位定时器/计数器 1 1 方式3,仅适用于T0,分成两个8位计数器,T1停止计数 b(控制寄存器TCON D7 D6 D5 D4 D3 D2 D1 D0 TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 TF1:定时器1溢出标志位。注:进入中断服务程序后,该位自动硬件清零。如果使用查询该位置1后,需要软件清零。 TR1:定时器1运行控制位。 当GATE=1,且INT1为高电平时,TR1置1启动定时器1;当GATE=0,TR1置1启动定时1。 TF0:同TF1。 TR0:同TR1。 IE1:外部中断1请求标志。 IT1:外部中断1触发方式选择位。 0为电平触发方式,1为边沿触发方式。 TE0:同TE1。 IT0:同IT1。 (3)定时器计数初值 THx=(65536-N)/256,TLx=(65536-N)%256 (4)中断服务程序 void 函数名()interrupt 中断号 using 工作组 { 中断服务程序 } 6.数码管串行显示原理 (1)原理图 ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's (2)程序设计 clk=0 clk=1开始 buf=>>1显示位变量定义 dat=1dat=0 NY位变量>0Nbuf&0x01Y 结束位变量减1i++ YNi=0i<8 ships of 72 and a half the Harbour, like room Tao Yuan. Triangle at the cemetery (Shanghai, Nanjing and Hangzhou), and the small triangle (Soviet Union, Ka, Lake) where the hinterland, at the junction of Jiangsu, East, South and west sides respectively, and jiaxing in Zhejiang Province, Wuzhen, Nanxun town and connected. After the liberation, 17 townships, Yan Tomb, provided there is a town, District Administration had in town. A unique geographical environment, has become the military's battleground. On November 5, 1937, Japan 10th army landed in Hangzhou Bay, North Bay, on November 12, Shanghai fell. Part of the Japanese army to the North along the flood of jiaxing railway, Jiujiang road, invaded Wu Jiang. On November 18, the Japanese army occupied Wujiang city. Stationed in Wujiang's
本文档为【数码管显示原理及应用实现】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_882336
暂无简介~
格式:doc
大小:98KB
软件:Word
页数:11
分类:生活休闲
上传时间:2017-10-01
浏览量:115