Micropython SPI
-
@jwrm22 Want to brick your ESP32 with SPI programming ?
see http://community.m5stack.com/topic/1840/issues-interfacing-mfrc522-rfid-with-m5stack
Using GPIO4 CS ? It is used as CS on the micro SD card reader of the M5Stack: You either have to solder a wire to your ESP32:
or make a micro sd card adapter connecting wires to micro sd card:
GPIO4 is on your microSD Pin 2 !
You can get all the SPI signals you wanted in the sd Micro card adapter ! https://github.com/m5stack/M5-Schematic/blob/master/Core/Basic/M5-Core-Schematic(20171206).pdf
Your copy and paste Micropython code from the M5Stack reference is the basic API reading/writing to the SD (SPI) micro card !
-
While I understand that the SPI is used for the SD card.
On the back of the m5stack SPI is clearly broken out. No hand soldering required.
I do not need CS it's just what's used as example.There is an implementation in the sited m5stack git source on software SPI on different pins.
I'm just annoyed the software and documentation are not in sync.
Do you know where I can find the source used to build 1.4.5.1 for instance?I'll see if I can find the code to read/write to the SD card.
-
I do not have enough knowledge of python or git to find the files that write SPI.
I've found some .c files but don't know what to do with them. -
Anyone tried flashing m5 stack basic device with raw micropython? Will it brick the device? I doubt that. Raw micropython works just fine with atom and reflashes to uiflow just okay.
-
@ you can find the micropython SPI API in the microphyton reference:
https://docs.micropython.org/en/latest/esp32/quickref.html#software-spi-bus
M5Stack has a repository hooking up a SPI TFT display to the M5Stack on github:
https://github.com/m5stack/M5Stack_TFT_ILI9341They are using following Pins for the Hardware SPI bus (vspi, ID channel 2) in order not to have any conflicts with the built in components:
MOSI: 23
MISO: 19
SCK : 18
CS: 5 (Display CS)
DC: 26 (display DC)
TCS: 25 (touch screen CS) -
@crami25 Ok. SPI is used both for the SD card and TFT.
The link to the micropython docs is not the same as any of the m5stsck firmware.
The SPI in the machine module does not exist.Can you tell me how I install or add SPI to a micropython build?
-
@thrasher I did it and it works fine. The only downside is that M5Stack doens't give you their micropython libraries to work with... They claim they are open source ( and that was why I got into it) but then they don't share the sources that we need to make the best of the hardware.. I have asked for some in other posts and got no reply
-
As well as any decent documentation. Its a known problem
-
@jwrm22 SPI can be found in machine module
from machine import SPI
-
@tialm The problem is that the firmware is constantly changing as they work to ix bugs in the firmware. They are working to get it up to the same level as mainstream Micropython but its slow going.
I'm currently digging through demo and examples (that I'm creating) to find the API's but its slow going due to the rapidly changing firmware.