Chapter 13
Serial Interface 2
Operation XIII - 23
13.3.3 Setup Example
■ Transmission/Reception Setup Example
Here is the setup example for transmission/reception of clock synchronous communication with serial interface 2.
Table: 13.3.7 shows the conditions for transmission/reception.
Table:13.3.7 Conditions of Synchronous Serial Interface Transmission/Reception
Setting item Description
SBI2/SBO2 pin setting Independent (3 channels)
Transfer bit count 8 bits
Start condition Without start condition
First transfer bit MSB
Input edge Rising
Output edge Falling
Clock Clock master
Clock source IOCLK/2
1/16 dividing of clock source No 16 dividing
SBT2 pin pull-up resistor Added
Serial interface 2 communication complete interrupt Enabled
SBO2 output after last data output Fixed to "1"(H)
Setup Procedure Description
(1) Select the prescaler operation
SC2CTR3(0x0000A125)
bp3: SC2PSCE=1
(1) Set the SC2PSCE flag of the SC2CTR3 register to “1” to
select the prescaler operation.
(2) Select the clock source
SC2CTR3(0x0000A125)
bp2-0: SC2PSC2-0=100
(2) Set the SC2PSC2-0 flags of the SC2CTR3 register to
“100” to select IOCLK/2 to the clock source.
(3) SBO2 output control after last data output
SC2CTR3(0x0000A125)
bp7-6: SC2FDC1-0=00
(3) Set the SC2FDC1-0 flags of the SC2CTR3 register to
“00” to select the “Fixed to “1” (High)” after the SBO
last data output.
(4) Control the pin style
P2PLU(0x0000A042)
bp0: P20R=1
(4) Set the P20R flag of the P2PLU register and the P20R
flag of the P2PLU register to “1” to select the pull-up
resistor enabled.
(5) Control the pin direction
P1DIR(0x0000A021)
bp7: P17D=1
P2DIR(0x0000A022)
bp1-0: P21D-P20D=01
(5) Set the P17D flag of the P1DIR register to “1” to set P17
(SBO2 pin) to the output pin. Set the P21D flag of the
P2DIR register to “1” to set P21 (SBI2 pin) to the input
pin, and set the P21D flag to “0” to set P20 (SBT2 pin)
to the output pin,