I’m tinkering with the ESP32 board. There isn’t a loader that works with the Arduino IDE’s board manager yet, and I had a basic problem installing the board files following the instructions at https://github.com/espressif/arduino-esp32. It says to put the files into [sketch folder]/hardware/espressif/esp32, but because my sketch folder is in my Documents/arduino, weird permissions blocked me from doing it.
I moved the files into C:\dev\arduino-1.8.4\hardware\espressif instead and it worked fine there. http://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/ confirmed that there was no special magic involved in where it goes.
There’s a load of warning during compilation, but they seem to be in places that make no difference, because it worked, good stuff.
Used SD_Test.ino from the ESP32 examples.
And it worked. This isn’t the connection I expected: I thought the MISO on the SD card would be connected to the MOSI on the ESP32. This isn’t how SPI works, and I’m conflating MISO and MOSI with DIN and DOUT.
DIN and DOUT are implicitly directional. The OUT of a device is naturally the IN of another device. So while it might make sense on a board to have an OUT marked, it’s not possible to have a conductor which is called OUT at one end, but looks like IN at the other.
Master In, Slave Out is a buss that might be common to multiple SPI devices. There is only one master with one input, so that doesn’t change, no matter how many devices there are added.
- https://forum.pjrc.com/threads/24993-SPI-Data-in-out-naming-clarity drops some knowledge.
SPI uses the chip select pin to put other devices into a high-impedence state that means that effectively the SPI bus is only connected to one device at a time. There is another form (referenced in the forum post above) where SPI devices are daisy-chained. That’s not for me.