This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: Help With DTH11

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Can anyone give me the code of tm4c123 microcontroller with dht11 on uart.

  • Hi,
    We don't have any example interfacing with the DTH11. You can build your own one-wire communication with the DTH11 using the GPIO. You will send the command by driving the GPIO in output mode and then change the GPIO to input mode to receive the data. Here is a similar post. e2e.ti.com/.../688766
  • Hi Charles,

    One of our 'interns' received a (very) similar 'homework assignment.' (very same device)

    Being clever - he SAVED the extra effort of 'Switch-Over' from GPIO Output to GPIO Input - by employing 'separate GPIO pins' - of course 'tied together' - and 'preventing reception' when he was 'sending.'

    The GPIO Output must not 'linger' when its 'Send' completes (to avoid 'output contention' w/his device) - there are several ways to accomplish that... (which is held - for 'next' homework assignment...and even (further) 'giving'...)

  • is that code wrong? can you explain to me clearly
  • Hi,
    The post that I referred to contains code in the beginning that wasn't working. I think after he followed my suggestions he probably got it working. You don't have to use his code as a starting point. It is your choice. You can write your own code which is not too difficult. It is just a matter of manipulating the GPIO pin or pin(s) per suggestion from cb1. Read the DTH11 spec carefully on the timing requirements and make sure you have a pullup on the bus.