基于单片机供暖锅炉控制系统课程设计内容摘要:

820: MOV R2,8 RE1: CLR C SETB NOP NOP CLR NOP NOP NOP SETB NOP MOV C, NOP NOP NOP NOP MOV R3,23 DJNZ R3,$ RRC A DJNZ R2,RE1 RET。 写 DS18B20 的程序 WRITE_1820: MOV R2,8 CLR C WR1: CLR NOP NOP NOP NOP RRC A MOV ,C MOV R3,35 DJNZ R3,$ SETB NOP DJNZ R2,WR1 SETB RET。 读 DS18B20 的程序 ,从 DS18B20 中读出两个字节的温度数据 READ_18200: MOV R4,2。 将温度高位和低位从 DS18B20 中读出 MOV R1,36H。 低位存入 36H TEMPER_L ,高位存入 35H TEMPER_H RE00: MOV R2,8 RE01: CLR C SETB NOP NOP CLR NOP NOP NOP SETB NOP NOP MOV C, MOV R3,35 RE20: DJNZ R3,RE20 RRC A DJNZ R2,RE01 MOV @R1,A DEC R1 DJNZ R4,RE00 RET。 将从 DS18B20 中读出的温度数据进行转换 TEMPER_COV: MOV A,0F0H ANL A,36H。 舍去温度低位中小数点后的四位温度数值 SWAP A MOV 37H,A MOV A,36H JNB ,TEMPER_COV1。 四舍五入去温度值 INC 37H TEMPER_COV1: MOV A,35H ANL A,07H SWAP A ADD,37H MOV 37H,A。 保存变换后的温度数据 LCALL BIN_BCD RET。 将 16 进制 37H 的温度数据转换成压缩 BCD 码放入 37H,38H,39H 中 BIN_BCD: MOV A,37H MOV B,10 DIV AB MOV 38H,B MOV B,10 DIV AB MOV 39H,B MOV 3AH,A RET DISPS: MOV SCON,00H。 设定温度显示子程序 MOV DPTR,TAB MOV A,3BH MOV B,10 DIV AB XCH A,B ACALL SS MOV A,B ACALL SS MOV A,0FH ACALL SS RET DISP: MOV SCON,00H。 正常温度显示子程序 MOV DPTR,TAB MOV A,38H ACALL SS MOV A,39H ACALL SS MOV A,3AH MOV 40H,00H CJNE A,40H, MOV DPTR,TAB1 ACALL SS RET : ACALL SS RET DELAY2: MOV R6,0fFH DL4: MOV R5,0FAH DJNZ R5,$ DJNZ R6,DL4 NOP RET QL: MOV A,00H MOV 20H,A。 20H 为状态标志单元 MOV 30H,A。 30H 为数据缓存标 MOV 35H,A。 35h39h 单元为温度数据单元 MOV 36H,A MOV 37H,A MOV 38H,A MOV 39H,A MOV 3AH,A RET SS: MOVC A,@A+DPTR。 送数子程序 MOV SBUF,A JNB TI,$ CLR TI RET TAB: DB 88h,0ebh,4ch,49h,2bh,19h,18h,0cbh,08h,09h DB 80h,13h,44h,41h,23h,11h,10h,0c3h,00h,01h RET TAB1: DB 0FFH RET END Structure and function of the MCS51 series Structure and function of the MCS51 series onechip puter MCS51 is a name of a piece of onechip puter series which Intel Company produces. This pany introduced 8 topgrade onechip puters of MCS51 series in 1980 after introducing 8 onechip puters of MCS48 series in 1976. It belong to a lot of kinds this line of onechip puter the chips have,such as 8051, 8031, 8751, 80C51BH, 80C31BH,etc., their basic position, basic performance and instruction system are all the same. 8051 daily representatives 51 serial onechip puters . An onechip puter system is made up of several following parts: 1 One microprocessor of 8 CPU . 2 At slice data memory RAM 128B/256B ,it use not depositting not can reading /data that write, such as result not middle of operation, final result and data wanted to show, etc. 3 Procedure memory ROM/EPROM 4KB/8KB , is used to preserve the procedure , some initial data and form in slice. But does not take ROM/EPROM within some onechip puters, such as 8031 , 8032, 80C ,etc.. 4 Four 8 run side by side I/O interface P0 four P3, each mouth can use as introduction , may use as exporting too. 5 Two timer / counter, each timer / counter may set up and count in the way, used to count to the external incident, can set up into a timing way too, and can according to count or result of timing realize the control of the puter. 6 Five cut off cutting off the control system of the source . 7 One all duplexing serial I/O mouth of UART universal asynchronous receiver/transmitter UART , is it realize onechip puter or onechip puter and serial munication of puter to use for. 8 Stretch oscillator and clock produce circuit, quartz crystal finely tune electric capacity need outer. Allow oscillation frequency as 12 megahertas now at most. Every the abovementioned part was joined through the inside data bus .Among them, CPU is a core of the onechip puter, it is the control of the puter and mand centre, made up of such parts as arithmetic unit and controller , etc.. The arithmetic unit can carry on 8 persons of arithmetic operation and unit ALU of logic operation while including one, the 1 storing device temporarilies of 8, storing device 2 temporarily, 839。 s accumulation device ACC, register B and procedure state register PSW, etc. Person who accumulate ACC count by 2 input ends entered of checking etc. temporarily as one operation often, e from person who store 1 operation is it is it make operation to go on to count temporarily , operation result and loopback ACC with another one. In addition, ACC is often regarded as the transfer station of data transmission on 8051 inside . The same as general microprocessor, it is the busiest register. Help remembering that agreeing with A expresses in the order. The controller includes the procedure counter , the order is depositted, the order decipher, the oscillator and timing circuit, etc. The procedure counter is made up of counter of 8 for two, amounts to 16. It is a byte address counter of the procedure in fact, the content is the next IA that will carried out in PC. The content which changes it can change the direction that the procedure carries out . Shake the circuit in 8051 onechip puters, only need outer quartz crystal and frequency to finely tune the electric capacity, its frequency range is its 12MHZ of . This puls。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。