此帖出自嵌入式系统论坛
最新回复
C51 COMPILER V7.01 DS18B20 05/28/2007 14:05:27 PAGE 3
ASSEMBLY LISTING OF GENERATED OBJECT CODE
; FUNCTION ow_reset (BEGIN)
; SOURCE LINE # 9
; SOURCE LINE # 10
; SOURCE LINE # 12
0000 C297 CLR DQ
; SOURCE LINE # 13
0002 7F1D MOV R7,#01DH
0004 7E00 MOV R6,#00H
0006 120000 E LCALL _delay
; SOURCE LINE # 14
0009 D297 SETB DQ
; SOURCE LINE # 15
000B 7F03 MOV R7,#03H
000D 7E00 MOV R6,#00H
000F 120000 E LCALL _delay
; SOURCE LINE # 16
0012 A297 MOV C,DQ
0014 E4 CLR A
0015 33 RLC A
0016 F500 R MOV presence,A
; SOURCE LINE # 17
0018 7F19 MOV R7,#019H
001A 7E00 MOV R6,#00H
001C 120000 E LCALL _delay
; SOURCE LINE # 18
001F AF00 R MOV R7,presence
; SOURCE LINE # 19
0021 ?C0001:
0021 22 RET
; FUNCTION ow_reset (END)
; FUNCTION read_byte (BEGIN)
; SOURCE LINE # 22
; SOURCE LINE # 23
; SOURCE LINE # 25
0000 E4 CLR A
0001 F500 R MOV value,A
; SOURCE LINE # 26
0003 750008 R MOV i,#08H
0006 ?C0002:
; SOURCE LINE # 27
; SOURCE LINE # 28
0006 E500 R MOV A,value
0008 C3 CLR C
0009 13 RRC A
000A F500 R MOV value,A
; SOURCE LINE # 29
000C C297 CLR DQ
; SOURCE LINE # 30
000E D297 SETB DQ
; SOURCE LINE # 31
0010 7F01 MOV R7,#01H
0012 7E00 MOV R6,#00H
0014 120000 E LCALL _delay
; SOURCE LINE # 32
0017 309703 JNB DQ,?C0005
001A 430080 R ORL value,#080H
001D ?C0005:
; SOURCE LINE # 33
C51 COMPILER V7.01 DS18B20 05/28/2007 14:05:27 PAGE 4
001D 7F06 MOV R7,#06H
001F 7E00 MOV R6,#00H
0021 120000 E LCALL _delay
; SOURCE LINE # 34
0024 1500 R DEC i
0026 E500 R MOV A,i
0028 D3 SETB C
0029 9400 SUBB A,#00H
002B 50D9 JNC ?C0002
002D ?C0003:
; SOURCE LINE # 35
002D AF00 R MOV R7,value
; SOURCE LINE # 36
002F ?C0006:
002F 22 RET
; FUNCTION read_byte (END)
; FUNCTION _write_byte (BEGIN)
; SOURCE LINE # 39
0000 8F00 R MOV val,R7
; SOURCE LINE # 40
; SOURCE LINE # 42
0002 750008 R MOV i,#08H
0005 ?C0007:
; SOURCE LINE # 43
; SOURCE LINE # 44
0005 C297 CLR DQ
; SOURCE LINE # 45
0007 E500 R MOV A,val
0009 13 RRC A
000A 9297 MOV DQ,C
; SOURCE LINE # 46
000C 7F05 MOV R7,#05H
000E 7E00 MOV R6,#00H
0010 120000 E LCALL _delay
; SOURCE LINE # 47
0013 D297 SETB DQ
; SOURCE LINE # 48
0015 E500 R MOV A,val
0017 A2E7 MOV C,ACC.7
0019 13 RRC A
001A F500 R MOV val,A
; SOURCE LINE # 49
001C 1500 R DEC i
001E E500 R MOV A,i
0020 D3 SETB C
0021 9400 SUBB A,#00H
0023 50E0 JNC ?C0007
0025 ?C0008:
; SOURCE LINE # 50
0025 7F05 MOV R7,#05H
0027 7E00 MOV R6,#00H
0029 020000 E LJMP _delay
; FUNCTION _write_byte (END)
; FUNCTION Read_Temperature (BEGIN)
; SOURCE LINE # 54
; SOURCE LINE # 55
; SOURCE LINE # 56
0000 120000 R LCALL ow_reset
; SOURCE LINE # 57
0003 7FCC MOV R7,#0CCH
C51 COMPILER V7.01 DS18B20 05/28/2007 14:05:27 PAGE 5
0005 120000 R LCALL _write_byte
; SOURCE LINE # 58
0008 7F44 MOV R7,#044H
000A 120000 R LCALL _write_byte
; SOURCE LINE # 59
000D 7F32 MOV R7,#032H
000F 7E00 MOV R6,#00H
0011 120000 E LCALL _delay
; SOURCE LINE # 60
0014 120000 R LCALL ow_reset
; SOURCE LINE # 61
0017 7FCC MOV R7,#0CCH
0019 120000 R LCALL _write_byte
; SOURCE LINE # 62
001C 7FBE MOV R7,#0BEH
001E 120000 R LCALL _write_byte
; SOURCE LINE # 63
0021 120000 R LCALL read_byte
0024 8F00 R MOV TempX,R7
; SOURCE LINE # 64
0026 120000 R LCALL read_byte
0029 8F00 R MOV TempF,R7
; SOURCE LINE # 65
002B 22 RET
; FUNCTION Read_Temperature (END)
; FUNCTION SendTemperature (BEGIN)
; SOURCE LINE # 66
; SOURCE LINE # 67
0000 120000 R LCALL Read_Temperature
; SOURCE LINE # 68
0003 7F57 MOV R7,#057H
0005 120000 E LCALL _WrTiBuf
; SOURCE LINE # 69
0008 AF00 R MOV R7,TempX
000A 120000 E LCALL _WrTiBuf
000D AF00 R MOV R7,TempF
000F 020000 E LJMP _WrTiBuf
; FUNCTION SendTemperature (END)复制代码
详情
回复
发表于 2008-10-5 14:42
| ||
|
||
| |
|
|
| |
|
|
此帖出自嵌入式系统论坛
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
EEWorld Datasheet 技术支持