Spi Slave - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

Table 39-7. SPI Master (CPHA=1) Configuration (continued)
Register
TIMCFGn
TIMCTLn
TIMCMP(n+1)
TIMCFG(n+1)
TIMCTL(n+1)
SHIFTBUFn
SHIFTBUF(n+1)

39.5.4 SPI Slave

SPI slave mode can be supported using one Timer, two Shifters and four Pins. Either
CPHA=0 or CPHA=1 can be supported and transfers can be supported using the DMA
controller. For CPHA=1, the select can remain asserted for multiple transfers and the
timer status flag can be used to indicate the end of the transfer.
The transmit data must be written to the transmit buffer register before the external slave
select asserts, otherwise the shifter error flag will be set.
Due to synchronization delays, the output valid time for the serial output data is 2.5
FlexIO clock cycles, so the maximum baud rate is divide by 6 of the FlexIO clock
frequency.
Freescale Semiconductor, Inc.
0x0100_2222
0x01C3_0201
0x0000_FFFF
0x0000_1100
0x0003_0383
Data to transmit
Data to receive
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Value
Set TIMCMP[7:0] = (baud rate divider /
Configure start bit, stop bit, enable on
trigger high and disable on compare,
initial clock state is logic 0. Set PINPOL
TIMDIS=3 to keep slave select asserted
Configure dual 8-bit counter using Pin 2
output (shift clock), with Shifter 0 flag as
Enable when Timer 0 is enabled and
compare) using inverted Pin 3 output (as
SHIFTBUF, use the Shifter Status Flag
to indicate when data can be written
using interrupt or DMA request. Can
support MSB first transfer by writing to
SHIFTBUFBYS, use the Shifter Status
Flag to indicate when data can be read
using interrupt or DMA request. Can
support MSB first transfer by reading
from SHIFTBUFBIS register instead.
Chapter 39 FlexIO
Comments
2) - 1.
to invert the output shift clock. Set
for as long as there is data in the
transmit buffer.
the inverted trigger.
Never compare.
disable when Timer 0 is disabled.
Configure 16-bit counter (never
slave select).
Transmit data can be written to
SHIFTBUFBBS register instead.
Received data can be read from
777

Advertisement

Table of Contents
loading

Table of Contents