Using SPI Config for Linux

The SPI Config for Linux block lets you choose the hardware settings for the SPI Read for ARM-Linux and SPI Write for ARM-Linux blocks.

Bit Rate=Clk Src/SPIDiv: Displays the bit rate.

CLK Polarity: Clocks the polarity. You have two choices: Send on rise/Latch on fall and Send on fall/Latch on rise.

Clk Src: Selects the clock for the serial port unit. Raspberry Pi runs at Advanced Peripheral Bus (APB) clock speed, which is equivalent to core clock speed (250MHz). The supported clock speed ranges from 32kHz to 125MHz.

Mux Pin Assignment: Sets the external pins used to carry the SPI signals.

Network Mode: Indicates that the mode is set to Master. Slave mode does not work on Raspberry Pi.

SPIDiv: Specifies the divider for the system clock to set the SPI clock rate. The clock speed can be divided by any number from 1 to 3900 for the desired speed.

Sync Data: Synchronizes the data on the clock edge or ½ cycle before clock edge.

Sync Data (CPHA)

CLK Polarity (CPOL )

SPI Mode

on clock edge (0)

Send on rise/Latch on fall (0)

MODE 0

½ cycle before clock edge (1)

Send on rise/Latch on fall (0)

MODE 1

on clock edge (0)

Send on fall/Latch on rise (1)

MODE 2

½ cycle before clock edge (1)

Send on fall/Latch on rise (1)

MODE 3

Transmitted Bits: Sets the number of bits transmitted per transaction.

Unit: Specifies the unit number. Raspberry Pi has one SPI interface, referred to as SPI0. It also has a mini SPI interface, referred to as SPI1.