基于单片机供暖锅炉控制系统课程设计内容摘要:
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。基于单片机供暖锅炉控制系统课程设计
相关推荐
行驶里程为 5 里,起步价为 6 元,超出 3 公里后按每公里一元收费,则金额 =6+( 53) *1=8(元) 间接测速 单元设计 霍尔传感器 A44E在本 次设计 的 主要作用是 对 车轮转动时产生出的脉冲信号 采集。 车轮每转一周,磁铁经过 传感器 两 次。 霍尔传感器 A44E 的第 3 脚就输出一个脉冲信号作为单片机 AT89S52 的外中断信号,从 口输入。 口作为信号的输入端 ,
在 flash编程和校验时 P1 口接收低 8 位地址字节。 引脚号 第二功能 T2(定时器 /计数器 T2 的外部计数输入),时钟输出 ; T2EX(定时器 /计数器 T2 的捕捉 /重载触发信号 和方向控制) MOSI(在系统编程用) ; MISO(在系统编程用) ; SCK(在系统编程用) P2 口: P2 口是一个具有内部上拉电阻的 8 位双向 I/O 口, P2 输出缓冲器能驱动 4
.................................................................. II 引言 .............................................................................................................................
(如执行 MOVX@RI 指令)时, P2 口输出 P2 锁存器 的内容。 Flash 编程 或校验时, P2 亦接收高位地址和一些 控制信号。 P3 口 : P3 口是一组带有内部上拉电阻的 8 位双向 I/O 口。 P3 口输出缓冲级可驱动(吸收或输出电流) 4 个 TTL 逻辑门 电路。 对 P3 口写入 “ 1” 时,它们被内部上拉电阻拉高并可作为输入端口。 此时,被外部拉低的 P3
口输出) 运行状态 空 黄灯 绿灯 红灯 空 黄灯 绿灯 红灯 1 0 0 1 1 0 1 0 0x9a ① 1 0 0 1 1 1 1 0 0x9e ② 1 0 1 0 1 0 0 1 0xa9 ③ 1 1 1 0 1 0 0 1 0xe9 ④ 1 0 0 1 1 0 0 1 0x99 ⑤ 1 0 0 1 1 0 1 0 0x9a ⑥ 1 0 1 0 1 0 0 1 0xa9 ⑦ 单片机
DS18B20 中的每个器件上都有独一无二的序列号。 实际应用中不需要外部任何元器件即可实现测温。 测量温度范围在- 55。 C到+ 125。 C之间。 数字温度计的分辨率用户可以从 9位到 12 位选择。 内部有温度上、下限告警设置。 DS18B20 的数据输入 /输出端连接于 Atmega16L 的 PA7 引脚 ,电路原理如图 6所示。 AGND31X113X212R E