-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Support for SPI0 in SPI library #1062
Comments
SPI library uses hardware HSPI (a.k.a. SPI1) peripheral (pins 12-15). |
Hi @igrr , |
Actually I did implement this in a hacky manner about a month ago, need to revisit these changes and clean up the code. |
Hi @igrr , |
is SPI0 not shared with the flash? |
Actually this is done as follows: you are still using SPI1 peripheral (i.e. registers are the same), but its pins are mapped to the same pins as SPI0. There is a hardware arbiter which can demultiplex two SPI peripherals to the same physical set of pins, controlling two CS lines automatically. SPI0 has higher priority, so flash requests are still serviced, and you can use cached code. Access times via SPI1 become a bit unpredictable in this mode, but you can have an SPI peripheral and keep pins 12-15 free at the same time. |
@igrr - very interesting...is there any chance for tests this solution? |
@igrr Is there any possiblity to test your solution? |
+1 for this feature. Will it be possible to switch SPI1 between hardware and pins 12-15 at runtime? I was looking for something similar to https://github.com/espressif/esp8266_mp3_decoder implementation for SPI SRAM (or FRAM ) chip access. |
@igrr shouldn't it be enough to call hspi_dev_sel() ( esp_iot_sdk If such approach is acceptable I can try to modify the SPI driver in a backward compatible way and post a pull request with the changes. EDIT: CS1 can also be used by moving TX0 to GPIO2 - #1424 |
I have made a patch to implement this based on the SDK example code e011d38 but it is not tested yet, because I am still waiting for the SRAM chip. EDIT: created dedicated branches for the changes. SPI_RAM library is also added, but still untested |
I have some code here and here, but couldn't make it work with SRAM ( 23LC1024 ) attached to the same bus as flash (it does not read anything from SPI0 for some reason). I do not have a logic analyzer, so it is difficult to debug what is happening. |
@igrr can you elaborate, regards to this topic, what feature will be added to the ESP8266? if new HW SPI will be available for user , it is only break out on ESP-12E and not break out for most current available module in market |
Hi, Now i need use esp12E with (H)SPI and im doing first steps and have some doubts: Its factory ready to use HSPI? or i need to reprogram? Someone knows registers adress to write/read data to Wi-Fi? Thanks a lot, Loureiro |
Implemented in #3189. @riataman please go to bountysource to claim your bounty. |
- 9fd270f Documenting a few Esp.cpp methods (#3057) - 2881e91 Fix typo in client-class.md (#3045) - 97373e7 Add instructions how to re-enable DHCP (#2600) - af0f5ed Issue #1062: Implement support for HSPI overlap mode. - ca3a172 Addition of gen4-IoD Range boards (#3202) - d2b370b add AsyncPing library to libraries.md (#2889) - adeed6b Updated arduino-esp8266fs-plugin link to 0.3.0 (#2846) - b701b98 Update libraries.md (#2808) - 898d280 Update readme.md (#2809) - remove newlines from ota_updates/readme.rst
Hi, I'm trying to use the SPI library to read an SD card, with the previous version (without the PSI.pins() method) and worked fine, now with the SPI.Pins() method, I'm having this error when compile: ...esp8266\2.3.0\libraries\SPI\SPI.cpp:132:52: error: 'SPIPCS2DIS' was not declared in this scope
in any line where that names are used. can anybody help me? thanks!! |
Hi, I'm new here and also not very experienced in programming, I read what is described above, but it was not very clear to me. What I need is to use the SD card on the SPI0 pins, leaving the SPI1 pins free for other applications, if not ask too much, could someone publish an example code how to do this? |
I never got around getting a SD card working in SPI0 (I did got a SPI memory workking), I think the sd card library would need changes to make it work. I didn't had the proper tools at the time to try and debug this and right now I lack to time :( |
Except power-up, when the esp needs to use flash memory through SPi0? In other words, when my overlaped SPI is busy? |
Hi guys,
First of all Thanks for the good work, you made development much easier with esp integration with Arduino IDE.
I have one question if someone can answer on them.
ESP8226-12E https://www.adafruit.com/products/2491
Thanks in advance, Haris.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: