gLCD 7789 & SPI component clash on ESP32

Any bugs you encounter with Flowcode should be discussed here.
jollybv
Posts: 125
http://meble-kuchenne.info.pl
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

gLCD 7789 & SPI component clash on ESP32

Post 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

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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.

jollybv
Posts: 125
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Re: gLCD 7789 & SPI component clash on ESP32

Post by jollybv »

Hi Ben
no they using the same SPI just different CS I'll make a quick program

jollybv
Posts: 125
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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.

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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.

jollybv
Posts: 125
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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.

jollybv
Posts: 125
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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 3749 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 3749 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 3749 times
I see there was a Library update which I have done but still not working.

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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.

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: gLCD 7789 & SPI component clash on ESP32

Post 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.

Post Reply