PDA

View Full Version : DHT22 and PIC18F25K22



harryweb
- 13th November 2017, 20:35
Hi I'm using a PIC18F25K22 to drive 2x DHT22.
I found here some code working on PORTB.4
The other DHT is connected on PORTB.2 and... not working
I tried to exchange the 2 DHT22 without success. The 2 DHT22 are working fine on portB.4
8495

sequence is:
TRISB.2 = 1 'input
my program... then
TRISB.2 = 0 'output
PORTB.2 = 0 'low

With my DSO, I can see something strange. It takes more than 1mSec to become low (see curve)
8496


This is only on PORTB.2 !
May be you have an idea ? (I'm using PBP2.60)
Regards

Scampy
- 14th November 2017, 20:00
Have a read of this thread http://www.picbasic.co.uk/forum/showthread.php?t=19975

The excellent library file allows multiple sensors to be used (I have four running to monitor temperature and humidity in my reptile enclosures)

harryweb
- 15th November 2017, 12:40
Hi Scampy,

Yes this code is well done... But I'd like to use my own... :)
I tried another PIC (18f2520) = same pb, changing pullup resistors, capacitors...
I just found the problem... It's an hardware problem. Can't see it without binoculars... soldering to ground on PCB was not good
Thank you.
8497