Programming Examples
10-50
ADSP-BF537 Blackfin Processor Hardware Reference
SPI Initialization Sequence
Before the SPI can transfer data, the registers must be configured as
follows.
Listing 10-6. SPI 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 */
P1.H = hi(SPI_BAUD);
P1.L = lo(SPI_BAUD);
R0.L = 0x208E; /* Write to SPI baud rate register */
W[P0] = R0.L; ssync; /* If SCLK = 133MHz, SPI clock ~= 8kHz */
/* Setup SPI Control Register */
/***************************************************
* TIMOD [1:0] = 11 : Transfer on DMA TDBR write
* SZ [2] = 0 : Send last word when TDBR0 is empty
* GM [3] = 1 : Discard incoming data if RDBR0 is full
* PSSE [4] = 0 : Disables slave-select as input (master)
* EMISO [5] = 0 : MISO disabled for output (master)
* [7] and [6] = 0 : RESERVED
* SIZE [8] = 1 : 16 Bit word length select
* LSBF [9] = 0 : Transmit MSB first
* CPHA [10] = 0 : SCLK starts toggling at START of first data
bit
* CPOL [11] = 1 : Active HIGH serial clock
* MSTR [12] = 1 : Device is master
* WOM [13] = 0 : Normal MOSI/MISO data output (no open drain)
*
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...