English
Language : 

AN979 Datasheet, PDF (8/14 Pages) STMicroelectronics – DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC
DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC
6 DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC
The complete software is provided in an attached zip file (in assembly & C using ST7 software
library version 1.1) to this application note. It is only an example. It is up to the user to adapt it
to the application.
6.1 GENERAL DESCRIPTION
A 16-key keyboard is connected to the ST72F324 through the AIN0 pin on Port D.
A LED is connected to an output pin (PC0) to indicate to the user that a key is detected.
Figure 5. Application circuitry
ST7
output
VSS
ADC
VDD
analog
input
VDD
Rup
R0
LED
key 0
R14
key 15
VSS
The software uses a polling strategy. It makes conversions continuously (no wake-up
process).
First the software initializes the I/Os and the ADC.
When a conversion is done, the software decides if a key was pressed or not.
If not, it waits before analyzing the result of a new conversion.
If a key is pressed, it compares it with the former key to know if the key is stabilized. Then, a
LED is switched on.
8/14