The brain of a smartphone is the baseband (BB) controller with built-in microprocessor and special-purpose signal-processing circuits. Depending on the complexity of the BB controller, there are usually general-purpose input/output (GPIO) pins available for key-switch implementation.
Most recently, special-purpose key-switch controller chips have been used in many smart cell phones. A dedicated key-switch controller chip is used in a cell phone, sometimes because not enough GPIO pins are available. This happens commonly when a BB controller designed for a feature phone is used for a smartphone to avoid the system infrastructure redevelopment cost. At other times, it is used to minimize the wires between the BB controller and the key pad. This is especially true for slide-out key pads where the BB controller and the key pad are located on different PCBs or chassis. A key-switch controller is usually connected to the BB controller by an I²C or SPI™ interface.
A dedicated switch controller can be implemented with an off-the-shelf GPIO chip or a small microcontroller using the conventional key-scan method. A few dedicated special-purpose key-switch controller chips also use the conventional key-scan method. In this article, the conventional and low-EMI key-scan methods are compared to show the additional benefit of eliminating the use of EMI filters.
Conventional Key-Scan Method
Figure 1 shows the general approach of the conventional key-scan method. This method applies both to the BB controller's "GPIO pins" implementation and to some dedicated key-switch controllers. Some GPIO pins are used as column output ports to drive the switch matrix; other GPIO pins are used as row input ports to detect the contact of switches. There is usually no voltage applied to any key switches while they are not being touched. Once a key is pressed, the key controller starts to scan all keys. The scanning is carried out by raising the column voltages one at a time while checking, also one at a time, the input level of each row. An 8 x 8 switch matrix can be scanned in 64 clock cycles. The clock frequency can range from a few tens of kHz to a few MHz. Column output levels swing between logic low and high during the key scan. The voltage can vary between 1.8V to 3.3V, depending on the key controller's power supply.
Figure 1. The conventional key scan method.
Because of the sudden rises and falls of these column scanning signals, the corresponding electromagnetic emission can affect the qualification of EMI tests, especially when long wirings are extended from the BB controller's GPIO pins to the key pad. EMI filters are usually required on these column ports to minimize the effect of the electromagnetic emission. An EMI filter can be a first-order RC or a second-order CRC lowpass filter (Figures 2a and 2b). An EMI filter can be implemented using discrete passive components or is available in a small TDFN or CSP package. The use of EMI filters adds component cost and consumes board space.
Figure 2a and 2b. EMI filter configurations.
Low-EMI (Passive-Scan) Method
Maxim's key-switch controllers, such as the MAX7347/MAX7348/MAX7349
, and MAX7360
use a unique passive scan technique. The technique uses current sources to drive the switch matrix and senses passing currents to detect switch contacts. Figure 3
depicts the general configuration of this passive key-scan method. Once a key is pressed, the key controller starts to scan all keys. The scanning is carried out by applying constant current sources with a port output voltage of about 0.5V to all column outputs, while sensing the current follow through the rows that are turned on one at a time. For this passive-scan technique, an 8 x 8 switch matrix can also be scanned in 64 clock cycles, because the flow of constant current is detected one column at a time. During the key scan, all column voltages are static at 0.5V, except the one with a key pressed which reduces close to 0V during the corresponding row port's scanning time slot.
Figure 3. Maxim's low-EMI key-scan method.
Each column port is driven by a constant-current source of about 20µA. This amount of current only follows through the column and the row ports where a switch is making a contact for a very short time period. Therefore, the power consumption for this passive scan method can be much lower compared with the conventional approach where voltage swings drive capacitive and resistive loads.
Electromagnetic Emission (EMI) Comparison
For a 1.8V power supply, a voltage swing of 0.5V instead of the whole rail itself can reduce electromagnetic emissions by more than 11dB. The less-frequent swing of the low-EMI method can also help reduce the electromagnetic emission level. Figure 4 shows simulated power-spectrum-density (PSD) levels for the conventional and low-EMI key-scan methods. Tests assumed a clock frequency of 1MHz, a supply voltage of 1.8V, and rising/falling times of 0.2µs. The blue curve represents the conventional method and the green curve shows Maxim's passive-scan method. The simulation results show that Maxim's low-EMI method has a 15dB lower PSD level. In summary, the low-EMI method produces an electromagnetic emission of about 15dB lower than that from a conventional method. With such a significant reduction of electromagnetic emission, the use of EMI filters can be avoided.
Figure 4. Simulated key scan PSD levels. The blue curve represents the conventional method and the green curve shows Maxim's passive-scan method.
A Waveform Example
The dark blue trace (channel 1) in Figure 5 shows the column port and the light blue (channel 2) displays the row port voltages of a MAX7359 key-switch controller. A key crossing these column and row ports is pressed at around 26ms. The key controller wakes up with a delay of ~2ms. It applies a current source to the column port, resulting in a voltage of about 0.5V, and starts scanning. It scans twice at the chosen debounce time before deciding if a key is still pressed or has been released. For a pair of adjacent scanning pulses, the one on the right is the original scan and the one on the left is the secondary debounce scan.
Figure 5. Simulated key-scan PSD levels. Channel 1 shows the column port and channel 2 shows the row port voltages of a MAX7359.
ESD Protection and Capacitance Loading Allowance
Ports connected to the key pads are exposed to electrical static discharge (ESD) and need to be protected, sometimes up to 15kV. The built-in ESD protection for the MAX73447, MAX7348, MAX7349, and MAX7359 is ±2kV and ±8kV for the MAX7360. External ESD diodes are usually used with the built-in protection to provide adequate protection. ESD protection diodes add capacitive loading to those connected ports.
With distinctive "key pressed" and "key released" codes, it is possible to recognize multiple simultaneous key presses and their sequences. However, the capacitive loading is multiplied on the column and row ports involved. Each column port is driven by a constant-current source of 20µA ±30%. Each row port is pulled to ground by applying a positive pulse at the gate of the row port's output transistor. When the column port is pulled to ground through the close of a key switch while the row port is at the ground level, a key press action is detected.
While the positive pulse is applied to the gate of the row port's output transistor and shortly thereafter, there is a discharge and charge process at the switch's closing point. Right after the positive pulse, the switch's closing point is quickly discharged to zero from 0.5V. After the positive pulse disappears, the switch's closing point is charged to 0.5V, based on the following formula:
Where C is the total capacitance at the switch closing point. For a capacitance of pF, it will take
to reach 0.5V. The scan period is
In an application circuit the capacitances of column and row ports, including those from attached ESD protection diodes, are involved in the charging process. When the charging time is longer than the scan period, the false detection of a "key pressed" occurrence might happen. The falsely detected key can be the one whose row scan follows the pressed key on the same column.
To limit the charging time to less than 13µs while giving the circuit about 2.625µs for the "key pressed" detection, and considering the constant-current-source tolerance of 30%, the total capacitance should be less than 364pF according to the following formula:
The capacitance at each port, including those from attached ESD protection diode, should be less than Cport = Ctotal/3 = 121pF, assuming that two keys, a shift key and a regular key, are pressed. The capacitances of two row ports and a column port are considered in the above calculation. With a port capacitance of 20pF, the allowed external capacitance is 101pF.
The above approach applies only when keys, which are pressed, share the same column port. The excessive capacitance problem can also be avoided by reassigning a frequently pressed key in a multiple key-pressing action, such as the shift key, to a separate column port where only capacitances from one column port and one row port are considered. For a single key to be pressed in each column port case, the capacitance allowed at each port can be relieved to Cport = Ctotal/2 = 182pF. With a port capacitance of 20pF, the resulting external capacitance would, therefore, be 162pF.
The merits of using a dedicated low-EMI key-switch controller for smartphones have been examined. Compared with the conventional approach, data show that the use of EMI filters can be avoided. Instead, using low-EMI key-switch controller devices can improve overall system design and lower cost. The capacitive loading allowances estimated here are reasonable for most cell-phone keypad hardware. However, the use of ESD devices with heavy capacitive loading should be avoided.