Table 16-1. SPIxC1 Field Descriptions (continued)

 

 

 

Field

 

Description

 

 

5

SPI Transmit Interrupt Enable. This is the interrupt enable bit for SPI transmit buffer empty (SPTEF).

SPTIE

0

Interrupts from SPTEF inhibited (use polling)

 

1

When SPTEF is 1, hardware interrupt requested

 

 

4

Master/Slave Mode Select

MSTR

0

SPI module configured as a slave SPI device

 

1

SPI module configured as a master SPI device

 

 

3

Clock Polarity. This bit effectively places an inverter in series with the clock signal from a master SPI or to a slave

CPOL

SPI device. Refer to Section 16.5.1, “SPI Clock Formatsfor more details.

 

0

Active-high SPI clock (idles low)

 

1

Active-low SPI clock (idles high)

 

 

2

Clock Phase. This bit selects one of two clock formats for different synchronous serial peripheral devices. Refer

CPHA

to Section 16.5.1, “SPI Clock Formatsfor more details.

 

0

First edge on SPSCK occurs at the middle of the first cycle of an 8-cycle data transfer

 

1

First edge on SPSCK occurs at the start of the first cycle of an 8-cycle data transfer

 

 

1

Slave Select Output Enable. This bit is used with the mode fault enable (SPIxC2[MODFEN]) bit and the

SSOE

master/slave (MSTR) control bit to determine the function of the SS pin as shown in Table 16-2.

 

 

0

lsb First (Shifter Direction)

LSBFE

0

SPI serial data transfers start with most significant bit

 

1

SPI serial data transfers start with least significant bit

 

 

 

Table 16-2. SS Pin Function

MODFEN

SSOE

 

 

Master Mode

Slave Mode

 

 

 

 

0

0

General-purpose I/O (not SPI)

Slave select input

 

 

 

 

0

1

General-purpose I/O (not SPI)

Slave select input

 

 

 

 

 

 

1

0

 

 

input for mode fault

Slave select input

 

SS

 

 

 

 

 

 

 

1

1

 

Automatic

 

output

Slave select input

 

SS

 

 

 

 

 

 

 

 

NOTE

Ensure that the SPI should not be disabled (SPE = 0) at the same time as a bit change to SPIxC1[CPHA]. These changes should be performed as separate operations or unexpected behavior may occur.

16.4.2SPI Control Register 2 (SPIxC2)

This read/write register controls optional features of the SPI system. Bits 7, 6, 5, and 2 are reserved and always read 0.

MCF51QE128 MCU Series Reference Manual, Rev. 3

322

Freescale Semiconductor

Get the latest version from freescale.com

Page 322
Image 322
Freescale Semiconductor MCF51QE128RM SPI Control Register 2 SPIxC2, SS Pin Function, Modfen Ssoe, Master Mode Slave Mode