01.08.2013 Views

Chapter 24 Multichannel Serial Port Interface (McSPI).

Chapter 24 Multichannel Serial Port Interface (McSPI).

Chapter 24 Multichannel Serial Port Interface (McSPI).

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.ti.com Functional Description<br />

<strong>24</strong>.3.2.10 FIFO Buffer Management (Optional USEFIFO = 1)<br />

The <strong>McSPI</strong> controller has a built-in FFNBYTE bytes buffer in order to unload DMA or interrupt handler and<br />

improve data throughput. The use of this buffer is optional and depends on a generic parameter<br />

USEFIFO. The FIFO is enabled when it is set to 1. Allowed FIFO depth up to 64 bytes is supported and is<br />

defined by generic parameter FFNBYTE. When the FIFO is not enabled, writes to registers<br />

MCSPI_XFERLEVEL, MCSPI_CH(I)CONF[FFER] and MCSPI_CH(I)CONF[FFEW] have no functional<br />

effect, nevertheless read back is allowed to check written value.<br />

This buffer can be used by only one channel and is selected by setting MCSPI_CH(I)CONF[FFER] and/or<br />

MCSPI_CH(I)CONF[FFEW] to 1.<br />

If several channels are selected and several FIFO enable bit fields set to 1, the controller forces the buffer<br />

to be disabled for all channels. It is the responsibility of the driver to enable the buffer for only one<br />

channel.<br />

The buffer can be used in the modes defined below:<br />

• Master or Slave mode.<br />

• Transmit only, Receive only or Transmit/Receive mode.<br />

• Single channel or turbo mode, or in normal round robin mode. In round robin mode the buffer is used<br />

by only one channel.<br />

• All word length MCSPI_CH(I)CONF[WL] are supported.<br />

Two levels AEL and AFL located in MCSPI_XFERLEVEL register rule the buffer management. The<br />

granularity of these levels is one byte, then it is not aligned with SPI word length. It is the responsibility of<br />

the driver to set these values as a multiple of SPI word length defined in MCSPI_CH(I)CONF[WL]. The<br />

number of byte written in the FIFO depends on word length (see Table <strong>24</strong>-9).<br />

Table <strong>24</strong>-9. FIFO Writes, Word Length Relationship<br />

SPI Word Length WL<br />

3 ≤ WL ≤ 7 8 ≤ WL ≤ 15 16 ≤ WL ≤ 31<br />

Number of byte written in the FIFO 1 byte 2 bytes 4 byte<br />

<strong>24</strong>.3.2.10.1 Split FIFO<br />

The FIFO can be split into two part when module is configured in transmit/receive mode<br />

MCSPI_CH(I)CONF[TRM] is cleared to 0 and MCSPI_CH(I)CONF[FFER] and MCSPI_CH(I)CONF[FFEW]<br />

asserted. Then system can access a FFNBYTE/2 byte depth FIFO per direction.<br />

The FIFO buffer pointers are reset when the corresponding channel is enabled or FIFO configuration<br />

changes.<br />

SPRUH73E–October 2011–Revised May 2012 <strong>Multichannel</strong> <strong>Serial</strong> <strong>Port</strong> <strong>Interface</strong> (<strong>McSPI</strong>)<br />

Submit Documentation Feedback<br />

Copyright © 2011–2012, Texas Instruments Incorporated<br />

4141

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!