SPRUJF2A March 2026 – March 2026 AM13E23019
The control bit CTL1.MSB defines the direction of the data input and output with the most-significant-bit (MSB) or least-significant-bit (LSB) first. If the parity is enabled, the parity bit is always received last.
The CTL0.DSS control register bits determine the bit length per transfer. This can be configured to be between 4-16 bits for UNICOMM-SPI Controller mode and 7-16 bits for UNICOMM-SPI Peripheral mode.
A transfer is triggered by writing to the TXDATA register. The data write must have at least the number of bits of the transfer. For example, if only a byte is written to TXDATA, but the length of the transfer is > 8, the missing bits are filled with 0s. On the receive path, the received data is moved to the RX FIFO after the number of bits defined by the CTL0.DSS register have been received.
The RXDATA and TXDATA registers must be accessed with at least the bits covering one transfer.The clock polarity register field (CTL0.SPO) controls the clock polarity of SPICLK when data is not being transferred and is only valid in the Motorola SPI frame mode.
The UNICOMM-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 available for the peripheral on the CLK pins which needs to be configured for input. The Clock Select and divider control bits are not used. The CS input signal is used to select/enable the data receive path of the peripheral in 4 wire mode.
The SPI can be configured to work as Controller with CTL1.CP bit = 1. In controller mode, the SPICLK signal needs to be generated by selecting the available clock sources with the clock select bits. The SPI controller also needs to control the CS signal depending on the selected protocol.
Parity checking is a feature in UNICOMM-SPI used to improve the robustness of the communication. The parity transmit enable (CTL1.PTEN) and parity receive enable (CTL1.PREN) register bits add a parity bit to the UNICOMM-SPI transmission or reception respectively.When the CTL1.PTEN bit is set, each data transfer includes an additional parity bit calculated by the previously transmitted data bits. If CTL1.PTEN is cleared, there is no additional bit added to the transmission. When the CTL1.PREN bit is set, the last received bit is used as parity to evaluate the integrity of the previous bits that were received. The CTL1.PES bit selects whether the parity mode is even or odd for both transmit and receive parity operations. When a parity error is detected on a received character, the interrupt flag RIS.PER is set to mark the data as invalid.