Section 17 Keyboard Buffer Control Unit (KBU)
Start
Set KBIOE bit
Clear KBE bit
(reception disabled)
Write transmit data
to KBTR
Read KBCRH
Both KCLKI and
KDI = 1?
Yes
Set I/O inhibit
(KCLKO = 0)
Read KBCRH
KDI = 1?
Yes
Set start bit
(KDO = 0)
Set KBTS
(KBTS = 1)
Clear I/O inhibit
(KCLKO = 1)
Autmatic transmission
KBTE = 1
No
Yes
KTER = 0
No
Yes
Clear KBTE bit
To transmit operation or receive operation
Rev. 3.00 Jul. 14, 2005 Page 596 of 986
REJ09B0098-0300
(Condition: KBE = 0)
[1]
[2]
[3]
[4]
No
Receive termination
processing execution
KDO retains 1
[5]
No
Retransmit request
processing execution
KCLKO retains 0
[6]
[7]
KDO retains 0
[8]
[9]
[10]
Error handling
[11]
Figure 17.5 Sample Transmit Processing Flowchart
[1]
Write 1 to the KBIOE bit to enable transmission/
reception.
[2]
Clear the KBE bit (reception disabled).
[3]
Write transmit data to KBTR.
[4]
Read KBCRH, and when both the KCLKI and
KDI bits are 1, write 0 to the KCLKO bit to set
the I/O inhibit. 60 µs or more is required for I/O
inhibit.
[5]
Read KBCRH, and when the KDI bit is 1, write
0 to the KDO (set start bit).
[6]
Write 1 to the KBTS bit to enter the transmit
enabled state.
[7]
Write 1 to the KCLKO bit to clear the I/O inhibit.
[8]
Check D0 to D7, the parity bit, the stop bit, and
receive completion notification (send data at the
falling edge of the KCLK signal).
[9]
The KBTE bit is set to 1 at the eleventh rising
edge of the KCLK signal. When KTIE = 1, a
CPU interrupt occurs.
[10]
When KTER = 0, transmission is successfully completed.
[11]
Clear the KBTE bit to 0.
Note: * The start bit (KDO = 0) is automatically initialized (KDO = 1)
when automatic transmission is started. After initialization,
to write 0 to KDO, read 1 before writing 0 to it.