Support Question of the Week: How Can a GPIO Interface be Created for the Cheetah SPI Host Adapter to Control the Reset Signal and Pulse Periods?

I am using the CheetahTM SPI Host Adapter and would like to use it to program an SPI device. To set this device to programming mode, I need to do the following:

  1. At power on, set the Reset pin, and set the SCK pin for low for 4.7msec
  2. Afterwards, send a 4-bye command

The Cheetah adapter does not have GPIOs - how do I control that signal? Also, how do I send the command?

Thanks for your question! Using the Cheetah adapter, you can set the target device reset pin and the SCK pin to low for 4.7ms when you power on the device, and then sent a 4-bypte command. Although the Cheetah adapter does not have a GPIO pin, it does have three SS (SPI slave select) output signals. You can select one of the SS signals to control the reset line of your target device, and to pull the signal low for your required 4.7 ms pulse period. You can also use tud, user insertable delay, to program the desired length of the pulse period. For information about tud, timing, and other SPI signal characteristics, please refer to section 2.5 of the Cheetah SPI Host Adapter User Manual.

Use API Software and Cheetah SPI Host Adapter  SS Signal Pins to Create GPIO Figure 1: Cheetah SPI Host Adapter

For controlling the signals, you can use the Cheetah Software API. With API, commands are accumulated in a queue until a call is submitted to batch shift all of the queued commands. Following is an example of a command queue 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.
  6. Optionally, disable the outputs of the Cheetah device: call ch_spi_queue_oe.
  7. Send the accumulated commands across the SPI bus: Call ch_spi_batch_shift.The SPI signals (SS, MISO, MOSI and SCLK) will be toggled as called in the accumulated commands.

Note:  the command queue is not cleared after it has been executed, which allows the same queue to be executed many times without having to re-enter the commands. To clear a command, call ch_spi_queue_clear. For more details about the API software, please refer to section 5 of the Cheetah SPI Host Adapter User Manual.

For more 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.

Leave a Reply