Rev. 1.10
92
November 04, 2019
Rev. 1.10
93
November 04, 2019
HT45F5Q-3
Battery Charger Flash MCU
HT45F5Q-3
Battery Charger Flash MCU
Controlling the power on/off function of the A/D converter circuitry is implemented using the
ADCEN bit in the SADC0 register. This bit must be set high to power on the A/D converter. When
the ADCEN bit is set high to power on the A/D converter internal circuitry a certain delay, as
indicated in the timing diagram, must be allowed before an A/D conversion is initiated. Even if
no pins are selected for use as A/D inputs, if the ADCEN bit is high, then some power will still be
consumed. In power conscious applications it is therefore recommended that the ADCEN is set low
to reduce power consumption when the A/D converter function is not being used.
Conversion Rate and Timing Diagram
A complete A/D conversion contains two parts, data sampling and data conversion. The data
sampling which is defined as t
ADS
takes 4 A/D clock cycles and the data conversion takes 12 A/D
clock cycles. Therefore a total of 16 A/D clock cycles for an external input A/D conversion which is
defined as t
ADC
are necessary.
Maximum single A/D conversion rate = A/D clock period / 16
The accompanying diagram shows graphically the various stages involved in an analog to digital
conversion process and its associated timing. After an A/D conversion process has been initiated
by the application program, the microcontroller internal hardware will begin to carry out the
conversion, during which time the program can continue with other functions. The time taken for the
A/D conversion is 16 t
ADCK
clock cycles where t
ADCK
is equal to the A/D clock period.
ADCEN
START
ADBZ
SACS[3:0]
(SAINS[2:0]=000)
off
on
off
on
t
ON2ST
t
ADS
A/D sampling time
t
ADS
A/D sampling time
Start of A/D conversion
Start of A/D conversion
Start of A/D conversion
End of A/D
conversion
End of A/D
conversion
t
ADC
A/D conversion time
t
ADC
A/D conversion time
t
ADC
A/D conversion time
0011B
0010B
0000B
0001B
A/D channel
switch
A/D Conversion Timing – External Channel Input
Summary of A/D Conversion Steps
The following summarises the individual steps that should be executed in order to implement an A/D
conversion process.
•
Step 1
Select the required A/D conversion clock by correctly programming bits SACKS2~SACKS0 in
the SADC1 register.
• Step 2
Enable the A/D converter by setting the ADCEN bit in the SADC0 register to 1.
•
Step 3
Select which signal is to be connected to the internal A/D converter by correctly configuring the
SAINS2~SAINS0 bits.
Select the external channel input to be converted, go to Step 4.
Select the internal analog signal to be converted, go to Step 5.