Support Question of the Week: Using the Aardvark Host Adapter API Software, How Does the Slave Select Signal (SS) Work with MOSI Data and Multiple SPI Slave Devices?

 

I am using the AardvarkTM I2C/SPI Host Adapter as an SPI master with multiple slave devices. Can you clarify how the  Aardvark API Software command aa_spi_write() works?

Is Slave Select asserted for each byte sent MOSI (master output slave input)?
-or-
Is Slave Select asserted for each byte sent MOSI (master output slave input)?

Thanks for your question!  SPI requires four signals: SCLK, MODI, MISO, and SS. When the SPI implementation has multiple slave devices, each slave device requires a separate SS signal. The SCLK, MOSI and MISO signals are shared by all devices.

 

SPI bus set up with multiple slave devices Figure 1: Example of Multiple SPI Slaves

 

Following are details about the SPI signals. When the Aardvark host adapter SS  signal is configured to active low, and the Aardvark writes to the slave device, the following transactions occur:

  1. The SS signal goes from 1 to 0.
  2. A few bytes are sent in the MOSI signal
  3. The SS signal goes from 0 to 1.

Between the bytes there is a delay, as shown in the figures below. For additional information about MOSI (master output slave input) signals, please refer to section 2.4 of the Aardvark Adapter User Manual.

 

SPI Waveform for SS, MOSI and MISO signals Figure 2: SPI Waveform

 

  •   t1: time from the assertion of SS to the first clock cycle
  •   t2: time for the last clock cycle and the desertion of SS
  •   tp: one clock period

 

SPI Byte Waveform for SS, MOSI and MISO signals Figure 2: SPI Byte Waveform

 

  •    td: setup time between SPI bytes
  •   tb: total byte-to-byte time

For more information, please refer to the following documents:

Aardvark Host Adapter User Manual
Aardvark Software API
API Documentation
Total Phase Products
Product Selector Guide

We hope this answers your question. If you have other questions about our host adapters or other Total Phase products, feel free to email us at sales@totalphase.com or submit a request for technical support.

 

 

 

 

 

Leave a Reply