AN2421 Application note

Similar documents
STEVAL-ICB004V1. Advanced resistive touchscreen controller demonstration board based on the STMPE811. Features. Description

STEVAL-ILL029V1. Front panel demonstration board based on the STLED325 and STM8S. Features. Description

STEVAL-SPBT2ATV2. USB Dongle for the Bluetooth class 2 SPBT2532C2.AT module. Features. Description

STEVAL-IHM043V1. 6-step BLDC sensorless driver board based on the STM32F051 and L6234. Features. Description

ROBOT-M24LR16E-A. Evaluation board for the M24LR16E-R dual interface EEPROM. Features. Description

Obsolete Product(s) - Obsolete Product(s)

EVALPM8803-FWD. EVALPM8803-FWD: IEEE802.3at compliant demonstration kit with synchronous active clamp forward PoE converter. Features.

STEVAL-ILL037V1. Demonstration board for the HVLED805 IC for LED power supply. Features. Description

Obsolete Product(s) - Obsolete Product(s)

STEVAL-ISB008V1. Standalone USB Li-Ion battery charger demonstration board based on the STw4102 and STM32F103C6. Features.

STEVAL-CCH002V2. HDMI and video switches demonstration board. Features. Description

STEVAL-ILH004V1. 70 W electronic ballast for metal halide lamp (HID) based on the L6382D5 and ST7FLITE49K2. Features. Description

STEVAL-ILL015V1. High brightness RGB LED array with LED error detection based on the STP24DP05 and STM32. Features. Description

Obsolete Product(s) - Obsolete Product(s)

STEVAL-ILH005V W electronic ballast for HID lamps based on the L6562A and ST7LITE39F2. Features. Description

Multi-channel LED driver with integrated boost controller for medium, large LCD panel backlight based on LED7708 and STM32F103C6T6A

Obsolete Product(s) - Obsolete Product(s)

March 2012 Doc ID Rev 1 1/4

STEVAL-IKR001V7D. Sub Ghz transceiver daughterboard with power amplifier based on the SPIRIT1. Features. Description

STEVAL-CCA043V1. 25 Watt mono BTL class-d audio amplifier demonstration board based on the TDA7491MV. Features. Description

STEVAL-IME002V1. Multi-lead electrocardiogram (ECG) and body impedance demonstration board. Features. Description

L7208. Portable consumer electronics spindle and VCM motor controller. General features. Spindle driver. Description. VCM driver.

IMPORTANT NOTICE. Company name - STMicroelectronics NV is replaced with ST-NXP Wireless.

IEC compliant smart meter system for AMI applications based on STM32, ST7570 PLM, and STPMC1/STPMS1 chipset

STEVAL-CCM003V1. Graphic panel with ZigBee features based on the STM32 and SPZBE260 module. Features. Description

STEVAL-IHM024V W 3-phase inverter using the L6390 and STGDL6NC60DI for vector control. Features. Applications. Description

STEVAL-IHM021V W, 3-phase inverter based on the L6390 and UltraFASTmesh MOSFET for speed FOC of 3-phase PMSM motor drives. Features.

Order code Package Connection. SPDC400FC12M0.60 Open frame Comb. October 2007 Rev 1 1/9

STEVAL-ILL043V1. High end, 75 W high power factor flyback LED driver based on the L6562A with two dimmable strings. Features.

GM60028H. DisplayPort transmitter. Features. Applications

PRODUCT TERMINATION NOTIFICATION

GM68020H. DisplayPort receiver. Features. Applications

STEVAL-IFN003V1. PMSM FOC motor driver based on the L6230 and STM32F103. Features. Description

Obsolete Product(s) - Obsolete Product(s)

PRODUCT INFORMATION LETTER

STEVAL-TDR007V1. 3 stage RF power amplifier demonstration board using: PD57002-E, PD57018-E, 2 x PD57060-E. Features. Description

STV6110A. 8PSK/QPSK low-power 3.3 V satellite tuner IC. Description. Features

Obsolete Product(s) - Obsolete Product(s)

TN0885 Technical note

STEVAL-IHM008V1. BLDC & AC motor control Power board SEMITOP 2 1kW. Features. Applications

STEVAL-MKI126V2. MEMS microphone system evaluation board based on the STA321MPL and MP34DB01. Description. Features

STEVAL-IHM025V1. 1 kw 3-phase motor control demonstration board featuring the IGBT SLLIMM STGIPL14K60. Features. Description

Obsolete Product(s) - Obsolete Product(s)

AN3075 Application note

UM0534 User manual. STEVAL-MKI014V1 demonstration kit for the LIS344ALH. Introduction

STEVAL-MKI126V3. STSmartVoice demonstration board based on MP34DT01. Description. Features

