所需E币: 3
时间: 2019-12-25 09:50
大小: 25KB
PIC16F6278(或PIC类)与DS18B20通信的程序; Program 1820.asm;; Performs temperature measurment. No addressing.;; Note that in this routine, the results of the measurement are written; to a data buffer beginning at data location 18H for later display or; other processing.;; 12C509 DS1820 ; GPIO.0 (term 7) ------------------------------ DQ (term 2); LIST p=12C509A #include __CONFIG _CP_OFF & _WDT_OFF & _MCLRE_OFF & _IntRC_OSC CONSTANT DATA_PIN=0 CONSTANT BASE_VAR=07H CONSTANT DATA_BUFF=18H CONSTANT BUFF_SIZE=7PIN_DIRS EQU BASE_VAR+0N EQU BASE_VAR+1_N EQU BASE_VAR+2 ; these vars used by the O_BYTE EQU BASE_VAR+3 ; common 1-wire routinesI_BYTE EQU BASE_VAR+4LOOP3 ……