DS1820 example (PIC18F452, EP4) should be corrected like this :
Code: Select all
while TRUE
Ow_Reset(PORTA, 5) ' onewire reset signal
Ow_Write(PORTA, 5, $CC) ' issue command to DS1820
Ow_Write(PORTA, 5, $44) ' issue command to DS1820
Delay_ms(750) ' <==============here
i = Ow_Reset(PORTA, 5)
Ow_Write(PORTA, 5, $CC) ' issue command to DS1820
Ow_Write(PORTA, 5, $BE) ' issue command to DS1820
Delay_us(120) ' <================here
j1 = Ow_Read(PORTA, 5) ' get result
j2 = Ow_Read(PORTA, 5) ' get result (assuming the temperature
is positive)
also, sensor with mB is on RA5, and with mC on RE2