ST7262
10-BIT A/D CONVERTER (ADC) (Cont’d)
10.7.3.4 A/D Conversion
Conversion can be performed in One-Shot or Con-
tinuous mode. Continuous mode is typically used
for monitoring a single channel. One-shot mode
should be used when the application requires in-
puts from several channels.
2.Set the ADON bit to enable the A/D converter
and to start the conversion. The EOC bit is kept
low by hardware during the conversion.
Note: Changing the A/D channel during conver-
sion will stop the current conversion and start con-
version of the newly selected channel.
ADC Configuration
The analog input ports must be configured as in-
put, no pull-up, no interrupt. Refer to the «I/O
ports» chapter. Using these pins as analog inputs
does not affect the ability of the port to be read as
a logic input.
In the ADCCSR register:
– Select the CS[2:0] bits to assign the analog
channel to convert.
ADC One-Shot Conversion mode
In the ADCCSR register:
1.Set the ONE SHOT bit to put the A/D converter
in one shot mode.
When a conversion is complete:
– The EOC bit is set by hardware.
– An interrupt request is generated if the ITE bit
is set.
– The ADON bit is reset by hardware.
– The result is in the ADCDR registers.
To read the 10 bits, perform the following steps:
1. Wait for interrupt or poll the EOC bit
2. Read ADCDRLSB
3. Read ADCDRMSB
The EOC bit is reset by hardware once the AD-
CDRMSB is read.
Figure 51. ADC Block Diagram
fCPU
DIV 2
DIV 4
0 fADC
1
EOC Interrupt
EOC SPEED ADON
ITE
ONE
SHOT
CS2
CS1
CS0
ADCCSR
AIN0
AIN1
AINx
3
ANALOG
MUX
ANALOG TO DIGITAL
CONVERTER
ADCDRMSB D9 D8 D7 D6 D5 D4 D3 D2
ADCDRLSB 0 0 0 0 0 0 D1 D0
89/133