So I’ve recently gotten my SoM development materials and am encountering some confusion on how to properly wire up SPI devices. Using the schematics provided on Github I’ve wired up my custom board as shown below which clearly show the uSD card and Ethernet interface connecting to different Pins on the SoM.
However in the docs it references that both the SD and Ethernet interfaces should run of the only SPI bus and use pins D23 (which I suspect is a typo)/D8 respectively as the chip select. As I don’t have as much experience with SPI as opposed to I2C(In my previous project with a P1 I just put my separate devices on the separate buses) I don’t quite understand how to code both of these devices to run on the same bus (or if that’s possible).
Additionally I was a bit dismayed to see that WKP functionality is mapped to D8 (labeled CS everywhere else save this chart) addiding more complications to using SLEEP_MODE_DEEP as well as two SPI devices.
TL;DR
How do I use two SPI devices and properly wake from SLEEP_MODE_DEEP on the Gen3 SoMs all at the same time?
The evaluation board datasheet was incorrect, sorry about that. It should have read:
With the jumpers installed, it will use the secondary SPI (SPI1) and pin D5 as the chip select.
Micro SD
nRF52 Pin
SoM Pin
SoM Pin Number
SD_MISO
P1.8
D4 / PWM0 / SPI1 MISO
66
SD_SCK
P1.12
D2 / RTS / SPI1 SCK
42
SD_MOSI
P1.1
D3 / CTS / SPI1 MOSI
40
SD_CS
P1.10
D5 / PWM1
68
SD_DET
P1.11
D6 / PWM2
70
The Ethernet and SD card on the evaluation board are on different SPI interfaces.
With Device OS 1.5.0 and later, you can run them on the same SPI interface on your own custom board, as long as SPI_TRANSACTIONS is enabled in SdFat and they have different chip select pins. This won’t work properly in earlier Device OS versions.
On the eval board, the chip selects are:
SD card: SD_CS1 to PWM1 P1.10 (D5) pin 68
Ethernet: ETH_CS to CS P1.3 (D8)
On the B Series SoM, WKP is pin A7 in Device OS 1.3.1 and later. In prior versions, it was D8.
In a future version of Device OS, the WKP pin will be able to moved to any pin on Gen 3 devices.
The datasheet has been updated with the correct pins and SPI interface.
Thanks so much for the update Rick. Seeing as the Ethernet and SD card are actually on differnet interfaces, can I also assume that the SPI QTY 1 under Peripherals and GPIO on the B Series datasheet is also incorrect?
I corrected the number of SPI and I2C ports, and the number of PWM.
(The value 1 came from the Boron datasheet, which only has 1 available because the PMIC uses the other one. But on the B Series SoM, there is no PMIC on the SoM. Same with I2C and the fuel gauge.)