Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mianos
#41133 I just looked at your timing experiments. Interestingly I did the same thing. I put the code to track the timing
into the overall interrupt handler: https://github.com/mianos/micropython/b ... esp_gpio.c
Then I can dump out the exact timing of the pulses when the read finishes. In my experiments (still in in the code),
I didn't get anywhere near the variation in the timing you did. Mine was so tight I can see the extra 5mS given by the chip in between each byte in the bit stream. AT 80Mhz I see less then 5 checksum errors in 100,000 reads with this timing:
Code: Select all   if (elapsed > 45 && elapsed <= 55) {
            self->state = DHT_STATE_DATA_DATA;
        } else if (elapsed > 55 && elapsed < 80) {   
            self->state = DHT_STATE_DATA_DATA;
        } else {
            self->state = DHT_ERROR;
            return -1;
       }