SLAU847F October 2022 – March 2026 MSPM0L1105 , MSPM0L1106 , MSPM0L1116 , MSPM0L1117 , MSPM0L1227 , MSPM0L1227-Q1 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346 , MSPM0L2116 , MSPM0L2117 , MSPM0L2227 , MSPM0L2227-Q1 , MSPM0L2228 , MSPM0L2228-Q1
The control bit CTL1.CP B defines the direction of data input and output using the most-significant bit (MSB) or the least-significant bit (LSB) first. If the parity is enabled, the parity bits are always received as the last bit.
With the control register bits CTL0.DSS, the bit length per transfer will be defined between 4 and 16 bits in Controller mode and 7 and 16 bits in Peripheral mode.
A transfer will be triggered by writing to the TX buffer register. The data write needs to have at least the number of bits of the transfer. For example, if only a byte is written to the TX buffer, but the length of the transfer is > 8, the missing bits will be filled with 0s. On the receive path, received data will be moved to the RX FIFO or the RX buffer after the number of bits defined in the CTL0.DSS register has been received.
The RX and TX buffers shall be accessed with at least the bits covering one transfer.
Clock polarity (CTL0.SPO) is used to control the clock polarity when data is not being transferred, and it is only used in the Motorola SPI frame mode.
The Clock phase (CTL0.SPH) bit selects the clock edge that captures data and determines whether the data can change state. It has the greatest impact on the first bit transmitted, either by allowing or disallowing a clock transition before the first data capture edge. Please refer to the Motorola SPI frame mode section to check the diagram.
The SPI can be configured to work in Peripheral mode with CTL1.CP bit = 0. In Peripheral mode, the clock is provided by the controller and is available to the peripheral on the CLK pins, which must be configured as inputs. The Clock Select and divider control bits are not used. The CS input signal selects and enables the peripheral's data receive path in 4-wire mode.
The SPI can be configured to work as a Controller with CTL1.CP bit = 1. In Controller mode, the clock needs to be generated by selecting an available clock source using the clock select bits. It also needs to control the CS signal depending on the selected protocol.When setting the CTL1.PEN bit, the last bit will be used as parity to evaluate the integrity of the previous bits—the CTL1.PES bit selects the parity mode as even or odd. When detecting a fault, the interrupt flag RIS.PER is set to mark the data as invalid. Parity checking is a feature that improves the robustness of communication.