Problem using DS18B20 sensor with ESP32 board #97
-
First of all, thanks so much for all the great efforts with PICSimLab development. I'm developing a device full of sensors and software automation based on the ESP32, and tried to replicate my hardware with PICSimLab for testing the firmware on it before deploying it to real hardware. I got a lot of problems that I'm trying to solve bit by bit. Some of them seems to be solved using the latest unstable release and were related to SDCARD. Thanks once again. One of the issues I'm not being able to fix and not sure where is the problem, is making a DS18B20 sensor work. I uploaded the code I tested here: I can confirm the code works on real ESP32 hardware with several DSB18B20 sensors attached to it. Am I missing any configuration or execution arguments for making it work? If something is failing in PICSimLab, and I'm given some clues of what to read, check and change, I could try to fix the problem and generate a pull request with the fix. Thanks!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @villacampa , This problem is because Qemu does not support accurate cycle simulation. Therefore, signals that depend on exact timing, such as the onewire, dhtxx, or ws2812b protocols, do not work well with Qemu. In PICSimLab Using a value for the "Qemu CPU mips" combobox other than "no limit" causes Qemu to try to simulate an execution speed, which causes these peripherals to work sporadically. Setting the option to "Auto" in the example of the DS1820 that you send, some values are received (usually wrong). With the DHT22 it works with the "auto" option and as the IO clock at 4MHz on my computer (example attached). I didn't add examples of these protocols because I still haven't found the best way to deal with the problem. |
Beta Was this translation helpful? Give feedback.
Hi @villacampa ,
This problem is because Qemu does not support accurate cycle simulation. Therefore, signals that depend on exact timing, such as the onewire, dhtxx, or ws2812b protocols, do not work well with Qemu. In PICSimLab Using a value for the "Qemu CPU mips" combobox other than "no limit" causes Qemu to try to simulate an execution speed, which causes these peripherals to work sporadically. Setting the option to "Auto" in the example of the DS1820 that you send, some values are received (usually wrong). With the DHT22 it works with the "auto" option and as the IO clock at 4MHz on my computer (example attached). I didn't add examples of these protocols because I still haven't found…