In my application, first a pulse is sent to GPIO21 using driver/rmt.
Next a task delay, and after that GPIO21 should start blinking in a simple loop.
This is not working, looks like rmt blocks other usage of GPIO21.
How could I reset this "blocking" ?
reset rmt configuration for GPIO
Re: reset rmt configuration for GPIO
If we assume that an RMT channel is "using" a given pin then it makes sense that the pin can't be used for other functions. Our goal then is to either "stop" RMT or tell RMT to use a different pin. The first might be done with a call to rmt_driver_uninstall() while the later might be done with rmt_set_pin(). I personally haven't tried this in the past. In all my projects once I have chosen a pin to be used for RMT it remains used by RMT.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 9759
- Joined: Thu Nov 26, 2015 4:08 am
Re: reset rmt configuration for GPIO
You need to re-mux your pin to use GPIO. Use gpio_matrix_out with SIG_GPIO_OUT_IDX as the signal to reset the pin to GPIO mode.
Re: reset rmt configuration for GPIO
@ESP_Sprite, thanks for your helpful answer.
@kolban, I prefer to use a pin with a function which matches my needs in this moment.
Imagine, you have to send a short impulse (0.1msec) and later on you have to send a long impulse (200 msec).
As far as I know, based on your book, its not possible to create both with rmt.
(80 Mhz / divider(255 max) / duration (32786 max)) so maximum for pulse is 104msec.
@kolban, I prefer to use a pin with a function which matches my needs in this moment.
Imagine, you have to send a short impulse (0.1msec) and later on you have to send a long impulse (200 msec).
As far as I know, based on your book, its not possible to create both with rmt.
(80 Mhz / divider(255 max) / duration (32786 max)) so maximum for pulse is 104msec.
Re: reset rmt configuration for GPIO
Couldn't you use multiple high periods together to make a long pulse?
Re: reset rmt configuration for GPIO
@wifive, in our application (Espruino, javascript) we already support setTimeout and setInterval.
There is no limit in duration. To create long duration up to hours with connected high level pulses would be overdesigned for that.
Anyway due to help from ESP_Sprite this problem is solved now.
General thoughts, on one hand we have the option to assign pins to functions like rmt, SPI, Uart etc.
On the other hands, we work with functions not that much with pins anymore.
Therefore some "housekeeping" is helpful.
BTW, one question comes to my mind, is there any way to read the mapping ?
There is no limit in duration. To create long duration up to hours with connected high level pulses would be overdesigned for that.
Anyway due to help from ESP_Sprite this problem is solved now.
General thoughts, on one hand we have the option to assign pins to functions like rmt, SPI, Uart etc.
On the other hands, we work with functions not that much with pins anymore.
Therefore some "housekeeping" is helpful.
BTW, one question comes to my mind, is there any way to read the mapping ?
-
- Posts: 9759
- Joined: Thu Nov 26, 2015 4:08 am
Re: reset rmt configuration for GPIO
In theory, yes: the mapping isn't more than a set of bits in registers; it's even described in the TRM if I'm not mistaken. In practice, however, I don't think we have a pre-made C function for that.