⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1820.s

📁 基于ATMEGA16的温度传感器原代码
💻 S
📖 第 1 页 / 共 3 页
字号:
	.dbline 186
	mov R18,R22
	mov R16,R20
	xcall _LCD_address
	.dbline 187
	ldd R16,y+4
	swap R16
	andi R16,#0x0F
	xcall _BCD_ASCII
	xcall _WR_dat
	.dbline 188
	ldd R16,y+4
	xcall _BCD_ASCII
	xcall _WR_dat
	.dbline -2
L99:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym l number 4 c
	.dbsym r Y 22 c
	.dbsym r X 20 c
	.dbend
	.dbfunc e lcd_write2 _lcd_write2 fV
;         number -> y+4
;              Y -> R22
;              X -> R20
	.even
_lcd_write2::
	xcall push_gset2
	mov R22,R18
	mov R20,R16
	.dbline -1
	.dbline 192
	.dbline 193
	mov R18,R22
	mov R16,R20
	xcall _LCD_address
	.dbline 197
	ldd R16,y+4
	ldd R17,y+5
	xcall _BCD_ASCII
	xcall _WR_dat
	.dbline -2
L100:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym l number 4 i
	.dbsym r Y 22 c
	.dbsym r X 20 c
	.dbend
	.dbfunc e show_time _show_time fV
;           temp -> R20
;           time -> R22,R23
	.even
_show_time::
	xcall push_gset2
	movw R22,R16
	sbiw R28,1
	.dbline -1
	.dbline 200
	.dbline 203
	ldi R18,60
	ldi R19,0
	movw R16,R22
	xcall div16u
	mov R20,R16
	.dbline 204
	ldi R17,10
	xcall mod8u
	mov R2,R16
	ldi R17,10
	mov R16,R20
	xcall div8u
	mov R24,R16
	andi R24,#0x0F
	swap R24
	add R24,R2
	std y+0,R24
	ldi R18,3
	ldi R16,1
	xcall _lcd_writechar
	.dbline 206
	ldi R18,60
	ldi R19,0
	movw R16,R22
	xcall mod16u
	mov R20,R16
	.dbline 207
	ldi R17,10
	xcall mod8u
	mov R2,R16
	ldi R17,10
	mov R16,R20
	xcall div8u
	mov R24,R16
	andi R24,#0x0F
	swap R24
	add R24,R2
	std y+0,R24
	ldi R18,5
	ldi R16,1
	xcall _lcd_writechar
	.dbline -2
