
2.3 Serial I/O
2-42
APPLICATION
3802 GROUP USER’S MANUAL
Control procedure :
When the registers are set as shown in Fig. 2.3.28, the Serial I/O2 can transmit
1-byte data simply by writing data to the Serial I/O2 register.
Thus, after setting the CS signal to “L,” write the transmission data to the Serial
I/O1 register on a 1-byte base, and return the CS signal to “H” when the desired
number of bytes have been transmitted.
Figure 2.3.30 shows a control procedure of serial I/O2.
Fig. 2.3.30 Control procedure of serial I/O2 [Output of serial data]
Complete to transmit data
Set the Serial I/O2 control register.
Serial I/O2 interrupt : Disabled
Set the CS signal output port.
(“H” level output)
Set the CS signal output level to “L.”
Set the Serial I/O2 interrupt request bit to “0.”
Write a transmission data.
(start to transmit 1-byte data)
Check the completion of transmitting 1-
byte data.
Use any of RAM area as a counter for
counting the number of transmitted bytes.
Check that transmission of the target
number of bytes has been completed.
Return the CS signal output level to “H” when
transmission of the target number of bytes is
completed.
RESET
P5 (Address : 0A
16
), bit3 0
0
N
Y
1
IREQ2 (Address : 3D
16
), bit2
IREQ2 (Address : 3D
16
), bit2 0
SIO2 (Address : 1F
16
)
P5 (Address : 0A
16
), bit3 1
a transmission
data
G
G
G
G
G
G
G
G
G
X
: This bit is not used in this application.
Set it to “0” or “1.” It’s value can be disregarded.
G
Initialization
.
SIO2CON
ICON2
P5
P5D
.
(Address : 1D
16
)
(Address : 3F
16
), bit2
(Address : 0A
16
), bit3
(Address : 0B
16
)
01001010
2
0
1
XXXX
1
XXX
2
G