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
Support Question of the Week: Which SPI Host Adapter is Best for Simulating a MCU When a Programmed Delay is Needed Between Bytes?
Rena

I am looking to use an SPI host adapter as a master to simulate a MCU (multipoint control unit) for an application - this MCU in the design phase. Another existing MCU will be used as the SPI slave. In this simulation, I need to send an 8-byte message on one slave select. The first byte will always be the message ID, which the microcontroller needs to process to determine how to respond to the remaining 7 bytes. For this project, I need to insert a delay between the first byte and the second byte. The required delay is 150μs. Which host adapter do you recommend?

Thanks for your question! We have two devices that can operate as a simulator: The Aardvark I2C/SPI Host Adapter and the Cheetah SPI Host Adapter. For your system requirements, we recommend the Cheetah SPI Host Adapter, a high-speed SPI adapter that can communicate over SPI at up to 40+ MHz. You can insert User Insertable Delays from 0.8 tclk to 2^32 tclk between bytes, using the Cheetah GUI software, or the API. For details about the Cheetah adapter SPI characteristics, please refer to section 2.5.1 of the Cheetah Host Adapter User Manual.

User Insertable Delay for SPI Data Transfers Figure 1: Cheetah SPI Byte-Level Timing

You can control the delay using the Cheetah GUI Software and the Cheetah Software API. For additional information about the Cheetah GUI SPI transactions, please refer to our knowledgeable article Writing and Reading from SPI Flash Using Cheetah adapter and Cheetah GUI. For details about using Cheetah API, please refer to section 5 of the Cheetah Host Adapter User Manual.

To use the Cheetah API to send SPI data across the bus at high speed, commands are accumulated in a queue until a call is made to batch shift all of the queued commands. Following is an example of a command queue sequence for a typical SPI transaction:

  1. Clear the command queue: call ch_spi_queue_clear.
  2. Enable the Cheetah devices outputs on the SPI bus: call ch_spi_queue_oe.
  3. Enable the slave select signal: call ch_spi_queue_ss.
  4. Queue data to send across the SPI bus: Call ch_spi_queue_byte and ch_spi_queue_array.
  5. Disable the slave select signal: call ch_spi_queue_ss.

    Optionally, disable the outputs of the Cheetah device: call ch_spi_queue_oe.

  6. Send the accumulated commands across the SPI bus: Call ch_spi_batch_shift.

For additional information about the Cheetah API SPI transactions, please refer to section 5.5.1 of the Cheetah Host Adapter User Manual.

For additional information, please refer to the following documents:

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.