I've been working on a project wich includes a DHT22 as main sensor and wrote (as always) my firmware in GCB, but I've found a minor mistake in DHT application.
If you use Timer 1 AND DHT22 at the same time, the processor crashes sooner or later.
I'm using a 16F1827 at 16 mhz so I wanted to warn anybody using the DHT about this.
DISABLE INTERRUPTS BEFORE USING.
GIE=0
readDHT(rh, cels, fahr, msg) ;get current values
milis=milis+10 ' routine delay compensation on timer
GIE=1
Hope this helps! Best Regards,
Leo.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Everybody,
I've been working on a project wich includes a DHT22 as main sensor and wrote (as always) my firmware in GCB, but I've found a minor mistake in DHT application.
If you use Timer 1 AND DHT22 at the same time, the processor crashes sooner or later.
I'm using a 16F1827 at 16 mhz so I wanted to warn anybody using the DHT about this.
DISABLE INTERRUPTS BEFORE USING.
GIE=0
readDHT(rh, cels, fahr, msg) ;get current values
milis=milis+10 ' routine delay compensation on timer
GIE=1
Hope this helps! Best Regards,
Leo.