我可以使用这个repository中提供的示例代码来读取DS18B20传感器。
它使用标准的Espressif ESP32-WROOM-32 (也称为ESP32-DevKitC)工作得很好,它使用40 MHz的XTAL。
我不能使用Allnet-IOT-WLAN运行相同的示例,因为它使用26 MHz的XTAL。
我怀疑这个问题与RMT initialization有关。初始化使用的是:
rmt_tx.clk_div = 80;我尝试过clk_div的不同设置,但没有成功。
谁知道如何使用带有ESP-IDF的DS18B20传感器,使用26 MHz XTAL的主板,而不是更标准的40 MHz主板?
ESP32-WROOM-32输出(工作中)
I (0) cpu_start: Starting scheduler on APP CPU.
Find devices:
0 : d4000008e40d7428
1 : f8000008e3632528
Found 2 devices
Device 1502162ca5b2ee28 is not present
Temperature readings (degrees C): sample 1
0: 22.3 0 errors
1: 21.8 0 errors
Temperature readings (degrees C): sample 2
0: 22.3 0 errors
1: 21.9 0 errorsAllnet-IOT-WLAN输出(不工作)
I (0) cpu_start: Starting scheduler on APP CPU.
Find devices:
Found 0 devices
E (6780) owb_rmt: rx_items == 0
E (6880) owb_rmt: rx_items == 0
E (6980) owb_rmt: rx_items == 0发布于 2019-01-06 23:09:09
使用不同XTAL时钟频率的RMT初始化没有差别。
D (2319) rmt: Rmt Tx Channel 1|Gpio 25|Sclk_Hz 80000000|Div 80|Carrier_Hz 0|Duty 35
D (2319) intr_alloc: Connected src 47 to int 13 (cpu 0)
D (2319) rmt: Rmt Rx Channel 0|Gpio 25|Sclk_Hz 80000000|Div 80|Thresold 77|Filter 30两者使用相同的80 MHx源。
我使用了错误的引脚图。我已经用更多的simple example测试了RMT,我发现引脚是错误的。
DS18b20传感器与带有esp32-ds18b20库的26 MHz XTAL配合使用效果良好。
https://stackoverflow.com/questions/54057395
复制相似问题