ST AN2422 APPLICATION NOTE

AN2422
Application note
STMPE2401 GPIO port expander
Hardware interface guide
Introduction
STMPE2401 is the first in the ST family of I/O port expanders. The principle of a basic I/O port expander is that it provides additional I/Os that can be used by the host processor to implement additional features such as increased number of inputs/outputs, expanding the number of control signals and mixed signal lines, controlling a greater number of peripherals without resorting to an additional Complex Programmable Logic Device (CPLD) or upgrading the central processing unit (CPU).
In addition to these basic features, the STMPE2401 comes with integrated intelligence to implement advanced features such as keypad scanning, PWM control, rotator dial control, etc.
The STMPE2401 can be widely used in the fields of mobile communications, portable media players, game console, mobile phones, smart phones, consumer electronics and computer peripherals like state-of-the-art printers, advanced embedded systems, etc.
This application note deals with the setup and hardware interfacing of the device to perform various functions and the different modes for reducing power consumption.
January 2007 Rev 1 1/19
www.st.com
Contents AN2422
Contents
1 Advantageous features of STMPE2401 . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 STMPE2401 Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 STMPE2401 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Power supply and ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 32-kHz crystal oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 I2C Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Reset pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Interrupt pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.7 Initialization and configuration of Interrupt Controller . . . . . . . . . . . . . . . . 10
2.8 GPIO state description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.9 Configuring the GPIO Alternate Function register . . . . . . . . . . . . . . . . . . 11
2.10 GPIO Hotkey feature description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.10.1 GPIO Hotkey programming sequence . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.10.2 Minimum pulse width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11 Modes of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11.1 Operational mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11.2 Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11.3 Hibernate mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11.4 Typical ICC values in various modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.12 Power-up sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.13 Tips for hardware troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4 Reference documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2/19
AN2422 Advantageous features of STMPE2401

1 Advantageous features of STMPE2401

1. A highly flexible interrupt system eliminates the need for polling and reduces CPU usage
2. Low power consumption
3. Wake-up from Sleep mode
4. Easy-to-use driver software
5. Flexibility in the configuration of individual GPIOs
6. Simpler connection to CPU (just two I communication
7. Combinational keys to enhance gaming experience
8. Applications: Mobile phone keypads, all-in-one printers, game consoles, embedded systems, portable media players, etc.

Figure 1. Concept of GPIO port expander

2
C lines + Interrupt pin) for configuration and
3/19
STMPE2401 Hardware description AN2422

2 STMPE2401 Hardware description

The STMPE2401 is a GPIO (General Purpose Input/Output) port expander able to interface to a digital application-specific integrated circuit (ASIC) via the two-line bidirectional bus
2
(I
C).
A separate GPIO Expander IC is often used in Mobile-Multimedia platforms to solve the problems of the limited GPIOs usually available on the Digital Engine.
The STMPE2401 offers great flexibility as each I/O is configurable as input, output or in specific functions, to scan a keyboard, provide PWM outputs for brightness control in backlighting or in a rotator decoder interface. This device is designed for use with a very low quiescent current, and includes a wake-up feature for each I/O to optimize the power consumption of the IC. The main features of the port expander device are:
24 GPIOs
Operating voltage 1.8V
Hardware keypad controller (8*12 Matrix maximum)
3 PWM (8-bit) outputs for LED brightness control and LED blinking
Interrupt output (open drain) pin
Configurable hotkey feature on each GPIO
Ultra-low Standby-mode Current
Small Package TFBGA - 36 pins, 3.6x3.6mm and 0.5mm pitch making it optimal for use
in portable applications such as mobile phones with critical space constraints.
4/19
AN2422 STMPE2401 Hardware description

Figure 2. STMPE2401 block diagram

Keypad
Controller
GPIOs
7:0
Keypad
Inputs
Function
Select
Keypad Inputs 7:0 GPIOs 7:0
INT
SCLK
S DATA
Controller Core
+PWM +Rotator Control +GPIO Control
2
I²C Interface
GND
A0
A1
Keypad
Outputs
Function
Select
GPIO
15
PWM
O/P
POR
RC Oscillator
Clock
Controller
XTALIN XTALOUT
Keypad Outputs 11:0 GPIOs 14:8 and 20:16 Rotator
GPIO 15 Addr0
PWM1, 2 and 3 Addr1 GPIOs 23:21
Reset_N
CC1
CC2
V
CC1
V
CC2
Ai12531
5/19
STMPE2401 Hardware description AN2422

2.1 STMPE2401 pin description

Ta bl e 1 describes all the pins on the STMPE2401 device.

Table 1. STMPE2401 Pin list

Pin Name Type Description
1GND -
2 KP_X0 IO GPIO
3 Reset_N I External reset input, active LOW
4 KP_X1 IO GPIO
5 KP_X2 IO GPIO
6 KP_X3 IO GPIO
7 KP_X4 IO GPIO
8 KP_X5 IO GPIO
9 KP_X6 IO GPIO
10 GND -
11 V
CC1
12 KP_X7 IO GPIO
13 KP_Y5 IO GPIO
14 KP_Y4 IO GPIO
15 KP_Y3 IO GPIO
16 KP_Y2 IO GPIO
17 KP_Y1 IO GPIO
18 KP_Y0 IO GPIO
19 GND -
20 ADDR0 IO GPIO and I
21 KP_Y9 A/IO GPIO
22 KP_Y10 A/IO GPIO
23 KP_Y11 A/IO GPIO
24 PWM3 A/IO GPIO and I
25 PWM2 A/IO GPIO
26 PWM1 A/IO GPIO
27 V
CC2
28 GND -
29 INT O Open drain interrupt output pin
30 KP_Y8 IO GPIO
31 KP_Y7 IO GPIO
32 KP_Y6 IO GPIO
33 SDATA A I
34 SCLK A I
35 XTALIN A XTAL oscillator or external 32-kHz input
36 XTALOUT A XTAL oscillator
- 1.8V Input
- 1.8V Input
2
C DATA
2
C clock
2
C ADDR 0 (in reset)
2
C ADDR 1 (in reset)
6/19
Loading...
+ 13 hidden pages