Re-Map SPI-OUTPUT-GPIOS

EasySuccess
Posts: 5
Joined: Fri Sep 10, 2021 7:10 am

Re-Map SPI-OUTPUT-GPIOS

Postby EasySuccess » Fri Sep 10, 2021 8:44 am

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!

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

Re: Re-Map SPI-OUTPUT-GPIOS

Postby ESP_Sprite » Sat Sep 11, 2021 2:51 am

SPI devices are usually multiplexed using multiple /CS lines; does your LED strip have those, or only a clock and data input?

EasySuccess
Posts: 5
Joined: Fri Sep 10, 2021 7:10 am

Re: Re-Map SPI-OUTPUT-GPIOS

Postby EasySuccess » Sat Sep 11, 2021 5:53 am

Hello,

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

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

Re: Re-Map SPI-OUTPUT-GPIOS

Postby ESP_Sprite » Mon Sep 13, 2021 1:00 am

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.

EasySuccess
Posts: 5
Joined: Fri Sep 10, 2021 7:10 am

Re: Re-Map SPI-OUTPUT-GPIOS

Postby EasySuccess » Mon Sep 13, 2021 6:35 am

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!

Who is online

Users browsing this forum: No registered users and 107 guests