In Normal mode, the system is single-buffered in the transmit direction and double-buffered
in the receive direction. This influences the data handling in the following ways:
- 1.New bytes to be sent cannot be
written to the DATA (SPIn.DATA) register before the entire transfer has been
completed. A premature write will cause corruption of the transmitted data, and the
Write Collision (WRCOL) flag in SPIn.INTFLAGS will be set.
- 2.Received bytes are written to the
Receive Data Buffer register immediately after the transmission is completed.
- 3.The Receive Data Buffer register has
to be read before the next transmission is completed, or the data will be lost. This
register is read by reading SPIn.DATA.
- 4.The Transmit Data Buffer and Receive
Data Buffer registers are not used in Normal mode.
After a transfer has been completed, the Interrupt Flag (IF) will be set in the Interrupt
Flags (SPIn.INTFLAGS) register. This will cause the corresponding interrupt to be executed
if this interrupt and the global interrupts are enabled. Setting the Interrupt Enable (IE)
bit in the Interrupt Control (SPIn.INTCTRL) register will enable the interrupt.