ADSP-BF50x Blackfin Processor Hardware Reference
18-47
SPI-Compatible Port Controller
Listing 18-2. Initiate Transfer
Initiate_Transfer:
P0.H = hi(SPI_FLG);
P0.L = lo(SPI_FLG);
R0 = W[P0] (Z);
BITCLR (R0,0xF);
/* FLG7 */
W[P0] = R0;
/* Drive 0 on enabled slave-select pin */
P0.H = hi(SPI_TDBR);
/* SPI Transmit Register */
P0.L = lo(SPI_TDBR);
R0 = W[P1++] (z);
/* Get First Data To Be Transmitted
And Increment Pointer */
W[P0] = R0;
/* Write to SPI_TDBR */
P0.H = hi(SPI_RDBR);
P0.L = lo(SPI_RDBR);
R0 = W[P0] (z); /* Dummy read of SPI_RDBR kicks off transfer */
Post Transfer and Next Transfer
Following the transfer of data, the SPI generates an interrupt, which is ser-
viced if the interrupt is enabled during initialization. In the interrupt
routine, software must write the next value to be transmitted prior to
reading the byte received. This is because a read of the
SPI_RDBR
initiates
the next transfer.
Listing 18-3. SPI Interrupt Handler
SPI_Interrupt_Handler:
Process_SPI_Sample:
P0.H = hi(SPI_TDBR);
/* SPI transmit register */
P0.L = lo(SPI_TDBR);
R0 = W[P1++](z);
/* Get next data to be transmitted */
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 ...