Chapter 13Serial Interface 2XIII - 24 OperationNote: Each in (1) to (3), (7), and (8) can be set at the same time.(6) Set the pin functionP1MD(0x0000A031)bp7: P17M=1P2MD(0x0000A032)bp0: P20M=1(6) Set the P17M flag of the P1MD register to “1” to set theSBO2 pin function, the P20M flag of the P2MD registerto “1” to set the SBT2 pin function.(7) Set the SC2CTR0 registerSet the transfer bit countSC2CTR0(0x0000A120)bp2-0: SC2LNG2-0=111Select the start conditionSC2CTR0(0x0000A120)bp3: SC2STE=0Select the first transfer bitSC2CTR0(0x0000A120)bp4: SC2DIR=0Select the transfer edgeSC2CTR0(0x0000A120)bp7: SC2CE1=0(7) Set the SC2LNG2-0 flag of the SC2CTR0 register to“111” to set the transfer bit count to 8 bits.Set the SC2STE flag of the SC2CTR0 register to “0”and select “Without start condition”.Set the SC2DIR flag of the SC2CTR0 register to “0” toset the first transfer bit to MSB.Set the SC2CE1 flag of the SC2CTR0 register to “0” toset the transmission data output edge to “falling” andthe reception data input edge to “rising”.(8) Set the SC2CTR1 registerSelect the communication styleSC2CTR1(0x0000A121)bp0: SC2CMD=0Select the transfer clockSC2CTR1(0x0000A121)bp2: SC2MST=1bp3: SC2CKM=0Control the pin functionSC2CTR1(0x0000A121)bp4: SC2SBOS=1bp5: SC2SBIS=1bp6: SC2SBTS=1bp7: SC2IOM=0(8) Set the SC2CMD flag of the SC2CTR1 register to “0”and select the synchronous serial.Set the SC2MST flag of the SC2CTR1 register to “1”and select the clock master (internal clock).Set the SC2CKM flag to “0” and select “ no 1/16dividing of the clock source.Set the SC2SBOS, SC2SBIS, and SC2SBTS flags ofthe SC2CTR1 register to “1” to set the SBO2 pin to theserial data output and the SBT2 pin to the serial I/O pin.Set the SBI2 pin to the serial data input by setting theSC2IOM flag to “0”.(9) Set the interrupt levelG15ICR(0x0000893C)bp14-12: G15LV2-0=100(9) Set the interrupt level by the G15LV2-0 flags of theG15ICR register.(10) Enable the interruptG15ICR(0x0000893C)bp9: G15IE1=1(10) Set the G15IE1 flag of the G15ICR register to “1” toenable the interrupt. If the interrupt request flag(G15IR1 of the G15ICR register) is already set, clearthe G15IR1 flag to enable the interrupt.(11) Start the serial transmissionTransmission data→SC2TB(0x0000A130)Reception data→input to the SBI2 pin(11) set the transmission data to the serial interface 2transmission data buffer (SC2TB). The transfer clock isgenerated and transmission and reception are started.When transmission is completed, the serial interface 2interrupt SC2TIRQ is generated.Setup Procedure Description