How Do I Set Up the Timing for SPI Slave and SPI Master Devices to Communicate?

Question from the Customer:

I am streaming 5.56 MHz SPI data over the MOSI line. I am using the Aardvark I2C/SPI Host Adapter as the slave device in SPI + GPIO mode with the Control Center Serial Software. My problem is I do not see data at either 4 MHz or 8 MHz in the transaction log window.  I see that the master sends out data every 1ms. The setup for both views:

  • The master I/O level is 3.3V
  • The SPI master clock rate is 5.568 MHz

What I see on the oscilloscope:

View of timing and data on oscilloscope Data View on 'Scope

What I see in the Control Center Serial Software:

View of SPI data transmission on Control Center Serial Software Data View on Control Center Serial Software

Response from Technical Support:

Thanks for your questions! Here are some details about communication between SPI slave and master devices, as well as some diagnostic tips and suggestions. We can start with two essential check points:

  • Is the operation voltage of the master device compatible with the Aardvark adapter?
  • What is the bitrate at which the master device operates?

We will continue with more details in the following sections.

SPI Slave to Master Communication and Timing

For communication to occur, a delay is required between bytes. The timing requirements are a bit different for slave to master (MISO) and master to slave (MOSI) communication.

MISO Timing

For transmitting data from the slave to the master, a minimum 4 µs delay is required between the end of byte n and start of byte n+1. This timing allows setting up the MISO data for byte n+1. Without that delay, the Aardvark adapter will simply return the data that it received.

MOSI Timing

For transmitting data from the master to the slave, a minimum 10 µs is required between the start of byte n and the start of byte n+1.

Technical Tips for Communication

Here are some tips for correcting the communication between SPI devices.

Timing between Transactions

When the Aardvark adapter is configured to act as an SPI slave and the slave select is pulled high to indicate the end of a transaction, there is a data processing overhead of sending the transaction to the PC host.

If the SPI master sends a subsequent transaction in rapid succession to the Aardvark slave, the data received by the Aardvark slave may be corrupted. There is no precise value for this minimum inter-transaction time. We suggest 100-200 µs between transactions, which is usually sufficient.

Incompatible Master/Slave Characteristics

There is a chance that the target system, the SPI master, may not follow the characteristic requirements of the Aardvark adapter in SPI slave mode. If necessary, modify the SPI target system so that it follows the Aardvark slave requirements. For more information, please refer to the section  SPI Signaling Characteristics in the Aardvark I2C/SPI Host Adapter User Manual

More Timing Control with Promira Serial Platform

Looking at the details of your setup and requirements, it seems that the tb (time between start of bytes) is 1.4µs. However, as previously discussed about signaling characteristics, the minimum time required between the start of each byte is 10µs.

For your system requirements, we recommend looking at our Promira Serial Platform, which can be used as an SPI master up to 80 MHz and up to 20 MHz as an SPI slave. The current release of the Promira platform supports SPI Active Level 1, Level 2 and Level 3 Applications.  Using the Promira platform gives the ability to more finely tune the timing requirements.

Monitoring Details with Beagle I2C/SPI Protocol Analyzer

The Beagle I2C/SPI Protocol Analyzer non-intrusively monitors SPI up to 24 MHz.  We recommend considering the integration of this tool in your setup for more detailed monitoring and diagnostics.  This may help diagnose the timing and data issues.

For a quick overview of our products, here is a table of our I2C/SPI devices:

Chart of Total Phase SPI and I2C Tools Total Phase I2C/SPI Tools

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.

Request a Demo