Rev. 1.00
120
September 11, 2018
Rev. 1.00
121
September 11, 2018
HT45F4050
A/D NFC Flash MCU
HT45F4050
A/D NFC Flash MCU
The relevant pin-shared function selection bits determine which pins on I/O
Port
s are used as analog
inputs for the A/D converter input and which pins are not to be used as the A/D converter input.
When the pin is selected to be an A/D
converter input, its original function whether it is an I/O or
other pin-shared function will be removed. In addition, any internal pull-high resistor connected to
the pin will be automatically removed if the pin is selected to be an A/D converter input.
• SADC0 Register
Bit
7
6
5
4
3
2
1
0
Name
START
ADBZ
ADCEN
ADRFS
SACS3
SACS2
SACS1
SACS0
R/W
R/W
R
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
0
0
0
0
0
0
0
Bit 7
START
: Start the A/D conversion
0
→
1
→0: Start A/D conversion
This bit is used to initiate an A/D conversion process. The bit is normally low but if set
high and then cleared low again, the A/D converter will initiate a conversion process.
Bit 6
ADBZ
: A/
D
Converter busy flag
0:
No A/D conversion is in progress
1: A/D conversion is in progress
This read only flag is used to indicate whether the A/D conversion is in progress or
not. When the START bit is set from low to high and then to low again, the ADBZ flag
will be set high to indicate that the A/D conversion is initiated. The ADBZ flag will be
cleared to zero after the A/D conversion is complete.
Bit 5
ADCEN
: A/
D
Converter
function enable control
0: D
isable
1: E
nable
This bit controls the A/D converter internal function. This bit should be set high to
enable the A/D converter. If the bit is set low, then the A/D converter will be switched
off reducing the device power consumption. When the A/D converter function is
disabled, the contents of the A/D converter data register pair, SADOH and SADOL,
will keep unchanged
.
Bit 4
ADRFS
: A/D Converter data format control
0: ADC output data format → SADOH=D[11:4]; SADOL=D[3:0]
1: ADC output data format → SADOH=D[11:8]; SADOL=D[7:0]
This bit controls the format of the 12-bit converted A/D converter value in the two
A/D converter data registers. Details are provided in the A/D converter data register
section.
Bit 3~0
SACS3~SACS0
: A/
D
converter external analog input channel selection
0000: External
AN0 input
0001: External
AN1 input
0010: External
AN2 input
0011: External
AN3 input
0100: External
AN4 input
0101: External
AN5 input
0110: External
AN6 input
0111: External
AN7 input
1000: External
AN8 input
1001: External
AN9 input
1010: External
AN10 input
1011: External
AN11 input
1100: External
AN12 input
1101~1111:
Undefined, input floating
These bits are used to select which external analog input channel is to be converted.
When the external analog input channel is selected, the SAINS bit field must be set to
"000
0
", "0
100
" or "
11xx
". Details are summarized in the "A/D Converter Input Signal
Selection" table.