[Solved] Using the RMT peripheral ...
[Solved] Using the RMT peripheral ...
In a separate thread there was an excellent suggestion for using the "RMT peripheral" for part of a project (driving WS2811/WS2812/NeoPixels). See:
http://esp32.com/viewtopic.php?f=13&t=293
The ESP32 Technical Reference Manual covers some good stuff on the registers at the lowest level. There is also a story on an example (which sadly I have yet to find). Has anyone any experience working with this component of the device or know where to find any samples? Is there a plan for higher level driver libraries in the future?
http://esp32.com/viewtopic.php?f=13&t=293
The ESP32 Technical Reference Manual covers some good stuff on the registers at the lowest level. There is also a story on an example (which sadly I have yet to find). Has anyone any experience working with this component of the device or know where to find any samples? Is there a plan for higher level driver libraries in the future?
Last edited by kolban on Tue Nov 22, 2016 4:04 am, edited 1 time in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Using the RMT peripheral ...
I'm sure examples for all peripherals are coming soon. The led example was just added before the holiday.kolban wrote: Has anyone any experience working with this component of the device or know where to find any samples? Is there a plan for higher level driver libraries in the future?
Re: Using the RMT peripheral ...
There is a plan for high level drivers for all peripherals. They'll continue appearing in esp-idf regularly until we have them all.
I think Sprite was mistaken when he mentioned RMT examples. There will be an example, but as far as I know there isn't one at the moment. Similarly, the RMT hardware is not documented in the technical reference yet but it will be.
There are register headers in esp-idf here and here, but probably easiest to wait until more is available. Sorry!
I think Sprite was mistaken when he mentioned RMT examples. There will be an example, but as far as I know there isn't one at the moment. Similarly, the RMT hardware is not documented in the technical reference yet but it will be.
There are register headers in esp-idf here and here, but probably easiest to wait until more is available. Sorry!
Re: Using the RMT peripheral ...
I'm pretty sure it is present in the latest version of TRM, chapter 7...ESP_Angus wrote:Similarly, the RMT hardware is not documented in the technical reference yet but it will be.
https://espressif.com/sites/default/fil ... ual_en.pdf
Re: Using the RMT peripheral ...
Oops, thanks Ivan.
Re: Using the RMT peripheral ...
I had a look around but couldn't find a sample. So I studied the ESP32 Technical Reference and believed that I had a basic understanding to run some tests ... but then it dawned on me that as I looked at the IO MUX table I couldn't see any functions mapped to physical pins that related to RMT channels 0-7.
My plan was to write a simple 8 bit square wave to RMT channel 0 and then attach a logic analyzer and see what it produced. I wrote the app and then sat back scratching my head as I couldn't figure out which physical pins of the ESP32 DevKitC to attach the input to the analyzer.
My plan was to write a simple 8 bit square wave to RMT channel 0 and then attach a logic analyzer and see what it produced. I wrote the app and then sat back scratching my head as I couldn't figure out which physical pins of the ESP32 DevKitC to attach the input to the analyzer.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Using the RMT peripheral ...
Check gpio matrix for rmt_sig signals
Re: Using the RMT peripheral ...
Thanks Mr WiFive ... appreciate the response. I'm afraid I don't understand the relationship between "signals" and IO multiplexing and physical pins. Do you have any guidance on how one might go about learning how to use the knowledge of "signals" with respect to configuring physical pins for a function?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Using the RMT peripheral ...
Check ledc.c example:
Also see gpio.h:
Code: Select all
/*set LEDC signal in gpio matrix*/
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio_num], PIN_FUNC_GPIO);
gpio_set_direction(gpio_num, GPIO_MODE_OUTPUT);
gpio_matrix_out(gpio_num, LEDC_HS_SIG_OUT0_IDX + ledc_channel, 0, 0);
Code: Select all
*----EXAMPLE OF I2C CONFIG AND PICK SIGNAL FOR IO MATRIX---*/
/* gpio_config_t io_conf;
* io_conf.intr_type = GPIO_INTR_DISABLE; //disable interrupt
* io_conf.mode = GPIO_MODE_INPUT_OUTPUT_OD; //set as output mode
* io_conf.pin_bit_mask = GPIO_SEL_21 | GPIO_SEL_22; //bit mask of the pins that you want to set,e.g.GPIO21/22
* io_conf.pull_down_en = 0; //disable pull-down mode
* io_conf.pull_up_en = 1; //enable pull-up mode
* gpio_config(&io_conf); //configure GPIO with the given settings
* gpio_matrix_out(21, EXT_I2C_SCL_O_IDX, 0, 0); //set output signal for io_matrix
* gpio_matrix_out(22, EXT_I2C_SDA_O_IDX, 0, 0); //set output signal for io_matrix
* gpio_matrix_in( 22, EXT_I2C_SDA_I_IDX, 0); //set input signal for io_matrix
Re: Using the RMT peripheral ...
I had a go at trying the following logic:
using a logic analyzer, I saw the output GPIO go high and stay high for 0.49 seconds and then go low ... but no matter how I tweaked or twiddled with values, that signal remained the only output. I'll continue to experiment ... but I think I'm getting lost ...
Code: Select all
void testRMT() {
printf("Setting RMT to IO17\n");
int gpioNum = 17;
gpio_set_direction(gpioNum, GPIO_MODE_OUTPUT);
gpio_matrix_out(gpioNum, RMT_SIG_OUT0_IDX, 0, 0);
//PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpioNum], PIN_FUNC_GPIO);
gpio_pad_select_gpio(gpioNum);
printf("About to test RMT\n");
RMTMEM.chan[0].data[0].level0 = 1;
RMTMEM.chan[0].data[0].duration0 = 100;
RMTMEM.chan[0].data[0].level1 = 0;
RMTMEM.chan[0].data[0].duration1 = 100;
RMTMEM.chan[0].data[1].level0 = 1;
RMTMEM.chan[0].data[1].duration0 = 100;
RMTMEM.chan[0].data[1].level1 = 0;
RMTMEM.chan[0].data[1].duration1 = 100;
RMTMEM.chan[0].data[2].level0 = 1;
RMTMEM.chan[0].data[2].duration0 = 0;
RMTMEM.chan[0].data[2].level1 = 0;
RMTMEM.chan[0].data[2].duration1 = 0;
RMT.conf_ch[0].conf1.mem_owner = 0;
RMT.conf_ch[0].conf1.tx_start = 1;
printf("Done!");
}
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Who is online
Users browsing this forum: No registered users and 317 guests