Main components Proximity and ambient light sensing (ALS) module

Main components Narrow-band OFDM power line networking PRIME compliant system-on-chip

M24LR04E-R, M24LR16E-R, M24LR64E-R Errata sheet

STEVAL-ISA121V1. Wide range single-output demonstration board based on the VIPER37LE. Features. Description

GM69010H DisplayPort, HDMI, and component input receiver Features Applications

STEVAL-ILL019V1. 32 W offline RGGB LED driver with individual LED channel brightness regulation. Features. Description

STW High voltage fast-switching NPN power transistor. Features. Application. Description

EVAL-RHF1009A. EVAL-RHF1009A product evaluation board. Description. Features

IMPORTANT NOTICE. Company name - STMicroelectronics NV is replaced with ST-NXP Wireless.

STEVAL-ISA050V1. Monolithic VR for chipset and DDR2/3 demonstration board based on the PM6641. Features. Application. Description

2 x 58 W high frequency ballast for T8 fluorescent tubes based on L6562A, L6569, and STL11NM60N in PowerFlat HV package

Mechanical specification. October 2010 Doc ID Rev 1 1/10

Obsolete Product(s) - Obsolete Product(s)

VT5365. Single-chip optical mouse sensor for wireless applications. Features. Applications. Technical specifications. Description.

SPC564A80CAL176 SPC564A70CAL176

STEVAL-TDR020V1. Portable UHF 2-way radio demonstration board based on the PD84006L-E. Features. Description

STV6417 R/C/Pr, G/C, B/Pb Switches + Filter. C, Y, CVBS/Y Switches + Filter. Audio Switches Volume Control AUDIO R SLOW BLANK

FLI30x02 Single-chip analog TV processor Features Application

BAL-NRF01D3. 50 ohm balun transformer for 2G45 ISM matched Nordic s chipset: nrf24le1 QFN32, nrf24ap2-1ch and nrf24ap2-8ch. Features.

STM32-PRIMER/LAB. Raisonance EvoPrimer-LAB to monitor STM32 applications and standalone STM32 Flash programming. Features

STEVAL-TDR021V1. Demonstration board using the PD84008L-E for 900 MHz 2-way radio. Features. Description

Main components Proximity and ambient light sensing (ALS) module

Very low-noise, high-efficiency DC-DC conversion circuit

PRODUCT/PROCESS CHANGE NOTIFICATION

M24SR-DISCOVERY. Discovery kit for the M24SR series Dynamic NFC/RFID tag. Features

STi5105 High-performance advanced SD decoder for set-top box Features

PRODUCT INFORMATION LETTER

EVLHVLED815W8CV. 8 W - high power factor - constant voltage regulation based on HVLED815PF. Features. Description

STDP4020. DisplayPort receiver. Features. Applications

PRODUCT/PROCESS CHANGE NOTIFICATION

STDP2650 Advanced DisplayPort to HDMI converter Features Applications

Obsolete Product(s) - Obsolete Product(s) UM0223 User manual STEVAL-IFS001V1 evaluation kit with MEMS Introduction

PRODUCT/PROCESS CHANGE NOTIFICATION

STEVAL-IHT005V2. Demonstration board with full 3.3 V ACS/Triac control using the STM32F100. Description. Features

STEVAL-IHM038V1. BLDC ceiling fan controller based on the STM32 and SLLIMM-nano. Description. Features

Description. Table 1. Device summary. Order codes Temperature range [ C] Package Packing. LPS2HBTR -30 to +105 HLGA - 10L

Obsolete Product(s) - Obsolete Product(s)

STEVAL-ILL031V1. Digital constant-current controller for LED driving based on the STM8S208x. Features. Description

STA3005. Dual-IF AM/FM digital radio receiver. Feature summary. Order codes

EVLHVLED815W10F. 10 W wide-range high power factor isolated LED driver based on HVLED815PF. Description. Features

EVAL6208Q. Stepper motor driver mounting the L6208Q. Features. Description

STANC0. Stereo HD-PA digitally programmable active noise cancelling audio engine. Features. System. Input and output.

Order code Marking Package Packing. STA5630TR STA5630 VFQFPN32 Tape and reel STA5630ATR (1) September 2013 Doc ID Rev 4 1/8

ST10F273M Errata sheet

STEVAL-IHM034V2. Dual motor control and PFC evaluation board featuring the STM32F103 and STGIPS20C60. Features

USBLC6-4SC6Y. Automotive very low capacitance ESD protection. Features. Applications. Description. Benefits. Complies with the following standards

EVAL6474PD. Stepper motor driver mounting the L6474 in a high power PowerSO package. Features. Description

ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32

