High Voltage Touch A/D Flash MCU with HVIO
BS86DH12C
Revision: V1.00 Date: October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Table of Contents
Features ................................................................................................................. 7
CPU Features ...............................................................................................................................7
Peripheral Features ....................................................................................................................... 7
General Description .............................................................................................. 8
Block Diagram ....................................................................................................... 9
Pin Assignment ..................................................................................................... 9
Pin Descriptions ................................................................................................. 11
Absolute Maximum Ratings ............................................................................... 14
D.C. Electrical Characteristics ........................................................................... 15
Operating Voltage Characteristics ...............................................................................................15
Operating Current Characteristics ...............................................................................................15
Standby Current Characteristics .................................................................................................16
A.C. Characteristics ............................................................................................ 16
High Speed Internal Oscillator – HIRC – Frequency Accuracy ...................................................16
Internal Low Speed Oscillator Characteristics – LIRC ................................................................17
External Low Speed Oscillator Characteristics – LXT ................................................................. 17
Operating Frequency Characteristic Curves ............................................................................... 17
System Start Up Time Characteristics ........................................................................................18
Input/Output Characteristics ............................................................................. 19
Memory Characteristics ..................................................................................... 19
LVD/LVR Electrical Characteristics ................................................................... 20
A/D Converter Electrical Characteristics .......................................................... 20
Internal Reference Voltage Characteristics ...................................................... 21
High Voltage I/O Electrical Characteristics ...................................................... 21
Voltage Detector Electrical Characteristics .................................................................................21
High Voltage I/O Other Electrical Characteristics ........................................................................22
Low Dropout Regulator Electrical Characteristics .......................................... 22
OCP Electrical Characteristics .......................................................................... 24
OVP Electrical Characteristics ..........................................................................24
Power-on Reset Characteristics ........................................................................ 25
System Architecture ........................................................................................... 25
Clocking and Pipelining ............................................................................................................... 25
Program Counter ......................................................................................................................... 26
Stack ...........................................................................................................................................27
Arithmetic and Logic Unit – ALU .................................................................................................27
Flash Program Memory ...................................................................................... 28
Structure ...................................................................................................................................... 28
Special Vectors ...........................................................................................................................28
Rev. 1.00 2 October 26, 2018 Rev . 1.00 3 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Look-up Table .............................................................................................................................. 28
Table Program Example .............................................................................................................. 29
In Circuit Programming – ICP .....................................................................................................30
On-Chip Debug Support – OCDS ...............................................................................................31
Data Memory ....................................................................................................... 31
Structure ...................................................................................................................................... 31
Data Memory Addressing ............................................................................................................ 32
General Purpose Data Memory ..................................................................................................32
Special Purpose Data Memory ...................................................................................................32
Special Function Register Description ............................................................. 34
Indirect Addressing Registers – IAR0, IAR1, IAR2 .....................................................................34
Memory Pointers – MP0, MP1L/MP1H, MP2L/MP2H ................................................................. 34
Accumulator – ACC .................................................................................................................... 35
Program Counter Low Register – PCL .......................................................................................36
Look-up Table Registers – TBLP, TBHP, TBLH .......................................................................... 36
Status Register – STATUS .........................................................................................................36
EEPROM Data Memory ....................................................................................... 38
EEPROM Data Memory Structure ..............................................................................................38
EEPROM Registers ....................................................................................................................38
Reading Data from the EEPROM ...............................................................................................39
Writing Data to the EEPROM ......................................................................................................40
EEPROM Interrupt ......................................................................................................................40
Programming Considerations ...................................................................................................... 40
Oscillators ...........................................................................................................42
Oscillator Overview .....................................................................................................................42
System Clock Congurations ...................................................................................................... 42
Internal High Speed RC Oscillator – HIRC .................................................................................43
Internal 32kHz Oscillator – LIRC ................................................................................................. 43
External 32.768 kHz Crystal Oscillator – LXT .............................................................................43
Operating Modes and System Clocks .............................................................. 45
System Clocks ............................................................................................................................45
System Operation Modes ............................................................................................................ 46
Control Registers ........................................................................................................................47
Operating Mode Switching .......................................................................................................... 49
Standby Current Considerations ................................................................................................. 53
Wake-up ......................................................................................................................................53
Watchdog Timer .................................................................................................. 54
Watchdog Timer Clock Source .................................................................................................... 54
Watchdog Timer Control Register ............................................................................................... 54
Watchdog Timer Operation ......................................................................................................... 55
Reset and Initialisation ....................................................................................... 56
Reset Functions ..........................................................................................................................56
Reset Initial Conditions ...............................................................................................................59
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Input/Output Ports .............................................................................................. 63
Pull-high Resistors ......................................................................................................................63
Port A Wake-up ...........................................................................................................................64
I/O Port Control Registers ........................................................................................................... 64
I/O Port Source Current Selection ...............................................................................................64
I/O Port Sink Current Selection ................................................................................................... 66
Pin-shared Functions ..................................................................................................................68
I/O Pin Structures ........................................................................................................................ 72
Programming Considerations ...................................................................................................... 72
High Voltage I/O Port .......................................................................................... 73
High Voltage I/O Registers ..........................................................................................................74
Voltage Detector ..........................................................................................................................75
Short-circuit Protection Function ................................................................................................. 76
Low Dropout Regulator – LDO .......................................................................... 77
Timer Modules – TM ...........................................................................................77
Introduction .................................................................................................................................77
TM Operation ..............................................................................................................................77
TM Clock Source ......................................................................................................................... 78
TM Interrupts ............................................................................................................................... 78
TM External Pins ......................................................................................................................... 78
Programming Considerations ...................................................................................................... 79
Compact Type TM – CTM ................................................................................... 80
Compact Type TM Operation ......................................................................................................80
Compact Type TM Register Description......................................................................................81
Compact Type TM Operation Modes ..........................................................................................84
Periodic Type TM – PTM ..................................................................................... 90
Periodic TM Operation ................................................................................................................90
Periodic Type TM Register Description .......................................................................................90
Periodic Type TM Operation Modes ............................................................................................95
Analog to Digital Converter ............................................................................. 104
A/D Overview ............................................................................................................................104
A/D Converter Register Description .......................................................................................... 105
A/D Converter Reference Voltage .............................................................................................107
A/D Converter Input Signals ...................................................................................................... 108
A/D Converter Operation ........................................................................................................... 108
Conversion Rate and Timing Diagram ......................................................................................109
Summary of A/D Conversion Steps ...........................................................................................110
Programming Considerations .................................................................................................... 111
A/D Transfer Function ............................................................................................................... 111
A/D Programming Examples ..................................................................................................... 112
Touch Key Function ......................................................................................... 114
Touch Key Structure .................................................................................................................. 114
Touch Key Register Denition ................................................................................................... 114
Rev. 1.00 4 October 26, 2018 Rev . 1.00 5 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Touch Key Interrupt ................................................................................................................... 120
Programming Considerations .................................................................................................... 120
Over Current Protection – OCP ....................................................................... 121
Over Current Protection Operation ...........................................................................................121
Over Current Protection Registers ............................................................................................ 122
Input Voltage Range ..................................................................................................................124
Input Offset Calibration .............................................................................................................125
Over Voltage Protection – OVP ........................................................................ 126
Over Voltage Protection Operation ...........................................................................................126
Over Voltage Protection Registers ............................................................................................127
Comparator Input Offset Cancellation ......................................................................................128
I2C Interface ....................................................................................................... 129
I2C Interface Operation .............................................................................................................. 129
I2C Registers .............................................................................................................................131
I2C Bus Communication ............................................................................................................133
I2C Time-out Control ..................................................................................................................137
UART Interface .................................................................................................. 138
UART External Pins ..................................................................................................................139
UART Data Transfer Scheme....................................................................................................139
UART Status and Control Registers..........................................................................................139
Baud Rate Generator ................................................................................................................ 145
UART Setup and Control...........................................................................................................145
UART Transmitter...................................................................................................................... 146
UART Receiver .........................................................................................................................148
Managing Receiver Errors ........................................................................................................149
UART Interrupt Structure...........................................................................................................150
UART Power Down and Wake-up ............................................................................................. 151
Low Voltage Detector – LVD ............................................................................ 152
LVD Register ............................................................................................................................. 152
LVD Operation ........................................................................................................................... 153
Interrupts ........................................................................................................... 154
Interrupt Registers ..................................................................................................................... 154
Interrupt Operation .................................................................................................................... 158
External Interrupt ....................................................................................................................... 159
Touch Key Module Interrupt ......................................................................................................160
Time Base Interrupt ...................................................................................................................160
Multi-function Interrupts ............................................................................................................. 161
I2C Interrupt ............................................................................................................................... 161
UART Transfer Interrupt ............................................................................................................162
LVD Interrupt ............................................................................................................................. 162
A/D Converter Interrupt ............................................................................................................. 162
EEPROM Interrupt ....................................................................................................................162
Over Voltage Protection Interrupt ..............................................................................................163
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Over Current Protection Interrupt .............................................................................................. 163
High Voltage Short Circuit Interrupt ...........................................................................................163
TM Interrupts ............................................................................................................................. 163
Interrupt Wake-up Function .......................................................................................................163
Programming Considerations .................................................................................................... 164
Conguration Options ...................................................................................... 164
Application Circuits .......................................................................................... 165
Instruction Set ................................................................................................... 166
Introduction ...............................................................................................................................166
Instruction Timing ......................................................................................................................166
Moving and Transferring Data ...................................................................................................166
Arithmetic Operations ................................................................................................................ 166
Logical and Rotate Operation ...................................................................................................167
Branches and Control Transfer .................................................................................................167
Bit Operations ...........................................................................................................................167
Table Read Operations .............................................................................................................167
Other Operations ....................................................................................................................... 167
Instruction Set Summary ................................................................................. 168
Table Conventions .....................................................................................................................168
Extended Instruction Set ........................................................................................................... 170
Instruction Denition ........................................................................................ 172
Extended Instruction Denition .................................................................................................181
Package Information ........................................................................................ 188
20-pin SOP (300mil) Outline Dimensions .................................................................................189
28-pin SOP (300mil) Outline Dimensions .................................................................................190
44-pin LQFP (10mm×10mm) (FP2.0mm) Outline Dimensions .................................................191
Rev. 1.00 6 October 26, 2018 Rev . 1.00 7 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Features
CPU Features
• Operating voltage
♦
f
=8/12/16MHz, using internal LDO: VDD=5V (Typ.)
SYS
♦
High Voltage Driver: VCC=7V~10V
• Up to 0.25μ s instruction cycle with 16MHz system clock at VDD=5V
• Power down and wake-up functions to reduce power consumption
• Oscillator types
♦
Internal High Speed 8/12/16MHz RC – HIRC
♦
Internal Low Speed 32kHz RC – LIRC
♦
External Low Speed 32.768kHz Crystal – LXT
• Multi-mode operation: FAST, SLOW, IDLE and SLEEP
• Fully integrated internal oscillators require no external components
• All instructions executed in 1~3 instruction cycles
• Table read instructions
• 115 powerful instructions
• 8-level subroutine nesting
• Bit manipulation instruction
Peripheral Features
• Flash Program Memory: 8K×16
• Data Memory: 512×8
• True EEPROM Memory: 64×8
• 12 touch key functions – fully integrated without requiring external components
• Watchdog Timer function
• 22 bidirectional I/O lines
• 6 bidirectional High Voltage I/O lines with short circuit protection function
• Programmable I/O port source current and sink current for LED driving applications
• Single external interrupt line shared with I/O pin
• Multiple Timer Modules for time measurement, input capture, compare match output or PWM
output or single pulse output function
• Single Time-Base function for generation of xed time interrupt signals
• 8 external channels 12-bit resolution A/D converter with internal reference voltage V
• Over Current Protection function – OCP
• Over Voltage Protection function – OVP
• Internal 5V LDO with driving current of up to 500mA, providing power supply for MCU and
external components
• I2C interface
• Fully-duplex Universal Asynchronous Receiver and Transmitter Interface – UART
• Low voltage reset function
BG
• Low voltage detect function
• Package types: 20/28-pin SOP, 44-pin LQFP
General Description
The device is a Flash Memory type 8-bit high performance RISC architecture microcontroller with
fully integrated touch key functions. With all touch key functions provided internally and with the
convenience of Flash Memory multi-programming features, the device has all the features to offer
designers a reliable and easy means of implementing touch keys within their products applications.
The touch key functions are fully integrated, completely eliminating the need for external
components. In addition to the Flash program memory, other memory includes an area of RAM
Data Memory as well as an area of true EEPROM memory for storage of non-volatile data such as
serial numbers, calibration data etc. Analog feature includes a multi-channel 12-bit A/D converter
and an internal LDO for power supply. Protective features such as an internal Watchdog Timer, Low
Voltage Reset, Low Voltage Detector, Over Current Protection and Over Voltage Protection coupled
with excellent noise immunity and ESD protection ensure that reliable operation is maintained in
hostile electrical environments.
A full choice of external low, internal high and low speed oscillators are provided including fully
integrated system oscillators which require no external components for its implementation. The
ability to operate and switch dynamically between a range of operating modes using different
clock sources gives users the ability to optimise microcontroller operation and minimise power
consumption. Easy communication with the outside world is provided using the internal I2C and
UART interfaces, while the inclusion of exible I/O programming features, Time-Base function,
Timer Modules and many other features further enhance device functionality and exibility.
This device contains programmable I/O port source current and sink current functions which are
used to implement LED driving function. The High Voltage I/O function specic to high voltage and
high current applications is also fully integrated within the device.
The touch key device will find excellent use in a huge range of modern Touch Key product
applications such as sensor signal processing, household appliances, health care products, industrial
control, consumer products, subsystem control to name but a few.
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Rev. 1.00 8 October 26, 2018 Rev . 1.00 9 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Block Diagram
VLDO
VCC1
HVSS
VCC2
PD0~PD5
VDD/AVDD/
VLDO
VSS/AVSS/
IOVSS/HVSS
Reset
Circuit
Pin-Shared
With Port C
Time Base
XT1
XT2
Pin-Shared
With Port A
Port D
Driver
V
DD
V
SS
Interrupt
Controller
8/12/16MHz
High Voltage Analog Peripherals
INT
: Bus Entry : Pin-Shared Node
8K × 16
EEPROM
Watchdog
LIRC
32kHz
LXT
HIRC
Clock System
LDO
(5V)
HV I/O
ROM
64 × 8
Timer
HT8 MCU Core
RAM
512 × 8
Stack
8-Level
LVR/LVD
MUX
Bus
Analog to Digital Converter
Over Current
Protection Circuit
Over Voltage
Protection Circuit
Touch Key Module 2
Touch Key Module 1
Touch Key Module 0
C to F
Circuit
Touch Key Function
Timers
I2C
12-bit
ADC
+
_
+
_
Analog Peripherals
I/O
UART
Digital Peripherals
MUX
MUX
8-bit
DAC
8-bit
DAC
V
V
V
V
Pin-Shared
BG
CC1O
CC2O
OCPAO
Function
AV
DD
OPA
Pin-Shared
With Port A, B & C
Port A
Driver
Port B
Driver
Port C
Driver
VREF
Pin-Shared
With Port A
AN0~AN7
Pin-Shared
With Port A & B
OCPAO
OCPI
Pin-Shared
With Port A & B
OVPI0
OVPI1
Pin-Shared
With Port A, B & C
KEY1~KEY12
PA0~PA7
PB0~PB7
PC0~PC5
Pin Assignment
PB0/RX/CTCK0/OCPI/KEY1 PA6/CTCK1/PTPI/CTP0/PTPB/XT1
PA1/PTCK/SCL/OVPI1/KEY3
PA3/PTPI/SDA/VREF/KEY4 PA0/RX/CTP1/OCPVR/ICPDA/OCDSDA
PD3 VCC2
PD2 VCC1
PD1 VDD/VLDO/AVDD
PD0 PA7/CTCK0/PTCK/PTP/XT2
PA4/AN0/KEY5
PA5/AN1/KEY6 PB2/SCL/AN6/KEY9
20
1
19
2
18
3
17
4
16
5
6
7
8
9
10
VSS/AVSS/IOVSS/HVSS PB1/TX/CTCK1/OVPI0/KEY2
15
PA2/TX/CTP1B/OCPI/ICPCK/OCDSCK
14
13
PB3/SDA/AN7/KEY10
12
11
BS86DH12C/BS86DHV12C
20 SOP-A
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
PB0/RX/CTCK0/OCPI/KEY1
PB1/TX/CTCK1/OVPI0/KEY2
PA1/PTCK/SCL/OVPI1/KEY3
PA3/PTPI/SDA/VREF/KEY4
PA4/AN0/KEY5
PA5/AN1/KEY6
PB4/CTP0/AN2/KEY7
PB5/CTP0B/AN3/KEY8
PB6/CTP1/AN4/OCPAO
PB7/CTP1B/AN5/OVPCOUT
NC
NC
NC
PB0/RX/CTCK0/OCPI/KEY1
PB1/TX/CTCK1/OVPI0/KEY2
PA1/PTCK/SCL/OVPI1/KEY3
PA3/PTPI/SDA/VREF/KEY4
PA4/AN0/KEY5
PA5/AN1/KEY6
PB4/CTP0/AN2/KEY7
PB5/CTP0B/AN3/KEY8
PD3
1
28
PD2
2
27
PD1
3
26
PD0
4
25
5
24
6
23
7
22
8
21
9
20
10
19
11
18
12
17
13
16
14
15
BS86DH12C/BS86DHV12C
28 SOP-A
V
VCC2
C
P
P
P
PD0
PD1
P
D
D
D
4
3
2
1
2
3
4
5
BS86DH12C/BS86DHV12C
6
7
8
9
10
11
44 LQFP-A
12 13 14 15 16 1718 19 20 21 22
NC
NC
NC
P
P
B
B
7
6
/
/
C
C
T
T
P
P
1
1
B
/
A
/
A
N
N
4
/
5
O
/
O
C
V
P
P
A
C
O
O
U
T
NC
C
D
1
5
PB3/SDA/AN7/KEY10
P
P
P
B
C
C
2
5
4
/
S
C
L
/
A
N
6
/
K
E
Y
9
VCC2
VCC1
VDD/VLDO/AVDD
PA7/CTCK0/PTCK/PTP/XT2
PA6/CTCK1/PTPI/CTP0/PTPB/XT1
VSS/AVSS/IOVSS/HVSS
PC3/CTP0/SDA/TX
PC2/CTP1/SCL/RX
PA2/TX/CTP1B/OCPI/ICPCK/OCDSCK
PA0/RX/CTP1/OCPVR/ICPDA/OCDSDA
PC1/INT/PTPB/OVPI1/KEY12
PC0/PTP/OVPI0/KEY11
PB3/SDA/AN7/KEY10
PB2/SCL/AN6/KEY9
NC
NC
34 35 36 37 38 39 40 41 42 43 44
VDD/VLDO/AVDD
33
NC
32
NC
31
NC
30
PA7/CTCK0/PTCK/PTP/XT2
29
PA6/CTCK1/PTPI/CTP0/PTPB/XT1
28
VSS/AVSS/IOVSS/HVSS
27
PC3/CTP0/SDA/TX
26
PC2/CTP1/SCL/RX
25
PA2/TX/CTP1B/OCPI/ICPCK/OCDSCK
24
PA0/RX/CTP1/OCPVR/ICPDA/OCDSDA
23
PC1/INT/PTPB/OVPI1/KEY12
PC0/PTP/OVPI0/KEY11
Note: 1. If the pin-shared pin functions have multiple outputs, the desired pin-shared function is determined by the
corresponding software control bits.
2. The OCDSDA and OCDSCK pins are supplied for the OCDS dedicated pins and as such only available
for the BS86DHV12C device which is the OCDS EV chip for the BS86DH12C device.
3. For less pin-count package types there will be unbonded pins which should be properly congured to
avoid unwanted current consumption resulting from floating input conditions. Refer to the “Standby
Current Considerations” and “Input/Output Ports” sections.
Rev. 1.00 10 October 26, 2018 Rev . 1.00 11 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Pin Descriptions
With the exception of the power pins, all pins on the device can be referenced by their Port name, e.g.
PA0, PA1 etc., which refer to the digital I/O function of the pins. However these Port pins are also
shared with other function such as the Touch Key function, Timer Module pins etc. The function of
each pin is listed in the following table, however the details behind how each pin is congured is
contained in other sections of the datasheet.
As the Pin Description table shows the situation for the package with the most pins, not all pins in
the table will be available on smaller package sizes.
Pin Name Function OPT I/T O/T
PA0/RX/CTP1/
OCPVR/ICPDA/
OCDSDA
PA1/PTCK/SCL/
OVPI1/KEY3
PA2/TX/CTP1B/
OCPI/ICPCK/
OCDSCK
PA3/PTPI/SDA/
VREF/KEY4
PA4/AN0/KEY5
PA0
RX
CTP1 PAS0 — CMOS CTM1 output
OCPVR PAS0 AN — OCP D/A converter reference voltage input
ICPDA — ST CMOS ICP data/address
OCDSDA — ST CMOS OCDS data/address, for EV chip only
PA1
PTCK
SCL
OVPI1 PAS0 AN — OVP input 1
KEY3 PAS0 NSI — Touch key input
PA2
TX PAS0 — CMOS UART data transmit pin
CTP1B PAS0 — CMOS CTM1 inverted output
OCPI PAS0 AN — OCP input
ICPCK — ST — ICP clock
OCDSCK — ST — OCDS clock, for EV chip only
PA3
PTPI
SDA
VREF PAS0 AN — A/D converter external input channel
KEY4 PAS0 NSI — Touch key input
PA4
AN0 PAS1 AN — A/D converter external input channel
KEY5 PAS1 NSI — Touch key input
PAPU
PAWU
PAS0
PAS0
IFS0
PAPU
PAWU
PAS0
PAS0
IFS1
PAS0
IFS0
PAPU
PAWU
PAS0
PAPU
PAWU
PAS0
PAS0
IFS1
PAS0
IFS0
PAPU
PAWU
PAS1
ST CMOS
ST — UART data receive pin
ST CMOS
ST — PTM clock input
ST NMOS I2C clock line
ST CMOS
ST CMOS
ST — PTM capture input
ST NMOS I2C data line
ST CMOS
General purpose I/O. Register enabled pull-up and
wake-up
General purpose I/O. Register enabled pull-up and
wake-up
General purpose I/O. Register enabled pull-up and
wake-up
General purpose I/O. Register enabled pull-up and
wake-up
General purpose I/O. Register enabled pull-up and
wake-up
Description
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Pin Name Function OPT I/T O/T
PAPU
PAWU
PAS1
PAPU
PAWU
PAS1
PAS1
IFS1
PAS1
IFS1
PAPU
PAWU
PAS1
PAS1
IFS1
PAS1
IFS1
PBPU
PBS0
PBS0
IFS0
PBS0
IFS1
PBPU
PBS0
PBS0
IFS1
PBPU
PBS0
PBS0
IFS0
PBPU
PBS0
PBS0
IFS0
PA5/AN1/KEY6
PA6/CTCK1/PTPI/
CTP0/PTPB/XT1
PA7/CTCK0/PTCK/
PTP/XT2
PB0/RX/CTCK0/
OCPI/KEY1
PB1/TX/CTCK1/
OVPI0/KEY2
PB2/SCL/AN6/KEY9
PB3/SDA/AN7/
KEY10
PA5
AN1 PAS1 AN — A/D converter external input channel
KEY6 PAS1 NSI — Touch key input
PA6
CTCK1
PTPI
CTP0 PAS1 — CMOS CTM0 output
PTPB PAS1 — CMOS PTM inverted output
XT1 PAS1 LXT — LXT oscillator pin
PA7
CTCK0
PTCK
PTP PAS1 — CMOS PTM output
XT2 PAS1 — LXT LXT oscillator pin
PB0
RX
CTCK0
OCPI PBS0 AN — OCP input
KEY1 PBS0 NSI — Touch key input
PB1
TX PBS0 — CMOS UART data transmit pin
CTCK1
OVPI0 PBS0 AN — OVP input 0
KEY2 PBS0 NSI — Touch key input
PB2
SCL
AN6 PBS0 AN — A/D converter external input channel
KEY9 PBS0 NSI — Touch key input
PB3
SDA
AN7 PBS0 AN — A/D converter external input channel
KEY10 PBS0 NSI — Touch key input
Description
ST CMOS
ST CMOS
ST — CTM1 clock input
ST — PTM capture input
ST CMOS
ST — CTM0 clock input
ST — PTM clock input
ST CMOS General purpose I/O. Register enabled pull-up
ST — UART data receive pin
ST — CTM0 clock input
ST CMOS General purpose I/O. Register enabled pull-up
ST — CTM1 clock input
ST CMOS General purpose I/O. Register enabled pull-up
ST NMOS I2C clock line
ST CMOS General purpose I/O. Register enabled pull-up
ST NMOS I2C data line
General purpose I/O. Register enabled pull-up and
wake-up
General purpose I/O. Register enabled pull-up and
wake-up
General purpose I/O. Register enabled pull-up and
wake-up
Rev. 1.00 12 October 26, 2018 Rev . 1.00 13 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Pin Name Function OPT I/T O/T
PB4
PB4/CTP0/AN2/
KEY7
PB5/CTP0B/AN3/
KEY8
PB6/CTP1/AN4/
OCPAO
PB7/CTP1B/AN5/
OVPCOUT
PC0/PTP/OVPI0/
KEY11
PC1/INT/PTPB/
OVPI1/KEY12
PC2/CTP1/SCL/RX
PC3/CTP0/SDA/TX
PC4~PC5 PC4~PC5 PCPU ST CMOS General purpose I/O. Register enabled pull-up
PD0~PD5 PD0~PD5 — ST CMOS High voltage I/O port
VDD/AVDD/VLDO
CTP0 PBS1 — CMOS CTM0 output
AN2 PBS1 AN — A/D converter external input channel
KEY7 PBS1 NSI — Touch key input
PB5
CTP0B PBS1 — CMOS CTM0 inverted output
AN3 PBS1 AN — A/D converter external input channel
KEY8 PBS1 NSI — Touch key input
PB6
CTP1 PBS1 — CMOS CTM1 output
AN4 PBS1 AN — A/D converter external input channel
OCPAO PBS1 AN — OCP operational amplier output
PB7
CTP1B PBS1 — CMOS CTM1 inverted output
AN5 PBS1 AN — A/D converter external input channel
OVPCOUT PBS1 — CMOS OVP comparator output
PC0
PTP PCS0 — CMOS PTM output
OVPI0 PCS0 AN — OVP input 0
KEY11 PCS0 NSI — Touch key input
PC1
INT
PTPB PCS0 — CMOS PTM inverted output
OVPI1 PCS0 AN — OVP input 1
KEY12 PCS0 NSI — Touch key input
PC2
CTP1 PCS0 — CMOS CTM1 output
SCL
RX
PC3
CTP0 PCS0 — CMOS CTM0 output
SDA
TX PCS0 — CMOS UART data transmit pin
VDD — PWR — Digital positive power supply
AVDD — PWR — Analog positive power supply
VLDO — — PWR LDO output voltage
PBPU
PBS1
PBPU
PBS1
PBPU
PBS1
PBPU
PBS1
PCPU
PCS0
PCPU
PCS0
PCS0
INTC0
INTEG
PCPU
PCS0
PCS0
IFS0
PCS0
IFS0
PCPU
PCS0
PCS0
IFS0
ST CMOS General purpose I/O. Register enabled pull-up
ST CMOS General purpose I/O. Register enabled pull-up
ST CMOS General purpose I/O. Register enabled pull-up
ST CMOS General purpose I/O. Register enabled pull-up
ST CMOS General purpose I/O. Register enabled pull-up
ST CMOS General purpose I/O. Register enabled pull-up
ST — External interrupt input
ST CMOS General purpose I/O. Register enabled pull-up
ST NMOS I2C clock line
ST — UART data receive pin
ST CMOS General purpose I/O. Register enabled pull-up
ST NMOS I2C data line
Description
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Pin Name Function OPT I/T O/T
VSS — PWR — Digital negative power supply, ground
VSS/AVSS/IOVSS/
HVSS
VCC1 VCC1 — PWR —
VCC2 VCC2 — PWR —
NC NC — — — Unused
AVSS — PWR — Analog negative power supply, ground
IOVSS — PWR — I/O port negative power supply, ground
HVSS — PWR — High voltage negative power supply, ground
Provides high voltage positive power supply for
LDO input
Provides high voltage positive power supply for
High Voltage I/O and Level Shifter
Legend: I/T: Input type; O/T: Output type;
OPT: Optional by register selection;
PWR: Power; ST: Schmitt Trigger input;
CMOS: CMOS output; NMOS: NMOS output;
AN: Analog signal; NSI: Non-standard input;
LXT: Low frequency crystal oscillator.
Absolute Maximum Ratings
Supply Voltage (VCC) ................................................................................................VSS-0.3V to 10.0V
Supply Voltage (VDD) .........................................................................................VSS-0.3V to VSS+6.0V
High Voltage Input Voltage ............................................................................... VSS-0.3V to VCC+0.3V
Input Voltage .....................................................................................................VSS-0.3V to VDD+0.3V
Storage Temperature .....................................................................................................-50°C to 125°C
Operating Temperature ................................................................................................... -40°C to 85°C
High Voltage IOH Total ..............................................................................................................-150mA
IOH Total ......................................................................................................................................-80mA
High Voltage IOL Total ............................................................................................................... 150mA
IOL Total ....................................................................................................................................... 80mA
Total Power Dissipation ........................................................................................................... 500mW
Description
Note: These are stress ratings only. Stresses exceeding the range specified under “Absolute
Maximum Ratings” may cause substantial damage to this device. Functional operation of
this device at other conditions beyond those listed in the specification is not implied and
prolonged exposure to extreme conditions may affect device reliability.
Rev. 1.00 14 October 26, 2018 Rev . 1.00 15 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
D.C. Electrical Characteristics
For data in the following tables, note that factors such as oscillator type, operating voltage, operating
frequency, pin load conditions, temperature and program instruction type, can all exert an inuence
on the measured values.
Operating Voltage Characteristics
Ta=25°C
Symbol Parameter Test Conditions Min. Typ. Max. Unit
f
=8MHz 4.5 — 5.5
SYS=fHIRC
Operating Voltage – HIRC
V
DD
Operating Voltage – LIRC f
Operating Voltage – LXT f
Operating Current Characteristics
Symbol Parameter
SLOW Mode – LIRC 5V
SLOW Mode – LXT 5V
I
DD
FAST Mode – HIRC 5V
f
SYS=fHIRC
f
SYS=fHIRC
SYS=fLIRC
SYS=fLXT
Test Conditions
V
DD
f
SYS=fLIRC
consumption included
f
SYS=fLXT
consumption included
f
SYS=fHIRC
consumption included
f
SYS=fHIRC
consumption included
f
SYS=fHIRC
consumption included
=12MHz 4.5 — 5.5
=16MHz 4.5 — 5.5
=32kHz 4.5 — 5.5 V
=32.768kHz 4.5 — 5.5 V
Ta=25°C
Conditions
=32kHz, LDO current
=32768Hz, LDO current
=8MHz, LDO current
=12MHz, LDO current
=16MHz, LDO current
Min. Typ. Max. Unit
— 180 200 μA
— 180 200 μA
— 1.6 2.4
— 2.4 3.6
— 6.0 9.0
V
mA
Note: When using the characteristic table data, the following notes should be taken into consideration:
1. Any digital input is set in a non-oating condition.
2. All measurements are taken under conditions of no load and with all peripherals in an off state.
3. There are no DC current paths.
4. All Operating Current values are measured using a continuous NOP instruction program loop.
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Standby Current Characteristics
Ta=25°C, unless otherwise specied
Symbol Parameter
SLEEP Mode 5V
IDLE0 Mode – LIRC 5V
IDLE0 Mode – LXT 5V
I
STB
IDLE1 Mode – HIRC 5V
V
Test Conditions
DD
Conditions
WDT on, LDO current
consumption included
f
on, LDO current
SUB
consumption included
f
on, LDO current
SUB
consumption included
f
on, f
SUB
=8MHz, LDO
SYS
current consumption included
f
on, f
SUB
=12MHz, LDO
SYS
current consumption included
f
on, f
SUB
=16MHz, LDO
SYS
current consumption included
Min. Typ. Max.
— 160 200 210 μA
— 165 200 215 μA
— 165 200 215 μA
— 1.0 1.8 2.0
— 1.5 2.6 3.0
— 2.0 3.5 4.0
Note: When using the characteristic table data, the following notes should be taken into consideration:
1. Any digital input is set in a non-oating condition.
2. All measurements are taken under conditions of no load and with all peripherals in an off state.
3. There are no DC current paths.
4. All Standby Current values are taken after a HALT instruction executed thus stopping all instruction
execution.
Max.
@85°C
Unit
mA
A.C. Characteristics
For data in the following tables, note that factors such as oscillator type, operating voltage, operating
frequency and temperature etc., can all exert an inuence on the measured values.
High Speed Internal Oscillator – HIRC – Frequency Accuracy
During the program writing operation the writer will trim the HIRC oscillator at a user selected
HIRC frequency and user selected voltage of 5V.
Symbol Parameter
8MHz Writer Trimmed HIRC Frequency
f
HIRC
12MHz Writer Trimmed HIRC Frequency
16MHz Writer Trimmed HIRC Frequency
Note: 1. The 5V values for VDD are provided as this is the xed voltage at which the HIRC frequency is trimmed
by the writer.
2. The row below the 5V trim voltage row is provided to show the values for the full VDD range operating
voltage. It is recommended that the trim voltage is xed at 5V for application voltage ranges from 3.3V
to 5.5V.
Test Conditions
V
DD
5V
4.5V~5.5V
5V
4.5V~5.5V
5V
4.5V~5.5V
Temp.
Min. Typ. Max. Unit
25°C -1% 8 +1%
-40°C~85°C -2% 8 +2%
25°C -2.5% 8 +2.5%
-40°C~85°C -3% 8 +3%
25°C -1% 12 +1%
-40°C~85°C -2% 12 +2%
25°C -2.5% 12 +2.5%
-40°C~85°C -3% 12 +3%
25°C -1% 16 +1%
-40°C~85°C -2% 16 +2%
25°C -2.5% 16 +2.5%
-40°C~85°C -3% 16 +3%
MHz
MHz
MHz
Rev. 1.00 16 October 26, 2018 Rev . 1.00 17 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
3. The minimum and maximum tolerance values provided in the table are only for the frequency at which
the writer trims the HIRC oscillator. After trimming at this chosen specific frequency any change in
HIRC oscillator frequency using the oscillator register control bits by the application program will give a
frequency tolerance to within ±20%.
Internal Low Speed Oscillator Characteristics – LIRC
Symbol Parameter
f
LIRC
t
START
LIRC Frequency 4.5V~5.5V
LIRC Start Up Time — 25°C — — 500 μs
Test Conditions
V
DD
25°C -10% 32 +10%
-40°C~85°C -50% 32 +60%
Temp.
Min. Typ. Max. Unit
kHz
External Low Speed Oscillator Characteristics – LXT
C1=C2=10pF, RP=10MΩ (C1, C2 and RP are external components), CL=7pF, ESR=30kΩ
Symbol Parameter
f
LXT
t
START
LXT Frequency 4.5V~5.5V — — 32768 — Hz
LXT Start Up Time 5V — — — 1000 μs
Test Conditions
V
DD
Conditions
Min. Typ. Max. Unit
Duty Cycle Duty Cycle — — 40 — 60 %
R
NEG
Negative Resistance 5V — 3×ESR — — Ω
Ta=25°C
Operating Frequency Characteristic Curves
System Operating Frequency
16MHz
12MHz
8MHz
~
~
~
~
~
~
4.5V 5.5V
Operating Voltage
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
System Start Up Time Characteristics
Symbol Parameter
System Start-up Time
Wake-up from Condition where f
t
SST
System Start-up Time
Wake-up from Condition where f
SYS
SYS
is Off
is On
System Speed Switch Time
FAST to SLOW Mode or
SLOW to FAST Mode
System Reset Delay Time
Reset Source from Power-on Reset or
LVR Hardware Reset
t
RSTD
System Reset Delay Time
LVRC/WDTC/RSTC Software Reset
System Reset Delay Time
Reset Source from WDT Overow
t
SRESET
Minimum Software Reset Width to Reset — — 45 90 180 μs
Note: 1. For the System Start-up time values, whether f
f
system oscillator. Details are provided in the System Operating Modes section.
SYS
2. The time units, shown by the symbols t
HIRC
, t
as provided in the frequency tables. For example t
3. If the LIRC is used as the system clock and if it is off when in the SLEEP Mode, then an additional LIRC
start up time, t
, as provided in the LIRC frequency table, must be added to the t
START
above.
4. The System Speed Switch Time is effectively the time taken for the newly activated oscillator to start up.
V
DD
— f
— f
— f
— f
— f
— f
— f
— RR
SYS=fH~fH
SYS=fSUB=fLXT
SYS=fSUB=fLIRC
SYS=fH~fH
SYS=fSUB=fLIRC
HIRC
LXT
Test Conditions
Conditions
/64, fH=f
HIRC
/64, fH=f
HIRC
or f
LXT
switches from off → on — 16 — t
switches from off → on — 1024 — t
=5V/ms
POR
Min. Typ. Max. Unit
— 16 — t
— 1024 — t
— 2 — t
— 2 — t
— 2 — t
30 48 72 ms
— —
— — 10 16 24 ms
is on or off depends upon the mode type and the chosen
SYS
etc. are the inverse of the corresponding frequency values
SYS
=1/f
, t
=1/f
HIRC
HIRC
SYS
SYS
etc.
time in the table
SST
Ta=25°C
HIRC
LXT
LIRC
H
SUB
HIRC
LXT
Rev. 1.00 18 October 26, 2018 Rev . 1.00 19 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Input/Output Characteristics
Ta=25°C
Symbol Parameter
V
V
I
OL
I
OH
R
I
LEAK
t
TCK
t
TPI
t
INT
Input Low Voltage for I/O Ports
IL
Input High Voltage for I/O Ports
IH
Sink Current for I/O Ports
(PA, PB, PC)
Source Current for I/O Ports
(PA, PB, PC)
Pull-high Resistance for I/O Ports
PH
(Note)
Input Leakage Current 5V VIN=VDD or VIN=V
TM Clock Input Pin Minimum Pulse Width — — 0.3 — — μs
TM Capture Input Pin Minimum Pulse Width — — 0.3 — — μs
External Interrupt Minimum Pulse Width — — 10 — — μs
Note: The RPH internal pull high resistance value is calculated by connecting to ground and enabling the input pin
with a pull-high resistor and then measuring the pin current at the specied supply voltage level. Dividing
the voltage by this measured current provides the RPH value.
Test Conditions
V
DD
5V
— 0 — 0.2V
5V
— 0.8VDD— V
Conditions
—
—
VOL=0.1VDD,
PxNS=0, x=A, B or C
5V
VOL=0.1VDD,
PxNS=1, x=A, B or C
Min. Typ. Max. Unit
0 — 1.5
DD
3.5 — 5.0
DD
32 64 —
mA
50 100 —
VOH=0.9VDD,
SLEDCn[m+1:m]=00B
-1.5 -2.9 —
(n=0, 1; m=0, 2, 4 or 6)
VOH=0.9VDD,
SLEDCn[m+1:m]=01B
(n=0, 1; m=0, 2, 4 or 6)
5V
VOH=0.9VDD,
SLEDCn[m+1:m]=10B
-2.5 -5.1 —
mA
-3.6 -7.3 —
(n=0, 1; m=0, 2, 4 or 6)
VOH=0.9VDD,
SLEDCn[m+1:m]=11B
-8 -16 —
(n=0, 1; m=0, 2, 4 or 6)
5V — 10 30 50 kΩ
SS
— — ±1 μA
V
V
Memory Characteristics
Symbol Parameter
V
Flash Program / Data EEPROM Memory
t
DEW
I
DDPGM
E
t
RETD
RAM Data Memory
V
VDD for Read / Write — — V
RW
Erase / Write Cycle Time – Flash Program
Memory
Write Cycle Time – Data EEPROM Memory — — — 4 6 ms
Programming / Erase Current on V
Cell Endurance — — 100K — — E/W
P
ROM Data Retention Time — Ta=25°C — 40 — Year
RAM Data Retention Voltage — Device in SLEEP Mode 1.0 — — V
DR
Ta=-40°C~85°C, unless otherwise specied
Test Conditions
V
DD
Conditions
Min. Typ. Max. Unit
DDmin
— V
DDmax
V
— — — 2 3 ms
DD
— — — — 5.0 mA
High Voltage Touch A/D Flash MCU with HVIO
LVD/LVR Electrical Characteristics
Symbol Parameter
V
V
t
t
t
LVDS
LVR
LVD
Low Voltage Reset Voltage
LVR
Low Voltage Detection Voltage
LVD
LVDO Stable Time —
Minimum Low Voltage Width to Reset — — 120 240 480 μs
Minimum Low Voltage Width to Interrupt — — 60 120 240 μs
V
BS86DH12C
Test Conditions
DD
Conditions
— LVR enable, voltage select 2.1V
— LVR enable, voltage select 2.55V 2.55
— LVR enable, voltage select 3.15V 3.15
— LVR enable, voltage select 3.8V 3.8
— LVD enable, voltage select 2.0V
— LVD enable, voltage select 2.2V 2.2
— LVD enable, voltage select 2.4V 2.4
— LVD enable, voltage select 2.7V 2.7
— LVD enable, voltage select 3.0V 3.0
— LVD enable, voltage select 3.3V 3.3
— LVD enable, voltage select 3.6V 3.6
— LVD enable, voltage select 4.0V 4.0
For LVR enable, VBGEN=0,
LVD off → on
Min. Typ. Max. Unit
2.1
-5%
2.0
-5%
— — 15 μs
Ta=25°C
+5% V
+5% V
A/D Converter Electrical Characteristics
Symbol Parameter
V
V
V
A/D Converter Operating Voltage — — 4.5 — 5.5 V
DD
A/D Converter Input Voltage — — 0 — V
ADI
A/D Converter Reference Voltage — — 2 — V
REF
DNL A/D Converter Differential Non-linearity 5V
INL A/D Converter Integral Non-linearity 5V
I
ADC
t
ADCK
t
ON2ST
t
ADS
t
ADC
Additional Current Consumption for A/D
Converter Enable
A/D Converter Clock Period — — 0.5 — 10 μs
A/D Converter On-to-Start Time — — 4 — — μs
A/D Converter Sampling Time — — — 4 — t
A/D Conversion Time
(Including A/D Sampling and Hold Time)
Test Conditions
V
DD
V
V
V
V
5V No load, t
— — — 16 — t
Conditions
REF=VDD
REF=VDD
REF=VDD
REF=VDD
Ta=-40°C~85°C
Min. Typ. Max. Unit
, t
=0.5μs
ADCK
, t
=10μs
ADCK
, t
=0.5μs
ADCK
, t
=10μs
ADCK
=0.5μs — 1.5 3.0 mA
ADCK
-3 — +3 LSB
-4 — +4 LSB
REF
DD
V
V
ADCK
ADCK
Rev. 1.00 20 October 26, 2018 Rev . 1.00 21 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Internal Reference Voltage Characteristics
Ta=25°C
Symbol Parameter
V
t
BG
BGS
Bandgap Reference Voltage — — -5% 1.04 +5% V
VBG Turn-on Stable Time — No load — — 150 μs
Test Conditions
V
DD
Conditions
Min. Typ. Max. Unit
Note: 1. All the above parameters are measured under conditions of no load condition unless otherwise described.
2. A 0.1μF ceramic capacitor should be connected between VDD and GND.
3. The VBG voltage is used as the A/D converter internal signal input.
High Voltage I/O Electrical Characteristics
VDD=5V, Ta=25°C, unless otherwise specied
Symbol Parameter Test Conditions Min. Typ. Max. Unit
V
V
V
I
OH
I
OL
t
SF
Input Voltage — V
IN
Input High Voltage for High Voltage I/O Ports — 0.6VIN— V
IH
Input Low Voltage for High Voltage I/O Ports — 0 — 0.3VINV
IL
DET1
Source Current for High Voltage I/O Ports VOH=0.9×VIN, VIN=10V -40 -70 — mA
Sink Current for High Voltage I/O Ports VOL=0.1×VIN, VIN=10V 50 80 — mA
SFRTC=0, Ta=25°C 2 — 3
Short Circuit Flag Response Time
SFRTC=0, Ta=-40°C~85°C 1.5 — 3.9
SFRTC=1, Ta=25°C 1.0 — 1.5
SFRTC=1, Ta=-40°C~85°C 0.75 — 1.85
— 10 V
IN
V
ms
Voltage Detector Electrical Characteristics
Symbol Parameter
V
IN
V
DET1
V
RLS1
V
HYS1
V
DET2
V
RLS2
V
HYS2
Input Voltage — — V
V
Detect Level
CC2
V
Release Level
CC2
Hysteresis — VIN=10V ↔ 5V 100 750 1000 mV
VDD Detect Level — VDD=0V → 5V
VDD Release Level
Hysteresis — VDD=0V ↔ 5V 100 250 500 mV
(Note)
(Note)
(Note)
V
DD
— VIN=0V → 10V
— VIN=10V → 0V V
— VDD=5V → 0V V
Test Conditions
Conditions
Ta=25°C
Min. Typ. Max. Unit
DET1
Typ.-
0.5
Typ.
-0.2
— 10 V
Typ.
7
+0.5
DET1-VHYS1
2.5
DET2-VHYS2
Typ.
+0.2
V
V
V
V
Note:
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
V
V
DET1
V
RLS1
V
DET2
V
RLS2
PWRRDY
Undefined
High Voltage I/O Other Electrical Characteristics
Symbol Parameter
V
V
V
IN
CC1O
CC2O
Input Voltage — — 7 — 10 V
V
Accuracy — VIN=10V -5% 0.2V
CC1O
V
Accuracy — VIN=10V -5% 0.2V
CC2O
Note: Divider 1: R11:R12=4:1(12kΩ /3kΩ ), V
Divider 2: R21:R22=4:1(12kΩ /3kΩ ), V
Test Conditions
V
DD
=R12/(R11+R12)×V
CC1O
=R22/(R21+R22)×V
CC2O
Conditions
CC1
CC2
Min. Typ. Max. Unit
IN
IN
=0.2V
=0.2V
CC1
CC2
.
.
V
IN
V
DD
t
t
Ta=25°C
+5% V
+5% V
Low Dropout Regulator Electrical Characteristics
C
=10μF+0.1μF, VIN=V
LOAD
Symbol Parameter
V
V
ΔV
V
I
OUT
IN
OUT
LOAD
DROP
Input Voltage — — 6 — 10 V
Output Voltage
Load Regulation
Dropout Voltage
Output Current
V
IN
—
—
(1)
(2)
— 1mA≤I
—
— VIN=V
— VIN=V
Test Conditions
Conditions
Ta=25°C,
I
=1mA, V
LOAD
OUT
Ta=-40°C~85°C, I
V
=5.0V
OUT
≤70mA, VIN=V
LOAD
ΔV
=2%, I
OUT
VIN=V
+1V
OUT
+1V, Δ V
OUT
+2V, Δ V
OUT
LOAD
=5.0V
LOAD
=1mA,
OUT
OUT
Rev. 1.00 22 October 26, 2018 Rev . 1.00 23 October 26, 2018
+1V, Ta=25°C, unless otherwise specied
OUT
Min. Typ. Max. Unit
-2% 5.0 +2% V
=1mA,
+1V — 0.015 0.033 %/mA
OUT
-5% 5.0 +5% V
— — 100 mV
=-3% 250 — — mA
=-3% 500 — — mA
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Symbol Parameter
I
Q
ΔV
LINE
Quiescent Current 10V No load — 120 200 μA
Line Regulation — 6V≤V IN≤10V, I
V
IN
TC Temperature Coefcient — Ta=-40°C~85°C, I
ΔV
OUT_RIPPLE
RR Ripple Rejection
I
LIMIT
t
START
Output Voltage Ripple 6V I
(3)
—
Current Limit 6V ΔV
LDO Start Up Time 6V I
Test Conditions
Conditions
=1mA — — 0.2 %/V
LOAD
=10mA — ±1.5 ±2.0 mV/°C
LOAD
=10mA — — 40 mV
LOAD
VIN=10VDC+2V
P-P(AC)
, I
LOAD
≤50mA,
f=120Hz
=-10% 600 800 — mA
OUT
LOAD
=1mA, V
settle to ±5% — — 10 ms
OUT
Min. Typ. Max. Unit
35 — — dB
Note: 1. Load regulation is measured at a constant junction temperature, using pulse testing with a low ON time
and is guaranteed up to the maximum power dissipation. Power dissipation is determined by the input/
output differential voltage and the output current. Guaranteed maximum power dissipation will not be
available over the full input/output range. The maximum allowable power dissipation at any ambient temperature is PD=(T
J(MAX)-Ta
)/θ JA.
2. Dropout voltage is dened as the input voltage minus the output voltage that produces a 2% change in the
output voltage from the value at appointed VIN.
3. Ripple rejection ratio measurement circuit. RR=20×log(ΔVIN/ΔV
OUT
).
LDO
AC
0.33μF
V
IN
GND
V
OUT
2
10.1μF
R
Output
L
4. Application information for LDO load capacitor selection for stability:
Recommended Output Capacitor
Symbol Parameter
C
LOAD
Output Load Capacitor — Capacitor 4.7 10 — μF
In common with most regulators, the LDO requires an external capacitor connected between V
and ground for regulator stability. If the ESR is less than 10Ω, capacitor values of 4.7μF or large
are acceptable. Any aluminum electrolytic capacitor meeting the requirements described above is
suitable.
For better load transient response purposes, use a combination of a C
0.1μF capacitor on V
. Note that the 0.1μF capacitor is always required on V
OUT
recommended to be a multi-layer ceramic capacitor. The internal regulator is designed to be stable
with an output lter capacitor C
and ESR as recommended.
LOAD
Test Conditions
V
DD
Conditions
Min. Typ. Max.
10μF and an extra
LOAD
and is strong
OUT
Ta=25°C
Unit
OUT
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
OCP Electrical Characteristics
Ta=25°C
Symbol Parameter
I
V
V
V
V
V
V
OCP
Operating Current 5V
Comparator Input Offset Voltage
OS_CMP
Hysteresis 5V — 10 40 60 mV
HYS
Comparator Common Mode Voltage
CM_CMP
Range
OPA Input Offset Voltage
OS_OPA
OPA Common Mode Voltage Range 5V — V
CM_OPA
OPA Maximum Output Voltage Range 5V — VSS+0.1 — VDD-0.1 V
OR
Ga PGA Gain Accuracy 5V All gains -5 — +5 %
V
D/A Converter Reference Voltage 5V OCPVRS=1 2 — V
REF
DNL Differential Non-linearity 5V DAC V
INL Integral Non-linearity 5V DAC V
Test Conditions
V
DD
Conditions
OCPEN[1:0]=01B,
DAC V
Without calibration
5V
(OCPCOF[4:0]=10000B)
REF
=2.5V
Min. Typ. Max. Unit
— 730 1250 μA
-15 — 15
5V With calibration -4 — 4
5V — V
Without calibration
5V
(OCPOOF[5:0]=100000B)
-15 — 15
— VDD-1.4 V
SS
5V With calibration -4 — 4
— VDD-1.4 V
SS
REF=VDD
REF=VDD
-1 — +1 LSB
-1.5 — +1.5 LSB
DD
mV
mV
V
OVP Electrical Characteristics
Symbol Parameter
I
V
V
V
OVP
Operating Current 5V OVPEN=1, DAC V
Input Offset Voltage 5V With calibration -2 — 2 mV
OS
Hysteresis 5V
HYS
Common Mode Voltage Range 5V — V
CM
DNL Differential Non-linearity 5V DAC V
INL Integral Non-linearity 5V DAC V
t
RP
OVP Response Time 5V
V
DD
HYS[1:0]=00B 0 0 5
HYS[1:0]=01B 15 30 45
HYS[1:0]=10B 40 60 80
HYS[1:0]=11B 60 80 100
OVPDA[7:0]=10000000B,
OVPDEB[2:0]=000B,
DAC V
OVP input=2.1V~3.6V
Test Conditions
Conditions
REF=VDD
REF=VDD
REF=VDD
,
REF=VDD
Ta=25°C
Min. Typ. Max. Unit
— 500 750 μA
mV
— VDD-1.4 V
SS
-1 — +1 LSB
-1.5 — +1.5 LSB
— 1.0 1.8 μs
Rev. 1.00 24 October 26, 2018 Rev . 1.00 25 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Power-on Reset Characteristics
Symbol Parameter
V
RR
t
POR
VDD Start Voltage to Ensure Power-on Reset — — — — 100 mV
POR
PORVDD
Rising Rate to Ensure Power-on Reset — — 0.035 — — V/ms
Minimum Time for VDD Stays at V
Power-on Reset
V
DD
to Ensure
POR
Test Conditions
V
— — 1 — — ms
DD
Conditions
Ta=25°C
Min. Typ. Max. Unit
System Architecture
A key factor in the high-performance features of the range of microcontrollers is attributed to their
internal system architecture. The device takes advantage of the usual features found within RISC
microcontrollers providing increased speed of operation and enhanced performance. The pipelining
scheme is implemented in such a way that instruction fetching and instruction execution are
overlapped, hence instructions are effectively executed in one or two cycles for most of the standard
or extended instructions respectively. The exceptions to this are branch or call instructions which need
one more cycle. An 8-bit wide ALU is used in practically all instruction set operations, which carries
out arithmetic operations, logic operations, rotation, increment, decrement, branch decisions, etc.
The internal data path is simplied by moving data through the Accumulator and the ALU. Certain
internal registers are implemented in the Data Memory and can be directly or indirectly addressed.
The simple addressing methods of these registers along with additional architectural features ensure
that a minimum of external components is required to provide a functional I/O and A/D control
system with maximum reliability and flexibility. This makes the device suitable for low-cost,
high-volume production for controller applications.
Clocking and Pipelining
The main system clock, derived from either a HIRC, LIRC or LXT oscillator is subdivided into four
internally generated non-overlapping clocks, T1~T4. The Program Counter is incremented at the
beginning of the T1 clock during which time a new instruction is fetched. The remaining T2~T4
clocks carry out the decoding and execution functions. In this way, one T1~T4 clock cycle forms
one instruction cycle. Although the fetching and execution of instructions takes place in consecutive
instruction cycles, the pipelining structure of the microcontroller ensures that instructions are
effectively executed in one instruction cycle. The exception to this are instructions where the
contents of the Program Counter are changed, such as subroutine calls or jumps, in which case the
instruction will take one more instruction cycle to execute.
t
POR
RR
POR
V
POR
Time
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
f
(System Clock)
Phase Clock T1
Phase Clock T2
Phase Clock T3
Phase Clock T4
Program Counter PC PC+1 PC+2
SYS
Pipelining
For instructions involving branches, such as jump or call instructions, two machine cycles are
required to complete instruction execution. An extra cycle is required as the program takes one
cycle to rst obtain the actual jump or call address and then another cycle to actually execute the
branch. The requirement for this extra cycle should be taken into account by programmers in timing
sensitive applications.
1 MOV A,[12H]
2 CALL DELAY
3 CPL [12H]
4 :
5 :
6 DELAY: NOP
Program Counter
During program execution, the Program Counter is used to keep track of the address of the next
instruction to be executed. It is automatically incremented by one each time an instruction is executed
except for instructions, such as “JMP” or “CALL” that demand a jump to a non-consecutive Program
Memory address. Only the lower 8 bits, known as the Program Counter Low Register, are directly
addressable by the application program.
When executing instructions requiring jumps to non-consecutive addresses such as a jump instruction,
a subroutine call, interrupt or reset, etc., the microcontroller manages program control by loading
the required address into the Program Counter. For conditional skip instructions, once the condition
has been met, the next instruction, which has already been fetched during the present instruction
execution, is discarded and a dummy cycle takes its place while the correct instruction is obtained.
Fetch Inst. (PC)
Execute Inst. (PC-1) Fetch Inst. (PC+1)
Execute Inst. (PC)
System Clocking and Pipelining
Fetch Inst. 1
Execute Inst. 1
Fetch Inst. 2 Execute Inst. 2
Fetch Inst. 3 Flush Pipeline
Instruction Fetching
Program Counter
High Byte Low Byte (PCL)
PC12~PC8 PCL7~PCL0
Program Counter
Fetch Inst. (PC+2)
Execute Inst. (PC+1)
Fetch Inst. 6 Execute Inst. 6
Fetch Inst. 7
The lower byte of the Program Counter, known as the Program Counter Low register or PCL, is
available for program control and is a readable and writeable register. By transferring data directly
into this register, a short program jump can be executed directly; however, as only this low byte
is available for manipulation, the jumps are limited to the present page of memory that is 256
locations. When such program jumps are executed it should also be noted that a dummy cycle
Rev. 1.00 26 October 26, 2018 Rev . 1.00 27 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
will be inserted. Manipulating the PCL register may cause program branching, so an extra cycle is
needed to pre-fetch.
Stack
This is a special part of the memory which is used to save the contents of the Program Counter
only. The stack is organized into 8 levels and neither part of the data nor part of the program space,
and is neither readable nor writeable. The activated level is indexed by the Stack Pointer, and is
neither readable nor writeable. At a subroutine call or interrupt acknowledge signal, the contents of
the Program Counter are pushed onto the stack. At the end of a subroutine or an interrupt routine,
signaled by a return instruction, RET or RETI, the Program Counter is restored to its previous value
from the stack. After a device reset, the Stack Pointer will point to the top of the stack.
If the stack is full and an enabled interrupt takes place, the interrupt request ag will be recorded but
the acknowledge signal will be inhibited. When the Stack Pointer is decremented, by RET or RETI,
the interrupt will be serviced. This feature prevents stack overow allowing the programmer to use
the structure more easily. However, when the stack is full, a CALL subroutine instruction can still
be executed which will result in a stack overow. Precautions should be taken to avoid such cases
which might cause unpredictable program branching.
If the stack is overow, the rst Program Counter save in the stack will be lost.
Top of Stack
Stack
Pointer
Bottom of Stack
Arithmetic and Logic Unit – ALU
The arithmetic-logic unit or ALU is a critical area of the microcontroller that carries out arithmetic
and logic operations of the instruction set. Connected to the main microcontroller data bus, the ALU
receives related instruction codes and performs the required arithmetic or logical operations after
which the result will be placed in the specied register. As these ALU calculation or operations may
result in carry, borrow or other status changes, the status register will be correspondingly updated to
reect these changes. The ALU supports the following functions:
• Arithmetic operations:
ADD, ADDM, ADC, ADCM, SUB, SUBM, SBC, SBCM, DAA,
LADD, LADDM, LADC, LADCM, LSUB, LSUBM, LSBC, LSBCM, LDAA
• Logic operations:
AND, OR, XOR, ANDM, ORM, XORM, CPL, CPLA,
LAND, LOR, LXOR, LANDM, LORM, LXORM, LCPL, LCPLA
• Rotation:
RRA, RR, RRCA, RRC, RLA, RL, RLCA, RLC,
LRRA, LRR, LRRCA, LRRC, LRLA, LRL, LRLCA, LRLC
• Increment and Decrement:
INCA, INC, DECA, DEC,
LINCA, LINC, LDECA, LDEC
Stack Level 1
Stack Level 2
Stack Level 3
:
:
:
Stack Level 8
Program Counter
Program Memory
• Branch decision:
JMP, SZ, SZA, SNZ, SIZ, SDZ, SIZA, SDZA, CALL, RET, RETI,
LSZ, LSZA, LSNZ, LSIZ, LSDZ, LSIZA, LSDZA
Flash Program Memory
The Program Memory is the location where the user code or program is stored. For this device the
Program Memory is Flash type, which means it can be programmed and re-programmed a large
number of times, allowing the user the convenience of code modication on the same device. By
using the appropriate programming tools, the Flash device offers users the exibility to conveniently
debug and develop their applications while also offering a means of eld programming and updating.
Structure
The Program Memory has a capacity of 8K×16 bits. The Program Memory is addressed by the
Program Counter and also contains data, table information and interrupt entries. Table data, which
can be configured in any location within the Program Memory, is addressed by a separate table
pointer register.
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Special Vectors
Within the Program Memory, certain locations are reserved for the reset and interrupts. The location
0000H is reserved for use by the device reset for program initialisation. After a device reset is
initiated, the program will jump to this location and begin execution.
Look-up Table
Any location within the Program Memory can be dened as a look-up table where programmers
can store xed data. To use the look-up table, the table pointer must rst be congured by placing
the address of the look up data to be retrieved in the table pointer register, TBLP and TBHP. These
registers dene the total address of the look-up table.
After setting up the table pointer, the table data can be retrieved from the Program Memory using
the “TABRD [m]” or “TABRDL [m]” instructions respectively when the memory [m] is located in
sector 0. If the memory [m] is located in other sectors except sector 0, the data can be retrieved from
the program memory using the corresponding extended table read instruction such as “LTABRD [m]”
or “LTABRDL [m]” respectively. When the instruction is executed, the lower order table byte from
the Program Memory will be transferred to the user dened Data Memory register [m] as specied
0000H
0004H
0034H
1FFFH
Program Memory Structure
n00H
nFFH
Initialisation Vector
Interrupt Vectors
Look-up Table
Bank 0
16 bits
Rev. 1.00 28 October 26, 2018 Rev . 1.00 29 October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
in the instruction. The higher order table data byte from the Program Memory will be transferred to
the TBLH special register.
The accompanying diagram illustrates the addressing data ow of the look-up table.
Program Memory
Last Page or
TBHP Register
TBLP Register
Address
16 bits
Data
Table Program Example
The following example shows how the table pointer and table data is dened and retrieved from the
microcontroller. This example uses raw table data located in the Program Memory which is stored
there using the ORG statement. The value at this ORG statement is “1F00H” which refers to the start
address of the last page within the 8K Program Memory of the microcontroller. The table pointer
low byte register is set here to have an initial value of “06H”. This will ensure that the rst data read
from the data table will be at the Program Memory address “1F06H” or 6 locations after the start of
the last page. Note that the value for the table pointer is referenced to the specic page pointed by
the TBLP and TBHP registers if the “TABRD [m]” or “LTABRD [m]” instruction is being used. The
high byte of the table data which in this case is equal to zero will be transferred to the TBLH register
automatically when the “TABRD [m]” instruction is executed.
Because the TBLH register is a read/write register and can be restored, care should be taken
to ensure its protection if both the main routine and Interrupt Service Routine use table read
instructions. If using the table read instructions, the Interrupt Service Routines may change the
value of the TBLH and subsequently cause errors if used again by the main routine. As a rule it is
recommended that simultaneous use of the table read instructions should be avoided. However, in
situations where simultaneous use cannot be avoided, the interrupts should be disabled prior to the
execution of any main routine table-read instructions. Note that all table related instructions require
two instruction cycles to complete their operation.
Register TBLH
High Byte Low Byte
User Selected
Register
Table Read Program Example
tempreg1 db ? ; temporary register #1
tempreg2 db ? ; temporary register #2
:
:
mov a,06h ; initialise low table pointer - note that this address
; is referenced
mov tblp,a ; to the last page or the page that tbhp pointed
mov a,1Fh ; initialise high table pointer
mov tbhp,a
:
:
tabrd tempreg1 ; transfers value in table referenced by table pointer data at
; program memory address “1F06H” transferred to tempreg1 and TBLH
dec tblp ; reduce value of table pointer by one
tabrd tempreg2 ; transfers value in table referenced by table pointer
; data at program memory address “1F05H” transferred to
; tempreg2 and TBLH, in this example the data “1AH” is
; transferred to tempreg1 and data “0FH” to register tempreg2
:
:
org 1F00h ; sets initial address of program memory
dc 00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh, 01Ah, 01Bh
:
:
In Circuit Programming – ICP
The provision of Flash type Program Memory provides the user with a means of convenient and
easy upgrades and modications to their programs on the same device.
As an additional convenience, Holtek has provided a means of programming the microcontroller
in-circuit using a 4-pin interface. This provides manufacturers with the possibility of manufacturing
their circuit boards complete with a programmed or un-programmed microcontroller, and then
programming or upgrading the program at a later stage. This enables product manufacturers to easily
keep their manufactured products supplied with the latest program releases without removal and
re-insertion of the device.
Holtek Writer Pins MCU Programming Pins Pin Description
ICPDA PA0 Programming Serial Data/Address
ICPCK PA2 Programming Clock
VDD VDD Power Supply
VSS VSS Ground
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
The Program Memory can be programmed serially in-circuit using this 4-wire interface. Data
is downloaded and uploaded serially on a single pin with an additional line for the clock. Two
additional lines are required for the power supply. The technical details regarding the in-circuit
programming of the device is beyond the scope of this document and will be supplied in
supplementary literature.
During the programming process, the user must take care of the ICPDA and ICPCK pins for data
and clock programming purposes to ensure that no other outputs are connected to these two pins.
Writer Connector
Signals
Writer_VDD
ICPDA
ICPCK
Writer_VSS
* *
To other Circuit
MCU Programming
Pins
VDD
PA0
PA2
VSS
Note: * may be resistor or capacitor. The resistance of * must be greater than 1kΩ or the capacitance
of * must be less than 1nF.
Rev. 1.00 30 October 26, 2018 Rev . 1.00 31 October 26, 2018