Public Version
www.ti.com
McSPI Basic Programming Model
The end of the transfer (dotted line in
) is more complex and depends on the transfer type.
describes the different types of end-of-transfer and the transfer types to which they are
applicable.
Table 20-17. End-of-Transfer Types
Word Count
Transmit/Receive
Transmit Only
Receive Only
Yes
See
See
See
,
Transmit-Receive With Word
Transmit-Only.
Receive-Only With Word
Count.
Count.
No
See
See
See
,
Transmit-Receive Without
Transmit-Only.
Receive-Only Without Word
Word Count.
Count.
The sequence differs depending on whether word count is used (MCSPI_XFERLEVEL: WCNT is set or
not). The AEL and/or AFL values can be different, but they must be multiples of the word size in the FIFO:
1, 2, or 4 bytes, according to word length.
In these sequences, the transfer to execute has a size of N words.
When accessing the FIFO, only one word is written or read for each OCP access.
In these sequences, the number of words written or read for each write or read FIFO request is:
•
write_request_size
•
read_request_size
If they are not submultiples of N, the last request sizes are:
•
last_write_request_size (< write_request_size)
•
ast_read_request_size. (< read_request_size)
The different sequences can be merged in one process to manage transfers of several types.
The end-of-transfer sequences are described from the start of the channel.
In these sequences, some soft variables are used:
•
write_count = N
•
read_count = N
•
last_request = FALSE
They are initialized before starting the channel.
20.6.3.2 Transmit-Receive Procedure With Word Count (WCNT
≠
0)
shows the flow of a transfer in transmit-receive mode, with word count.
3027
SWPU177N – December 2009 – Revised November 2010
Multichannel SPI
Copyright © 2009–2010, Texas Instruments Incorporated