| Prev: Getting Started | Table of Contents | Next: Legal / Contact |
SPI is a serial communication bus developed by Motorola. It is a full-duplex protocol that functions on a master-slave paradigm that is ideally suited to data streaming applications.
The main application window is divided into three major sections. The top section contains the controls to configure the SPI parameters of the Cheetah adapter. The middle section contains a hex editor for entering the MOSI message to send from the Cheetah adapter. The bottom section contains a transaction log that provides a timestamped list of transactions performed by the Cheetah GUI software.
Many of the SPI signaling parameters of the Cheetah adapter can be changed to suit the needs of the system it targets.
The Cheetah adapter is capable of communicating in all four modes of SPI. Both the Cheetah adapter and the target device must use the same SPI mode such that they both use the same data frame for the transaction.
Each of the four SPI mode defines a specific combination of clock polarity (CPOL) and clock phase (CPHA). A clock polarity of 0 means that the clock is rising then falling and a clock polarity of 1 means that the clock is falling then rising. A clock phase of 0 means that the data is sampled on the first edge and a clock phase of 1 means that the data is sampled on the trailing edge.
A pull-down menu provides a quick and easy way to change SPI modes. There is also an accompanying graphic, labeled “SCK Polarity,” which illustrates the characteristics of the mode. Once a mode has been selected from the pull-down menu, it is immediately set and a message should appear in the transaction log.
The bit rate is the speed of communications between the master and the slave. The Cheetah adapter can operate at bit rates from 100 kHz to 40 MHz in increments of 1-2 kHz. It is also possible to overclock the Cheetah adapter to bit rates beyond 40 MHz. While the Cheetah adapter can communicate at up to 50 MHz, Total Phase will not provide support for any communication over 40 MHz.
The most commonly used bit rates are available in the bit rate pull-down menu. To change the bit rate, simply select a bit rate from the pull-down menu. Alternatively, it is also possible to enter any arbitrary bit rate greater than 100 kHz. Only integer values are accepted; decimal bit rate values (e.g 1.3 MHz) will cause an error message to be displayed. Bit rates can be specified in either kilohertz (kHz) or megahertz (MHz). If no units are specified, it will be assumed that the bit rate is being set in kilohertz.
Once a bit rate is entered, the Accept and Cancel icons next to the bit rate box will become active. To accept the bit rate that has been entered, simply click on the green check mark of the Accept button. To cancel the data entry, simply click on the red X of the Cancel button. When a data entry has been canceled, the previous bit rate setting will be displayed.
The bit rate will not be accepted until the Accept button has been clicked. When the Accept button is clicked, the software will attempt to set the bit rate in the Cheetah adapter. If the requested bit rate is not available, the closest available bit rate will be set. In such a case, a dialog box will appear to inform the user of the bit rate that the Cheetah adapter was set to.
Once the bit rate has been set, a message will appear in the transaction log indicating the bit rate change.
The bit order of the SPI data can be changed. MSB indicates that the Most Significant Bit will be sent first. LSB indicates that the Least Significant Bit will be sent first.
To change the “Bit Order,” select the appropriate radio button for either “MSB” or “LSB.” Only one bit order can be selected at a time. Once the radio button has been selected, the parameter is immediately set and a message should appear in the transaction log.
The SS polarity indicates whether the Cheetah device will pull the Slave Select pin high or low to activate the SPI slave device.
To change the “SS polarity,” select the appropriate radio button for either “Active Low” or “Active High.” Once the radio button has been selected, the polarity is immediately set and a message should appear in the transaction log.
The Cheetah adapter provides three separate slave select lines. In this way it is possible to control three different slave devices with a single Cheetah adapter. Each slave select line can be toggled on or off separately. It is possible to use more than a single slave select line simultaneously.
SS1 |
Pin 9 |
SS2 |
Pin 1 |
SS3 |
Pin 3 |
To toggle a slave select line for use, simply check the box next to the desired slave select line. Once the checkbox has been toggled, a message should appear in the transaction log. The selected slave select lines will be enabled when the next MOSI message is sent.
Output enabled indicates whether or not the outputs of the Cheetah adapter have been enabled. When enabled, the Cheetah device connects to the SPI bus and is ready to drive the signal lines. When the Cheetah output enable is disabled, the device disconnects from the bus and each signal line is held at their current value with a very weak internal pull-up or pull-down on the Cheetah device. When the Cheetah adapter is disabled, it is not possible to send or receive data.
To toggle the enabled state of the Cheetah adapter, simply check or uncheck the checkbox next to “Output Enable.” The enabled state is set as soon as the checkbox has been changed and a message should appear in the transaction log.
It is possible to power a downstream target, such as an SPI EEPROM, with the Cheetah adapter’s power (which is provided by the USB port). More information about powering downstream devices can be found in the Cheetah SPI Host Adapter datasheet.
NC/+5V (Pin 4): 5V Power
NC/+5V (Pin 6): 5V Power
These pins can be enabled through the Cheetah GUI software. To turn on target power, check the box next to “Target Power.” A checkmark indicates that power will be supplied to downstream devices on both pins. The target power state is set as soon as the checkbox has been changed, and a message should appear in the transaction log.
The MOSI (Master Out, Slave In) message is the data that will be transmitted from the Cheetah adapter. The data can be entered in either hexadecimal or ASCII.
To send the MOSI message, simply click on the “Send” button. As soon as the button is clicked, the Cheetah GUI software will send the MOSI message through the Cheetah adapter. A message should appear in the transaction log with the data from the transaction.
Since SPI is a full-duplex protocol, the Cheetah adapter will receive as many bytes as it sends. However, there may be situations where either some or all of the returned data is not meaningful. For example, when programming a flash device, the returned MISO message does not have any meaningful data.
The “Expected Bytes” is normally disabled. To enable the field, uncheck the “All Bytes” checkbox. Check the “All Bytes” checkbox to receive all of the bytes in the MISO message.
The “Expected Bytes” field allows the user to specify the specific number of bytes that should be returned by the Cheetah adapter. Please note that the number of bytes received over the MISO line in any given transaction will never exceed the number of bytes sent over the MOSI line, regardless of the value input into the “Expected Bytes” field.
The number of expected bytes is set in the Cheetah adapter upon a subsequent “Send”. When a transaction is sent, the expected byte value will be reported in the transaction log. The second value in the “Length” column should reflect the number of expected bytes, unless the number of bytes sent was fewer than the number of bytes expected. In the “Summary” column, the truncated bytes will be shown as “XX”.
Some SPI devices may require delays during an SPI transmission. To satisfy these requirements the user may specify a delay value in the “Delay” field. The delay value may be specified in units of clock cycles, nanoseconds, microseconds, or milliseconds. The delay unit can be selected in the drop down list next to the “Delay” field.
If the “Delay” field is not set to zero, the Cheetah will insert delays between the slave select assertion and the first byte, between each byte, and between the last byte and slave select deassertion. The Cheetah rounds the delay up to the nearest 8 clock cycle boundary. Therefore, the delay entered may not always be satisfied. The actual delay will be displayed in the Transaction Log and in the “Delay” field after a transmission is complete.
The “MOSI message” box is a full-featured hex editor. The data can be specified in either hexadecimal or ASCII. There are several keyboard shortcuts available while working in the hex editor.
Key(s) |
Function |
Arrow keys |
Move one space left, right, up or down |
Home |
Move to the beginning of the row |
End |
Move to the end of the row |
Page Up |
Move one screen up |
Page Down |
Move one screen down |
Ctrl-Home |
Move to the beginning of the message |
Ctrl-End |
Move to the end of the message |
Shift |
When holding it down, selects the text under the cursor. This can be used in conjunction with the movement keys above and the mouse. |
Ctrl-Tab |
Switches between Hex and ASCII mode |
Ctrl-Left |
Switches to Hex mode |
Ctrl-Right |
Switches to ASCII mode |
Insert |
Toggles between Insert mode and Overwrite mode |
Ctrl-Delete |
Cut |
Shift-Delete |
|
Ctrl-X |
|
Ctrl-Insert |
Copy |
Ctrl-C |
|
Ctrl-V |
Paste |
When moving around in the Hex Editor, the current location in the current mode (Hex or ASCII) is marked with the cursor. The equivalent position in the other mode is marked by green text. If the Hex Editor is in Insert mode, the cursor will be a line. If the Hex Editor is in Overwrite mode, the cursor will be a box.
The entire MOSI message can be cleared by clicking on the “Clear” button. Please note that the entire contents of the MOSI message will be cleared once the button is clicked.
An arbitrary number of zeros can be inserted at the current cursor position by clicking the “Zeros” button. When the button is clicked, a dialog box will appear where the number of zeros can be specified.
The contents of a binary file can be inserted at the current cursor position. Clicking the “Insert” button will cause a file dialog to appear. In this window, a *.bin file can be selected for insertion.
The entire MOSI message can be also be saved to a binary file by clicking on the “Save” button. When the button is clicked, a file dialog window will appear to allow a *.bin file to be created with the MOSI message.
The Transaction log is a scrolling list of all the transactions that the Cheetah adapter sends or receives. Since SPI is a full duplex protocol, when a MOSI message is sent, a MISO message is received at the same time. The transaction log will log MOSI and MISO in a single transaction with the corresponding bytes paired up and separated by a slash. The length of the two messages will be the same due to the duplex nature of the protocol.
The information is arranged in the following columns:
Index number of the transaction. The index is a zero-based number.
Time of the transaction. This information is displayed in the format:
YYYY-MMM-DD hh:mm:ss.xxx
The number of bytes in the transaction. There are two numbers in this column. The first number is the number of bytes in the MOSI message, and the second number is the number of bytes in the MISO message. The length of the MISO message will be less than the length of the MOSI message if the “Expected Bytes” field was set to a value less than the amount of the MOSI data sent.
A summary of the data sent and received on the SPI bus or a description of the action performed.
In the case of a configuration change, a brief message will be displayed, indicating the change made. In the case of data, up to ten byte pairs are displayed. Each pair represents a MOSI/MISO byte pair. If the “Expected Bytes” field was used, an “XX” will appear for any MISO values that were truncated.
The “Clear” button clears all entries from the Transaction Log.
Please note that all transactions are cleared immediately when the button is pressed.
The Details view provides the full details of a transaction. To see the details of a transaction, simply click on the “Details” button or double-click on an entry in the transaction log.
In the Details window, the MOSI and MISO messages are displayed separately.
The MOSI and/or MISO data can be saved separately in a binary file. Click on either the “Save MISO” button or “Save MOSI” button to bring up the save file dialog. This binary file can later be loaded as a MOSI message.
To close the Details window, click on the “Cancel” button or hit the Esc key.
The data in the log can be exported in a comma separated values (CSV) format by clicking on the “Save To File” button. You will be prompted for a filename to save the data.
The log file has a header with the following information:
Export Time: [time of export]
After the header, all transactions are appended, one per line. The column order in the exported file is the same as the order of the columns in the transaction log.
| Prev: Getting Started | Table of Contents | Next: Legal / Contact |
|
© 2012 Total Phase, Inc. All rights reserved. Terms of Use | Privacy Notice | Site Map |
|
|