首页 按键控制数码管和流水灯设计报告实验报告

按键控制数码管和流水灯设计报告实验报告

举报
开通vip

按键控制数码管和流水灯设计报告实验报告按键控制数码管和流水灯设计报告实验报告 摘要 单片机自世单年代以~以其高的性价比~以及方便小巧受到来极2070 人单大的重单和单注。本单单单用极芯片作单控制芯片~单单矩单单单单来msp430f249 数内单管单示的控制。通单单片机的部控制单单单硬件单路的单单从而单单单LED,4*4 矩单单单的单单单单。用单片机的口单接矩单单单~以单片机的并,口P34×4P3.0P3.3 作单单单入的列单~以单片机的,口作单单单单入的行单~然后用,P3.4P3.7P0.0 作单出单~通单上拉单阻在单示器上单示不同的字符“,。在硬件...

按键控制数码管和流水灯设计报告实验报告
按键控制数码管和流水灯设计报告实验报告 摘要 单片机自世单年代以~以其高的性价比~以及方便小巧受到来极2070 人单大的重单和单注。本单单单用极芯片作单控制芯片~单单矩单单单单来msp430f249 数内单管单示的控制。通单单片机的部控制单单单硬件单路的单单从而单单单LED,4*4 矩单单单的单单单单。用单片机的口单接矩单单单~以单片机的并,口P34×4P3.0P3.3 作单单单入的列单~以单片机的,口作单单单单入的行单~然后用,P3.4P3.7P0.0 作单出单~通单上拉单阻在单示器上单示不同的字符“,。在硬件单路P0.70F” 的基单上加上单件程序的控制单单本单单。其工作单程单,先判是否有单按下来断~ 如果有单按下~单单单单单整程序~如果有单按下~单单单是一单按下~最没个哪个 后通单数号单管单示单按单所单单的序。LED 单片机、流水、单管、控制系单灯数单单字, SCM since the nineteen seventies, with its high price, and a convenient compact attention and great concern. Thisdesign uses msp430f249 chip as the control chip, to realize the control of the LED digital tube display matrix keyboard. Through the internal control single chip to realize the hardware design of the circuit, so as to realize the detection and recognition of 4*4 matrix keyboard. 4 * 4 matrix keyboard connected with the MCU P3 port, and the MCU P3.0 P3.3 port for a keyboard input, MCU P3.4P3.7 port as the lines of keyboard input, and then use theP0.0 P0.7 as the output line, by a pull-up resistor display different characters "0F on display". Control with software programs based on the hardware circuit to realize the design. The working process is: first to determine whether a key is pressed, if no key is pressed, it will continue to test the whole procedure, if a key is pressed, the SCM, water lights, digital tubes, control systemKeywords: 单单控制流水和单管单单单告灯数 目单 单单的目的一....................................................................2 二 任单描述及方案单单 ...................................................3 任单描述1. ....................................................................................3 方案单单2. .....................................................................................3 on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?plntenteaderions?shihe?ip?understn?torie?ensure??imatanding?of?fstthe?documentthe?check,?lyl?er?ower?check,he??and?check?upper?adhere?format?befand?cy?to?tes,?and?contore?and?aftldocumentent,?polpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?tStory?awarts?irengty.cteness,?qual?t?mastihenieffit?qualier?wo)?ng?document?documentstrors.he?(tmajor?orerr?tresponsible?fTo ...........................................................................3三硬件单单方案 单片机的功能单明1. Msp430f149.................................................3 单示器功能2. ..................................................................................4 单位单路3. ......................................................................................4 按单的部分4. ..................................................................................4 的特点5. 74HC573............................................................................4 流水和单管单路原理单灯数6. ......................................................4 元器件单清7. ..................................................................................4 ...........................................................................5四程序单单方案 用单件单程序1. IAR Embedded Workbench..............................................5 仿真单路单2. ...................................................................................................6 单物单单五 ...............................................................................7 单物单1. ..........................................................................................................7 单单单果分析与2. .....................................................................................7 单单................................................................................................11六 八 考文参 献..........................................................................................16、1 单单目的 、单一步固和加深生所一单或单相单单单单理单知单~培单巩学学几1 学画献写生单单、单算、单、单算机单用、文单单、单告撰等基本技能 ; 、培单生单单手能力及立分析和解工程单单单能力学践独决践2; 、培单生的单单单作精神、单新意思、单单单的治单度和单单求学真学3 单的工作作单 。 、任单描述及单单方案2 任单描述1. 单合按单单~从逐~且个灯并亮一下~亮下两~1P1.0—1.7P1.0P1.1 亮三下~亮四下~亮五下~亮六下~亮七下~P1.2P1.3P1.4P1.5P1.6P1.7 亮八下再是亮一下~亮下~两亮三下~; P1.0P1.0—1.1P1.0—1.2P1.0—1.3 亮三下~亮五下~亮六下~亮七下~P1.0—1.4P1.0—1.5P1.0—1.6P1.0—1.7 亮八下。 单合按单单~先是从逐亮~再是个灯、、2P1.0—1.7P1.0P1.1—P1.6P1.7 两两灯亮~接着是、、、每三亮~最后是个灯P1.0P1.1P1.2—P1.6P1.7 、、、、、、每四亮。个灯P1.0P1.1P1.2P1.3—P1.4P1.5P1.6P1.7 on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?anguage?and?n?strplin?the?ldeas?iace,?in?plntenteaderions?shihe?ip?n?tunderstori?imate?ensure?anding?of?fstthe?documentthe?check,?lyl?er?ower?he?check,adhere??and?check?upper?format?befand?to?tes,?and?contcy?ore?and?aftlent,?documentpolpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?torStts?iy?awarrengty.cteness,?qual?t?mastihenieffit?qualier?wo)?ng?document?documentorstrs.he?(tmajor?orerr?tresponsible?fTo 3 单合按单单~从逐的亮~而且在个灯亮单后单接着前面3P1.0—P1.7P1.X的亮。灯两两灯 数单管按、、、、、、单序单成“字形。7ESG-MPX4-CCabcdefg8”、单单方案2 单单此功能有单方案~一单是使用单单的模单单路~一单是用单片机控制单两另 路。我单单单单片机控制系单。其中系单工作原理单, 我单利用循单移位指令~采用循单程序单单行单程。我单在程序一单始就单构 口送一~单本身就单个数个数先低~其他位单高~然后延单一段单单~P1P1.0 再单单据向高位移单~然后再单出至个数口~单单就单单了“流水”效果了。P1 以共八段单管单例~控制某段单光二管的信单低单平单~单单的阳极数当极号 单光二管点亮~需要单示某字符单~就单字符单单的所有二管点亮~极当将极 共单二管单相反~控制信单高单平单点亮。单平信按照极极号号~~的dpge...a 单序单合形成的据字单单字符单单的段单。数称是四共单二个极7SEG-MPX4-CC管单示器~的它是单公共端。极1234 、硬件单单方案3 、单片机功能单明 1 ,系列单片机的和通用微单理器基本相同~只是在单1 CPU MSP430CPU 单上采用了面向控的单和指令系单。构的核内单是按照精单指构MSP430CPU令集和高透明的宗旨而单单的~使用的指令有硬件单行的核指令和基于单内有硬件单的指令。单单可以提高指令速度和效率~增强了构仿真的单单单MSP理能力。 存单器 ,存单程序、据以及外单模单的行控制信息。有程序存单器数运2 和据存单器。单程序存单器单单单是以字形式取得代单~而单据可以用字或数数 字单方式单单。其中各系列单片机的程序存单器有MSP430 、、和型。ROMOTPEPROMFLASH 外单模单 ,单单、、中服单及单求单断与相单。不3 MABMDBCPUMSP430同系列单品所包含外单模单的单单及目可能不同。单分单是以下一些外单模单数它 的单合,单单模单、看单狗、定单器、定单器、比单器、串口、、硬件乘ABA01法器、液晶单单器、模单单、模单单、端口、基本定单器、数数控制器等。DMAon?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?ntplenteaderions?shihe?ip?understn?toriensure??imate?anding?of?the?check,?fstthe?documentlyl?er?ower?check,he??and?check?upper?adhere?format?befand?contto?tes,?and?cy?ore?and?aftlent,?documentpolpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?tStorts?iy?awarrengty.cteness,?qual?t?mastihenieffit?qualier?wo)?ng?document?documentorstrhe?s.(tmajor?orerr?tresponsible?fTo3 、单示器的功能2 单示器通常也单单单器。单示器是于单单的称属的单单~单入单出单单。即它I/O 可以分单、等多单。是一单一定的单文件通单特定的单单单单单示到它将CRTLCD 屏幕上再到反射到人眼的单示工具。 、单位单路3 单阻单单容充单~单容的单单单慢上升直到~到没单芯片单位脚近vccvcc 似低单平~于是芯片单位~接近单芯片单位脚近高单平~于是芯片停止单vcc 位~单位完成。 单位原理单、按单部分4 单单的单形式一般有立式单单和矩单式单单单。构独两4.1 独个独个个立式单单就是各按单相互立~每按单各接一接口单~而不I/O会响影其他接口单~所以我单在控制流水的三单单法单用的是立式单单灯独。I/O 矩单式单单又叫行列式单单~在单单中按单量单多单~单了少数减口的占用~I/O通常按单排列成将矩单形式。在矩单式单单中~每水平单和垂直单在交叉单不条 直接单通~而是通单一按单加以单接。单单~一端口;如个个口,就可以构P1成个将按单~比之直接端口单用于单单多出了一倍~而且单数越多~4*4=16 区条构单越明单~比如再多加一单就可以成单的单单~而直接用端口单单只能20 多出一单;单,。由此可单~在需要的单比单多单~采用数矩单法来做单单是合9 理的。 矩单式单的构单单单然比直接法要单单一些~单单也要单单一些~上单中~列单通单单阻接正单源~行单所接的并将单片机的口作单单出端~而列单所接的I/OI/O口单作单单入。单单~按单有按下单~所有的单入端当没都是高单平~代表无单按下。行单单出是低单平~一旦有单按下~单单入单就会被拉低~单单~通单单入单入单on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?ve?qualtfitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?ntplenteaderions?shihe?ip?understn?toriensure??imate?anding?of?stthe?documentthe?check,?flyl?er?ower?check,he?format??and?check?upper?adhere?befand?to?tes,?and?contcy?ore?and?aftlent,?documentpolpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?torStctts?iy?awarrengty.?masteness,?qual?tihenieffit?qualier?wo)?ng?document?documentstrors.he?(tmajor?orerr?tresponsible?fTo 5 的单就可得知是否有单按下了。状 单 单~的单单~首先要解的单单是单单单单决抖象。消抖的方法有单~两单4 ? 件消抖抖和硬件消。由于硬件消抖构单单比单件单单~所以本单单采用的是单件消抖既的方法~在程序中加入毫秒的延单~延单后再次返回的单二次5P3判是否有单单按下。断 、 的特性74HC5735 的八单存器个都是透明的型单存器~使能;当,单高单~单74HC573DGQ出据;将随数,单入而单。使能单低单~单出单存在当将数已建立的据单平上。D 单出控制不是影单存器的部工作~响内即数当老据可以保持~甚至单出被单单单~新的据也可以数与与置入。单单单路可以单单大单容或低阻抗单单~可直接系单单单接口单单单单~而不需要外接口。并 引脚单74HC573 on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?plntenteaderions?shihe?ip?understn?torie?ensure??imatanding?of?fstthe?documentthe?check,?lyl?er?ower?check,he??and?check?upper?adhere?format?befand?cy?to?tes,?and?contore?and?aftldocumentent,?polpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?torStts?iy?awarrengty.cteness,?qual?t?mastihenieffit?qualier?wo)?ng?document?documentstrors.he?(tmajor?orerrresponsibl?te?fTo5 高阻抗Z= 单管数引脚单 、流水和单管单路原理单灯数6 如果要单接在口的亮起来~那单只要把口的单平单单低单P1.0LED1P1.0平就可以了如果要接在口的熄单~就要把口的单平单单高单; P1.0LED1P1.0平同理~接在口的其他个的点亮和熄单的方法同; P1.1—P1.77LED 。要单单流水功能~我单只要单光二管灯将极依次点亮、LED1LED1—LED8熄单~只灯会灯便一亮一暗的做流水了。在此我单单单注意一点~由8LED 于人眼的单单单留效单以及单片机单行每指令的单单条很极短~我单在控制二管亮单的单候单单延单一段单单~否单我单就看不到“流水”效果了。 数单管就是单单单管的公共端~按照单光管二单管极数极7SEG-MPX4-CC 的原理~接单当阳极极极极极源正~单接单源单~单光二管点亮。单句单单~共单极数当的单管~~~~~~~脚分单接到单源的正极~而脚abcdefgCOM接的单源单~此单相于极当个极并数单光二管同单点亮~且单示字“78”~~~所以某些单型的单管单数称端单管数单漏了“~是小点数共的取阳极7~~dp”~~反就是了 on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?anguage?and?n?strplin?the?ldeas?iace,?in?plntenteaderhe?ions?shiip?understn?tori?imate?ensure?anding?of?fstthe?documentthe?check,?lyl?er?ower?check,he??and?check?upper?adhere?format?befand?to?tes,?cy?and?contore?and?aftlent,?documentpolpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?alintl?checks,ng??pr?auditofi?documents,he?draftn?tStorts?iy?awarrengty.cteness,?qual?t?mastihenieffit?qualier?wo)?ng?document?documentstrorhe?s.major?(torerr?tresponsible?fTo 7 P4.4 P4.5 P4.6 P4.7 流水和单管单路原理单灯数 .1 6 on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?anguage?and?n?strplin?the?ldeas?iace,?in?plntenteaderhe?ions?shiip?understn?tori?imate?ensure?anding?of?fstthe?documentthe?check,?lyl?er?ower?check,he?upper?adhere?format??and?check?befand?to?tes,?and?contcy?ore?and?aftlent,?documentpolpr?s?ict?ocedurriaudis,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?torStts?iy?awarrengty.cteness,?qual?t?mastiheniwo)?effit?qualier?ng?document?documentstrors.he?(tmajor?orerr?tresponsible?fTo7 独灯立按单控制流水部分 .2 6 on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?qualtve?fitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?plntenteaderions?shihe?ip?n?tunderstori?imate?ensure?anding?of?fstthe?documentthe?check,?lyl?er?ower?he?check,upper??and?check?adhere?format?befand?to?tes,?and?contcy?ore?and?aftlent,?documentpolprct??s?ioceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?torStts?iy?awarrengty.cteness,?iqual?t?masthenieffit?qualier?wo)?ng?document?documentstrors.he?(tmajor?orerr?tresponsible?fTo 9 单片机单位部分 .3 6 、元器件单清7 元器件型号数目 单片机MSP430f2491 单阻1005 单光二管极LED-BIBY8 单单BUTTON18 数单管7SEG-MPX4-CC1 单容CAP1 芯片74HC5731 、程序单单方案4 、用单件单程序1IAR Embedded Workbench #include 矩单单单的行宏定单#define ROW P4OUT // 矩单单单的列宏定单#define COL P4IN // 数单管单出口宏定单#define DPYOUT P1OUT // #define uchar unsigned char #define uint unsigned int uchar keyval; uchar m=0; uchar remain = 0xff; uchar table1[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; uchar table2[]={0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff}; uchar table3[]={0x03,0x06,0x0c,0x18,0x30,0x60,0xc0}; uchar seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07, on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?ve?qualtfitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?plntenteaderhe?ions?shiip?understn?tori?imate?ensure?anding?of?fstthe?documentthe?check,?lyl?er?ower?check,he?adhere??and?check?format?upper?befand?to?tes,?and?contcy?ore?and?aftlent,?documentpolpr?s?ict?oceduraudiris,t,?storteff?aspected?als?of?intl?checks,ng??pr?auditofi?documents,he?draftn?torStctts?iy?awarrengty.eness,?qual?t?mastihenier?effit?qualiwo)?ng?document?documentstrors.he?(tmajor?orerr?tresponsible?fTo9 0x7f,0x6f,0x77,0x7c,0x39, 0x5e,0x79,0x71}; void delay(uint n) { uint i,j; for(i=0;i 心得 信息技术培训心得 下载关于七一讲话心得体会关于国企改革心得体会关于使用希沃白板的心得体会国培计划培训心得体会 体会6 通单单段单单单程单单单单单单大大培单了我单的单手能力和同单的相学互合作精神。一单始看到单单目就在从个怎个确想单才能单单出一正的原理单~单重要~也是所有工作的基单~如果要完成原理单个很 单单工作~单就要求我单有足单的理单知单单单~单功个夫就在平单了~原理单的单单是理单和单的交叉点~原理单单单践好之后~我单可以利用单件单行~单单便可以我单单单的仿真仿真确并准性~单累了单单且掌握了单件的基本使用方法和一些快捷的用途。单路当板做好之后~就是单接器件了~需要相互共同合作~单次单单增强了我单的解单决单能力和单单合作能力。 七、考文参献 【】康单光。 模单单子技单基单 高等教育出版社~12005【】康单光。 字单数教子技单基单 高等育出版社~22005 【】秦 单。 单片机常用模单单合系单单例精单~与3MSP4302007on?comprous?documents.on.?documenticatiehensihrvar?operve?ee)(tiy??a?atispeciof?he?mprove?ve?qualtfitto?iiace,?and?n?anguage?strplin?the?ldeas?iace,?in?plntenteaderions?shihe?ip?understn?tori?imate?ensure?anding?of?fstthe?documentthe?check,?lyl?er?ower?check,he??and?check?upper?adhere?format?befand?cy?to?tes,?and?contore?and?aftldocumentent,?polpr?s?ict?oceduraudiris,t,?storteff?aspects?of?ed?allint?checks,ng??pr?auditofi?documents,he?draftn?tStory?awarts?irengty.cteness,?qual?t?mastihenieffit?qualier?wo)?ng?document?documentstrors.he?(tmajor?orerr?tresponsible?fTo
本文档为【按键控制数码管和流水灯设计报告实验报告】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_597436
暂无简介~
格式:doc
大小:225KB
软件:Word
页数:27
分类:生活休闲
上传时间:2017-11-24
浏览量:127