Toshiba TLCS-900 Computer Hardware User Manual


 
TMP92CM22
2007-02-16
92CM22-197
Figure 3.10.27 Receiver Mode (Example: Internal clock)
3. 8-bit transmit/receive mode
Set a control register to a transmit/receive mode and write data to the SBI0DBR.
After the data is written, set the SBI0CR<SIOS> to “1” to start
transmitting/receiving. When data is transmitted, the data is output from the SO
pin, starting from the least significant bit (LSB) and synchronized with the
leading edge of the serial clock signal. When data is received, the data is input via
the SI pin on the trailing edge of the serial clock signal. 8-bit data is transferred
from the shift register to the SBI0DBR and the INTSBE0 interrupt request is
generated. The interrupt service program reads the received data from the data
buffer register and writes the data which is to be transmitted. The SBI0DBR is
used for both transmitting and receiving. Transmitted data should always be
written after received data is read.
When the internal clock is used, the automatic wait function will be in effect
until the received data is read and the new data is written.
When the external clock is used, since the shift operation is synchronized with
the external clock, the received data is read and transmitted data is written before
a new shift operation is executed. The maximum transfer speed when the external
clock is used is determined by the delay time between the time when an interrupt
request is generated and the time at which received data is read and transmitted
data is written.
When the transmit is started, after the SBI0SR<SIOF> goes “1” output from the
SO pin holds final bit of the last data until falling edge of the SCK.
Transmitting/receiving data ends when the <SIOS> is cleared to “0” by the
INTSBE0 interrupt service program or when the SBI0CR1<SIOINH> is set to “1”.
When the <SIOS> is cleared to “0”, received data is transferred to the SBI0DBR in
complete blocks. The transmit/receive mode ends when the transfer is completed.
In order to confirm whether data is being transmitted/received properly by the
program, set the SBI0SR to be sensed. The <SIOF> is cleared to “0” when
transmitting/receiving is completed. When the <SIOINH> is set to “1”, data
transmitting/receiving stops. The <SIOF> is then cleared to “0”.
Note: When the transfer mode is changed, the contents of the SBI0DBR will be lost. If the mode
must be changed, conclude data transmitting/receiving by clearing the <SIOS> to “0”, read
the last data, and then change the transfer mode.
b
b
7
<SIOS>
a
2
a
1
a
4
a
3
a
6
a
5
b
0
a
7
b
2
b
1
b
4
b
3
b
6
b
5
a
0
Clear <SIOS>
<SIOF>
<SEF>
SCK pin (Output)
a
Read receive data
SI pin
INTSEB0
interrupt request
SBI0DBR
Read receive data