
Rev. 1.00
194 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
12
Analog to Digital Converter (ADC)
Sampling Time Setting
The conversion channel sampling time can be programmed according to the input resistance of the
input voltage source. This sampling time must be enough for the input voltage source to charge the
internal sample and hold capacitor in the A/D converter to the input voltage level. Each conversion
channel is sampled with the same sampling time. By modifying the ADST[7:0] bits in the ADCSTR
register, the sampling time of the analog input signal can be determined.
The total conversion time (T
conv
) is calculated using the following formula:
T
conv
= T
Sampling
+ T
Latency
Where the minimum sampling time T
Sampling
= 1.5 cycles (when ADST[7:0] = 0) and the minimum
channel conversion latency T
Latency
= 12.5 cycles.
Example:
With the A/D Converter clock CK_ADC = 14 MHz and a sampling time = 1.5 cycles:
T
conv
= 1.5 + 12.5 = 14 cycles = 1 μs
Data Format
The ADC conversion result can be read in the ADCDRy register and the data format is shown in
the following table.
Table 28. Data Format in ADCDR [15:0]
Description
ADCDR register Data Format
Right aligned
“0_0_0_0_d11_d10_d9_d8_d7_d6_d5_d4_d3_d2_d1_d0”
Analog Watchdog
The A/D converter includes a watchdog function to monitor the converted data. There are two
kinds of thresholds for the watchdog monitor function, known as the watchdog lower threshold
and watchdog upper threshold, which are specified by the ADLT bit field and ADUT bit field in the
ADCTR register respectively. The watchdog monitor function is enabled by setting the watchdog
upper and lower threshold monitor function enable bits, ADWUE and ADWLE, in the watchdog
control register ADCWCR. The channel to be monitored can be specified by configuring the
ADWCH and ADWALL bits. When the converted data is less or higher than the lower or upper
threshold, as defined by the ADLT bit field and ADUT bit field in the ADCTR register respectively,
the watchdog lower or upper threshold interrupt raw flags, ADIRAWL or ADIRAWU in the
ADCIRAW register, will be asserted if the watchdog lower or upper threshold monitor function
is enabled. If the lower or upper threshold interrupt raw flag is asserted and the corresponding
interrupt is enabled by setting the ADIEL or ADIEU bit in the ADCIER register, the A/D watchdog
lower or upper threshold interrupt will be generated.