Difference between revisions of "RPI SPI8"
Jump to navigation
Jump to search
Blwikiadmin (talk | contribs) |
Blwikiadmin (talk | contribs) |
||
Line 172: | Line 172: | ||
* Runs on [[RPI_PSOC5]] | * Runs on [[RPI_PSOC5]] | ||
* [https://github.com/douggilliland/RPI_PSOC5/tree/master/RPI_PSOC5_Serial_01 GitHub repo] | * [https://github.com/douggilliland/RPI_PSOC5/tree/master/RPI_PSOC5_Serial_01 GitHub repo] | ||
+ | ** [https://github.com/douggilliland/RPI_PSOC5/blob/master/RPI_PSOC5_Serial_01/RPS_PSOC5_Serial_01.cydsn/Test_RPI_SPI8.c Test_RPI_SPI8.c] | ||
== Issues == | == Issues == |
Revision as of 07:51, 4 April 2022
Contents
8-Channel SPI Bus Multiplexer for the Raspberry Pi
- 8 channels
- Supports SPI star topology
- MISO from all slaves are wired together
- Connects to the SPI pins on the Raspberry Pi
- 3.3V
- 50 mA limit from Raspberry Pi
SPI Star Topology
From Practical EE: SPI Bus page:
In Star topology all the signals are split and routed to each slave in parallel, except chip select. Multiple chip select are used to select individual slave devices. More devices support this mode than daisy-chain.
An example of a part ([MCP4231 Digital Pot]) which supports this mode (p 31):
Connectors
40-Pin Raspberry Pi Connector
- SPIMISO - GPIO Pin 21
- SPIMOSI - GPIO Pin 19
- SPISCK - GPIO Pin 23
- SPICE0 - GPIO Pin 24
- Three GPIO pins select SPI channel
- GPIO Pin 22 - A0
- GPIO Pin 27 - A1
- GPIO Pin 17 - A2
- BCM pin numbers
- PSOC5 to BCM mapping
SPI Connectors
Four of 2x6 right angle headers
- SPICE0[0-7]
- SPIMOSI
- SPIMISO
- SPISCK
- VCC (3.3V from Raspberry Pi)
- GND
Programming
- Set channel number on GPIO Pin 22 (A0), GPIO Pin 27 (A1), GPIO Pin 17 (A2)
- Do SPI transfer
- SPI on the Raspberry Pi
- Python Spidev
Application Example
Setup
- SPI0 is disabled by default.
- To enable it, use raspi-config, or ensure the line dtparam=spi=on isn't commented out in /boot/config.txt.
- By default it uses 2 chip select lines, but this can be reduced to 1 using dtoverlay=spi0-1cs.
- dtoverlay=spi0-2cs also exists, and without any parameters it is equivalent to dtparam=spi=on.
- Use n SPI-POTX2 cards
- Requires n SPI cables
SPI Cables
RPI_SPI8 (Marking) | RPI_SPI8 Pin | SPI-POTX2 Pin | SPI-POTX2 Marking |
---|---|---|---|
Chip En (CE) | 1 | 5 | SS |
MOSI (MO) | 2 | 4 | MOSI |
MISO (MI) | 3 | 1 | MISO |
SPICK (CK) | 4 | 3 | SCK |
Vcc (+V) | 5 | 2 | +V |
GND | 6 | 6 | GND |
Factory Test Procedure
- Verifies continuity/No shorts or opens
Hardware Setup
- RPI_PSOC5 - Raspberry Pi Clone
- LED-TEST-2
- POWER-49MM
- Distribute grounds to LEDs
- Cables 2 ports at a time
- 2x6 header plugs into pair of SPI ports
- 4 of 2x4 connectors attach to LED-TEST-2 card
- Power/Ground LED
- MOSI
- MISO
- CE (SS)
- SCK
Run Tests
- Run puTTY
- Find COM Port in Device Manager
- 115,200 baud
- RTS/CTS flow control
- Hit ENTER to see menu
Land Boards, LLC - RPi Card Test Station 1 - Select RPP-UIO-16 Card 2 - Select RPPSOC Card 3 - Select RASPI-PLUS-GVS-CFG Card 4 - Select RASPI-GVS Card 5 - Select RASPI-PLUS-GVS Card 6 - Select RPI-I2C-HUB Card 7 - Select RPI-SPI8 Card R - Read EEPROM W - Write EEPROM B - Bounce LED across Card GPIOs T - Test Card D - Debug Card ? - Print this menu
- Enter 7
7 Selected RPI-SPI8 card
- Enter B
b Blinking the RPI-SPI8 Card LEDs, please wait
- Bounces LEDs across the LEDs
- 8 CE signals go low one at a time
- MOSI, MISO, SCK cycles one on at time
Test Software
- Runs on RPI_PSOC5
- GitHub repo
Issues
Rev 2
Rev 1 Rework
- Cut etch between IC pins 5 and 6
- Add wire between IC pins 4 and 5