ChriX
Member
Hey all, i'm trying to interface the Dallas DS18S20 with a PIC 16F628 and having some problems. I can't even get the PIC to detect the presense pulse generated by the sensor. Here's my code, i've got the data line of the sensor on bit 0 on porta.
Macros
Subroutine
The NO_OW_DETECT routine is just sending something to an attached LCD to tell me the sensor has not been found, I haven't been able to get it to skip that at all yet, even though the sensor should be pulling that pin low.
Hopefully someone with some experience with these can help me out.
Macros
Code:
TEMP_OUTPUT macro
BANK1 ;Change to BANK1
bcf TRISA,0 ;Set PORTA,0 to an output
BANK0 ;Back to BANK0
bcf PORTA,0 ;Set output pin LOW
endm
TEMP_INPUT macro
BANK1 ;To BANK1 again
bsf TRISA,0 ;Set PORTA,0 to an input
BANK0 ;Back to BANK0
endm
Subroutine
Code:
OW_INIT
TEMP_OUTPUT
DELAY_MICRO 250
DELAY_MICRO 250
TEMP_INPUT
DELAY_MICRO 60
btfsc PORTA,0
call NO_OW_DETECT
TEMP_OUTPUT
return
The NO_OW_DETECT routine is just sending something to an attached LCD to tell me the sensor has not been found, I haven't been able to get it to skip that at all yet, even though the sensor should be pulling that pin low.
Hopefully someone with some experience with these can help me out.