微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 温度LTC1392 with PIC16C84单片机

温度LTC1392 with PIC16C84单片机

时间:03-08 来源:互联网 点击:

etches 10 bit result from ltc1392
CLRF DAT_H
CLRF DAT_L

CALL CLK_LO ; a dummy clock pulse
CALL CLK_HI

MOVLW .10 ; 10 bits
MOVWF NUM
RX_DATA_10_1:
CALL CLK_LO ; bring clock low and read bit
BTFSS PORTB, RX_D
BCF STATUS, C ; set CY to either a 0 or 1
BTFSC PORTB, RX_D
BSF STATUS, C
RLF DAT_L, F ; do a two byte left shift
RLF DAT_H, F
CALL CLK_HI

DECFSZ NUM, F
GOTO RX_DATA_10_1
RETURN

CLK_HI:
BSF PORTB, CLK
CALL DELAY_100USEC
RETURN

CLK_LO:
BCF PORTB, CLK
CALL DELAY_100USEC
RETURN

C_SEL_HI:
BSF PORTB, C_S
CALL DELAY_100USEC
RETURN

C_SEL_LO:
BCF PORTB, C_S
CALL DELAY_100USEC
RETURN

DELAY_100USEC:
MOVLW .20
MOVWF DELAY_LOOP ; 20 * 5 + 2 = 102 cycles
DELAY_100USEC_1:
NOP
NOP
DECFSZ DELAY_LOOP, F
GOTO DELAY_100USEC_1

RETURN

#INCLUDE A:\LCD\LCD_CTRL.ASM>
END

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top