液晶显示模拟多通道数据采集系统

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

实验报告课程名称:微机原理与接口技术指导老师:彭勇刚成绩:__________________实验名称:_______________________________实验类型:________________同组学生姓名:__________一、实验目的和要求(必填)二、实验内容和原理(必填)三、主要仪器设备(必填)四、操作方法和实验步骤五、实验数据记录和处理六、实验结果与分析(必填)七、讨论、心得液晶显示模拟多通道数据采集系统一:实验目的1):掌握和理解单片机总线工作模式下各信号线的跳变及相应的时序,特别要了解ALE及RD、WR信号线在总线方式下的时序。2):在总线方式下各相应指令的结构。3):外围接口芯片的地址选择方式。4):了解LCD模块的使用说明及特别是指令说明。二:实验原理和实验内容采用总线方式构架一个多路数据采集系统。并将采样数据分二行在液晶显示模块上进行实时显示。随着被采样电压值的变化液晶显示器显示的值跟随变化(即连续采样)。显示数值为实际的电压值。ADC0809接线图(AD转换)装订线CH4:xxHCH5:xxHCH6:xxHCH0:xxHDAC0832接线图(DA转换)液晶显示器接线图实验要求:ADC0809对三路数据【通道4、通道5、通道6】进行采样,同时将通道4的采样结果送人DAC0832进行DA转换,再将DA输出电压接到AD的通道0进行转换并将4个通道的实际值分分二行发送到液晶显示器上进行显示。显示效果如上图所示。三.实验程序及注释:ORG0000H0000020080LJMPMAINORG0003H0003020200LJMPADCORG0080HMAIN:0080758160MOVSP,#60H;初值设定00833126ACALLJIANC;检测显示器的工作状态008500NOP0086310EACALLLCD0088902300MOVDPTR,#2300H;指向选通地址008B7480MOVA,#80H;008DF0MOVX@DPTR,A008E3126ACALLJIANC00907E80MOVR6,#80H;R6指示显示位置00927F34MOVR7,#34H;R7指示显示的数字4,5,6,0009411DFACALLSHOWCH00967E89MOVR6,#89H;指向下一要显示的位置00980FINCR7009911DFACALLSHOWCH009B7EC0MOVR6,#0C0H009D0FINCR7009E11DFACALLSHOWCH00A07EC9MOVR6,#0C9H00A27F30MOVR7,#30H00A411DFACALLSHOWCHMAIN1:00A67830MOVR0,#30H;R0存放A/D部分的临时存储调试地址00A87A03MOVR2,#03H00AA902004MOVDPTR,#2004H;AD转换通道4STARTAD:00ADC2D5CLRF0;清中断发生标志00AFD288SETBIT000B1D2AFSETBEA00B3D2A8SETBEX000B5F0MOVX@DPTR,A00B630D5FDLOOP:JNBF0,LOOP00B9DAF2DJNZR2,STARTAD;用R2控制采集三路通道数据00BB11C5ACALLDASEND00BD9001F4MOVDPTR,#50000C0120250LCALLWTMS;调用延时子程序00C380E1SJMPMAIN1DASEND:00C5902100MOVDPTR,#2100H;先选通da第一级缓冲00C8E530MOVA,30H00CAF0MOVX@DPTR,A00CB902200MOVDPTR,#2200H;选通da第二级缓冲00CEF0MOVX@DPTR,A00CF902000MOVDPTR,#2000H;选通ad通道000D2C2D5START2:CLRF000D4D288SETBIT000D6D2A8SETBEX000D8D2AFSETBEA00DAF0MOVX@DPTR,A00DB30D5FDLOOP1:JNBF0,LOOP100DE22RET;显示CHSHOWCH:00DF902300MOVDPTR,#2300H;2300-写命令00E2EEMOVA,R6;确定写入位置00E3F0MOVX@DPTR,A00E43126ACALLJIANC00E6902302MOVDPTR,#2302H;2302-写数据00E97443MOVA,#43H;字母c的ascII00EBF0MOVX@DPTR,A00EC3126ACALLJIANC00EE7448MOVA,#48H;字母h的ascII00F0F0MOVX@DPTR,A00F13126ACALLJIANC00F3EFMOVA,R7;字母R7的ascII00F4F0MOVX@DPTR,A00F53126ACALLJIANC00F7743AMOVA,#3AH;字母:的ascII00F9F0MOVX@DPTR,A00FA3126ACALLJIANC00FC7406MOVA,#06H00FE2EADDA,R600FF902300MOVDPTR,#2300H0102F0MOVX@DPTR,A01033126ACALLJIANC0105902302MOVDPTR,#2302H01087448MOVA,#48H010AF0MOVX@DPTR,A010B3126ACALLJIANC010D22RET;液晶初始化子程序LCD:010E902300MOVDPTR,#2300H0111743FMOVA,#3FH0113F0MOVX@DPTR,A01143126ACALLJIANC01167401MOVA,#01H0118F0MOVX@DPTR,A01193126ACALLJIANC011B740FMOVA,#0FH011DF0MOVX@DPTR,A011E3126ACALLJIANC01207406MOVA,#06H0122F0MOVX@DPTR,A01233126ACALLJIANC012522RET;检测液晶显示器工作状态子程序JIANC:0126C082PUSHDPL0128C0E0PUSHACC012A00JIA:NOP012B902301MOVDPTR,#2301H;012EE0MOVXA,@DPTR012F20E7F8JBACC.7,JIA0132D0E0POPACC0134D082POPDPL013622RETORG0200HADC:0200E0MOVXA,@DPTR0201F6MOV@R0,A02025109ACALLSHOWV;调用显示函数0204A3INCDPTR020508INCR00206D2D5SETBF0020832RETI020900SHOWV:NOP;显示函数020AC082PUSHDPL020CC083PUSHDPH020EBA0304CJNER2,#03H,C02;利用R2来确定lcd显示位置指针R602117E84MOVR6,#84H;R2为03H说明此时采集的为4通道,故显示位置在84h02134128AJMPOUTC;跳出比较0215BA0204C02:CJNER2,#02H,C0102187E8DMOVR6,#8DH;R2为02H说明此时采集的为5通道,故显示位置在8Dh021A4128AJMPOUTC021CBA0104C01:CJNER2,#01H,C00021F7EC4MOVR6,#0C4H;R2为01H说明此时采集的为6通道,故显示位置在C4h02214128AJMPOUTC0223BA0002C00:CJNER2,#00H,OUTC02267ECDMOVR6,#0CDH;R2为00H说明此时采集的为0通道,故显示位置在CDh022800OUTC:NOP0229EEMOVA,R6022A902300MOVDPTR,#2300H022DF0MOVX@DPTR,A;待写入的光标位置在R6022E3126ACALLJIANC0230E6MOVA,@R00231C4SWAPA;先写ad结果的高位0232540FANLA,#0FH0234900271MOVDPTR,#TAB;利用movc查表ascii码023793MOVCA,@A+DPTR0238902302MOVDPTR,#2302H023BF0MOVX@DPTR,A023C3126ACALLJIANC023EE6MOVA,@R0;显示ad结果低位023F540FANLA,#0FH0241900271MOVDPTR,#TAB;利用movc查表ascii码024493MOVCA,@A+DPTR0245902302MOVDPTR,#2302H0248F0MOVX@DPTR,A02493126ACALLJIANC024BD083POPDPH024DD082POPDPL024F22RET02506382FFWTMS:XRLDPL,#0FFH;延时子程序02536383FFXRLDPH,#0FFH0256A3INCDPTR0257758A9CWTMS1:MOVTL0,#9CH025A758CFFMOVTH0,#0FFH025D758901MOVTMOD,#10260D28CSETBTR00262308DFDWTMS2:JNBTF0,WTMS20265C28CCLRTR00267C28DCLRTF00269A3INCDPTR026AE582MOVA,DPL026C4583ORLA,DPH026E70E7JNZWTMS1027022RET027130313202743334350277363738027A394142027D434445028046TAB:DB30H,31H,32H,33H,34H,35H,36H,37H,38H,39H,41H,42H,43H,44H,45H,46HEND四.心得体会:通过本次实验,我加深了对课上理论知识的理解,如A/D,D/A的转化,LCD显示等,同时也进一步学习了在总线方式下各相应指令的结构及外围接口芯片的地址选择方式。本次实验综合性较强,因而有一定难度:一是对于实验原理的理解,如A/D转化的原理,ADC0809芯片与80C51的接法以及对应的地址选择方式等;二是完整程序的编写,只有在理解实验原理的基础上才能对程序的整体结构有清晰的认识,但具体程序还有许多需要特别注意的地方,如对于各芯片选通地址的选择以及本实验中用R2来控制采集4,5,6通道的数据。总之,本次综合型实验对于课上的理论知识的理解有较高的要求,同时也使我进一步深化了对51单片机扩展和接口技术的理解。

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功