温度LTC1392 with PIC16C84单片机
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
单片机 51单片机 MCU 单片机视频教程 单片机开发 ARM单片机 AVR单片机 PIC单片机 Atmel stm32 单片机学习 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)