en:pfw:dht22
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:pfw:dht22 [2025-06-26 12:09] – [Pseudocode] mka | en:pfw:dht22 [2025-06-27 12:05] (current) – [Implementation for RP2040 using a PIO block] mka | ||
|---|---|---|---|
| Line 56: | Line 56: | ||
| {{ : | {{ : | ||
| - | ===== Implementation for TI's Launchpad ===== | + | ====== Implementation for TI's Launchpad ====== |
| - | + | ||
| - | + | ||
| - | ==== Source Code for Launchpad - and what it was used for.==== | + | |
| - | + | ||
| - | [[en: | + | |
| This program was used to test DHT22 modules before installation. The DHT22 modules were tested for functionality at room temperature, | This program was used to test DHT22 modules before installation. The DHT22 modules were tested for functionality at room temperature, | ||
| + | [[en: | ||
| - | ==== Numerical representation of the measured values ==== | ||
| - | === Humidity | + | ====== Implementation for RP2040 ====== |
| - | The first 16 bits coming from the DHT22 are the relative humidity in tenths of a percent. They can be processed directly with the 16-bit noForth and correspond to a positive integer. Rounded to whole digits for display purposes. | + | [[en:pfw:dht22-rp2040-nofortht|DHT22 for the Raspberry Pi Pico Board RP2040 |
| - | Here is an excerpt from the noforth source code: | + | |
| - | + | ||
| - | < | + | |
| - | : .hum ( hum -- ) 10 / . ." %rel" space ; | + | |
| - | </ | + | |
| - | + | ||
| - | === Temperature === | + | |
| - | + | ||
| - | The next 16 bits are the temperature in tenths of a degree Celsius. Temperatures from zero degrees and higher can be processed directly using the 16-bit noForth; they correspond to a positive integer. | + | |
| - | + | ||
| - | Temperatures below zero degrees are represented by the DHT22 as follows: The MSB of the 16-bits is set, but otherwise the temperature is specified as a positive integer. This number format //does not correspond// | + | |
| - | < | + | |
| - | : .tmp ( tmp -- ) | + | |
| - | dup hx 8000 and hx 8000 = \ check MSB | + | |
| - | if [char] - | + | |
| - | else [char] + | + | |
| - | then emit | + | |
| - | hx 7fff and ( tmp -- +tmp ) \ reset MSB | + | |
| - | 10 /mod 3 .r [char] . emit . \ --> TTT.T | + | |
| - | [char] f decemit | + | |
| - | space | + | |
| - | ; | + | |
| - | </ | + | |
| - | + | ||
| - | * This is already included in the following source code.\\ | + | |
| - | * And here you can see how this was discovered: [[en: | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | ===== Background Information ===== | + | |
| - | === MSP430G2553 === | + | |
| + | PIO stands for // | ||
| + | ====== Background Information ====== | ||
| + | * How this was discovered: [[en: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[en: | ||
| - | === All about noForth | + | ====== |
| - | + | ||
| - | [[https:// | + | |
| - | + | ||
| - | --- | + | |
| - | + | ||
| - | === Source code editor | + | |
| + | MK:\\ | ||
| I like //Notepad Next// for Linux, a cross-platform, | I like //Notepad Next// for Linux, a cross-platform, | ||
| - | https:// | + | https:// |
| - | + | ||
| - | === Terminal === | + | |
| To work with the embedded noForth system I use //e4thcom// by Manfred Mahlow. | To work with the embedded noForth system I use //e4thcom// by Manfred Mahlow. | ||
| - | https:// | + | https:// |
| - | + | Sometimes I also use Windows and Teraterm, for example, to log longer MCU outputs to a file. I also prefer it for testing parts of the source code using copy and paste.\\ | |
| - | Sometimes I also use Windows and Teraterm, for example, to log longer MCU outputs to a file. I also prefer it for testing parts of the source code using copy and paste. | + | In this project I used a Logic Analyzer by AZDelivery, 8 CH, 24MHz. (Amazon)\\ |
| - | + | ||
| - | === Logic Analyser === | + | |
| - | + | ||
| - | AZDelivery | + | |
| // | // | ||
| - | |||
| - | --- | ||
en/pfw/dht22.1750932596.txt.gz · Last modified: 2025-06-26 12:09 by mka