|
M38002M4 Datasheet, PDF (86/173 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER | |||
|
◁ |
APPLICATION
2.3 Serial I/O
Control procedure : When the registers are set as shown in Figure 2.3.21, the Serial I/O can transmit
1-byte data simply by writing data to the Transmit buffer register.
Thus, after setting the CS signal to âL,â write the transmission data to the
Receive buffer 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.23 shows a control procedure of serial I/O.
RESET
Initialization
SIOCON (Address : 1A16)
110110002
UARTCON (Address : 1B16), bit4 0
BRG
(Address : 1C16)
8â1
ICON1 (Address : 3E16), bit3 0
P5
(Address : 0A16), bit3 1
P5D
(Address : 0B16)
XXXX1XXX2
q X : This bit is not used in this application.
Set it to â0â or â1.â Itâs value can be disregarded.
q Set the Serial I/O.
q Serial I/O transmit interrupt : Disabled
q Set the CS signal output port.
(âHâ level output)
P5 (Address : 0A16 ), bit3 0
IREQ1 (Address : 3C16 ), bit3 0
TB/RB (Address : 1816 )
a transmission
data
IREQ1 (Address : 3C16 ), bit3?
0
1
N
Complete to transmit data?
Y
P5 (Address : 0A16 ), bit3 1
q Set the CS signal output level to âL.â
q Set the Serial I/O transmit interrupt
request bit to â0.â
q Write a transmission data.
(start to transmit 1-byte data)
q Check the completion of transmitting 1-
byte data.
q Use any of RAM area as a counter for
counting the number of transmitted bytes.
q Check that transmission of the target
number of bytes has been completed.
q Return the CS signal output level to âHâ
when transmission of the target number of
bytes is completed.
Fig. 2.3.23 Control procedure of serial I/O [Output of serial data]
2-38
3800 GROUP USERâS MANUAL
|
▷ |