does your program use interrupts ? if so how long does the isr take to execute ?
the tolerance here is 10uS + or - so an interrupt can easily cause the timing tolerance to be exceeded
possible solutions
1. disable interrupts during dht read
2. increase tolerance
3. ignore bad reading and retry
4. remove the noise test
5. use a faster chipCode:t2con=0 if ((tmr2>12)&&(tmr2<50)) then ' noise ? if (tmr2 >31 ) then dht.0[bits] = 1 endif else goto badread ' noise ? endif
Bookmarks