![SCT Scout SC4415 User Manual Download Page 21](http://html.mh-extra.com/html/sct/scout-sc4415/scout-sc4415_user-manual_1220014021.webp)
Document# SCT-UM026FVC
Page 21 of 46
Confidential
In order to successfully communicate with SPI devices using the SC4415, the SPI interface must first be configured in a
state that is compatible with the SPI Slave(s). There are two ways in which the interface configuration can be modified.
The first method, suitable for changing individual parameters, is by use of parameter specific commands such as
, and
. The second method, suitable for a full
reconfiguration, is by use of the
command in which all SPI interface parameters can be set simultaneously. The
current setting of each parameter can be queried by specifying any configuration command without providing any
additional arguments.
SPI related configuration parameters can be changed on-the-fly meaning that configuration commands can be
sequenced in the Command Queue amongst other commands. This enables flexible SPI sequencing in which multiple
Slave devices, requiring different configurations, can be communicated with in a single sequence.
The example below is a sequence involving three Slave devices. The initial configuration, set with the
is compatible with the Slave devices connected to the Slave Select SS1 and SS2. As a result of this convenience, only the
active Slave Select line needs to be updated in order to successfully communicate with the Slave device at SS1 or SS2.
The Slave device connected to SS3 however, requires an entirely different SPI configuration. In this case, the most
efficient method is to again make use of the
command to fully reconfigure the SPI interface.
# Enable Buffer Mode (Primary)
->buffer 1
# Configure Interface, Set for Slave Select SS1
B>config 1 0 0 8 8 2 2 10
B>s_write 1 0x02 0x2D 0x1D01
# Update configuration to use Slave Select SS2
B>select 2
B>s_read 2 0x01 0x0F
# Re-Configure Interface, Set for Slave Select SS3
B>config 3 1 0 8 4 1 1 100
...
The message format for both SPI Read and Write operations consist of three main components, a Command Word, an
Address Word, and Data. The width of each word can be adjusted as required using
. A basic data frame for both SPI Read and SPI Write is shown below.
Read Data Frame:
Write Data Frame:
Command
Word
Address
Word
Delay
Cycles
Read
Data
Command
Word
Address
Word
Write
Data
For SPI Read operations, the Master device begins the operation by writing the Command and Address words to the
Slave device. There may be some processing delay required by the Slave device to interpret the request and return the
data. To help accommodate for this delay the SC4415 can introduce Delay Cycles to provide the Slave device enough
time to process the request. The Delay Cycles can be adjusted using the
command.
Once the SPI interface has been properly configured for the Slave device(s) attached, SPI Read and Write operations
can be executed using the
and