© Semtech 2005 www.semtech.com
15
XE3005/XE3006
Using the SPI pins at startup the user is able to configure the CODEC in the corresponding setups without
reprogramming through the SPI interface and protocol. In best case the SPI interface can then be completely omitted and
the 3 SPI pins can be fixed to ‘0’ or ‘1’.
2. Programming through SPI interface after power-up
Once the device has been powered up, the configuration registers can be modified at all times (also when the device is
active) through the SPI interface.
The following section describes the SPI protocol which is required to change the control registers from their default
values.
3.3 SERIAL PERIPHERAL INTERFACE - SPI
The serial peripheral interface (SPI) allows the device to communicate synchronously with other devices such as a
microprocessor or a DSP. The CODEC interface only implements a slave controller. This section describes the
communication from master (e.g. DSP) to slave (CODEC pin MOSI) and from slave (CODEC pin MISO) to a master (e.g.
DSP).
Four lines are used to transmit data between the slave and master:
- MOSI (Master Out, Slave In) data from master to slave, synchronous with the SPI clock (SCK).
- MISO (Master In, Slave Out) data from slave to master, synchronous with the SPI clock (SCK).
- SCK (Serial Clock) synchronizes the data bits of MOSI and MISO.
- SS (Slave Select) Slave devices are selected by activating SS.
3.3.1 Protocol
During SPI communication, data is simultaneously transmitted and received.
0 1 15
SS
SCK
MOSI
MISO
15 0
14
14
1
t
disable
1/F
sck
t
recovery
…
…
…
…
Figure 16: SPI signal timing
The master puts data on the MOSI line on the falling edge of SCK; the slave reads the data on the rising edge of SCK.
The slave puts data on the MISO line on the falling edge of SCK; the master reads the data on the rising edge of SCK.
Transmission in either direction is by 2 bytes with MSB first.
The SS pin should be kept low during the whole transfer of data.
There are three timing constraints:
- Recovery time (t
recovery
) between the falling edge of SS and the falling edge of SCK.