Introduction - If you have any usage issues, please Google them yourself
18B20的复位时序及子程序:
init_1820:
clr dq1820
mov r7,#40
acall Delay15us ;(1)复位:低电平至少480 us,用15*40=600us可靠
setb dq1820 ;(2)释放,为了在15-60 us后接收存在脉冲
mov r7,#1
acall Delay15us 20us
mov r2,#90 ;(3) 最多等待(1+2)*90=270us
wait:
mov c,dq1820
jnc wait1
djnz r2,wait ;(4)在15-60 us后回发芯片一个存在脉冲,为了可靠,我们采用等到回发脉冲后在做下一步工作,存在脉冲是一个60-240us的低电平信号
wait1: