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 register (SPIn.DATA) before
the entire transfer has completed. A premature write will cause
corruption of the transmitted data, and the hardware will set the
Write Collision Flag (WRCOL flag in SPIn.INTFLAGS).
- 2.Received bytes
are written to the First Receive Buffer register immediately
after the transmission is completed.
- 3.The First Receive
Buffer register has to be read before the next transmission is
completed or data will be lost. This register is read by reading
SPIn.DATA.
- 4.The Transmit
Buffer register and Second Receive Buffer register are not used
in Normal mode.
After a transfer has completed, the Interrupt Flag will be set in the
Interrupt Flags register (IF flag in SPI.INTFLAGS). 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 register (SPIn.INTCTRL) will enable
the interrupt.