Keil Logo Arm Logo

How do i learn interfacing LPC2148 to DHT22

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
Abhishek M
Posted
22-Mar-2017 20:23 GMT
Toolset
ARM
New! How do i learn interfacing LPC2148 to DHT22

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

Author
Andrew Neil
Posted
22-Mar-2017 22:24 GMT
Toolset
None
New! How To Interface Anything to Anything Else

How To Interface Anything to Anything Else:


http://www.8052.com/forum/read/160143

Author
John Linq
Posted
23-Mar-2017 01:55 GMT
Toolset
None
New! RE: How To Interface Anything to Anything Else

Easy! Migrate it from Arduino.

http://www.electroschematics.com/11291/arduino-dht22-am2302-tutorial-library/

Author
Umang G
Posted
14-Apr-2017 06:10 GMT
Toolset
ARM
New! RE: How do i learn interfacing LPC2148 to DHT22

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 : http://www.ocfreaks.com/lpc2148-gpio-programming-tutorial/ and I2C basics tutorial : http://www.ocfreaks.com/i2c-tutorial/

I am planning to do a tutorial on interfacing 1-wire devices with LPC2148 so it helps others who are using LPC2148 :)

-Regards

Author
Andrew Neil
Posted
14-Apr-2017 10:32 GMT
Toolset
None
New! RE: 1-wire is very similar to I2C


Is it?!

How so?!?!

Note that 1-Wire is a trademark of Maxim (formerly Dallas):

https://www.maximintegrated.com/en/app-notes/index.mvp/id/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:

https://cdn-shop.adafruit.com/datasheets/DHT22.pdf

As already noted, there is Arduino code & a tutorial available at:

https://www.adafruit.com/product/385

Author
Umang G
Posted
14-Apr-2017 17:12 GMT
Toolset
ARM
New! RE: 1-wire is very similar to I2C

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 ?

-Regards

Author
Andrew Neil
Posted
14-Apr-2017 19:14 GMT
Toolset
None
New! RE: 1-wire is very similar to I2C

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!

Author
Umang G
Posted
15-Apr-2017 07:34 GMT
Toolset
ARM
New! RE: 1-wire is very similar to I2C

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.

Author
Umang G
Posted
15-Apr-2017 07:48 GMT
Toolset
ARM
New! How do i learn interfacing LPC2148 to DHT22

Also with multiple slaves I mean the 'basic' topology since both support slave addressing.

Author
Andrew Neil
Posted
15-Apr-2017 11:06 GMT
Toolset
None
New! RE: 1-wire is very similar to I2C

OK, so they both use open-drain drivers, and support slave addressing.

I don't think that's sufficient to say that they are "similar" - certainly not "very similar"

There are also very significant differences:

I2C requires a clock line - 1-Wire does not;

The Slave addressing is optional for 1-Wire - not on I2C;

The signalling protocol is entirely different.

And, of course, the topic of this thread - the DHT22 - is not 1-Wire anyhow.

Author
Lm Narsch
Posted
15-Apr-2017 11:22 GMT
Toolset
None
New! RE: 1-wire is very similar to I2C

They both use serial to communicate. Thats reasonably similar. Just like pascal is similar to c.

Author
Andrew Neil
Posted
15-Apr-2017 13:01 GMT
Toolset
None
New! RE: They both use serial to communicate

Indeed.

So I2C is similar to Ethernet;

1-Wire is similar to USB;

They are both similar to an IR remote control ...

Author
K Klasio
Posted
15-Apr-2017 08:20 GMT
Toolset
ARM
New! RE: 1-wire is very similar to I2C

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.

Author
K Klasio
Posted
14-Apr-2017 16:47 GMT
Toolset
ARM
New! RE: How do i learn interfacing LPC2148 to DHT22

Hi Urang.

I look at your tuts but they are very old now. No one wants to use the old parts. When are you updating them to the cortex?

You must also add tut for keyboard and water sensor. This will be very useful to everybody.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

ARM’s Privacy Policy has been updated. By continuing to use our site, you consent to ARM’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.