
V PeRiPheRaL MoDuLes 3 (inteRFaCe): seRiaL PeRiPheRaL inteRFaCe (sPi)
V-3-10
ePson
s1C33L17 teChniCaL ManuaL
V.3.6 sPi interrupts and DMa
The SPI module can generate the following three types of interrupts:
Transmit DMA interrupt (transmit data empty)
Receive DMA interrupt (receive data full)
SPI interrupt (transmit data empty, receive data full, receive data overflow)
transmit DMa interrupt
A cause of interrupt occurs when the transmit data set in the SPI Transmit Data Register (0x301704) is trans-
ferred to the shift register. When TXDE (D3/0x301708) has been set to 1, the interrupt request signal is output
to the ITC and it sets the cause-of-interrupt flag FSPITX (D5/0x300289) in the ITC to 1.
tXDe: Transmit DMA Enable Bit in the SPI Control Register 1 (D3/0x301708)
At this time, if the interrupt conditions set using the interrupt control register are met, an interrupt to the CPU is
generated. Occurrence of this cause of interrupt indicates that the next transmit data can be written to the trans-
mit data register. This cause of interrupt can also be used to invoke DMA, enabling transmit data to be written
to the register by means of a DMA transfer.
Receive DMa interrupt
A cause of interrupt occurs when the data received in the shift register is loaded into the SPI Receive Data Reg-
ister (0x301700). When RXDE (D2/0x301708) has been set to 1, the interrupt request signal is output to the
ITC and it sets the cause-of-interrupt flag FSPIRX (D4/0x300289) in the ITC to 1.
RXDe: Receive DMA Enable Bit in the SPI Control Register 1 (D2/0x301708)
At this time, if the interrupt conditions set using the interrupt control register are met, an interrupt to the CPU
is generated. Occurrence of this cause of interrupt indicates that the received data can be read out. This cause of
interrupt can also be used to invoke DMA, enabling the received data to be written into specified memory loca-
tions by means of a DMA transfer.
sPi interrupt
In addition to the two interrupt request signals shown above, the SPI module outputs one more interrupt re-
quest signal. This interrupt request circuit is configured as Figure V.3.6.1 and it allows selection of one or more
causes of interrupt.
Interrupt request (INT_SPI)
IRQE (D0/0x301718)
TEIE (D4/0x301718)
Transmit data empty (TDEF)
ROIE (D3/0x301718)
Receive data overflow (RDOF)
RFIE (D2/0x301718)
Receive data full (RDFF)
MIRQ (D1/0x301718)
Figure V.3.6.1 SPI Interrupt Request Circuit
To output the SPI interrupt requests, enable interrupts of the causes described below and set IRQE (D0/0x301718)
to 1. When IRQE (D0/0x301718) is set to 0, no SPI interrupt request is output.
iRQe: Interrupt Request Enable Bit in the SPI Interrupt Control Register (D0/0x301718)