Page 1 of 3

gLCD 7789 & SPI component clash on ESP32

Posted: Thu Oct 14, 2021 4:05 pm
by jollybv
Hi Guys

I have a problem with the Initializing of the SPI component and the gLCD ST7789 what happens is that when I Initialize the gLCD before the SPI component then the gLCD works and the SPI component dose not work, if i Initialize in the revers order I have the opposite the SPI component works and the gLCD stops.
I'm not sure but I think the two SPI are clashing

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Fri Oct 15, 2021 1:17 pm
by BenR
Hello,

Are the two SPI components using different SPI channels or are they on the same channel?

Can you post a quick example and I'll investigate for you.

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Fri Oct 15, 2021 2:18 pm
by jollybv
Hi Ben
no they using the same SPI just different CS I'll make a quick program

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Fri Oct 15, 2021 3:40 pm
by jollybv
Hi Ben I have sent you a privet message with the programs as i did not have enough time to create an example and the programs will be in the market when in done with them.

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Fri Oct 15, 2021 4:54 pm
by BenR
Hello,

I see the problem and think this one is going to need some thought. I'll see what I can do to help you get this working. It's something I've been wanting to do for a while as it should make the code more compact and efficient when using multiple components using the same peripheral.

I'll keep you posted.

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Sat Oct 16, 2021 6:05 am
by jollybv
Thanks Ben
I will give it a try and let you know

I found the file but not sure how to use it. I think I am using it as I'm using the ESP32 Wroom chip

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Mon Oct 18, 2021 4:00 pm
by BenR
Hello,

Right sorry the last file didn't work, it caused a compile error. However I think I may have gotten somewhere with this now.

Copy the attached file into your "C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\ESP" folder and hopefully when you compile your project the problem will go away.
ESP_CAL_SPI.c
(15.51 KiB) Downloaded 115 times
Let me know and if this works ok then I'll push it to the update system and consider doing the same for other peripherals / chip packs.

What happens now is if there is multiple instances of a SPI peripheral then we will redirect all subsiquent calls to the peripheral functions to the initial instance of the peripheral code.

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Tue Oct 19, 2021 7:43 am
by jollybv
Hi Ben

It is still not working the problem is still the same wont work with multiple instances of a SPI

When I initialize before the gLCD initialize the screen works but second SPI component stops.
UART Debug.png
UART Debug.png (3.97 KiB) Viewed 3750 times
When I initialize after the gLCD Initialize the screen stops working SPI component starts to work.
UART Debug 2 MAX6675.png
UART Debug 2 MAX6675.png (8.99 KiB) Viewed 3750 times
Also when i try to use the DS18B20 probe it starts to work but then stops
UART Debug 1 DS18.png
UART Debug 1 DS18.png (7.28 KiB) Viewed 3750 times
I see there was a Library update which I have done but still not working.

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Thu Nov 11, 2021 12:53 pm
by BenR
Hello,

Sorry this one fell off my radar a little. I've got another idea and so I'll have a go at that for you and see if we can get this working.

Re: gLCD 7789 & SPI component clash on ESP32

Posted: Thu Nov 11, 2021 2:55 pm
by BenR
Hello,

I think I may have bottomed the problem for you now and I've pushed the latest fix to the library update system.