Hi, I'm trying interfacing DHT11 with PIC. I'm using Hi-Tech compiler.
From information all over datasheet and internet, after sending start signal, DHT11 will reply 5 byte data. The last one is check sum.
Code:
void dht11_start(void)
{
DataDir=0; // set pin as output
Data=0; // give low
__delay_ms(20);
Data=1; //give high
__delay_us(30);
DataDir=1; //set pin as input
while(Data==0) continue;
while(Data==1) continue;
}
char dht11_byte(void)
{int i;
char value=0;
for(i=0;i<8;i++){
while(Data==0) continue;
__delay_us(40);
if(Data==1){
value=value|(1<<(7-i));
while(Data==1) continue;}
}
return value;
}
This is my DHT11 start signal and DHT11 read byte. I give start signal and read 5 byte. Another 1, I calculate the sum of 5 byte.
i need protius simulation for dht 11 or sht 11 with 89c51... how to simulate ...??? then windows 7 sum time not fully instal protious ?? with version better for windows 7?????