Texas Instruments CC2650DK Benutzerhandbuch

Seite von 1570
Initialization and Configuration
20.6 Initialization and Configuration
To enable and initialize the SSI, perform the following steps:
1. Ensure the corresponding power domain is powered up properly. For details, refer to
,
PRCM.
2. Enable the appropriate SSI module in PRCM by writing to the [PRCM:SSICLKGR],
[PRCM:SSICLKGS], and [PRCM:SSICLKGDS] registers, or by using the driverlib functions:
PRCMPeripheralRunEnable(uint32_t)
PRCMPeripheralSleepEnable(uint32_t)
PRCMPeripheralDeepSleepEnable(uint32_t)
and then loading the setting to clock controller by writing to PRCM:CLKLOADCTL
or by using the driverlib function.
PRCMLoadSet().
3. Configure the IOC module to route the SSIn_RX, SSIn_TX, SSIn_FSS, and SSIn_CLK functionalities
from I/Os to the SSI module. IOCFGxx.PORTID should be written to the correct PORTIDs.
For each of the frame formats, the SSI is configured using the following steps:
1. Ensure that the SSE bit in the [SSI_CR1] register is clear before making any configuration changes.
2. Select whether the SSI is a master or slave:
(a) For master operations, set the [SSI_CR1] register to 0x0000 0000.
(b) For slave mode (output enabled), set the [SSI_CR1] register to 0x0000 0004.
(c) For slave mode (output disabled), set the [SSI_CR1] register to 0x0000 000C.
3. Configure the SSI clock source by writing to the [SSI_CC] register.
4. Configure the clock prescale divisor by writing to the [SSI_CPSR] register.
5. Write the [SSI_CR0] register with the following configuration:
Serial clock rate (SCR)
Desired clock phase and polarity, if using Motorola SPI mode (SPH and SPO)
The protocol mode: Motorola SPI, TI SSF, MICROWIRE (FRF)
The data size (DSS)
6. Optionally, configure the
μDMA channel (see
µDMA) and enable the DMA options in the
[SSI_DMACR] register.
7. Enable the SSI by setting the SSE bit in the [SSI_CR1] register.
As an example, assume that the SSI configuration is required to operate with the following parameters:
Master operation
Texas Instruments SSI mode
1 Mbps bit rate
8 data bits
1365
SWCU117A – February 2015 – Revised March 2015
Synchronous Serial Interface (SSI)
Copyright © 2015, Texas Instruments Incorporated