|
M38203M4 Datasheet, PDF (223/344 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER | |||
|
◁ |
APPLICATION
2.5 Serial I/O1
(3) Initialization of serial I/O1 operation
The operating procedure of the serial I/O1 control register for initialization of the serial I/O1 operation
is described below.
sInitialization of receive operation
By setting the receive enable bit (bit 5 of SIO1CON) to â0â or setting the serial I/O1 enable bit (bit 7
of SIO1CON) to â0,â the receive operation is stopped and initialized as shown below. The initialization
items of receive operation are as follows.
â¢Stopping and initializing the shift clock to the receive shift register.
â¢Setting the receive shift register to â0.â
â¢Setting each error flag (overrun error flag, parity error flag, framing error flag, summing error flag) to
â0.â
â¢Setting the receive buffer full flag (RBF) to â0.â
sInitialization of transmit operation
Basically, the transmit operation is stopped and initialized by setting the transmit enable bit (bit 4 of
SIO1CON) to â0.â The initialization items of transmit operation are as follows.
â¢Stopping and initializing the shift clock to the transmit shift register.
â¢Setting the receive shift register to â0.â (However, when an external clock is used in the clock
synchronous mode, the receive shift register is not set to â0â unless the input clock of the SCLK1 pin
is âH.â)
â¢Setting the transmit buffer empty flag (bit 0 of SIO1STS) and the transmit shift register shift comple-
tion flag (bit 2 of SIO1STS) to â0.â
(When bit 4 is set to â0,â bits 0 and 2 are cleared to â0â forcibly. After that, when bit 4 is set to â1,â
bits 0 and 2 are set to â1.â)
When all conditions below are satisfied, initialization is not performed only by setting bit 4 of SIO1CON
to â0.â It is also necessary to set bit 5 of SIO1CON to â0.â
â¢In the full duplex data transfer
â¢In the clock synchronous mode
â¢When an internal clock is used
â¢When bit 5 of SIO1CON is â1â (receive enabled)
In the clock synchronous mode of the full duplex data transfer, the same clock is used for transmission
and reception.
When an internal clock is used, the shift clock is started by writing data into the transmit buffer at both
transmission and reception, so both transmit and receive operations use a clock generating circuit of
the transmitter.
Because of this, the serial I/O1 is designed so that even if only a receive operation is performed, the
transmit circuit may be operated internally to generate a shift clock when an internal clock is used in
the clock synchronous mode. Accordingly, note that the transmitter may operate even when bit 4 of
SIO1CON is â0.â The transmit operation cannot be initialized only by setting the serial I/O1 enable bit
(bit 7 of SIO1CON) to â0.â
3820 GROUP USERâS MANUAL
2â137
|
▷ |