104
2. APPLICAT ION
MITSUBISHI MICROCOMPUTER
3819 Group
2.3 Serial I/O
3819 Group USER’S MANUAL
(2) Control in the slave unit
After a setting of the related registers is completed as shown in Figure 2.3.25, the slave unit becomes the state
which is received a synchronizing clock at all times, and the Serial I/O 1 interrupt request bit is set to “1” every
time an 8-bit synchronous clock is received.
For transmitting or receiving data according to the synchronizing clock input in the timing shown in the
specifications, read out the reception data and write the next transmission data to the Serial I/O 1 register in the
following conditions.
When the Serial I/O 1 interrupt occurs.
When the Serial I/O 1 interrupt request bit is set to “1” as the result of checking.
When the Serial I/O 1 interrupt request bit is not set to “1” within a certain time (heading adjustive time), the first
byte of the transmission data in a block is written to the Serial I/O 1 register, then the next reception data is
processed as the first byte of the reception data in a block. A processing example in the slave unit using serial
I/O interrupts and timer interrupts (for a heading adjustment) is shown below.
Fig. 2.3.27 Control in the slave unit
Serial I/O 1 interrupt processing
routine
Write a transmission data
Read a reception data
N
Within a block transfer period
Y
Y
A received byte counter
≥
8
N
RTI
Write any data (FF
16
)
A received byte counter +1
Heading adjustive
counter
Initialized
value (Note)
Timer interrupt processing
routine
Heading adjustive counter – 1
N
Heading adjustive
counter = 0
Y
RTI
Write the first transmission data
(first byte) in a block
A received byte counter
0
Check the received byte
counter to judge if a block
has been transfered.
In this example, set the value which is equal to the
heading adjustive time divided by the timer interrupt
cycle as the initialized value of the heading adjustive
counter.
For example :
When the heading adjustive time is 8ms
and the timer interrupt cycle is 1ms, set
8 as the initialized value.
Note :
G