The code does include DT's INT file.
I've found an indepth data sheet which states that each two way communication process should take 4ms, so why it seems that the code runs slow might of been down to the use of the wrong crystals ??
Basically connection is via a single pin. This pin is kept high by pull up resistor. To get data, the PIC needs to make the pin go low for a minimum of 18ms then hight again and waits 20-40us for the response. The sensor then sends a response by taking the pin low for 80us and then back up high for a further 80us and then sends the data, which is a 40bit stream of high pulses with a duration of 20-28us to represent a 0 or 70us for a 1. Each pulse is preceded by a low pulse of 50us, with a final 50us low at the end of the data stream.
I've seen examples using pulseIN command, with pause xxUS to trick the sensor into sending data, but don't know if interrupts could be used here ?
here's the data sheet http://www.micropik.com/PDF/dht11.pdf
Bookmarks