Low-cost SDTV set-top box decoder for H.264/AVC and MPEG-2. S/PDIF AudioL AudioR. SD video in. Audio. DACs USB 2.0. Digital video input.

STDP4320 DisplayPort 1.2a splitter Features Applications

EVLHVLED815W10A. 10 W wide range non-isolated high power factor LED driver using HVLED815PF. Description. Features

Obsolete Product(s) - Obsolete Product(s)

STDP2500. Mobility DisplayPort (MyDP) to DP converter. Features. Applications

STV output dot-matrix display driver. Features. Description

Transcription:

Application note Using the STMPE801 as a keypad controller Introduction STMPE801 is an 8-bit general purpose port expander device in the STMicroelectronics Port Expander Logic family. Its eight GPIOs (General Purpose Input Output) are connected to the host system using a standard I2C connection. This application note explains how to control an 8*8 (64-key) matrix keypad using the 8 internal GPIOs of a base-band processor and the 8 GPIOs of the STMPE801 port expander. The simplified schematic is shown below. Schematic for using STMPE801 as a keypad controller RST Baseband SDAT STMPE801 BB_GPIO SCLK INT 801_GPIO 8*8 Keypad November 2006 Rev 1 1/6 www.st.com

Contents AN2421 Contents 1 Design objectives........................................... 3 2 Keypad scanning operation................................... 3 3 Pseudo-Code of the KPC software............................. 4 4 Performance............................................... 5 5 Enhancements.............................................. 5 6 Revision history............................................ 5 2/6

Design objectives 1 Design objectives The keyboard controller presented in this application note complies with the following design objectives: Implementation of an 8*8 keypad controller using 8 GPIOs from the Baseband and 8 GPIOs from the STMPE801 Requires no external interrupts Minimum traffic on the I 2 C bus Ability to support hot-key (wake-up from suspend) features 2 Keypad scanning operation The rows (X-n) are used as inputs and are pulled up to V CC using a weak pull-up resistor (47kOhm). The columns (Y-n) are used as outputs and are normally driven to V CC. An X-Y matrix keypad works in the following sequence: 1. Y-0 is driven to GND. 2. KPC Software scans X-0 to X-n. A "LOW" indicates that key Y-0, X-n is pressed. 3. Y-0 is driven to V CC. Scanning of column 1 completes. 4. Proceed to scanning of column Y+1. To minimize I2C traffic between the baseband and the STMPE801, the GPIOs in baseband (BB_GPIO) are used as inputs and the STMPE801 GPIOs (801_GPIO) are used as outputs. This enables KPC Software to operate without causing the STMPE801 to return interrupts. There is no reading operation from the STMPE801. 3/6

Pseudo-Code of the KPC software AN2421 3 Pseudo-Code of the KPC software DEFINITIONS BB_GPIO_n 801_GPIO_n Max_X = 8 Max_Y=8 INITIALIZATION Set BB_GPIO as inputs Set 801_GPIO as outputs Set 801_GPIO to output 0xFF VARIABLES XCount=0 YCount=0 LOOP YCount=0 LOOP <I2C Transaction> Set 801_GPIO to output ( ~(YCount<<0x01) ) READ BB_GPIO (and interpret keypress) YCount++ END LOOP IF YCount = Max_Y END LOOP WRITE_KEYS_TO_BUFFER 4/6

Performance 4 Performance To ensure minimum I 2 C activity, with 20-ms scanning interval (50 scan cycles per second) for an 8*8 keypad matrix, 400 I 2 C transactions are required per second with each transaction writing to one single register in STMPE801 for driving the respective column low and reading the BB_GPIO status. Assuming the transaction length is approximately 40-bit time (I 2 C address with ACK, Register address with ACK, Register Data with ACK, inter-transaction time), the total bittime per second is: Equation 1 400 40= 16.000 bit time The I 2 C interface has a bandwidth of 400Kbit/s, so the keypad controller uses only 16/400 (4%) of the I 2 C bandwidth. There are no interrupts from STMPE801 to the Baseband. 5 Enhancements It is possible to further enhance keypad controller performance using the following recommendations: In Idle state, Baseband goes into hibernation STMPE801 GPIOs are configured to inputs with interrupt enabled If any keys are pressed, the STMPE801 sends an interrupt to wake up the Baseband and start the scanning operation (STMPE801 reverts to operating as output). This enables the system to enter Deep Hibernation mode and still detect key presses. This enhancement also further reduces I 2 C bandwidth requirements as a scanning operation occurs if and only if a key is pressed. 6 Revision history Table 1. Document revision history Date Revision Changes 20-Nov-2006 1 Initial release. 5/6

Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2006 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 6/6