电路设计,软件开发,专业项目团队承接电子产品开发!


ISPRO下载型编程器
火爆销售中

RS232/TTL转换器
全IC串口窃电

RS232/TTL转换线
全IC串口窃电

ByteBlasterMV Cable
CPLD/FPGA并口下载线

ByteBlaster II Cable ISPRO下载型编程器
支持S51/AVR/PIC
超级51开发板套件
前卫实用超值

PC/MCU/CPLD
三合一学习套件

全新万年历方案
AVR单片机开发板
 

Min51单片机仿真机
迷你型

ARM7开发板
仅售260元!
 

RS-232/RS-485双向接口电平转换器  

51单片机升级STM32
火爆销售中
MPLAB-ICD2
火爆销售中
LED51开发板
玩具又名图文显示棒

面板模块/开发板
经济危机明智决择

       

GSM MODEM GSM猫

SMS短信模块 工业级/全自动
火爆销售中

大功率数传电台

高速数传电台

您当前位置:电子技术资料 -> 外围驱动 -> 温度芯片驱动 ->

祝您阅读愉快!

ISPRO下载型编程器

RS232 TO TTL转换器
↑↑本文相关产品介绍↑↑

89C51与DS1820温度汇编程序


类别:技术文章
来源:未知
作者:未知
关键字:DS1820
加入日期:2010-8-3

