Page 1 of 1

Re-Map SPI-OUTPUT-GPIOS

Posted: Fri Sep 10, 2021 8:44 am
by EasySuccess
Hello,

I just registered to this forum because I need some Help while using the ESP32 with the Arduino IDE.. I have already gained some experience and am already addressing the registers directly to not use any Arduino functions (e.g. digitalWrite).
But now I need your help to solve a somewhat complicated problem.
I have a LED strip which is divided into 7 sections. I want to fill these sections with information one after the other. So I don't need 7 SPI channels, I just want to switch one channel between several GPIOs.

I thought about it as follows:
- The first segment is filled with the data
- SPI output is put on next pin
- The second segment is filled with the data
...

I need only 1xCLK, because all LEDs are controlled one after the other, so I shouldn't get any problems with the number of pins.

I have already found a few sources about the GPIO matrix, but I haven't found any example code that shows me how to use it.

I hope you can help me a little bit, if there is still some information missing, please send me a short message.

Best regards!

Re: Re-Map SPI-OUTPUT-GPIOS

Posted: Sat Sep 11, 2021 2:51 am
by ESP_Sprite
SPI devices are usually multiplexed using multiple /CS lines; does your LED strip have those, or only a clock and data input?

Re: Re-Map SPI-OUTPUT-GPIOS

Posted: Sat Sep 11, 2021 5:53 am
by EasySuccess
Hello,

many thanks for your response. It is just an Led stripe with DATA and Clock no CS Line.

Re: Re-Map SPI-OUTPUT-GPIOS

Posted: Mon Sep 13, 2021 1:00 am
by ESP_Sprite
Hm, yeah, then you want to look for something in the direction of the GPIO matrix... not sure if Arduino has dedicated calls for that, but given it's built on ESP-IDF, you may be able to use the esp_rom_gpio_connect_out_signal() call for this.

Re: Re-Map SPI-OUTPUT-GPIOS

Posted: Mon Sep 13, 2021 6:35 am
by EasySuccess
Hello,

many thanks for your input. Could you explain it a bit more? I did not use the ESP32-IDF.. Or could you send me a short example how to star the Transmission and how to change the GPIO after the data is successfully transmitted. Or did you have an other Idea how to solve this problem?

Many Thanks!