L101:
	adiw R28,1
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r temp 20 c
	.dbsym r time 22 i
	.dbend
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
_JD::
	.blkb 2
	.area idata
	.byte 53,52
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.blkb 2
	.area idata
	.byte 51,50
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.blkb 2
	.area idata
	.byte 49,48
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.blkb 2
	.area idata
	.byte 49,50
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.blkb 2
	.area idata
	.byte 51,52
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.blkb 1
	.area idata
	.byte 53
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.dbsym e JD _JD A[11:11]c
	.area text(rom, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.dbfunc e lcd_writejd _lcd_writejd fV
;         number -> y+4
;              Y -> R22
;              X -> R20
	.even
_lcd_writejd::
	xcall push_gset2
	mov R22,R18
	mov R20,R16
	.dbline -1
	.dbline 215
	.dbline 216
	mov R18,R22
	mov R16,R20
	xcall _LCD_address
	.dbline 217
	ldd R24,y+4
	cpi R24,5
	brsh L103
	.dbline 218
	.dbline 219
	ldi R16,43
	xcall _WR_dat
	.dbline 220
	xjmp L104
L103:
	.dbline 221
	ldd R24,y+4
	cpi R24,5
	brne L105
	.dbline 222
	.dbline 223
	ldi R16,32
	xcall _WR_dat
	.dbline 224
	xjmp L106
L105:
	.dbline 226
	.dbline 227
	ldi R16,45
	xcall _WR_dat
	.dbline 228
L106:
L104:
	.dbline 229
	ldi R24,<_JD
	ldi R25,>_JD
	ldd R30,y+4
	clr R31
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _WR_dat
	.dbline -2
L102:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym l number 4 c
	.dbsym r Y 22 c
	.dbsym r X 20 c
	.dbend
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20\1820.c
	.dbfunc e init_1820 _init_1820 fV
	.even
_init_1820::
	.dbline -1
	.dbline 21
	.dbline 22
	sbi 0x11,7
	.dbline 23
	sbi 0x12,7
	.dbline 24
	cbi 0x12,7
	.dbline 25
	ldi R16,500
	ldi R17,1
	xcall _delay_nus
	.dbline 26
	sbi 0x12,7
	.dbline 27
	cbi 0x11,7
	.dbline 28
	ldi R16,30
	ldi R17,0
	xcall _delay_nus
L108:
	.dbline 29
L109:
	.dbline 29
	sbic 0x10,7
	rjmp L108
	.dbline 30
	sbi 0x11,7
	.dbline 31
	sbi 0x12,7
	.dbline 32
	ldi R16,80
	ldi R17,0
	xcall _delay_nus
	.dbline -2
L107:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e write_1820 _write_1820 fV
;              m -> R20
;              x -> R22
	.even
_write_1820::
	xcall push_gset2
	mov R22,R16
	.dbline -1
	.dbline 41
	.dbline 43
	clr R20
	xjmp L115
L112:
	.dbline 44
	.dbline 45
	cbi 0x12,7
	.dbline 46
	ldi R16,1
	mov R17,R20
	xcall lsl8
	mov R2,R22
	and R2,R16
	breq L116
	.dbline 47
	sbi 0x12,7
	xjmp L117
L116:
	.dbline 49
	cbi 0x12,7
L117:
	.dbline 50
	ldi R16,30
	ldi R17,0
	xcall _delay_nus
	.dbline 51
	sbi 0x12,7
	.dbline 52
L113:
	.dbline 43
	inc R20
L115:
	.dbline 43
	cpi R20,8
	brlo L112
	.dbline 53
	sbi 0x12,7
	.dbline -2
L111:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r m 20 c
	.dbsym r x 22 c
	.dbend
	.dbfunc e read_1820 _read_1820 fc
;           temp -> R20
;              k -> R22
;              n -> R10
	.even
_read_1820::
	xcall push_gset3
	.dbline -1
	.dbline 62
	.dbline 63
	clr R20
	.dbline 64
	clr R10
	xjmp L122
L119:
	.dbline 65
	.dbline 66
	cbi 0x12,7
	.dbline 67
	sbi 0x12,7
	.dbline 68
	cbi 0x11,7
	.dbline 69
	in R22,0x10
	andi R22,128
	.dbline 70
	breq L123
	.dbline 71
	ldi R16,1
	mov R17,R10
	xcall lsl8
	or R20,R16
	xjmp L124
L123:
	.dbline 73
	ldi R16,1
	mov R17,R10
	xcall lsl8
	mov R2,R16
	com R2
	and R20,R2
L124:
	.dbline 74
	ldi R16,50
	ldi R17,0
	xcall _delay_nus
	.dbline 75
	sbi 0x11,7
	.dbline 76
L120:
	.dbline 64
	inc R10
L122:
	.dbline 64
	mov R24,R10
	cpi R24,8
	brlo L119
	.dbline 77
	mov R16,R20
	.dbline -2
L118:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r temp 20 c
	.dbsym r k 22 c
	.dbsym r n 10 c
	.dbend
	.dbfunc e Read_1820_temprter _Read_1820_temprter fi
;           teml -> R20
;           temh -> R22
;          count -> R20,R21
	.even
_Read_1820_temprter::
	xcall push_gset2
	sbiw R28,4
	.dbline -1
	.dbline 86
	.dbline 89
	xcall _init_1820
	.dbline 90
	ldi R16,204
	xcall _write_1820
	.dbline 91
	ldi R16,68
	xcall _write_1820
	.dbline 92
	ldi R16,400
	ldi R17,1
	xcall _delay_nus
	.dbline 93
	xcall _init_1820
	.dbline 94
	ldi R16,204
	xcall _write_1820
	.dbline 95
	ldi R16,190
	xcall _write_1820
	.dbline 96
	xcall _read_1820
	mov R20,R16
	.dbline 97
	xcall _read_1820
	mov R22,R16
	.dbline 98
	ldi R16,<L128
	ldi R17,>L128
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	mov R18,R22
	clr R19
	ldi R16,256
	ldi R17,1
	xcall empy16s
	movw R2,R16
	mov R4,R20
	clr R5
	add R2,R4
	adc R3,R5
	movw R16,R2
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall empy32f
	movw R30,R28
	std z+0,R16
	std z+1,R17
	std z+2,R18
	std z+3,R19
	movw R30,R28
	ldd R2,z+0
	ldd R3,z+1
	ldd R4,z+2
	ldd R5,z+3
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	ldi R16,<L129
	ldi R17,>L129
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall cmp32f
	brlt L126
	movw R30,R28
	ldd R2,z+0
	ldd R3,z+1
	ldd R4,z+2
	ldd R5,z+3
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	ldi R16,<L129
	ldi R17,>L129
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall sub32f
	xcall fp2int
	movw R22,R16
	subi R22,0  ; offset = 32768
	sbci R23,128
	xjmp L127
L126:
	movw R30,R28
	ldd R16,z+0
	ldd R17,z+1
	ldd R18,z+2
	ldd R19,z+3
	xcall fp2int
	movw R22,R16
L127:
	movw R20,R22
	.dbline 99
	movw R16,R20
	.dbline -2
L125:
	adiw R28,4
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r teml 20 c
	.dbsym r temh 22 c
	.dbsym r count 20 i
	.dbend
	.dbfunc e main _main fV
;            tem -> <dead>
	.even
_main::
	sbiw R28,2
	.dbline -1
	.dbline 108
	.dbline 109
	xcall _CPU_Init
	xjmp L132
L131:
	.dbline 111
	.dbline 112
	xcall _Read_1820_temprter
	sts _temprter+1,R17
	sts _temprter,R16
	.dbline 114
	xcall _Lcd_INT
	.dbline 115
	xcall _lcd_clear
	.dbline 117
	ldi R18,10000
	ldi R19,39
	lds R16,_temprter
	lds R17,_temprter+1
	xcall mod16u
	ldi R18,1000
	ldi R19,3
	xcall div16u
	std y+1,R17
	std y+0,R16
	ldi R18,1
	ldi R16,2
	xcall _lcd_write2
	.dbline 118
	ldi R18,10000
	ldi R19,39
	lds R16,_temprter
	lds R17,_temprter+1
	xcall mod16u
	ldi R18,1000
	ldi R19,3
	xcall mod16u
	ldi R18,100
	ldi R19,0
	xcall div16u
	std y+1,R17
	std y+0,R16
	ldi R18,2
	ldi R16,2
	xcall _lcd_write2
	.dbline 121
	ldi R24,<L134
	ldi R25,>L134
	std y+1,R25
	std y+0,R24
	ldi R18,3
	ldi R16,2
	xcall _LCD_Write_string
	.dbline 123
	ldi R18,10000
	ldi R19,39
	lds R16,_temprter
	lds R17,_temprter+1
	xcall mod16u
	ldi R18,1000
	ldi R19,3
	xcall mod16u
	ldi R18,100
	ldi R19,0
	xcall mod16u
	ldi R18,10
	ldi R19,0
	xcall div16u
	std y+1,R17
	std y+0,R16
	ldi R18,4
	ldi R16,2
	xcall _lcd_write2
	.dbline 124
	ldi R18,10000
	ldi R19,39
	lds R16,_temprter
	lds R17,_temprter+1
	xcall mod16u
	ldi R18,1000
	ldi R19,3
	xcall mod16u
	ldi R18,100
	ldi R19,0
	xcall mod16u
	ldi R18,10
	ldi R19,0
	xcall mod16u
	std y+1,R17
	std y+0,R16
	ldi R18,5
	ldi R16,2
	xcall _lcd_write2
	.dbline 125
	ldi R16,500
	ldi R17,1
	xcall _delay_nms
	.dbline 129
L132:
	.dbline 110
	xjmp L131
X15:
	.dbline -2
L130:
	adiw R28,2
	.dbline 0 ; func end
	ret
	.dbsym l tem 3 i
	.dbend
	.area bss(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20\1820.c
_ADtmp::
	.blkb 1
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/lcd.h
	.dbsym e ADtmp _ADtmp c
_temprter::
	.blkb 2
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/AVR_XQV12.h
	.dbsym e temprter _temprter i
_Key_Number::
	.blkb 1
	.dbsym e Key_Number _Key_Number c
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/AVR_XQV12.h
L134:
	.blkb 2
	.area idata
	.byte 46,0
	.area data(ram, con, rel)
	.dbfile H:\bbi项目源程序\18b20温度传感器\LCD显示18B20/AVR_XQV12.h
	.area lit(rom, con, rel)
L129:
	.word 0x0,0x4700
L128:
	.word 0x0,0x40c8

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -