Can you provide more details?
but I can clearly see on my oscilloscope that the level of the pin is not 0 anymore
Is it 1 or just floating? How did you read that 1MO? What is the ouput of gpio_dump_io_configuration()? Why does it bother you?
Thanks for the pointer to gpio_dump_io_configuration(). The RMT configuration does, indeed, set the pull-up flag. I will have to dig deeper, but I'm confident that my code isn't setting that flag.
Reason it bothers me: I'm using an HC-SR04 ultrasound sensor. Instead of using a voltage divider to go from 5V to 3.3V, I use the forward voltage drop of an LED to bring the level to the acceptable range. This also comes with the benefit that I have a visible indication of what the sensor is doing. (And tbh, it's just what I had on the table, whereas I would have needed to look for matching resistors). However, with the LED (being a diode), the HC-SR04 can't sink the pull-up anymore, and my pin now always read 1.
Edit: I added a dump before and after the rmt_new_rx_channel():
Code: Select all
rmt_rx_channel_config_t cfg = {
.gpio_num = static_cast<gpio_num_t>(pin_num),
.clk_src = RMT_CLK_SRC_DEFAULT,
.resolution_hz = resolution,
.mem_block_symbols = static_cast<size_t>(block_symbols),
.intr_priority = 0,
.flags = {
.invert_in = false,
.with_dma = false,
.io_loop_back = false,
},
};
gpio_dump_io_configuration(stdout, 1ULL << pin_num);
err = rmt_new_rx_channel(&cfg, &handle);
gpio_dump_io_configuration(stdout, 1ULL << pin_num);
leads to
Code: Select all
================IO DUMP Start================
IO[19] -
Pullup: 0, Pulldown: 0, DriveCap: 2
InputEn: 1, OutputEn: 0, OpenDrain: 0
FuncSel: 2 (GPIO)
GPIO Matrix SigIn ID: (simple GPIO input)
SleepSelEn: 1
=================IO DUMP End==================
================IO DUMP Start================
IO[19] -
Pullup: 1, Pulldown: 0, DriveCap: 2
InputEn: 1, OutputEn: 0, OpenDrain: 0
FuncSel: 2 (GPIO)
GPIO Matrix SigIn ID: 84
SleepSelEn: 1
=================IO DUMP End==================
So the 'rmt_new_rx_channel' is setting the pullup.