Rev. 1.60
146
August 20, 2019
Rev. 1.60
147
August 20, 2019
BS66F340/BS66F350/BS66F360/BS66F370
Touch A/D Flash MCU with LED Driver
BS66F340/BS66F350/BS66F360/BS66F370
Touch A/D Flash MCU with LED Driver
the ADCR0 register and the TSE and BGMEN bits in the TSC1 and TSC0 registers are used to
determine that the specific external channel input or relevant internal temperature sensor signal is
selected to be converted. If the internal temperature sensor analog signal is selected to be converted,
the ACS3~ACS0 bits should be set as "1xxx" together with proper configurations of TSE and
BGMEN bits.
TSE
BGMEN
ACS3~ACS0
Input Signals
Description
0
x
x000~x111
AN0~AN7
External channel analog input
1
0
1xxx
V
TSO
Temperature Sensor output voltage
1
1
1xxx
V
TSVREF
Temperature Sensor reference voltage
A/D Converter Input Signal Selection
The relevant pin-shared function selection bits determine which pins on I/O Ports 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 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.
• ADCR0 Register
Bit
7
6
5
4
3
2
1
0
Name
START
ADBZ
ADCEN
ADRFS
ACS3
ACS2
ACS1
ACS0
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
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 to 1 to indicate that the A/D conversion is initiated. The ADBZ flag will be
cleared to 0 after the A/D conversion is complete.
Bit 5
ADCEN
: A/D Converter function enable control
0: Disable
1: Enable
This bit controls the A/D internal function. This bit should be set to one 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 data register pair known as ADRH and ADRL will be cleared
to zero.
Bit 4
ADRFS
: A/D conversion data format select
0: A/D converter data format
→
ADRH=D [11:4]; ADRL=D [3:0]
1: A/D converter data format
→
ADRH=D [11:8]; ADRL=D [7:0]
This bit controls the format of the 12-bit converted A/D value in the two A/D data
registers. Details are provided in the A/D converter data register section.
Bit 3~0
ACS3~ACS0
: A/D converter analog input signal select
0000: External AN0 input
0001: External AN1 input
0010: External AN2 input
0011: External AN3 input
0100: External AN4 input