CS5376
DS256PP1 32
5.3.6 SPI 1 Transactions
To send an SPI 1 command to the decimation en-
gine, a microcontroller or other SPI bus master ini-
tiates a serial transaction to write the SPI1CMD,
SPI1DAT1, and SPI1DAT2 registers. Depending
on the command type, additional serial transactions
may be required to write or read data in the
SPI1DAT1 and SPI1DAT2 registers.
At the end of each serial write transaction the SPI 1
port automatically transfers the command and data
values to the decimation engine by setting the
e2dreq bit (external-to-decimation-request bit) in
the SPI1CTRL register. When the written values
are received by the decimation engine, the e2dreq
bit in the SPI1CTRL register is cleared, indicating
that new data can be written.
After writing to the SPI 1 port, the microcontroller
must not overwrite the register values before they
are read by the decimation engine. To ensure this,
the microcontroller should poll the e2dreq bit by
reading the middle byte of the SPI1CTRL register
(SPI1CTRLM) to check if the decimation engine
has received the current data. Alternately, the mi-
crocontroller can delay 1 ms between transactions
to guarantee enough time for the decimation engine
to receive the data.
Command Transactions
All SPI 1 commands require a serial transaction to
write the initial command and data values to the
decimation engine. Depending on the command
type, a single command transaction may be the
only one required.
To send a serial command transaction, the SSI sig-
nal is pulled low and the SPI1CMD, SPI1DAT1,
and SPI1DAT2 registers are written using the
SCK1 and MOSI pins. The full serial transaction
sends the SPI ‘write’ opcode (0x02), the starting
register address (SPI1CMDH 0x03), and up to nine
data bytes. The nine data bytes are the SPI 1 com-
mand code to the SPI1CMD register and the initial
data values to the SPI1DAT1 and SPI1DAT2 reg-
isters. When completed, the SSI signal is pulled
high and the SPI 1 port automatically sets the
e2dreq bit in the SPI1CTRL register to send the
command and data values to the decimation engine.
The decimation engine then uses the SPI1CMD,
SPI1DAT1, and SPI1DAT2 values to start the re-
quested command. After the decimation engine re-
ceives the command and data values, it
automatically clears the e2dreq bit in the
SPI1CTRL register to indicate the SPI 1 port is
available for the next transaction. See “SPI 1 Com-
mands” on page 36 for more information on the
data required for SPI 1 command transactions.
Burst Transactions
Depending on the SPI 1 command, additional
transactions may be required after the initial com-
mand transaction. An SPI 1 burst transaction reads
or writes the SPI1DAT1 and SPI1DAT2 registers
as required by the particular command.
The Read Register command (0x02) reads a data
value from the SPI1DAT1 register using a burst
transaction. All other burst transaction commands,
Write FIR Coefficients (0x03), Write IIR Coeffi-
cients (0x04), and Write TBS Data (0x06) write ad-
ditional data to the decimation engine through the
SPI1DAT1 and SPI1DAT2 registers. See “SPI 1
Commands” on page 36 for more information
about the data required for SPI 1 burst transactions.
To start a serial burst read transaction, the SSI sig-
nal is pulled low and the SPI1DAT1 register is read
using the SCK1, MOSI, and MISO pins. The full
serial transaction sends the SPI ‘read’ opcode
(0x03) with the starting register address
(SPI1DAT1H 0x06) using the SCK1 and MOSI
pins, and receives three data bytes using the SCK1
and MISO pins. The three data bytes returned are
the data value from the SPI1DAT1 register. When
completed, the SSI signal is pulled high to end the
transaction. The e2dreq bit is not used for a read