pmfournier / bbb-dht22

Tool to read the DHT222 sensor using the BeagleBone processor's PRU
3 stars 2 forks source link

Wire Dht22 sensor #1

Open icepic1984 opened 10 years ago

icepic1984 commented 10 years ago

Hi!

I just found your project by accident. I am currently working on a very similar project. I although try to read data from the dht22 sensor using the pru. (https://github.com/icepic1984/dht22pruss). I saw in your source code that your are using two pins. One is accessed through global memory and one through the r31 register. But how must i wire the sensor when i am using two pins? Just connect both to the output pin of the dht22? And why are you accessing one pin through global memory and one through the fast register? I couldn't figure out how to switch between input and output mode for pins connected through r31 and therefore i just use one pin accessed through global memory and switch the mode by setting the adequate register.

pmfournier commented 10 years ago

Your questions highlight a few problems with the doc in my project. I just updated the README.md with more complete information.

To your specific questions:

1) I really wanted to learn how to use the registers for ultra-fast access, but like you, I didn't figure out how to switch modes at run time. For the output pin, I figured it would just be simpler to use the memory access.

2) I was paranoid that due to bad coding on my part or bad behavior on the DHT22, the pin would be involved in a short-circuit when outputting and that as a result, the pin on my bbb would get damaged. Keeping the output pin separate allows to protect it with a resistor without risking to mess up the faster input signal.

Hope this helps.