Dual SPI on VSPI as well as HSPI pins

Harikrishna Parikh
Posts: 1
Joined: Tue May 04, 2021 5:19 pm

Dual SPI on VSPI as well as HSPI pins

Postby Harikrishna Parikh » Tue May 04, 2021 5:29 pm

Dear all,
I am working on Arduino platform for some projects.
I am trying to interface ADS1292 with ESP32 and log the output on microSD card.
I have connected ADS1292 to pins 18,19,23,05
while microSD card is connected to 14,13,27,15 pins
I can enable either of them at a time, but cant enable both simultaneously.

Need help for resolving this issue.

rGlory
Posts: 5
Joined: Fri Apr 30, 2021 6:23 pm

Re: Dual SPI on VSPI as well as HSPI pins

Postby rGlory » Tue May 04, 2021 11:46 pm

You need to use separate instances of SPIClass for VSPI and HSPI. Global SPIClass instance SPI is by default initialized as VSPI so you can create another instance of this class in your code and initialize it as HSPI. Or do not use global instance at all and create 2 your own instances and for example call them spiV and spiH:

Code: Select all

    SPIClass spiV(VSPI);
    SPIClass spiH(HSPI);
    
    void setup()
    {
       spiV.begin();
       spiH.begin();
    }
Then use spiV when you communicate with ADS1292 and spiH with microSD card.

Who is online

Users browsing this forum: No registered users and 24 guests