ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

prvermas
Posts: 11
Joined: Wed Oct 09, 2019 7:20 pm

ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

Postby prvermas » Mon Sep 14, 2020 1:50 am

I was trying to use GPIO 33 on ESP32 Wrover-B devkit to detect a single sensor on One wire bus implementation (RMT ch 0). In my experiment I was able to detect the sensor using IO 21, but failed to do so with IO 33. My actual hardware design has IO33 earmarked for OwB connection. I appreciate a priority response on the same.

Best Regards,
Pradeep

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

Postby ESP_Sprite » Mon Sep 14, 2020 7:57 am

Can you post the code that initializes the RMT / IO pin?

prvermas
Posts: 11
Joined: Wed Oct 09, 2019 7:20 pm

Re: ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

Postby prvermas » Mon Sep 14, 2020 12:44 pm

I am using the code below for initialization as shared by David Antliff for one wire bus via RMT channel
Here:
gpio_num =33
tx_channel = RMT_CHANNEL_1
rx_channel = RMT_CHANNEL_0


static owb_status _init(owb_rmt_driver_info *info, gpio_num_t gpio_num,
rmt_channel_t tx_channel, rmt_channel_t rx_channel)
{
owb_status status = OWB_STATUS_HW_ERROR;

// Ensure the RMT peripheral is not already running
// Note: if using RMT elsewhere, don't call this here, call it at the start of your program instead.
//periph_module_disable(PERIPH_RMT_MODULE);
//periph_module_enable(PERIPH_RMT_MODULE);

info->bus.driver = &rmt_function_table;
info->tx_channel = tx_channel;
info->rx_channel = rx_channel;
info->gpio = gpio_num;

#ifdef OW_DEBUG
ESP_LOGI(TAG, "RMT TX channel: %d", info->tx_channel);
ESP_LOGI(TAG, "RMT RX channel: %d", info->rx_channel);
#endif

rmt_config_t rmt_tx = {0};
rmt_tx.channel = info->tx_channel;
rmt_tx.gpio_num = gpio_num;
rmt_tx.mem_block_num = 1;
rmt_tx.clk_div = 80;
rmt_tx.tx_config.loop_en = false;
rmt_tx.tx_config.carrier_en = false;
rmt_tx.tx_config.idle_level = 1;
rmt_tx.tx_config.idle_output_en = true;
rmt_tx.rmt_mode = RMT_MODE_TX;
if (rmt_config(&rmt_tx) == ESP_OK)
{
if (rmt_driver_install(rmt_tx.channel, 0, ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_SHARED) == ESP_OK)
{
rmt_config_t rmt_rx = {0};
rmt_rx.channel = info->rx_channel;
rmt_rx.gpio_num = gpio_num;
rmt_rx.clk_div = 80;
rmt_rx.mem_block_num = 1;
rmt_rx.rmt_mode = RMT_MODE_RX;
rmt_rx.rx_config.filter_en = true;
rmt_rx.rx_config.filter_ticks_thresh = 30;
rmt_rx.rx_config.idle_threshold = OW_DURATION_RX_IDLE;
if (rmt_config(&rmt_rx) == ESP_OK)
{
if (rmt_driver_install(rmt_rx.channel, 512, ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_SHARED) == ESP_OK)
{
rmt_get_ringbuf_handle(info->rx_channel, &info->rb);
status = OWB_STATUS_OK;
}
else
{
ESP_LOGE(TAG, "failed to install rx driver");
}
}
else
{
status = OWB_STATUS_HW_ERROR;
ESP_LOGE(TAG, "failed to configure rx, uninstalling rmt driver on tx channel");
rmt_driver_uninstall(rmt_tx.channel);
}
}
else
{
ESP_LOGE(TAG, "failed to install tx driver");
}
}
else
{
ESP_LOGE(TAG, "failed to configure tx");
}

// attach GPIO to previous pin
if (gpio_num < 32)
{
GPIO.enable_w1ts = (0x1 << gpio_num);
}
else
{
GPIO.enable1_w1ts.data = (0x1 << (gpio_num - 32));
}

// attach RMT channels to new gpio pin
// ATTENTION: set pin for rx first since gpio_output_disable() will
// remove rmt output signal in matrix!
rmt_set_pin(info->rx_channel, RMT_MODE_RX, gpio_num);
rmt_set_pin(info->tx_channel, RMT_MODE_TX, gpio_num);

// force pin direction to input to enable path to RX channel
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);

// enable open drain
GPIO.pin[gpio_num].pad_driver = 1;

return status;
}

prvermas
Posts: 11
Joined: Wed Oct 09, 2019 7:20 pm

Re: ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

Postby prvermas » Tue Sep 15, 2020 5:10 pm

Any input regarding this??

-Pradeep

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

Postby ESP_Sprite » Thu Sep 17, 2020 8:55 am

Nope, sorry, nothing that strikes me as odd. Is there any way you can reproduce this with just the RMT driver, for example by taking one of the ESP-IDF RMT examples and modifying it to use GPIO33 to transmit or receive?

prvermas
Posts: 11
Joined: Wed Oct 09, 2019 7:20 pm

Re: ESP32 Wrover-B :GPIO_33 not responding to one wire bus settings on RMT channel,

Postby prvermas » Thu Sep 17, 2020 12:40 pm

I think on ESP32-Wrover Kit, IO-32 & 33 are not available, as they are connected to some crystal. This was confirmed after when I tried to use them in GPIO example & reviewing the dev kit schematic thereafter.

Best Regards,
Pradeep

Who is online

Users browsing this forum: No registered users and 49 guests