Rev. 1.40
1�8
De�e��e� 1�� �01�
Rev. 1.40
1�9
De�e��e� 1�� �01�
BS67F340/BS67F350/BS67F360/BS67F370
Enhanced Touch A/D Flash MCU with LCD Driver
BS67F340/BS67F350/BS67F360/BS67F370
Enhanced Touch A/D Flash MCU with LCD Driver
A/D Converter Data Registers – ADRL, ADRH
As these devices contain an internal 12-bit A/D converter, it requires two data registers to store the
converted value. These are a high byte register, known as ADRH, and a low byte register, known
as ADRL. After the conversion process takes place, these registers can be directly read by the
microcontroller to obtain the digitised conversion value. As only 12 bits of the 16-bit register space
is utilised, the format in which the data is stored is controlled by the ADRFS bit in the ADCR0
register as shown in the accompanying table. D0~D11 are the A/D conversion result data bits. Any
unused bits will be read as zero. Note that the A/D data register contents can only be read in the A/
D conversion completion interrupt service subroutine when the Auto-conversion mode is enabled by
setting the ATM bit in the ADCR1 register to 1. The A/D data registers contents will be cleared to
zero if the A/D converter is disabled.
ADRFS
ADRH
ADRL
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
0
D11 D10 D9 D8 D7 D� D� D4 D3 D� D1 D0
0
0
0
0
1
0
0
0
0
D11 D10 D9 D8 D7 D� D� D4 D3 D� D1 D0
A/D Converter Data Registers
A/D Converter Control Registers
–
ADCR0, ADCR1
To control the function and operation of the A/D converter, two control registers known as
ADCR0 and ADCR1 are provided. These 8-bit registers define functions such as the selection of
which analog channel is connected to the internal A/D converter, the digitised data format, the A/
D clock source as well as controlling the start function and monitoring the A/D converter busy
status. As these devices contain only one actual analog to digital converter hardware circuit, each
of the external and internal analog signals must be routed to the converter. The ACS3~ACS0 bits
in 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
Exte�nal �hannel analog input
1
0
1xxx
VTSO
Te�pe�atu�e Senso� output voltage
1
1
1xxx
VTSVREF
Te�pe�atu�e Senso� �efe�en�e 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.