; Here we will continously convert temp,
; in CPU Mode for Temp Display
check_tmp:
clr p3.2 ; reset ds1620
setb p3.0 ; RXD and TXD high
setb p3.1
mov a,#0ch ; Load Write configuration
; byte instruction
lcall out_cmd ; send it to 1620
mov a,#02h ; set config byte = cpu mode,
lcall out_data ; send it to 1620
mov a,#0eeh ; initiate temperature conversion
lcall out_cmd
mov a,#0ffh ; set delay time here
lcall delay
read_tmp:
clr a
mov a,#0aah ; Load instruction to fetch last temp
lcall out_cmd ; conversion result.
nbsp; lcall in_data ; get temp data from ds1620 ( LSB )
mov r3,a ; move ( LSB ) of temp data to Storage
; Register.
lcall in_data ; get temp data from ds1620 ( MSB )
mov r1,a ; move ( MSB ) of temp data to Storage
; Register.
; use data retrieved into Storage Registers, to point to
; lookup_table data to be shown on LCD.
mov a,r3 ; mov conversion results to ACC
lcall look_up ; Fetch display data.
上一页 [1] [2] [3] [4] [5] [6] 下一页
本文关键字:暂无联系方式51单片机,单片机-工控设备 - 51单片机
上一篇:51单片机车用主控器的设计与应用