R8C/36T-A Group
21. Clock Synchronous Serial Interface
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0240EJ0010 Rev.0.10
Page 480 of 728
Aug 05, 2011
21.3.2.3
Data Reception
as described below. (The data transfer length can be set from 8 to 16 bits using the SSBR register.)
When the MCU is set as the master device, it outputs a synchronous clock and inputs data. When the MCU is
set as a slave device, it inputs data synchronized with the input clock.
When the MCU is set as the master device, it outputs a receive clock and reception is started by performing a
dummy read of the SIRDR register.
After 8 bits of data are received, the RDRF bit in the SISR register is set to 1 (data present in the SIRDR
register) and receive data is stored in the SIRDR register. If the RIE bit in the SIER register is 1 (RXI and OEI
interrupt requests enabled) at this time, an RXI interrupt request is generated. When the SIRDR register is read,
the RDRF bit is automatically set to 0 (no data in the SIRDR register).
When the MCU is set as the master device and reception completes, set the RCVD bit in the SICR1 register to 1
(receive operation is completed after 1 byte of data is received) before reading the [last frame - 1] of the receive
data. With this setting, the synchronous serial communication unit outputs a receive clock for the [last frame]
and then stops. After that, set the RE_STIE bit in the SIER register to 0 (reception disabled) and the RCVD bit
to 0 (receive operation continues after the 1 byte of data is received), and then read the last received data from
the SIRDR register. If the SIRDR register is read while the RE_STIE bit is 1 (reception enabled), the receive
clock is output again.
When the 8th clock rises while the RDRF bit is 1, the ORER_AL bit in the SISR register is set to 1 (overrun
error: OEI) and the operation is stopped. While the ORER_AL bit is 1, reception cannot be performed. Confirm
that the ORER_AL bit is 0 before restarting reception. If an overrun error occurs, the data received in the frame
where the error has occurred is discarded.
Figure 21.9
Operation Example during Data Reception (Clock Synchronous Communication
Mode, 8-Bit SSU Data Transfer Length)
SSCK
b0
SSI
MS = 0 (clock synchronous communication mode), CPHS = 0 (data download at even edge),
CPOS_WAIT = 0 (high when clock stops), MLS = 1 (LSB-first transfer), and BS3 to BS0 = 1000b (8 bits)
b0
b7
One frame
RDRF bit in
SISR register
RCVD bit in
SICR1 register
Dummy read
SIRDR register
Program
processing
RXI interrupt request generated
b0
b7
One frame
RXI interrupt request generated
Read data from
SIRDR register
Read data from
SIRDR register
Set RCVD bit to 1
BS0 to BS3: Bits in SSBR register
CPHS, CPOS_WAIT, MLS: Bits in SIMR1 register
MS: Bit in SIMR2 register
Clock stops
1
81
8
RXI interrupt
request
generated
Last frame