Specifications
Intelligent Controller
The typical computer keyboard keyboard contains an embedded controller that performs the necessary functions to scan the
key matrix and implement the communication interface to the host computer. The essential task of the controller is to
monitor the keys and report key presses and/or releases to the host computer. The basic key-matrix scanning approach is,
for the most part, independent of the host communications interface.
Basic Key Matrix Scanning
The controller continuously imposes a sequential scan pattern onto the column lines of the key matrix, such that a logic 0 is
imposed on one column line at a time, with all other column lines at logic 1. The controller reads the row lines each time a
new column pattern is applied. If a 0 is propagated to a row line, then the key at the intersection of that column and row has
been pressed. See Figure 2 and Figure 3.
1 Scan Results For No Key Press
1 Scan Results for Key
1, 1
Pressed
Host Interface Cable
A PS/2 keyboard is connected to the main computer through a shielded PS/2 cable that typically contains 4 wires carrying
signals Vcc, GND, Clock, and Data. A shield drain wire is typically also provided. The USB cable is also a shielded cable
containing four conductors: Vcc, GND, Data+ and Data-. For the purpose of implementing a dual-interface keyboard, the
electrical requirements of the USB interface are more stringent than those of PS/2. For that reason, the interface cable used
in the dual-interface implementation should meet all requirements for low-speed USB.
Introduction to CY7C63413
The CY7C63413 is a high performance 8-bit RISC microcontroller with an integrated USB Serial Interface Engine (SIE). The
architecture implements 37 commands that are optimized for USB applications. The CY7C63413 has a built-in clock
oscillator and timers, as well as general purpose I/O lines that can be configured as resistive with internal pull-ups, open-
drain outputs, or traditional CMOS outputs. High performance, low-cost human-interface type computer peripherals such as
a keypad or keyboard can be implemented with minimum external components and firmware effort.
In addition, the CY7C63413’s microcontroller is capable of performing all functions necessary to implement a PS/2 interface
to a host computer. In this case, the USB functions of the chip are unused, and the RAM and I/O normally dedicated to USB
tasks are available for general use.
Clock Circuit
The CY7C63413 has a built-in clock oscillator and PLL-based frequency doubler. This circuit allows a cost effective 6 MHz
ceramic resonator to be used externally while the on-chip RISC core runs at 12 MHz.
USB Serial Interface Engine (SIE)
The operation of the SIE is totally transparent to the user. In receive mode, USB packet decode and data transfer to the
endpoint FIFO are automatically done by the SIE. The SIE then generates an interrupt to invoke the service routine after a
packet is unpacked.
In the transmit mode, data transfer from the endpoint and the assembly of the USB packet are handled automatically by the
SIE.
General Purpose I/O
The CY7C63413 has 32 general purpose I/O lines divided into 4 ports: Port 0 through Port 3. One such I/O circuit is shown
in Figure 4. Each port (8 bits) can be configured as resistive with internal pull-ups (7 KΩ), open drain outputs (high
impedance inputs), or traditional CMOS outputs.The port configuration is determined according to Table 1 below.
Table 1. GPIO Configuration
Port Pin Driver Mode Interrupt