MS51
Dec. 17, 2019
Page
130
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
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.
01 = PWM2.
10 = PWM4
11 = STADC pin.
3:0
ADCHS[3:0]
A/D converting channel select
This filed selects the activating analog input source of ADC. If ADCEN is 0, all inputs are
disconnected.
0000 = ADC_CH0.
0001 = ADC_CH1.
0010 = ADC_CH2.
0011 = ADC_CH3.
0100 = ADC_CH4.
0101 = ADC_CH5.
0110 = ADC_CH6.
0111 = ADC_CH7
1000 = Internal band-gap voltage.
Others = Reserved.