Interfaces and Connectors
EBX-22 Reference Manual
52
B
INARY
F
ORMAT
(0
TO
+4.095V
O
NLY
)
The full analog input range is divided into 4096 steps. The output code (0000h) is associated with
an analog input voltage of 0 volts (ground). All codes are considered positive.
The following formulas are used for calculating analog and digital values:
Step
Analog
Digital =
Analog = Step Digital
x
Where:
Analog = Applied voltage
Digital = A/D conversion data
Step
= 0.001V
Sample values are shown in the following table.
Table 25: Binary Data Format
0 to +4.096V
Input Voltage
Hex Decimal
Comment
+4.096V
–
– Out of range
+4.095V
0FFFh
4095 Maximum voltage
+2.048V
0800h
2048 Half scale
+1.024V 0400h
1024
Quarter
scale
+0.001V
0001h
1 1 LSB
0.000000
0000h
0 Zero (ground input)
ADC
S
TATE
M
ACHINE
Data Registers
The EBX-22 ADC state machine uses eight 16-bit registers for analog input, at even-numbered
base addresses from I/O port 1C0h to 1CEh. The state machine continuously reads ADC channels
in a “round robin” fashion and places the data in the 16-bit registers. It reads the eight channels
approximately 40,000 times a second. To enable the ADC state machine, the ADC field (bits D1-
D0) of the MODCON register (1DFh) must be set to 2h (see Table 44 for mode control settings).
This is best done by a read-modify-write procedure since the other bits in the register control
other devices.
StockCheck.com