
V PeRiPheRaL MoDuLes 3 (inteRFaCe): seRiaL PeRiPheRaL inteRFaCe (sPi)
s1C33L17 teChniCaL ManuaL
ePson
V-3-11
V
SPI
transmit data empty
A cause of interrupt occurs when the transmit data set in the SPI Transmit Data Register (0x301704) is trans-
ferred to the shift register, in which case TDEF (D4/0x301714) is set to 1. Set TEIE (D4/0x301718) to 1 to out-
put an interrupt request by this cause of interrupt.
tDeF: Transmit Data Empty Flag in the SPI Status Register (D4/0x301714)
teie: Transmit Data Empty Interrupt Enable Bit in the SPI Interrupt Control Register (D4/0x301718)
This interrupt request occurs by the same cause of interrupt as the transmit DMA interrupt.
Receive data full
A cause of interrupt occurs when the data received in the shift register is loaded into the SPI Receive Data Reg-
ister (0x301700), in which case RDFF (D2/0x301714) is set to 1. Set RFIE (D2/0x301718) to 1 to output an
interrupt request by this cause of interrupt.
RDFF: Receive Data Full Flag in the SPI Status Register (D2/0x301714)
RFie: Receive Data Full Interrupt Enable Bit in the SPI Interrupt Control Register (D2/0x301718)
This interrupt request occurs by the same cause of interrupt as the receive DMA interrupt.
Receive data overflow
A cause of interrupt occurs when receive data is loaded into the SPI Receive Data Register (0x301700) before
the previous data in the register is read out, in which case RDOF (D3/0x301714) is set to 1. Set ROIE (D3/
0x301718) to 1 to output an interrupt request by this cause of interrupt.
RDoF: Receive Data Overflow Flag in the SPI Status Register (D3/0x301714)
Roie: Receive Data Overflow Interrupt Enable Bit in the SPI Interrupt Control Register (D3/0x301718)
Manual interrupt request
An SPI interrupt request can be output manually by setting MIRQ (D1/0x301718) to 1. After an interrupt oc-
curs by this operation, write 0 to MIRQ (D1/0x301718) to negate the SPI interrupt request signal.
MiRQ: Manual IRQ Set/Clear Bit in the SPI Interrupt Control Register (D1/0x301718)
The SPI interrupt request is sent to the ITC as the port 8 input interrupt (FPT8) signal and it sets the cause-of-
interrupt flag FP8 (D0/0x3002A9) in the ITC to 1. However, INT_SPI must be selected for the port 8 input in-
terrupt.
Control registers of the interrupt controller
Table V.3.6.1 shows the interrupt controller's control registers provided for each interrupt source.
Table V.3.6.1 Control Register of Interrupt Controller
interrupt
Transmit DMA interrupt
Receive DMA interrupt
SPI interrupt
Cause-of-interrupt flag
FSPITX(D5/0x300289)
FSPIRX(D4/0x300289)
FP8(D0/0x3002A9)
interrupt priority register
PSPI[2:0](D[6:4]/0x30026E)
PP8L[2:0](D[2:0]/0x3002A0)
interrupt enable register
ESPITX(D5/0x300279)
ESPIRX(D4/0x300279)
EP8(D0/0x3002A6)
When a cause of interrupt described above occurs, the corresponding cause-of-interrupt flag is set to 1. If the
interrupt enable register bit for that cause of interrupt has been set to 1, an interrupt request is generated.
Interrupts can be disabled by leaving the interrupt enable register bit for that cause of interrupt set to 0. The
cause-of-interrupt flag is set to 1 whenever interrupt conditions are met, regardless of the setting of the interrupt
enable register (even if it is set to 0).
The interrupt priority register sets the interrupt priority level of each interrupt source in a range between 0 and
7. An interrupt request to the CPU is accepted only when no other interrupt request of a higher priority has been
generated. In addition, only when the PSR's IE bit = 1 (interrupts enabled) and the set value of the IL is smaller
than the input interrupt level set by the interrupt priority register, will the input interrupt request actually be ac-
cepted by the CPU.
For details on these interrupt control registers, as well as the device operation when an interrupt has occurred,
refer to Section III.2, “Interrupt Controller (ITC).”