Specifications

SPI Control Registers
9-22
one interrupt sequence each time this bit is set if the OVERRUN_INT_ENA bit
(SPICTL.4) is set high. The bit is cleared in one of three ways:
- Writing a 1 to this bit
- Writing a 0 to SPI_SW_RESET (SPICCR.7)
- Resetting the system
If the OVERRUN_INT_ENA bit (SPICTL.4) is set, the SPI requests only one
interrupt upon the first occurance of setting the RECEIVER_OVERRUN flag
bit. Subsequent overruns will not request additional interrupts if this flag bit is
already set. This means that in order to allow
new
overrun interrupt requests
the user must clear this flag bit by writing a 1 to SPISTS.7 each time an overrun
condition occurs. In other words, if the RECEIVER_OVERRUN flag bit is left
set (not cleared) by the interrupt service routine, another overrun interrupt will
not be immediately re-entered when the interrupt service routine is exited.
However, the RECEIVER_OVERRUN flag bit should be cleared during the in-
terrupt service routine because the RECEIVER_OVERRUN flag bit and
SPI_INT_FLAG bit share the same interrupt vector. This will alleviate any pos-
sible doubt as to the source of the interrupt when the next byte is received.
Bit 6 SPI_INT_FLAG. SPI Interrupt Flag. SPI_INT_FLAG is a read-only flag. The
SPI hardware sets this bit to indicate that it has completed sending or receiving
the last bit and is ready to be serviced. The received character is placed in the
receiver buffer at the same time this bit is set. This flag causes an interrupt to be
requested if the SPI INT ENA bit (SPICTL.0) is set. This bit is cleared in one of
three ways:
- Reading SPIRXBUF
- Writing a 1 to SPI SW RESET (SPICCR)
- Resetting the system
Bit 5 TX_BUF_FULL_FLAG. SPI Transmit Buffer full flag. This read only bit gets
set to 1 when a character is written to the SPI Transmit buffer SPITXBUF. It is
cleared when the character is automatically loaded into SPIDAT when the
shifting out of a previous character is complete. It is cleared at reset.
Bits 4–0 Reserved. Reads return zero; writes have no effect.