Part # Application Note General Purpose datasheet

Part Manufacturer: ST Microelectronics

ST Microelectronics

Part Description: Using ST6 analog inputs for multiple key decoding

Part Details:

AN431 Application note Using ST6 analog inputs for multiple key decoding INTRODUCTION The ST6 on-chip Analog to Digital Converter (ADC) is a useful peripheral integrated into the sili-con of the ST6 family members. The flexibility of the I/O port structure allows the multiplexing ofup to 13/8 Analog Inputs into the converter in a 28/20 pin device for the ST6210/15 2k ROM andST6220/25 4k ROM families, enabling full freedom in circuit layout. Many other members of theST6 family also offer the Analog to Digital converter. One of the more novel and practical applications of this converter, is to decode a number of keys.The technique is to connect the keys by resistive voltage dividers to the converter inputs. An ex-ample of key detection using 10 keys is illustrated in this note. Using the Analog to Digital converter in this fashion does not require a static current and avoidsfalse key detection. BASIC CIRCUIT The basic circuit of the key decoder consists of a pull-up resistor connected to the ST6 Analog toDigital converter input with the first key directly switching to ground. The following keys are thenconnected in sequence to the ADC input through serial resistors. The number of keys which maybe detected depends on the tolerance of the resistors used. It can be seen that if more than onekey is pressed at the same time, the key detected will be the next key in the chain closest to theADC input. This also allows the keys in the keyboard to be prioritized. June 2008 Rev 2 1/15 ANALOG KEYBOARD PRINCIPLE OF OPERATION The combination of the pull-up resistor, the serial resistors and the pressed key form a resistivevoltage divider, generating a different voltage at the ADC input for each key pressed. The serialresistors are selected in order to give an equal distribution of voltage between VDD and VSS foreach switch combination to give the best noise margin between keys. When a key is pressed, the voltage at the ADC input is given by the activated voltage divider.This analog voltage is converted by the ADC and the digital value is used to determine whichswitch is closed. Two successive conversions may be made to avoid the influence of key bounce. If the top key is pressed, the voltage measured is always zero. For n keys, the resistor values shouldbe selected such that the voltage for the second key from top is VDD/n, for the 3rd - 2xVDD/n, for the Figure 1. Analog Keyboard resistor key matrix Figure 2. Multiple key press 2/15 ANALOG KEYBOARD Table 1. Key code ranges Valid Code Distance to 4th - 3xVDD/n and for the nth - (n-1)xVDD/n. Re- Key Nr sistor values from the tolerance set used Range next key must be selected to meet this requirement. 1 0 24 The recommended resistor values for a10-key keyboard with 2% resistors from the 2 18-1A 22 E24 series, used with a 10k pull-up resistor, 3 30-33 22 are shown in table 2. If more current can be al-lowed, then a 1k resistor can be used in 4 49-4E 21 which case the serial resistor values shouldbe divided by 10. 5 63-68 20 6 7C-81 22 7

Please click the following link to download the datasheet:

Application Note General Purpose.pdf Datasheet