Difference between revisions of "RPI SPI8"

From Land Boards Wiki
Jump to navigation Jump to search
Line 85: Line 85:
  
 
[[file:RPI_PSOC5_SPI_LOGIC.PNG]]
 
[[file:RPI_PSOC5_SPI_LOGIC.PNG]]
 +
 +
[[file:RPI_PSOC5_SPI_config.PNG]]
  
 
=== PSOC5 to BCM mapping ===
 
=== PSOC5 to BCM mapping ===

Revision as of 11:31, 6 April 2022

Tindie-mediums.png


RPI SPI8 P1892-720px.jpg

8-Channel SPI Bus Multiplexer for the Raspberry Pi

  • 8 SPI channels
  • Connects to the SPI pins on the Raspberry Pi
  • Supports SPI star or daisy-chain topologies - or a mix of both
    • Daisy chain often used to get around the single Chip Select limitation (which this card fixes)
  • 3.3V
    • 50 mA limit from Raspberry Pi

SPI Star Topology

  • MISO from all slaves are wired together
  • MOSI, SCLK is sent out to all ports
  • SS (Slave Select) is separate for each of the 7 ports
  • A0-A2 lines from Raspberry Pi control the port number

SPI Star Topology.png

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):

SPI DO Open Drain.PNG

SPI Daisy-Chain Topology

Daisy-chain mode could also be used via external wiring.

  • MOSI / MISO from all slaves are connected in series
  • SCLK is sent out to all ports
  • Individual (Slave Select) is separate for each daisy-chain
  • A0-A2 lines from Raspberry Pi control the port number

SPI Daisy-Chain Topology.png

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
    • A0 - IO_22 - GPIO Pin 15
    • A1 - IO_27 - GPIO Pin 13
    • A2 - IO_17 - GPIO Pin 11
  • BCM pin numbers

RPI 40Pin Conn.PNG

SPI Connectors

Four of 2x6 right angle headers

  1. SPICE0[0-7]
  2. SPIMOSI
  3. SPIMISO
  4. SPISCK
  5. VCC (3.3V from Raspberry Pi)
  6. GND

Programming

RPI_PSOC5 Programming

The RPI_SPI8 can be used with the RPI_PSOC5 card

SPI-POTX2 P1889 720px.jpg

SPI Logic

RPI PSOC5 SPI LOGIC.PNG

RPI PSOC5 SPI config.PNG

PSOC5 to BCM mapping

RPI PSOC5 PSOC TO BCM.png

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

Timing

  • RPI_PSOC5 Tester
  • PSOC5 C code
  • Yellow = center tap if POT0 (GND/VCC shunts installed
  • Cyan = Slave Select/Chip Select

SPI-POTX2-14.png

Factory Test Procedure

  • Verifies continuity/No shorts or opens

Hardware Setup

RPI SPI8 P1878-720PX.jpg

  • RPI_PSOC5
    • Raspberry Pi CPU Clone
  • LED-TEST-2
    • Uses 11 LEDs
  • POWER-49MM
    • Distribute grounds to LEDs
  • Cable set
    • 2x6 header plugs into pair of SPI ports
    • 4 of 2x4 connectors attach to LED-TEST-2 card
      • (8) CE (SS)
      • MOSI
      • MISO
      • SCK

Run Tests

  • Run puTTY
    • Find COM Port in Device Manager
    • 115,200 baud
    • RTS/CTS flow control

RPI SPI8-puTTY setup.PNG

  • 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
  • Select RPI-SPI8 Card by entering 7[ENTER]
7
Selected RPI-SPI8 card

Blink LEDs

  • Enter B[ENTER]
B
Blinking the RPI-SPI8 Card LEDs, please wait
  • Bounces LEDs off across the LEDs
    • 8 CE signals go low one at a time
    • MOSI, MISO, SCK cycles one on at time

Test Software

Issues

Rev 2

Rev 1 Rework

  • Cut etch between IC pins 5 and 6
  • Add wire between IC pins 4 and 5

REV1 RWK.PNG

Assembly Sheet

RPI-SPI8 Assembly Sheet - Rev 1