SN32F760 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 92
Version 2.0
7.3 ADC CONTROL NOTICE
7.3.1
ADC SIGNAL
The ADC high reference voltage is internal Vdd or external voltage source. The ADC low reference voltage is ground.
The ADC input signal voltage range must be from high reference voltage to low reference voltage.
The external high reference voltage from
P2.0 must be higher than “Low reference voltage + 2V”. The low
reference voltage is ground. So the external reference voltage range must be under 2V~Vdd.
7.3.2
ADC PROGRAM
The first step of ADC execution is to setup ADC configuration. The ADC program setup sequence and notices are as
following.
Step 1:
Enable ADC. ADENB is ADC control bit to control. ADENB = 1 is to enable ADC. ADENB = 0 is to disable
ADC.
When ADENB is enabled, the system must be delay 100us to be the ADC warm-up time by program,
and then set ADS to do ADC converting. The 100us delay time is necessary after ADENB setting (not ADS
setting), or the ADC converting result would be error.
Normally, the ADENB is set one time when the system
under normal run condition, and do the delay time only one time.
Step 2:
If the ADC high reference voltage is from external voltage source, set the AVREFHSEL = 1. The ADC
external high reference voltage inputs from P2.0 pin.
It is necessary to set P2.0 as input mode without pull-up
resistor.
Step 3:
Select the ADC input pin by CHS[3:0], and enable ADC global input.
When one AIN pin is selected to
be analog signal input pin, it is necessary to setup the pin as input mode and disable the pull-up resistor
by program.
Step 4:
Start to execute ADC conversion by setting ADS = 1.
Step 5:
Wait the end of ADC converting through checking EOC = 1 or ADCIF = 1. If ADC interrupt function is
enabled, the program executes ADC interrupt service when ADC interrupt occurrence.
ADS is cleared when the
end of ADC converting automatically. EOC bit indicates ADC processing status immediately and is
cleared when ADS = 1. Users needn’t to clear it by program.
7.4 ADC CIRCUIT
VCC
GND
0.1uF
Analog Signal Input
47uF
0.1uF
External High
Reference Voltage
Main Power Trunk
AINn/P2.n
VSS
AVREFH
MCU
A
B
C
The analog signal is inputted to ADC input pin “AINn/P2.n”. The ADC input signal must be through a 0.1uF capacitor
“A”. The 0.1uF capacitor is set between ADC input pin and VSS pin, and must be on the side of the ADC input pin as
possible. Don’t connect the capacitor’s ground pin to ground plain directly, and must be through VSS pin. The capacitor
can reduce the power noise effective coupled with the analog signal.
If the ADC high reference voltage is from external voltage source, the external high reference is connected to AVREFH
pin (P2.0). The external high reference source must be through a 47uF ”C” capacitor first, and then 0.1uF capacitor “B”.