-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RMT RX Filter "signal_range_min_ns" doesn't work (IDFGH-9977) #11262
Comments
Thanks for reporting! In fact, We will add a check in the driver in case the user sets a value that will lead to out-of-register-range. Meanwhile, you can reduce the RMT clock resolution by choosing another clock source, e..g |
@suda-morris
So, Best regards |
This is a trap of RMT. When setting the filter threshold, we're using the RMT's "group resolution" (one group has several channels). Which by default, equals the source clock's frequency (80MHz e.g.). https://github.com/espressif/esp-idf/blob/master/components/driver/rmt/rmt_common.c#L166
|
Ow sorry, i'd missed it. So,
If i'm correct, Regards |
Answers checklist.
IDF version.
v5.0-dev-6416-gef4b1b7704
Operating System used.
Windows
How did you build your project?
Eclipse IDE
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-WROOM32E
Power Supply used.
Battery
What is the expected behavior?
I am using RMT peripheral to communicate with other devices over HOMEBUS. There are a lot of noises on the bus, as natural.
I am trying to eliminate the noises with RMT RX filter module but i can't achieve it.
The communication baudrate 9600, and 1 bit 104us.
For Homebus, bit 0 means "52us 0-52us 1", bit 1 means "104us 1"
I set the rx config struct as;
![image](https://user-images.githubusercontent.com/16398174/233971547-1a5f992c-9bf5-4333-8d33-462f7d9a1005.png)
static const rmt_receive_config_t rmt_receive_config = {
.signal_range_min_ns = (uint32_t)18 * 1000, //18us
.signal_range_max_ns = (uint32_t)104 * 12 * 1000 //~1200us
};
rmt_receive_config_t::signal_range_min_ns specifies the minimal valid pulse duration (either high or low level). A pulse whose width is smaller than this value will be treated as glitch and ignored by the hardware.
I expect that i should not get signals less than 18us by rmt_rx_done_event_data_t.
What is the actual behavior?
I got all signals higher than 1us by rmt_rx_done_event_data_t rx data.
Steps to reproduce.
rmt_channel_handle_t rmt_rx_channel;
const rmt_receive_config_t rmt_receive_config = {
.signal_range_min_ns = (uint32_t)18 * 1000,
.signal_range_max_ns = (uint32_t)104 * 12 * 1000
};
QueueHandle_t rmt_receive_queue;
rmt_rx_channel_config_t rx_channel_cfg = {
.gpio_num = CONFIG_IO_VRF_RX_PIN,
.clk_src = RMT_CLK_SRC_DEFAULT, //80MHz
.resolution_hz = 1000000, // 1MHz resolution, 1 tick = 1us
.mem_block_symbols = 5 * SOC_RMT_MEM_WORDS_PER_CHANNEL,
.flags.invert_in = VRF_GPIO_RX_INVERT,
.flags.with_dma = 0,
.flags.io_loop_back = 0,
};
ESP_ERROR_CHECK(rmt_new_rx_channel(&rx_channel_cfg, &rmt_rx_channel));
configASSERT(rmt_rx_channel);
rmt_receive_queue = xQueueCreate(VRF_DATA_BUF_SIZE, sizeof(rmt_rx_done_event_data_t));
configASSERT(rmt_receive_queue);
rmt_rx_event_callbacks_t rcbs = {
.on_recv_done = rmt_rx_done_callback,
};
ESP_ERROR_CHECK(rmt_rx_register_event_callbacks(rmt_rx_channel, &rcbs, rmt_receive_queue));
ESP_LOGI("RMT", "Init done.");
rmt_enable(rmt_rx_channel);
rmt_receive(rmt_rx_channel, rmt_raw_symbols, sizeof(rmt_raw_symbols), &rmt_receive_config);//ready
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: