c.
Optionally, enable the µDMA completion interrupt by setting the
DMATXIM
or
DMARXIM
bit
in the
SSIIM
register.
Note:
For a TX DMA completion interrupt, software must disable the µDMA transmit enable
to the SSI by clearing the
TXDMAE
bit in the
QSSI DMA Control (SSIDMACTL)
register
and then setting the
DMATXIC
bit in the
SSIICR
register. This clears the DMA completion
interrupt. When the µDMA is needed to transmit more data, the
TXDMAE
bit must be
set (enabled) again.
7.
If this is the first initialization out of reset, enable the QSSI by setting the
SSE
bit in the
SSICR1
register.
As an example, assume the QSSI must be configured to operate with the following parameters:
■ Master operation
■ Freescale SPI mode (SPO=1, SPH=1)
■ 1 Mbps bit rate
■ 8 data bits
Assuming the system clock is 20 MHz, the bit rate calculation would be:
SSInClk = SysClk / (CPSDVSR * (1 + SCR))
1x10
6
= 20x10
6
/ (CPSDVSR * (1 + SCR))
In this case, if
CPSDVSR
=0x2,
SCR
must be 0x9.
The configuration sequence would be as follows:
1.
Ensure that the
SSE
bit in the
SSICR1
register is clear.
2.
Write the
SSICR1
register with a value of 0x0000.0000.
3.
Write the
SSICPSR
register with a value of 0x0000.0002.
4.
Write the
SSICR0
register with a value of 0x0000.09C7.
5.
The QSSI is then enabled by setting the
SSE
bit in the
SSICR1
register.
17.4.1
Enhanced Mode Configuration
If the QSSI module supports the Advanced/Bi-/Quad features, then these modes can be enabled
after initializing the QSSI module. Below is an example of configuring the QSSI to transmit two data
bytes in Advanced SSI mode followed by 2 bytes in Bi-SSI mode:
1.
Set the
MODE
bit to 0x3, and the
FSSHLDFM
bit to 1 in the
SSICR1
register. To operate in the
master mode, program the MS bit to 0. Program the remaining bits in the
SSICR0
and
SSICR1
register to relevant values.
2.
Write one data byte to the TX FIFO; set the
EOM
bit to 1 and write the second data byte to the
Tx FIFO.
June 18, 2014
1242
Texas Instruments-Production Data
Quad Synchronous Serial Interface (QSSI)