User Manual

34
5.3 Analog Inputs
There are 8 pins that can be configured as analog inputs. Refer to Table 4-2
for the specific I/O pin capabilities.
Using the analog input pins consists of the following:
Configuring the pins
Select direction as analog input. Select the analog-to-digital
converter settings for each specific pin configured as an analog input
(refer to Section 4.2.7).
Configuring the sleep state of the pins
Select direction (input or output), enable or disable pull-up or pull-
down resistors for pins configured as digital inputs, and set the
output value for pins configured as digital outputs. Note that pins
configured as analog inputs under normal operating mode can be set
as anything when the Matrix module is put into Sleep Mode.
Reading the state of the pins configured as analog inputs
Read the analog value of the signal applied to the pins configured as
inputs.
The voltage on the analog input pins is determined by the following
equations. These equations take into account the “reference
voltage” and “resolution” from the “Analog Input ADC Settings”. The
“Analog Input ADC Settings” can be set and queried from the module
using host messages 0x25 (Set Analog Input ADC Settings) and
0x26 (Query Analog Input ADC Settings).
8 Bit Resolution
Analog Input Voltage = (Analog Value / 128) x Reference Voltage
10 Bit Resolution
Analog Input Voltage = (Analog Value / 512) x Reference Voltage
12 Bit Resolution
Analog Input Voltage = (Analog Value / 2048) x Reference Voltage
14 Bit Resolution
Analog Input Voltage = (Analog Value / 8192) x Reference Voltage