I'm a beginner in ARM programming how do interface DHT22(temperature and humidity sensor) with LPC2148 I need help with flow chart and code if possible thank you uys in advance
Hi Abhishek, you will need to implement a 1-wire master using GPIO or you need a I2C to 1-wire bridge. 1-wire is very similar to I2C. I would recommend using GPIO to implement a 1-wire master in software since it would be easier.
You can find lpc2148 gpio tutorial : www.ocfreaks.com/.../ and I2C basics tutorial : www.ocfreaks.com/.../
I am planning to do a tutorial on interfacing 1-wire devices with LPC2148 so it helps others who are using LPC2148 :)
-Regards
Is it?!
How so?!?!
Note that 1-Wire is a trademark of Maxim (formerly Dallas):
www.maximintegrated.com/.../1796
Although it has similarities, the protocol used by the DHT22 is not the same as the Maxim/Dallas 1-Wire.
The DHT22 protocol is described in its datasheet:
cdn-shop.adafruit.com/.../DHT22.pdf
As already noted, there is Arduino code & a tutorial available at:
www.adafruit.com/.../385
Thanks pointing it out Andrew. Indeed it uses a sort-of similar protocol lacking support for Slave Addressing / ROM Numbers as one of the major differences I see. Also, really sorry for posting it in haste under the wrong impression that it uses 1 wire interface.
Abhishek : You can use the DHT library as reference for implementing it on lpc2148.
K Klasio : Thanks for the suggestion. I will post Cortex-M3 lpc1768 tutorials soon if time permits. Also you meant interfacing keyboard and water sensor with which MCU ?
You didn't explain how you think I2C is "similar" to 1-Wire?
I can't see that they are in any way similar at all!
IMO there are quite a few similarities like: Both use open drain output so they cannot drive the line high by themselves. This in turn means they need an external pullup to pull the line continuously high. Data is Received and Transmitted on the same line\wire. Both support multiple Slaves on the same bus. Also, the bus enters idle state when data line is continuously high.
Also with multiple slaves I mean the 'basic' topology since both support slave addressing.
Hi Urang. I need to interface keyboard and water sensor to STM32F103. it will be a better tut. when will u do it coz i need it very soon. also i must have a count for degrees.
View all questions in Keil forum