
MS51
Dec. 17, 2019
Page
300
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
Formula as following
For example:
Read the 2 bytes value after the UID address, wherein the first byte value is 0x64, and the second
byte value is 0x0E, merged as 0x64E = 1614. The conversion result is as follows:
Band-gap as ADC input to calculate the V
DD
value:
MS51 internal embedded band-gap voltage also can be the internal ADC input. This input is useful to
measure V
REF
value then means can know the V
DD
value from ADC convert result.
6.12.5
Control Registers
ADCCON0
– ADC Control 0
Regiser
Address
Reset Value
ADCCON0
E8H, page 0, Bit addressable
0000_0000b
7
6
5
4
3
2
1
0
ADCF
ADCS
ETGSEL1
ETGSEL0
ADCHS3
ADCHS2
ADCHS1
ADCHS0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Bit
Name
Description
7
ADCF
ADC flag
This flag is set when an A/D conversion is completed. The ADC result can be read. While this
flag is 1, ADC cannot start a new converting. This bit is cleared by software.
6
ADCS
A/D converting software start trigger
Setting this bit 1 triggers an A/D conversion. This bit remains logic 1 during A/D converting
time and is automatically cleared via hardware right after conversion complete. The meaning
of writing and reading ADCS bit is different.
Writing:
0 = No effect.
1 = Start an A/D converting.
Reading:
0 = ADC is in idle state.
1 = ADC is busy in converting.
5:4
ETGSEL[1:0]
External trigger source select
When ADCEX (ADCCON1.1) is set, these bits select which pin output triggers ADC
conversion.
00 = PWM0 channel 0.
01 = PWM0 channel 2.
10 = PWM0 channel 4.
11 = STADC pin.