smôl Hookup Guide
SPI Chip Select Waterfalling
smôl allows you to connect up to three Serial Peripheral Interface (SPI) peripheral boards into your stack.
SPI devices share common clock and data signals but require an individual Chip Select signal. Here's how we connect the Chip Select signal on smôl using a technique called waterfalling.
The three chip select signals are called CS0, CS1 and CS2. On the ESP32 Processor Board, these are connected to GPIO5, GPIO14 and GPIO13 respectively. In Arduino terms, they are D5, D14 and D15, or Digital Pins 5, 14 and 13.
Waterfalling is a technique where:
- if a Peripheral Board needs an SPI Chip Select, it will always use CS0 from the IN connector
- the unused Chip Select lines CS1 and CS2 are then passed to the OUT connector as CS0 and CS1
Let's see that in action. Here are the FPC connections on the smôl ARTIC R2:
The smôl ARTIC R2 uses SPI communication and so uses CS0 (Pin 7) from the IN connector.
CS1 (IN Pin 8) and CS2 (IN Pin 9) are not used and so are connected directly to the OUT connector but as Pins 7 and 8 (not Pins 8 and 9).
If the ARTIC R2 is placed immediately above the ESP32 Processor Board in the smôl stack, its Chip Select is connected to ESP32 Digital Pin 5.
If another SPI Peripheral Board were placed above the ARTIC R2 board, it too would use CS0 but its CS0 would be connected to ESP32 Digital Pin 14 (not 5) thanks to the waterfalling.
The important 'rule' is: Peripheral Boards must be placed above the Processor Board in the smôl stack
If you accidentally place a Peripheral Board below the processor board, no damage will be done. But the Peripheral Board will not function because its Chip Select signal will be left floating.
Power Boards are a special case. They only use I2C for communication and so can be placed anywhere in the stack. The natural place for them is below the Processor Board, but you can place them above if you want to.
The smôl Header only has an OUT connector so it needs to go at the very bottom of your stack.