Chapter 13Serial Interface 2XIII - 28 Operation■ Setting Data I/O PInCommunication modes can be selected from 2 channels (data output pin (SBO2 pin) and data input pin (SBI2pin)), or 1 channel (data I/O pin (SBO2 pin)). The SBI2 pin can be used only for serial data input. The SBI2 pincan be used for both serial data input and output. The SC2IOM flag of the SC2CTR1 register can select whetherserial data is fed from the SBI2 pin or SBO2 pin. When “data input from the SBO2 pin” is selected, 1-channelcommunication mode is used; so, the P17D flag of the P1DIR register controls the SBO2 pin direction for switch-ing between transmission and reception. At this time, the SBI2 pin can be used as a general-purpose port since itis not used.■ Reception Buffer Empty Flag OperationWhen the reception complete interrupt SC2RIRQ is generated, data is automatically stored from the receptionshift register to SC2RB. If data is stored in the shift register SC2RB, the reception buffer empty flag SC2REMP ofthe SC2STR register is set to “1”. This indicates that reception data is ready to be read out. SC2REMP is clearedto “0” when data is read from 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 SC2RBSY flag of the SC2STR register is set to “1” when a start bit is recognized. The flag is cleared to “0”after generation of the reception complete interrupt SC2RIRQ. The SC2RBSY flag is reset to “0” when theSC2SBIS flag is set to “0” during reception.■ Transmission BUSY Flag OperationThe SC2TBSY flag of the SC2STR register is set to “1” when data is set in SC2TB. The flag is cleared to “0”after generation of the transmission complete interrupt SC2TIRQ. SC2TBSY flag setup is maintained during con-tinuous communication. If the transmission buffer empty flag SC2TEMP is set to”0” when the transmission com-plete interrupt SC2TIRQ is generated, SC2TBSY is cleared to “0”. The SC2TBSY flag is reset to “0” when theSC2SBIS flag is set to “0” during transmission.■ Setting Break Status Transmission ControlBreak status can be transmitted by the SC2BRKE flag of the SC2CTR2 register. When SC2BRKE is set to “1” toselect break transmission, all from the start to stop bits transmit “0” .■ Break Status Reception JudgementReception at bread status can be judged. If all received data from the start bit to stop bit are “0”, the SC2BRKFflag of the SC2CTR2 register is set and regards the break status. The SC2BRKF flag is set when the receptioncomplete interrupt SC2RIRQ is generated.