Datasheet

Section 18 Keyboard Buffer Control Unit (PS2)
Rev. 3.00 Sep. 28, 2009 Page 575 of 910
REJ09B0350-0300
18.4.2 Transmit Operation
In a transmit operation, KCLK (clock) is an output on the keyboard side, and KD (data) is an
output on the chip (system) side. KD outputs a start bit, 8 data bits (LSB-first), an odd parity bit,
and a stop bit, in that order. The KD value is valid when KCLK is high. A sample transmit
processing flowchart is shown in figure 18.5, and the transmit timing in figure 18.6.
KDO retains 1
[4]
[3]
[2]
[1]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
Set KBIOE bit
Write 1 to the KBIOE bit to enable transmission/
reception.
Clear the KBE bit (reception disabled).
Write transmit data to KBTR.
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.
Read KBCRH, and when the KDI bit is 1, write
0 to the KDO (set start bit).
Write 1 to the KBTS bit to enter the transmit
enabled state.
Write 1 to the KCLKO bit to clear the I/O inhibit.
Check D0 to D7, the parity bit, the stop bit, and
receive completion notification (send data at the
falling edge of the KCLK signal).
The KBTE bit is set to 1 at the eleventh rising
edge of the KCLK signal. When KTIE = 1, a
CPU interrupt occurs.
When KTER = 0, transmission is successfully completed.
Clear the KBTE bit to 0.
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
Write transmit data
to KBTR
Clear KBE bit
(reception disabled)
Read KBCRH
No
Ye s
No
No
No
Ye s
Ye s
Ye s
To transmit operation or receive operation
Read KBCRH
KCLKO retains 0
KDO retains 0
Clear I/O inhibit
(KCLKO = 1)
Autmatic transmission
Clear KBTE bit
Error handling
Set KBTS
(KBTS = 1)
KBTE = 1
KTER = 0
Set start bit
(KDO = 0)
*
KDI = 1?
Receive termination
processing execution
Retransmit request
processing execution
Both KCLKI and
KDI = 1?
Set I/O inhibit
(KCLKO = 0)
Start
(Condition: KBE = 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.
Figure 18.5 Sample Transmit Processing Flowchart