Chapter 13Serial Interface 2XIII - 16 Operation■ Setting Data I/O PinCommunication modes have 2 types: 3 channels (clock pin (SBT2 pin), data output pin (SBO2 pin) and data inputpin (SBI2 pin )) and 2 channels (clock pin SBT2 pin) and data I/O pin (SBO2 pin)). The SBO2 pin can be usedonly for serial data input. The SBI2 pin can be used for serial data input and output. The SC2IOM flag of theSC2CTR1 register can select whether serial data is fed from the SBI2 pin or SBO2 pin. When “data input from theSBO2 pin” is selected, 2-channel communication is used. In this case, the P17D flag of the P1DIR register con-trols the SBO2 pin direction and switches between transmission and reception. The SBI2 pin can be used as a gen-eral-purpose port because it not used at this time, ...In using synchornous serial interface, only GI5IR1 of the interrupt request flag becomes "1"whether the completion of the transmission or reception. GI5IR0 is not generated.....Maximum transfer speed should be under 5.0 MHz. If transfer clock exceeds 5.0 MHz, datamay not be transferred properly.....In reception, the SBI2 pin can be used as a general-purpose port when the SC2IOM of theSC2CTR1 register is set to “1” and “serial data input from the SBO2 pin” is selected...■ Reception Buffer Empty Flag OperationAfter reception is completed, (communication complete interrupt SC2TIRQ), data is automatically stored fromthe reception shift register into SC2RB. If data is stored in the shift register SC2RB while the SC2SBIS flag of theSC2CTR1 register is set to “serial input” , the reception buffer empty flag SC2REMP of the SC2STR register isset to “1”. This indicates that reception data is ready to be read out. SC2REMP is cleared to “0” when data is readfrom SC2RB.■ Transmission Buffer Empty Flag OperationIf data is set in SC2TB during communication (till the communication complete interrupt SC2TIRQ is generatedafter data is load into the transmission shift register), the transmission buffer empty flag SC2TEMP of the SC2TBregister is set to “1”. This indicates that the next transmission data is ready to be loaded. When data is loaded intothe internal shift register from SC2TB after SC2TIRQ is generated and when SC2TEMP is cleared to “0”, thenext transfer is automatically started.■ Reception BUSY Flag OperationThe BUSY flag SC2RBSY of the SC2STR register is set to “1” when data is set in SC2TB or when a start condi-tion is recognized while “serial data input” is selected with the SC2SBIS flag of the SC2CTR1 register. TheBUSY flag is cleared to “0” after generation of the communication end interrupt SC2TIRQ. The SC2RBSY flagsetting is maintained during continuous communication. If the transmission buffer empty flag SC2TEMP iscleared to “0” when the communication complete interrupt SC2TIRQ is generated, SC2RBSY is cleared to “0”.The SC2RBSY flag is reset to “0” when the SC2SBIS flag is set to “0” during communication.