2681 views|5 replies

2

Posts

0

Resources
The OP
 

CC2640R2F as master control for DHT11 [Copy link]

 DHT11 is controlled by a single bus. I set it as follows: static PIN_State AM2120PinState; static PIN_Handle AM2120PinHandle; PIN_Config AM2120PinTable[] = { Board_DIO22 | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, PIN_TERMINATE } static void AM2120InputInitial(void)//Set the port to input { //Set it to input PIN_setConfig(AM2120PinHandle, PIN_BM_OUTPUT_MODE | PIN_BM_INPUT_MODE, Board_DIO22 | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP); } static void AM2120OutputInitial(void)//Set the port to output { //Set to output PIN_setConfig(AM2120PinHandle, PIN_BM_OUTPUT_MODE | PIN_BM_INPUT_MODE, Board_DIO22 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX); } Subsequent debugging found that the io port is always at a high level and the pull-down does not work. The pull-down code is as follows: AM2120OutputInitial();//Set the port to output PIN_setOutputValue(AM2120PinHandle, Board_DIO22, 0);//DATA_PIN=0; I hope you can help me answer this question. See the attachment for the specific code. (The program starts once every 5S if (events & SBP_TEST_EVT) { Util_startClock(&testClock); DHT11_Read_Humiture(sbDHT11_data); )

board_dht11.h

473 Bytes, downloads: 3

board_dht11.c

7.89 KB, downloads: 5

This post is from TI Technology Forum

Latest reply

Can you check whether the waveform of the output signal and the input signal is consistent with the data sheet?  Details Published on 2018-11-30 14:24
 

2618

Posts

0

Resources
2
 
First check if the hardware is not welded properly.
This post is from TI Technology Forum
 
 
 

6547

Posts

0

Resources
3
 
Go to the official website to find reference programming examples and estimate the setting issues
This post is from TI Technology Forum
 
 
 

9702

Posts

24

Resources
4
 
This is normal GPIO control, and has nothing to do with DHT11. You can refer to the above and try the official code first to control an LED. After you understand how to control GPIO, switch to pull-up and pull-down according to your requirements, and try the output and input respectively to see if they are successful. After everything is adjusted, try DHT11. If you can't read the data, use an oscilloscope to check the timing.
This post is from TI Technology Forum
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

2

Posts

0

Resources
5
 
littleshrimp posted on 2018-11-30 12:01 This is normal GPIO control, and has nothing to do with DHT11. You can refer to the above and try the official code first, control an LED and see how to control it...
At present, the pull-up, pull-down, input and output have been solved. At that time, the data alone is 0. I don't know why
This post is from TI Technology Forum

Comments

Can you check whether the waveforms of the output signal and input signal are consistent with the data sheet?  Details Published on 2018-11-30 14:24
 
 
 

9702

Posts

24

Resources
6
 
长草小仙女发表于2018-11-30 13:57 At present, the pull-up, pull-down, input and output have been solved. At that time, the data alone is 0. I don’t know why
Can you check whether the waveform of the output signal and the input signal is consistent with the data sheet?
This post is from TI Technology Forum
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list