How Do I Customize the Word Length Transmitted from an SPI Host Adapter?

Question from the Customer:

I’ve been using the Cheetah SPI Host Adapter for a while – today I have a question. I’m working on a prototype SPI device with a data length of 33 bits – it’s not based on a “normal” byte. I’ve been looking at the Cheetah Software API.  Is there a function I can use for transmitting variable length data?

Response from Technical Support:

Thanks for your question!  For interfacing with your SPI device, we recommend using the Promira Serial Platform and the appropriate SPI application for your setup. With the Promira Serial Platform and Promira Software API I2C/SPI Active, you can program the desired word length – the Cheetah adapter does not support this feature.

You Can Use Promira Software API to Customize the Desired Word Length

Here is the API function that you could use with the Promira platform to queue a command that writes a stream of the same word to the downstream SPI slave device:

int ps_queue_spi_write_word (

PromiraQueueHandle queue,
PromiraSpiIOMode   io,
u08                word_size,
u32                out_num_words,
u32                word);

Arguments:

queue: handle of the queue
io: IO mode flag as defined in table 12
word_size: number of bits for a word, between 2 and 32
out_num_words: number of words to send word value of the word to queue

Return Value:

A status code is returned with PS_APP_OK on success.

Function:

This function queues the out_num_words number of words to send and sets each word to the value of word.

Note: the outputs should be enabled using ps_queue_spi_oe before calling the  function ps_queue_spi_write_word. For more information about API commands, please refer to the section API Documentation in the Promira Serial Platform I2C/SPI Active User Manual.

SPI Applications for the Promira Serial Platform

Three levels of SPI applications are available for the Promira platform:

  • SPI Active - Level 1 Application: supports clock speeds of up to 12.5 MHz for master and 8 MHz for slave; up to 6 GPIOs (2 while using SPI); up to 1 Slave Select (configurable, shared with GPIO)
  • SPI Active - Level 2 Application: supports clock speeds of up to 40 MHz for master and 20 MHz for slave; up to 12 GPIOs; up to 3 Slave Selects (configurable, shared with GPIO); support for Dual I/O
  • SPI Active - Level 3 Application: supports clock speeds of up to 80 MHz for master and 20 MHz for slave; up to 16 GPIOs; up to 8 Slave Selects (configurable, shared with GPIO); support for Dual and Quad I/O

Summary of Promira Serial Platform Features

Here are some of the advanced features provided by the Promira platform:

  • Integrated level shifting  - configure a variety of voltages from 0.9 to 5.0 volts without an external level shifter accessory board.
  • High-speed USB connectivity - high performance and convenience for bench top programming, testing, and emulation.
  • Ethernet connectivity - convenient for bench top work, and enables remote control for your automation needs.
  • Provides up to 200 mA of power – you can easily power your project, which simplifies connectivity and troubleshooting.

In addition, you can download applications to the Promira platform at any time – easily upgrade your device when you need new features.

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

More questions? Other projects? You can contact us at sales@totalphase.com. You can also request a demo that applies to your application, as well as ask questions about the Promira Serial Analyzer and other Total Phase products.

Request a Demo