Hi Dialog Team
i want to use DHT11 snesor driver in sdk 5.0.4 ,
i tried using this driver but not working , do i have to select port pins ??what all are the modifications i have to do ? so i can read from sensor ??
//systick_usec_units(true); i just commented this line , is there are other option ??
Thank you Dilaog.
Device:
Hi prasanth.velliyangiri,
I am sorry i dont get the question as far as i could check the DHT11 is a somekind of a temperature sensor but i am not able to see the interface that it is using, analog digital, so you can either use the SPI or the I2C drivers in order to communicate with the sensor if it has a digital interface or use the ADC if it is analog. I dont understand what a systick function which is not part of the SDK as far as i can tell has to do with it.
Thanks MT_dialog
Hi Dialog
Thank you for your reply
in sdk5.0.4 SDK 5.0.4/DA1458x_SDK_5.0.4/DA1458x_SDK/5.0.4/sdk/platform/driver/sensor/dht11
this is the driver i am mentioning , i hope this is developed by dialog
thank you
Hi Dialog
systick_usec_units(): Selects the core clock at 16 MHz (with a tick duration of 62.6 ns) or the
reference clock at 1 MHz (with a tick duration of 1 s) as the clock source for the SysTick timer.
if systick_usec_units() is not part of sdk , then how can i select reference clock to 1MHZ
usec
Selects the SysTick clock frequency.
TRUE: use the reference clock frequency of 1 MHz
FALSE: use the core clock frequency of 16 MHz
谢谢你的对话框
Hi prasanth,
Hadn't seen the driver for that particular sensor, its not used in any of our examples so i missed it.
不管怎样正确使用我t you will have to first to configure your pin that you connent the single bus output of your sensor like this GPIO_ConfigurePin(DHT11_GPIO_PORT, DHT11_DATA_PIN, OUTPUT, PID_GPIO, true) then initialize with the init function void DHT11_Init(GPIO_PORT port, GPIO_PIN pin, IRQn_Type irq) and then by using the DHT11_Status_t DHT11_Read(BYTE*, BYTE*); you can start reading back data.
Thanks MT_dialog
Hi Dialog
\DA1458x_SDK_5.0.3\DA1458x_SDK\5.0.3\projects\target_apps\peripheral_examples\systick\Keil_5
Inside the sdk i made the below changes
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_0, OUTPUT, PID_GPIO, false );
int main (void)
{
uint8_t* tem ; uint8_t* hum;
system_init();
periph_init();
//systick_test();
int i = 0xBFFF ;
while(i--){
dht11_init(GPIO_PORT_0 , GPIO_PIN_0 , GPIO0_IRQn);
dht11_read( tem, hum);
}
in dht11.c
i commanded the
//systick_usec_units(true);
but still i am not able to read from sensor
my sensor has 10k pullup , Vcc = 5v , Gnd = GND , D = P0_0 ,
if (dht11_bit_get() < 1)
return dht11_reset(DHT11_FAIL); i am always getting DHT11_FAIL ...??
Please help me to resolve this..
Hi prasanth,
Please try using the below function in order to test the sensor:
Thanks MT_dialog
Hi Dialog
Thank you for your help.Now i am able to get data.
i made mistake in dht11_init(DHT11_GPIO_PORT, DHT11_DATA_PIN, GPIO3_IRQn); , now its working, thank you
Hi prasanth,
If the answer was helpfull please mark it as accepted.
Thanks MT_dialog