ADSP-BF50x Blackfin Processor Hardware Reference
18-45
SPI-Compatible Port Controller
Programming Examples
This section includes examples (
Listing 18-1
through
Listing 18-8
) for
both core-generated and DMA-based transfers. Each code example
assumes that the appropriate processor header files are included.
Core-Generated Transfer
The following core-driven master-mode SPI example shows how to initial-
ize the hardware, signal the start of a transfer, handle the interrupt and
issue the next transfer, and generate a stop condition.
Initialization Sequence
Before the SPI can transfer data, the registers must be configured as
follows.
Listing 18-1. SPI Register Initialization
SPI_Register_Initialization:
P0.H = hi(SPI_FLG);
P0.L = lo(SPI_FLG);
R0 = W[P0] (Z);
BITSET (R0,0x7);
/* FLS7 */
W[P0] = R0;
/* Enable slave-select output pin */
P0.H = hi(SPI_BAUD);
P0.L = lo(SPI_BAUD);
R0.L = 0x208E;
/* Write to SPI Baud rate register */
W[P0] = R0.L; ssync;
/* If SCLK = 133 MHz, SPI clock ~= 8 kHz
*/
/* Setup SPI Control Register */
/*************************************************
Summary of Contents for EZ-KIT Lite ADSP-BF506F
Page 50: ...Contents l ADSP BF50x Blackfin Processor Hardware Reference ...
Page 92: ...Development Tools 1 30 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 110: ...Interface Overview 3 12 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 236: ...Internal Flash Memory Control Registers 6 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 650: ...Programming Examples 15 56 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 804: ...Programming Examples 17 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1194: ...Programming Examples 24 90 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1256: ...ACM Registers A 50 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1264: ...Boundary Scan Architecture B 8 ADSP BF50x Blackfin Processor Hardware Reference ...