English
Language : 

AN979 Datasheet, PDF (5/14 Pages) STMicroelectronics – DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC
DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC
When ‘key i’ is pressed (where i is in the range 1 to 15), the resistor Ri-1 is connected to Vss.
Then we have a resistive divider
and Vkey is given by the formula:
Vkey i =
i-1
Σ (VDD - VSS) Rj
j=0
i-1
Σ Rup + Rj
j=0
So the corresponding voltage of each key is given by the values of the resistors. An equal dis-
tribution of voltage between VDD and VSS is usually recommended.
To recognize a key, the user will measure Vkey and will be able to decide which key was
pressed.
4.2 PRACTICAL LIMITATIONS
Theoretically, with an 10-bit ADC, 1023 keys can be decoded. But potential errors must be
taken into account. They can come from the power supply, the key resistivity, the resistor tol-
erance, the ADC conversion errors.
The resistor tolerance is the main limitation as usually 5% tolerance resistors are used. It is
advised to use a 1% tolerance resistor for the pull-up. Changing this resistor greatly improves
the keyboard as the pull-up has an influence on every key.
The ADC total unadjusted error (TUE) for the device is specified as 4 LSB. So, it has to be
taken into account to avoid any key decision error.
These parameters will reduce the number of keys that can be efficiently decoded.
5/14