Skip to content

SPI0 Overlap with multiple slaves #3446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
universam1 opened this issue Jul 21, 2017 · 1 comment
Open

SPI0 Overlap with multiple slaves #3446

universam1 opened this issue Jul 21, 2017 · 1 comment

Comments

@universam1
Copy link

Basic Infos

SPI0 Overlap is now #1062 supported, awesome!
I need to address more than one SPI Slave....

Hardware

Hardware: ESP-12-E
Core Version: 2.1.0-rc2

Description

The implementation suggests that there is a possibility to use custom CS thus being able to use more than one SPI slave:
https://github.com/esp8266/Arduino/blob/master/libraries/SPI/SPI.cpp#L129

Question, is this true or the above code does not make sense?

Settings in IDE

Module: Generic ESP8266 Module
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: OTA / SERIAL
Reset Method: ?ck

Sketch

 case SPI_PINS_HSPI_OVERLAP:
        if (use) {
...
        }
        else {
            if (useHwCs) {
                pinMode(SPI_OVERLAP_SS, INPUT);
                SPI1P |= SPIPCS1DIS | SPIPCS0DIS | SPIPCS2DIS;
                SPI1U &= ~(SPIUCSSETUP | SPIUCSHOLD);
            }
        }
@universam1
Copy link
Author

@riataman Is the SPI overlap transfer blocking? I understand so, so given might it be possible to select the slave prior to the SPI.transfer, by using a simple circuit (AND and NOR) which toggles between these.

I've simulated a circuit I think of here

So the idea is that one custom pin toggles with high/low between two slaves, and the transfer is started by the hardware controlled CS.

andorgatter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant