NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
478
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
12-bit SAR ADC
Internal
Band-gap
(V
BG
)
AV
DD
(2.5~5.5V)
ADC
Channel 7
RSLT(ADDR7[15:0])
Channel Setting:
Select ADC Channel 7 Source as Internal Band-gap and
enable ADC Channe 7.
ADC->ADCHER = 0x00000180;
12
V
BG
00
01
PRESEL(ADCHER[9:8]) = 2'b01
10
11
Figure 6.17-6 V
BG
for Measuring AV
DD
Application Block Diagram
For example, the V
BG
typical value is 1.25 V, the ADC is 12-bit resolution, select V
BG
as ADC
channel 7 input source, and enable ADC channel 7. Then trigger ADC to converse.
If the A/D conversion result is 1707:
N = 12
R = 1707
V
BG
= 1.25 V
AV
DD
= ((2 ^ 12) / 1707) * 1.25 = (4096 / 1707) * 1.25 = 3 V
If the A/D conversion result is 2048:
AV
DD
= ((2 ^ 12) / 2048) * 1.25 = (4096 / 2048) * 1.25 = 2.5 V
6.17.5.6 External trigger Input Sampling and A/D Conversion Time
In single-cycle scan mode, A/D conversion can be triggered by external pin request. When the
TRGEN (ADCR[8]) is set to high to enable ADC external trigger function, setting the TRGS bits
(ADCR[5:4]) to 00b is to select external trigger input from the STADC pin. Software can set
TRGCOND (ADCR[7:6]) to select trigger condition is falling/rising edge or low/high level. If level
trigger condition is selected, the STADC pin must be kept at defined state at least 8 PCLKs. The
ADST bit will be set to 1 at the 9th PCLK and start to conversion. Conversion is continuous if
external trigger input is kept at active state in level trigger mode. It is stopped only when external
condition trigger condition disappears. If edge trigger condition is selected, the high and low state
must be kept at least 4 PLCKs. Pulse that is shorter than this specification will be ignored.
6.17.5.7 PWM Center-aligned trigger
In single-cycle scan mode, the PWM can be the trigger source of ADC by setting the TRGEN