黄丹文档格式.docx
- 文档编号:16393820
- 上传时间:2022-11-23
- 格式:DOCX
- 页数:19
- 大小:96.33KB
黄丹文档格式.docx
《黄丹文档格式.docx》由会员分享,可在线阅读,更多相关《黄丹文档格式.docx(19页珍藏版)》请在冰豆网上搜索。
整个程序的流程图如图所示。
四.系统主程序:
系统主程序
ORG0000H
LJMPMAIN
ORG0013H
LJMPSUB
ORG0100H
MAIN:
MOVSP,#40H
MOVA,#78H
MOVR7,#09H
MOVXA,@DPTR
MOVR0,A
CLRC
SUBBA,#34H
JNCLOOP1
CLRC
MOVA,R0
SUBBA,#3AH
JCLOOP
MOVA,R0
ACALLTEMP
LOOP:
MOVDPTR,#EF00H
MOVR1,#0F8H
MOVA,#33H
MOVX@R1,A
MOVCA,@A+DPTR
DECR1
MOVX@R1,A
MOVA,R2
INCR1
INCR0
CLRC
RRCA
MOVR2,A
MOVA,#00H
MOVDPTR,#00F8H
MOVX@DPTR,A
AJMPGO
LOOP1:
MOVP1,#8FH
AJMPGO
LOOP2:
MOVP1,#0BFH
GO:
POPDPH
POPDPL
POPACC
POPPSW
RETI
END
TEMP:
MOVDPTR,TABLE
MOVA,R0
MOVB,#04H
CLRC
MULAB
JNCNOO
INCDPH
NOO:
MOVCA,@A+DPTR
MOV80H,A
INCDPTR
MOVCA,@DPTR
MOV81H,A
AJMPLOOP
ORG0300H
TAB:
DB3FH06H5BH4FH66H6DH7DH07H7FH6FH77H83H
MOV20H,#0
MOV21H,#0
MOVR0,#3CH
MOVR1,#12
LCALLCLEAR
SETBPT0
ML2:
NOP
MOVA,P1
CJNEA,#0FBH,ML3
AJMPMAIN
ML3:
MOVA,PIN1
INCA
SUBBA,PIN3
CJNEA,#0,ML4
AJMPTEST0
ML4:
JCTEST0
JNBE1,TEST0
AJMPCOMPP
TEST0:
MOVPIN3,#0
CJNEA,#0FDH,TEST
AJMPEXIT
TEST:
MOVA,P1
CJNEA,#0FFH,TEST1
EXIT:
MOVR0,#79H
MOVR1,#50H
HEX:
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E0
MOVR0,#4EH
JNZML00
AJMPML00
MIN:
MOVR0,#4CH
SEC:
MOVR0,#4AH
ML00:
MOVR0,#49H
MOVR1,#30H
DELY:
MOVR1,#0FFH
A1:
MOVR2,#0FFH
NOP
DJNZR2,LOOP
DJNZR1,A1
RET
PITO:
PUSHPSW
PUSH0E0H
PUSHDPH
PUSHDPL
SETBPSW.3
MOVTL0,#01H
MOVTH0,#1FH
CJNEA,#0FDH,SSS
MOVTL0,#0EDH
MOVTH0,#0FBH
SSS:
JNBP1.5,GETNUM
DDD:
MOVA,2FH
DECA
MOV2FH,A
JNZRET0
MOV2FH,#10H
RET0:
SETBTR0
POPDPL
POP0E0H
POPPSW
RETI
GETNUM:
JBFLAG1,EE
MOVR1,#49H
CO:
MOV@R1,#0
DJNZR2,CO
SETBFLAG1
EE:
AJMPDDD
DAAD1:
ORLA,@R0
ADDA,#1
DAA
MOVR2,A
MOV@R0,A
SETBFLAG3
SUB:
DEC@R0
CJNE@R0,#0FFH,RET2
CJNE@R0,#0,AA
MOV@R0,#0
AA:
MOV@R0,#9
RET2:
SUB0:
CJNE@R0,#0,BB
BB:
CJNE@R0,#0FFH,RET3
RET3:
CLR0:
CLRA
FUL0:
MOVA,#6
INI:
ORLTMOD,#20H
MOVTH1,#0fdH
MOVTL1,#0fdH
MOVSCON,#50H
MOVPCON,#80H
SETBTR1
MOVA,#0CH
MOVSBUF,A
JNBTI,$
CLRTI
MOVR3,#2
REC2:
MOVR2,#2
REC:
SND:
CLRTI
DJNZR2,REC
MOVA,#3AH
DJNZR3,REC2
REC1:
DJNZR2,REC1
JBE0,REE
AJMPJJ
REE:
MOVSBUF,#24H
DJNZR1,REE
EEE:
JNBE2,JJ
CLRE2
CLRE0
E:
MOVSBUF,#0DH
JJ:
JNBFLAG2,ENDS
MOVR3,#5
RE:
MOVSBUF,#30H
DJNZR3,RE
CLRFLAG2
ENDS:
五.总结和体会
本课程设计叙述了仓库温度计(数字式热敏电阻温度计)的设计,包括硬件组成和软件的设计,该系统在硬件设计上主要是通过温度传感器对温度进行采集,把温度转换成变化的电压,然后由放大器将信号放大,通过A/D转换器,MC14433将模拟温度电压信号转化为对应的数字温度信号电压。
其硬件设计中最核心的器件是单片机89C51,它一方面控制A/D转换器实现模拟信号到数字信号的转换,另一方面,将采集到的数字温度电压值经计算机处理得到相应的温度值,送到LED显示器,以数字形式显示测量的温度。
整个系统的软件编程就是通过汇编语言对单片机MT89C51实现其控制功能。
通过这次实验课题的设计,让我更加了解了单片机的功能,也对它有了新一步的认识,其功能强大,不光学习上重要,在生活中有更多方面都设计到单片机,让我受益非浅。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 黄丹.docx
![提示](https://static.bdocx.com/images/bang_tan.gif)