89C51与DS1820温度汇编程序
;中国电子网www.ec66.com
lctzc: nop
setb p3.5
mov r7,#02h
lcall yszc3
lcall fwyg
lcall fwyg1
lcall rst
lcall fwyg
lct1: jnb p3.5,lct1
mov a,#0cch ;jmp:rom.code
lcall wrt
mov a,#44h ;start.T
lcall wrt
lcall fwyg
lcall fwyg1
lct2: lcall read
cjne a,#0ffh,lct2
lcall fwyg
lcall rst
lcall fwyg
lct3: jnb p3.5,lct3
lcall fwyg
mov a,#0cch ;jmp:rom.code
lcall wrt
mov a,#0beh ;read.T
lcall wrt
lcall read ; 1
mov 40h,a ;tl:40
nop
lcall read ;2
mov 41h,a ;th:41 +,-?
nop
lcall read ;3
nop
nop
lcall read ;4
nop
nop
lcall read ;5
nop
nop
lcall read ;6
nop
nop
lcall read ;7
mov 42h,a ;count-r
nop
lcall read ;8
mov 43h,a ;count-p-c
nop
lcall read ;9
nop
lcall rst
lcall fwyg
lcall fwyg1
mov a,41h
jz ljzt ;+t
ljft: nop ;-t:js
mov a,40h
clr acc.0
cpl a
inc a ;-trd
mov b,#32h ;trd*50:30,31h
mul ab
mov 30h,a
mov a,b
mov 31h,a
mov a,43h ;(cout.p.c-count.rem)*100
clr c ;:50h,51h
subb a,42h
mov b,#64h
mul ab
mov 50h,a
mov 51h,b
mov 58h,43h
mov 59h,#00h
MOV R0,#50H
MOV R1,#58H
MOV R3,#02H
LCALL NIDV2 ;(cout.p.c-count.rem)*100/cout.p.c:50,51h
clr c
mov a,30h ;(trd*50)-(cout.p.c-count.rem)
*100/cout.p.c:50,51h
subb a,50h
mov 50h,a
mov a,31h
subb a,51h
mov 51h,a
mov 3bh,#0c0h
mov 58h,#0ah
mov 59h,#00h
MOV R0,#50H
MOV R1,#58H
MOV R3,#02H
LCALL NIDV2
mov flgt,#0ffh
mov wtl,50h
mov wth,51h
mov 30h,50h
mov 31h,51h
mov r0,#30h
mov r1,#50h
mov r7,#02h
lcall nibtd
mov 3ah,50h
mov a,51h
anl a,#0fh
orl a,#0b0h
mov 3bh,a
lcall fwyg
lcall xszc
mov r7,#05h
lcall yszc3
ret
ljzt: nop ;+t:js
mov a,40h
clr acc.0
mov b,#32h ;trd*50
mul ab
mov 30h,a
mov a,b
mov 31h,a
mov a,43h ;(cout.p.c-count.rem)*50
clr c ;:50h,51h
subb a,42h
mov b,#64h
mul ab
mov 50h,a
mov 51h,b
mov 58h,43h
mov 59h,#00h
MOV R0,#50H
MOV R1,#58H
MOV R3,#02H
LCALL NIDV2 ;(cout.p.c-count.rem)*50/cout.p.c
mov a,50h ;(cout.p.c-count.rem)*50/cout.p.c+
(trd*50):50,51h
add a,30h
mov 50h,a
mov a,51h
addc a,31h
mov 51h,a
mov 58h,#0ah
mov 59h,#00h
MOV R0,#50H
MOV R1,#58H
MOV R3,#02H
LCALL NIDV2
mov flgt,#00h
mov wtl,50h
mov wth,51h
mov 30h,50h
mov 31h,51h
mov r0,#30h
mov r1,#50h
mov r7,#02h
lcall nibtd
mov 3ah,50h
mov a,51h
anl a,#0fh
orl a,#0c0h
mov 3bh,a
lcall fwyg
lcall xszc
mov r7,#05h
lcall yszc3
ret
rst: clr p3.5
mov err,#00h
mov r6,#0c8h ;ys:800us
lcall ysdc1
setb p3.5
mov r6,#0eh ;ys:56us
lcall ysdc1
mov r6,#0ffh
rst2: nop
jnb p3.5,rst1
nop
djnz r6,rst2
mov err,#7fh ;ct.err
rst1: nop
ret
wrt: rrc a ;bit0
clr p3.5
mov r6,#06h
wrt0: djnz r6,wrt0 ;0:15us
nop
mov p3.5,c ;wr:bit0
mov r6,#16h ;keep:45us
wrt00: djnz r6,wrt00
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt1: djnz r6,wrt1 ;0:15us
nop
mov p3.5,c ;wr:bit1
mov r6,#16h ;keep:45us
wrt10: djnz r6,wrt10
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt2: djnz r6,wrt2 ;0:15us
nop
mov p3.5,c ;bit2
mov r6,#16h ;keep:45us
wrt20: djnz r6,wrt20
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt3: djnz r6,wrt3 ;0:15us
nop
mov p3.5,c ;wr:bit3
mov r6,#16h ;keep:45us
wrt30: djnz r6,wrt30
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt4: djnz r6,wrt4 ;0:15us
nop
mov p3.5,c ;bit4
mov r6,#16h ;keep:45us
wrt40: djnz r6,wrt40
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt5: djnz r6,wrt5 ;0:15us
nop
mov p3.5,c ;bit5
mov r6,#16h ;keep:45us
wrt50: djnz r6,wrt50
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt6: djnz r6,wrt6 ;0:15us
nop
mov p3.5,c ;wr:bit6
mov r6,#16h ;keep:45us
wrt60: djnz r6,wrt60
setb p3.5
rrc a
clr p3.5
mov r6,#06h
wrt7: djnz r6,wrt7 ;0:15us
nop
mov p3.5,c ;wr:bit7
mov r6,#16h ;keep:45us
wrt70: djnz r6,wrt70
setb p3.5
ret
read: clr p3.5 ;0:1us
nop
setb p3.5 ;1
mov r6,#04h ;keep:10us
read0: djnz r6,read0
nop
mov c,p3.5 ;rd:bit0
rrc a
mov r6,#0ah
lcall ysdc1 ;ys45us
nop
clr p3.5
nop
setb p3.5
mov r6,#04h
read1: djnz r6,read1
nop
mov c,p3.5 ;rd:bit1
rrc a
mov r6,#0ah
lcall ysdc1
clr p3.5
nop
setb p3.5
mov r6,#04h
read2: djnz r6,read2
nop
mov c,p3.5 ;rd:bit2
rrc a
mov r6,#0ah
lcall ysdc1 ;ys45us
clr p3.5
nop
setb p3.5
mov r6,#04h
read3: djnz r6,read3
nop
mov c,p3.5 ;rd:bit3
rrc a
mov r6,#0ah
lcall ysdc1
clr p3.5
nop
setb p3.5
mov r6,#04h
read4: djnz r6,read4
nop
mov c,p3.5 ;rd:bit4
rrc a
mov r6,#0ah
lcall ysdc1
clr p3.5
nop
setb p3.5
mov r6,#04h
read5: djnz r6,read5
nop
mov c,p3.5 ;rd:bit5
rrc a
mov r6,#0ah
lcall ysdc1
clr p3.5
nop
setb p3.5
mov r6,#04h
read6: djnz r6,read6
nop
mov c,p3.5 ;rd:bit6
rrc a
mov r6,#0ah
lcall ysdc1
clr p3.5
nop
setb p3.5
mov r6,#04h
read7: djnz r6,read7
nop
mov c,p3.5 ;rd:bit7
rrc a
mov r6,#0ah
lcall ysdc1
ret


您可能还会关注的相关技术资料:

中国电子网
www.EC66.com
QQ:34740080 EMAIL:iloveaoe@163.com
最佳浏览:1024*768
Copyright (C) 2001-2010 EC66.COM All Rights Reserved
Aoe/帝国 制作维护
粤ICP备18061901号