thunderboympm
Full Member level 5
- Joined
- Sep 17, 2007
- Messages
- 243
- Helped
- 32
- Reputation
- 64
- Reaction score
- 29
- Trophy points
- 1,308
- Location
- Malappuram, India
- Activity points
- 2,469
hi,
i am doing a project in PIC18f452, it needs a DHT11 temperature and humidity sensor. my problem is DHT11 is not responding to my detection code
this is my start sequence
this is my detection subroutine
onewire_cntrl is TRISAbits.TRISA0
onewire is PORTAbits.RA0
i already given ADCON1bits.PCFG = 7
i am using XC8 as compiler and PICKit3 as debugger.
please help
i am doing a project in PIC18f452, it needs a DHT11 temperature and humidity sensor. my problem is DHT11 is not responding to my detection code
this is my start sequence
Code:
void dht11_start(void)
{
onewire_cntrl = 0;
onewire = 0;
__delay_ms(20);
onewire = 1;
__delay_us(30);
onewire_cntrl = 1;
return;
}
Code:
void dht11_responce()
{
while(onewire & 1); /* wait till bus is High */
while(!(onewire & 1)); /* wait till bus is Low */
while(onewire & 1); /* wait till bus is High */
}
onewire is PORTAbits.RA0
i already given ADCON1bits.PCFG = 7
i am using XC8 as compiler and PICKit3 as debugger.
please help
Last edited: