The goal of this application note is to present a standard example of the use of the Analog to Digital Converter (ADC) of the ST7. In this note, the ADC is used to convert a 16-key analog keyboard. The technique for the keyboard is to connect the keys by resistive dividers to one of the converter inputs. The Application note is based on ST72F324 which has an embedded 10-bit ADC.
The document presents a standard example of utilizing the Analog-to-Digital Converter (ADC) in ST7 microcontrollers, specifically based on the ST72F324 model. It details the hardware interface required to connect an analog keyboard with resistive dividers to the converter inputs.
The note covers the configuration of I/O ports and ADC registers, including control bits for speed and channel selection. It provides practical limitations regarding resistor tolerance and ADC errors, along with specific digital value thresholds for key detection in a 16-key setup.
| ADC Resolution | 10-bit successive approximation converter |
|---|---|
| Max Analog Inputs | Up to 12 analog inputs on ST72F324 |
| Conversion Time | 15 ADC cycles including sampling time of 4 ADC cycles |
| Total Unadjusted Error (TUE) | 4 LSB |
The application has been tested with a ST72F324 configured as described.
With a 10-bit ADC, up to 1023 keys can be decoded.
It is advised to use a 1% tolerance resistor for the pull-up.