Hi all.
The full program and documentation is available here:
http://www.prlsoftware.com/dht-for-32-mhz-picaxe.aspx
This article is about programming the PICAXE to receive data from the DHT sensor series at 32MHz. Just a bit of background first though.
I've just started developing PICAXE development so each time I work on an aspect of PICAXE I'm coming to it fresh, with little knowledge of electronics and no knowledge of ICs and microcontrollers. So if you see an better way of doing what I've outlined, please reply. For instance, I've used 2x 555 timers but I'd never heard of a 555 before so I don't know if there is some type of combined multi-555 IC or perhaps some other IC that does what I've done with 2 x 555 timers.
Back to the DHT...
There are other posts on the DHT, many of which mentioned a 555 timer. I tried it on my 18M2+ at 32 MHz and it failed to read all of the bits - but did read a lot of them. However, the approach got me interested in the 555 so I read some more. I came up with a 2x555 solution that, along with some mathematics, allows 32MHz PICAXE to read the DHT family of processors.
NOTE - I tried lower speeds, such as 16MHz but it didn't work, however 20MHz was not tested and may work.
In short the "down time" of the DHT range is 50us. That's far too short for any PICAXE to process what it needs to process (put a PulsIn value into a variable and then re-issue the PulsIn). The 555 timer approach I found on this forum altered this to be a 60us down time (processing time) at the expense of the "up time" of the zero and one bit. This approach works for 64MHz PICAXEs AND I would reccomend that this approach (or variants listed in the forum) still be used for 64MHz processors as this approach is simpler to construct and has smaller program code.
However, the 60us down time is still too short for 32MHz PICAXEs. I've implemented an approach that increases the available processing time to 110us, which is more than double the original 50us timeframe and more than enough for 32MHz processor.
This has been done at the expense of zero bits. Instead of reading in every zero bit I ONLY read one bits and the zero bits are then calculated from the time gap between 1 bits. Therefore the program is necesarily longer due to the reconstruction required (the current program is 512 lines in length to do the read).
The specific theory and mathematics are all on my web site (link above).
The program has only been tested on DHT11 units. I'll be purchasing DHT22 unit and making adjustments to the program when they arrive.
The full program and documentation is available here:
http://www.prlsoftware.com/dht-for-32-mhz-picaxe.aspx
This article is about programming the PICAXE to receive data from the DHT sensor series at 32MHz. Just a bit of background first though.
I've just started developing PICAXE development so each time I work on an aspect of PICAXE I'm coming to it fresh, with little knowledge of electronics and no knowledge of ICs and microcontrollers. So if you see an better way of doing what I've outlined, please reply. For instance, I've used 2x 555 timers but I'd never heard of a 555 before so I don't know if there is some type of combined multi-555 IC or perhaps some other IC that does what I've done with 2 x 555 timers.
Back to the DHT...
There are other posts on the DHT, many of which mentioned a 555 timer. I tried it on my 18M2+ at 32 MHz and it failed to read all of the bits - but did read a lot of them. However, the approach got me interested in the 555 so I read some more. I came up with a 2x555 solution that, along with some mathematics, allows 32MHz PICAXE to read the DHT family of processors.
NOTE - I tried lower speeds, such as 16MHz but it didn't work, however 20MHz was not tested and may work.
In short the "down time" of the DHT range is 50us. That's far too short for any PICAXE to process what it needs to process (put a PulsIn value into a variable and then re-issue the PulsIn). The 555 timer approach I found on this forum altered this to be a 60us down time (processing time) at the expense of the "up time" of the zero and one bit. This approach works for 64MHz PICAXEs AND I would reccomend that this approach (or variants listed in the forum) still be used for 64MHz processors as this approach is simpler to construct and has smaller program code.
However, the 60us down time is still too short for 32MHz PICAXEs. I've implemented an approach that increases the available processing time to 110us, which is more than double the original 50us timeframe and more than enough for 32MHz processor.
This has been done at the expense of zero bits. Instead of reading in every zero bit I ONLY read one bits and the zero bits are then calculated from the time gap between 1 bits. Therefore the program is necesarily longer due to the reconstruction required (the current program is 512 lines in length to do the read).
The specific theory and mathematics are all on my web site (link above).
The program has only been tested on DHT11 units. I'll be purchasing DHT22 unit and making adjustments to the program when they arrive.