I2C SPI USB CAN eSPI Cable Testing View All Quick Start Guides User Manuals Software Downloads Knowledge Base Videos Case Studies App Notes White Papers Sales Support About Us
Products Blog Sales Support Contact Search
How Do I Keep SS Low Between Extended Data Transactions with SPI Devices?
Rena Ayeras

Engineer staring a laptop trying to figure out keeping SS low for extended SPI data transactions

Image by Andrea Piacquadio

Question from the Customer:

I am using the Aardvark I2C/SPI Host Adapter and Aardvark Software API to talk to various SPI devices. I am using the API examples to create sets of SPI data transactions. So far, it works for all the devices except one that requires 24-bit transactions for configuration: three 8-bit bytes with SS held low during the transaction.

However, in following the examples, the SS line is not staying low for the duration of the 3-byte transaction. Here is a view of the results I have:

Oscilloscope showing that SPI SS Is Not Staying Low Between Bytes

  • The pink line is the SS line.
  • The blue line is the MISO line
  • The yellow line is the SCLK.

So far, I have not found a way to keep SS low – the toggling of the SS signal is a problem for that one SPI device. Do you have any suggestions of how to keep the SS line pulled low? I am using the aa_spi_write command.

Response from Technical Support:

Thank you for your question! The Aardvark adapter manages data in bytes, not bits. We will start with an explanation of how the Aardvark adapter manages data transactions and then provide solutions for your question.

How the Aardvark Host Adapter Manages Data Transactions

As mentioned, the Aardvark adapter is not capable of sending data bit by bit; it can only send data in 8-bit bytes. Therefore, each byte is transmitted in 8 clock cycles. The Aardvark adapter has a td that occurs between 8-bit bytes:

  • SPI master mode: 7 to 9 µs ;
  • SPI slave mode: minimum 4 µs

There is approximately 9 µs of setup time required in between each byte, which results in a total transmission period of the byte transmission time plus 9 µs. In other words, the Aardvark adapter can transfer 8 bits of data without the td delay. Between bytes, however, the td delay will occur.

Transaction Delays for 24-bit Data Transfer

The Aardvark adapter cannot transfer more than 8 bits of data without a td delay. The maximum bitrates are only achievable within each individual byte – it is not extended across bytes. The delay between each byte of data sent are due to the characteristics of the Aardvark device.

SS could be held low during multiple data transfers. For ease of display, we will provide an example using the Control Center Serial Software (the same can be applied with API commands).

To hold SS low while sending three consecutive 8-bit transactions:

  1. assert SS (hold SS low)
  2. send AB (first 8 bits of data)
  3. send CD (the second 8 bits of data)
  4. send EF (the third 3 bits of data)
  5. deassert SS (release SS)

There will be a gap between the delivery of each 8-bit word, but the transaction will occur without SS toggling between the 8-bit bytes.

Note – depending on your setup, to keep SS low, it may be necessary to operate the Aardvark adapter in GPIO mode. This is because each line has two pull-up resistors, 2.2k-ohm and 100k-ohm. The 100k-ohm is always connected. It is a weak pull-up that is only there to ensure a “solid” logic high is present in case the pin is not connected.  In GPIO mode only, the stronger 2.2k-ohm pull-up resistor can be disabled.

If you need faster and easier delivery of the 24-bit data transactions, we recommend the Promira Serial Platform.

Faster Data Transactions with the Promira Serial Platform

For your application, to send 24 bits in a single transaction, we recommend using the Promira Serial Platform.  The Promira Serial Platform has options to configure word lengths in the API as needed, such as 24 bits. This way, there is no inter-byte delay that occurs as with the Aardvark adapter; SS would not have to asserted and deasserted.

For more information about Promira Software API, please refer to the section API Documentation in the Promira Serial Platform I2C/SPI Active User Manual.

The appropriate licenses for your setup are as follows:

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.