Holtek HT46R47 User manual

HT46R47, HT46R22,
HT46R23, HT46R24
A/D Type MCU
Handbook
October 2004
Copyright Ó2003 by HOLTEK SEMICONDUCTOR INC. All rights reserved. Printed in Taiwan. No part of this publication
may be reproduced, stored in a retrieval system, or transmitted in any form by any means, electronic, mechanical photo-
copying, recording, or otherwise without the prior written permission of HOLTEK SEMICONDUCTOR INC.

Contents
Part I Microcontroller Profile ................................................................... 1
Chapter 1 Hardware Structure ......................................................................................... 3
Introduction ....................................................................................................................3
Features ......................................................................................................................... 4
Technology Features ............................................................................................... 4
Kernel Features ....................................................................................................... 4
Peripheral Features ................................................................................................. 4
Selection Table .............................................................................................................. 5
Block Diagram ............................................................................................................... 6
Pin Assignment .............................................................................................................. 7
Pin Description ............................................................................................................... 8
Absolute Maximum Ratings ......................................................................................... 12
D.C. Characteristics ..................................................................................................... 12
A.C. Characteristics ..................................................................................................... 14
System Architecture ..................................................................................................... 15
Clocking and Pipelining ......................................................................................... 15
Program Counter ................................................................................................... 16
Stack ..................................................................................................................... 18
Arithmetic and Logic Unit -ALU ........................................................................... 18
Program Memory ......................................................................................................... 19
Organization .......................................................................................................... 19
Special Vectors ..................................................................................................... 20
Look-up Table ........................................................................................................ 20
Table Program Example ........................................................................................ 21
Data Memory ............................................................................................................... 22
Organization .......................................................................................................... 22
General Purpose Data Memory ............................................................................ 23
Special Purpose Data Memory ............................................................................. 24
Contents
i

Special Function Registers .......................................................................................... 25
Indirect Addressing Registers -IAR, IAR0, IAR1 ................................................. 25
Memory Pointers -MP, MP0, MP1 ....................................................................... 25
Bank Pointer -BP ................................................................................................. 26
Accumulator -ACC ............................................................................................... 26
Program Counter Low Register -PCL ................................................................. 26
Look-up Table Registers -TBLP, TBLH ................................................................ 27
Status Register -STATUS .................................................................................... 27
Interrupt Control Registers -INTC, INTC0, INTC1 ............................................... 28
Timer/Event Counter Registers ............................................................................. 28
Input/Output Ports and Control Registers ............................................................. 28
Pulse Width Modulator Registers -PWM, PWM0, PWM1, PWM2, PWM3 .......... 29
I2C Bus Registers -HADR, HCR, HSR, HDR ....................................................... 29
A/D Converter Registers -ADRL, ADRH, ADCR, ADSR ..................................... 29
Input/Output Ports ........................................................................................................ 29
Pull-high Resistors ................................................................................................ 30
Port A Wake-up ..................................................................................................... 30
I/O Port Control Registers ..................................................................................... 30
Pin-shared Functions ............................................................................................ 30
Programming Considerations ................................................................................ 34
Timer/Event Counters .................................................................................................. 34
Configuring the Timer/Event Counter Input Clock Source .................................... 35
Timer Registers -TMR, TMRL/TMRH, TMR0L/TMR0H, TMR1L/TMR1H ............ 36
Timer Control Registers -TMRC, TMR0C, TMR1C ............................................. 37
Configuring the Timer Mode .................................................................................. 39
Configuring the Event Counter Mode .................................................................... 39
Configuring the Pulse Width Measurement Mode ................................................. 40
Programmable Frequency Divider -PFD ............................................................. 41
Prescaler ............................................................................................................... 42
I/O Interfacing ........................................................................................................ 42
Programming Considerations ................................................................................ 42
Pulse Width Modulator ................................................................................................. 42
6+2 PWM Mode .................................................................................................... 43
7+1 PWM Mode .................................................................................................... 44
PWM Output Control ............................................................................................. 45
Analog to Digital Converter .......................................................................................... 46
A/D Converter Data Registers -ADRL/ADRH ...................................................... 46
A/D Converter Control Register -ADCR .............................................................. 47
A/D Converter Clock Source Register -ACSR ..................................................... 49
A/D Input Pins ....................................................................................................... 49
Summary of A/D Conversion Steps ...................................................................... 50
A/D Transfer Function ........................................................................................... 52
I2C Bus Serial Interface ............................................................................................... 54
I2C Bus Slave Address Register -HADR ............................................................. 55
I2C Bus Input/Output Data Register -HDR ........................................................... 55
I2C Bus Control Register -HCR ........................................................................... 55
I2C Bus Status Register -HSR ............................................................................. 55
ii
A/D Type MCU

I2C Bus Communication ........................................................................................ 56
Interrupts ......................................................................................................................60
External Interrupt ................................................................................................... 63
Timer/Event Counter Interrupt ............................................................................... 63
A/D Interrupt .......................................................................................................... 64
I2C Interrupt ........................................................................................................... 64
Interrupt Priority ..................................................................................................... 64
Programming Considerations ................................................................................ 65
Reset and Initialization ................................................................................................. 65
Reset ..................................................................................................................... 65
Oscillator ......................................................................................................................72
System Clock Configurations ................................................................................ 72
System Crystal/Ceramic Oscillator ........................................................................ 72
System RC Oscillator ............................................................................................ 73
Watchdog Timer Oscillator .................................................................................... 73
HALT and Wake-up in Power Down Mode .................................................................. 73
Watchdog Timer ........................................................................................................... 74
Configuration Options .................................................................................................. 76
Application Circuits .......................................................................................................77
Part II Programming Language ............................................................. 81
Chapter 2 Instruction Set Introduction ......................................................................... 83
Instruction Set .............................................................................................................. 83
Instruction Timing .................................................................................................. 83
Moving and Transferring Data ............................................................................... 84
Arithmetic Operations ............................................................................................ 84
Logical and Rotate Operations .............................................................................. 84
Branches and Control Transfer ............................................................................. 84
Bit Operations ....................................................................................................... 84
Table Read Operations ......................................................................................... 85
Other Operations ................................................................................................... 85
Instruction Set Summary ............................................................................................. 85
Convention ............................................................................................................ 85
Chapter 3 Instruction Definition .................................................................................... 89
Chapter 4 Assembly Language and Cross Assembler .............................................. 101
Notational Conventions .............................................................................................. 101
Statement Syntax ...................................................................................................... 102
Name ................................................................................................................... 102
Operation ............................................................................................................ 102
Operand .............................................................................................................. 102
Comment ............................................................................................................. 103
Contents
iii

Assembly Directives .................................................................................................. 103
Conditional Assembly Directives ......................................................................... 103
File Control Directives ......................................................................................... 104
Program Directives .............................................................................................. 105
Data Definition Directives .................................................................................... 108
Macro Directives .................................................................................................. 110
Assembly Instructions ................................................................................................ 112
Name ................................................................................................................... 112
Mnemonic ............................................................................................................ 112
Operand, Operator and Expression ..................................................................... 112
Miscellaneous ........................................................................................................... 114
Forward References ............................................................................................ 114
Local Labels ........................................................................................................ 114
Reserved Assembly Language Words ................................................................ 115
Cross Assembler Options .......................................................................................... 116
Assembly Listing File Format ..................................................................................... 116
Source Program Listing ....................................................................................... 116
Summary of Assembly ......................................................................................... 117
Miscellaneous ...................................................................................................... 117
Part III Development Tools ................................................................... 119
Chapter 5 MCU Programming Tools ............................................................................ 121
HT-IDE Development Environment ............................................................................ 121
Holtek In-Circuit Emulator -HT-ICE .......................................................................... 122
HT-ICE Interface Card ......................................................................................... 122
OTP Programmer................................................................................................. 123
OTP Adapter Card .............................................................................................. 123
System Configuration ................................................................................................ 123
HT-ICE Interface Card Settings.............................................................................124
Installation .................................................................................................................. 125
System Requirement ........................................................................................... 125
Hardware Installation .......................................................................................... 125
Software Installation ............................................................................................ 125
Chapter 6 Quick Start ................................................................................................... 129
Step 1 -Create a New Project ............................................................................ 129
Step 2 -Add Source Program Files to the Project ............................................. 129
Step 3 -Build the Project .................................................................................... 129
Step 4 -Programming the OTP Device .............................................................. 129
Step 5 -Transmit Code to Holtek ....................................................................... 130
iv
A/D Type MCU

Appendix ................................................................................................. 131
Appendix A Device Characteristic Graphics .............................................................. 133
Appendix B Package Information ................................................................................ 143
Contents
v

vi
A/D Type MCU

Preface
Since the founding of the company, Holtek Semiconductor Inc. has concentrated much of its de-
sign efforts in the area of microcontroller development. Although supplying a wide range of semi-
conductor devices, the microcontroller category has always been a key product category within
the Holtek range, and one which will continue to expand as their devices increase in functionality
and maturity. By capitalizing on the substantial accumulated skills within its dedicated
microcontroller development department, Holtek has been able to release a comprehensive
range of high quality low-cost microcontroller devices for a wide range of application areas. Many
important applications need to process analog signals such as those which interface to external
sensors. All of these applications require analog to digital signal conversion by an A/D converter
before they can be processed by the microcontroller. To address these needs, Holtek has devel-
oped its range of A/D microcontrollers, which in addition to having all the features and functions of
the I/O range of devices, also include integrated multi-channel A/D converters of varying resolu-
tion and channel capacity. The inclusion of PWM functions and an I2C interface further enhance
the features and application possibilities of the A/D series of microcontrollers.
This handbook is divided into three parts for user convenience. Most details regarding general
datasheet information and device specification is located within Part I. Information related to
microcontroller programming such as device instruction set, instruction definition, and assembly
language directives is found within Part II. Part III relates to the Holtek range of Development Tools
where information can be found on their installation and use.
By compiling all relevant data together in one handbook, we hope users of the Holtek range of A/D
Type microcontroller devices will have at their fingertips a useful, complete and simple means to ef-
ficiently implement their microcontroller applications. Holtek¢s efforts to combine information on de-
vice specifications, programming and development tools into one publication have produced a
handbook which with careful use by the user should result in trouble free designs and the maxi-
mum benefit being gained from the many features of Holtek microcontroller devices. We welcome
feedback and comments from our customers regarding further improvements.
Preface
vii

viii
A/D Type MCU

Part I
Microcontroller Profile
Part I Microcontroller Profile
1

2
A/D Type MCU

Chapter 1
Hardware Structure
This section is the main datasheet section of the A/D Type microcontroller handbook and contains
all the parameters and information related to the hardware. The information contained provides de-
signers with details on all the main hardware features of the A/D Type microcontroller range which
together with the programming section contains the information to enable swift and successful im-
plementation of user microcontroller applications. By proper consultation of the relevant parts of
this section, users can ensure that they make the most efficient use of the flexible and
multi-function features within the A/D Type microcontroller series.
Introduction
The HT46R47/HT46C47, HT46R22/HT46C22, HT46R23/HT46C23 and HT46R24/HT46C24
form the series of 8-bit high performance RISC architecture microcontrollers, designed especially
for applications that interface directly to analog signals, such as those from sensors. All devices in-
clude an integrated multi-channel Analog to Digital Converter in addition to one or more Pulse
Width Modulation outputs. Device flexibility is enhanced with the usual features of the other
microcontroller range such as HALT and wake-up functions, oscillator options, programmable fre-
quency divider etc. These features combine to ensure applications require a minimum of external
components and therefore reduce overall product costs. Having the benefits of integrated A/D and
PWM functions, in addition to the advantages of low power consumption, high performance, I/O
flexibility, as well as low cost, these devices have the versatility to suit a wide range of application
possibilities such as sensor signal processing, motor driving, industrial control, consumer prod-
ucts, subsystem controllers, etc. Many features are common to all devices however, they differ in
areas such as I/O pin count, RAM and ROM capacity, timer number and size, A/D channels, PWM
outputs, etc.
The HT46R47, HT46R22, HT46R23 and HT46R24 are OTP devices offering the advantages of
easy and effective program updates, using the Holtek range of development and programming
tools. These devices provide the designer with the means for fast and low cost product develop-
ment cycles. However, for applications that are at a mature state in their design process, the
HT46C47, HT46C22, HT46C23 and HT46C24 mask version devices offer a complementary de-
vice for products with high volume and low cost demands. Fully pin and functionally compatible
with their OTP sister devices, such mask version devices provide the ideal substitute for products
which have gone beyond their development cycle and are facing cost down demands.
Chapter 1 Hardware Structure
3
1

Features
Technology Features
·High-performance RISC Architecture
·Low-power Fully Static CMOS Design
·Operating Voltage:
fSYS=4MHz: 2.2V~5.5V
fSYS=8MHz: 3.3V~5.5V
·Power Consumption:
2mA Typical at 5V 4MHz (for Crystal Oscillator with ADC Disabled)
Maximum of 1mA Standby Current at 3V with WDT Disabled
·Temperature Range:
Operating Temperature -40°Cto85°C (Industrial Grade)
Storage Temperature -50°Cto125°C
Kernel Features
·Program Memory:
2K´14 OTP/Mask ROM (HT46R47/HT46C47, HT46R22/HT46C22)
4K´15 OTP/Mask ROM (HT46R23/HT46C23)
8K´16 OTP/Mask ROM (HT46R24/HT46C24)
·Data Memory:
64´8 SRAM (HT46R47/HT46C47, HT46R22/HT46C22)
192´8 SRAM (HT46R23/HT46C23)
384´8 SRAM (HT46R24/HT46C24)
·Table Read Function
·Multi-level Hardware Stack:
6-level (HT46R47/HT46C47, HT46R22/HT46C22)
8-level (HT46R23/HT46C23)
16-level (HT46R24/HT46C24)
·Direct and Indirect Data Addressing Mode
·Bit Manipulation Instructions
·63 Powerful Instructions
·Most Instructions Implemented in 1 Machine Cycle
Peripheral Features
·From 13 to 40 Bidirectional I/O with Pull-high Options
·Multi-channel 9 or 10-bit A/D Converter
·Pulse Width Modulator Outputs
·Port A Wake-up Options
·External Interrupt Input
·Event Counter Input
·Full Timer Functions with Prescaler and Interrupt
·Watchdog Timer (WDT)
4
A/D Type MCU

·HALT and Wake-up Feature for Power Saving Operation
·PFD Output
·I2C Interface (excluding HT46R47/HT46C47)
·On-chip Crystal and RC Oscillator
·Low Voltage Reset (LVR) Feature for Brown-out Protection
·Programming Interface with Code Protection
·Mask Version Devices Available for High Volume Production
·Full Suite of Supported Hardware and Software Tools Available
Selection Table
The series of A/D microcontrollers include a comprehensive range of features, some of which are
standard and some of which are device dependent. Most features are common to all devices, the
main feature distinguishing them are Program Memory, Data Memory capacity, I/O count, timer
functions, A/D channels and PWM outputs. To assist users in their selection of the most appropri-
ate device for their application, the following table, which summarizes the main features of each
device, is provided.
Part No. VDD Program
Memory
Data
Memory I/O Timer Interrupt I2C A/D PWM Stack Package
Types
HT46R47
HT46C47
2.2V~
5.5V 2K´14 64´813 8-bit´13¾9-bit´4 8-bit´1618DIP,
18SOP
HT46R22
HT46C22
2.2V~
5.5V 2K´14 64´819 8-bit´14Ö9-bit´8 8-bit´1624SKDIP,
24SOP
HT46R23
HT46C23
2.2V~
5.5V 4K´15 192x8
19
16-bit´14Ö10-bit´8
8-bit´1
8
24SKDIP,
24SOP
23 8-bit´228SKDIP,
28SOP
HT46R24
HT46C24
2.2V~
5.5V 8K´16 384´8
23
16-bit´25Ö10-bit´8
8-bit´2
16
28SKDIP,
28SOP
40 8-bit´448SSOP
Note Part numbers including ²C²are mask version devices while ²R²are OTP devices.
Chapter 1 Hardware Structure
5

Block Diagram
The following block diagram illustrates the main functional blocks of the A/D Type microcontroller
series of devices.
Note This block diagram represents the OTP devices, for the mask device there is no Device Pro-
gramming Circuitry. The HT46R47/HT46C47 does not contain an I2C interface. The Bank Pointer
only exists in the HT46R24/HT46C24.
6
A/D Type MCU
T i m i n g
G e n e r a t o r
S y s t e m R C /
X ' t a l O s c i l l a t o r I n s t r u c t i o n
D ecoder
I n s t r u c t i o n
R e g i s t e r
W D T
O s c i l l a t o r
D a t a
M e m o r y
A d d r e s s D e c o d e r
M e m o r y
P o i n t e r
M X A C C
C o n f i g .
R e g i s t e r
W a t c h d o g
T i m e r
R e s e t &
L V R
C o n f i g .
R e g i s t e r
T i m e r ( s ) /
C o u n t e r
Look-up
T a b l e
R e g i s t e r
P r o g r a m
M e m o r y
A d d r e s s D e c o d e r
S t a c k
S t a c k P o i n t e r
P r o g r a m
C o u n t e r
Look-up
T a b l e
P o i n t e r
C o n f i g .
R e g i s t e r
I/O
P o r t s
D e v i c e
P r o g r a m m i n g
C i r c u i t r y
C o n f i g u r a t i o n
O p t i o n
T o P r o g r a m
M e m o r y
A L
S h i f t e r
MX
C o n f i g .
R e g i s t e r
I n t e r r u p t
C i r c u i t
P F D
A / D
C o n v e r t e r
C o n f i g .
R e g i s t e r P W M
I2C
B a n k
P o i n t e r

Pin Assignment
Note The pin compatibility features of the microcontroller SKDIP/SOP packages allow for straightfor-
ward upgrading to devices of higher functionality with minimal changes to application hardware.
Chapter 1 Hardware Structure
7
P A 4 / T M R
P A 5 / I N T
P A 6
P A 7
O S C 2
O S C 1
V D D
R E S
P D 0 / P W M
P A 3 / P F D
P A 2
P A 1
P A 0
P B 3 / A N 3
P B 2 / A N 2
P B 1 / A N 1
P B 0 / A N 0
V S S
1 8
1 7
1 6
1 5
1 4
1 3
1 2
1 1
1 0
1
2
3
4
5
6
7
8
9
H T 4 6 R 4 7 / H T 4 6 C 4 7
1 8 D I P - A / S O P - A
H T 4 6 R 2 2 / H T 4 6 C 2 2
2 4 S K D I P - A / S O P - A
P B 5 / A N 5
P B 4 / A N 4
P A 3 / P F D
P A 2
P A 1
P A 0
P B 3 / A N 3
P B 2 / A N 2
P B 1 / A N 1
P B 0 / A N 0
V S S
P C 0
P B 6 / A N 6
P B 7 / A N 7
P A 4 / T M R
P A 5 / I N T
P A 6 / S D A
P A 7 / S C L
O S C 2
O S C 1
V D D
R E S
P D 0 / P W M
P C 1
2 4
2 3
2 2
2 1
2 0
1 9
1 8
1 7
1 6
1 5
1 4
1 3
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
P B 5 / A N 5
P B 4 / A N 4
P A 3 / P F D
P A 2
P A 1
P A 0
P B 3 / A N 3
P B 2 / A N 2
P B 1 / A N 1
P B 0 / A N 0
V S S
P C 0
P B 6 / A N 6
P B 7 / A N 7
P A 4 / T M R
P A 5 / I N T
P A 6 / S D A
P A 7 / S C L
O S C 2
O S C 1
V D D
R E S
P D 0 / P W M
0
P C 1
2 4
2 3
2 2
2 1
2 0
1 9
1 8
1 7
1 6
1 5
1 4
1 3
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
H T 4 6 R 2 3 / H T 4 6 C 2 3
2 4 S K D I P - A / S O P - A
H T 4 6 R 2 3 / H T 4 6 C 2 3
2 8 S K D I P - A / S O P - A
2 8
2 7
2 6
2 5
2 4
2 3
2 2
2 1
2 0
1 9
1 8
1 7
1 6
1 5
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
P B 5 / A N 5
P B 4 / A N 4
P A 3 / P F D
P A 2
P A 1
P A 0
P B 3 / A N 3
P B 2 / A N 2
P B 1 / A N 1
P B 0 / A N 0
V S S
P C 0
P C 1
P C 2
P B 6 / A N 6
P B 7 / A N 7
P A 4 / T M R
P A 5 / I N T
P A 6 / S D A
P A 7 / S C L
O S C 2
O S C 1
V D D
R E S
P D 1 / P W M 1
P D 0 / P W M 0
P C 4
P C 3
H T 4 6 R 2 4 / H T 4 6 C 2 4
4 8 S S O P - A
4 8
4 7
4 6
4 5
4 4
4 3
4 2
4 1
4 0
3 9
3 8
3 7
3 6
3 5
3 4
3 3
3 2
3 1
3 0
2 9
2 8
2 7
2 6
2 5
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
2 0
2 1
2 2
2 3
2 4
P B 5 / A N 5
P B 4 / A N 4
P A 3 / P F D
P A 2
P A 1
P A 0
P B 3 / A N 3
P B 2 / A N 2
P B 1 / A N 1
P B 0 / A N 0
N C
P F 3
P F 2
P F 1
P D 7
P D 6
P D 5
P D 4
V S S
P F 0
T M R 0
P C 0
P C 1
P C 2
P B 6 / A N 6
P B 7 / A N 7
P A 4
P A 5 / I N T
P A 6 / S D A
P A 7 / S C L
P F 4
P F 5
P F 6
P F 7
O S C 2
O S C 1
V D D
R E S
T M R 1
P D 3 / P W M 3
P D 2 / P W M 2
P D 1 / P W M 1
P D 0 / P W M 0
P C 7
P C 6
P C 5
P C 4
P C 3
H T 4 6 R 2 4 / H T 4 6 C 2 4
2 8 S K D I P - A / S O P - A
2 8
2 7
2 6
2 5
2 4
2 3
2 2
2 1
2 0
1 9
1 8
1 7
1 6
1 5
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
P B 5 / A N 5
P B 4 / A N 4
P A 3 / P F D
P A 2
P A 1
P A 0
P B 3 / A N 3
P B 2 / A N 2
P B 1 / A N 1
P B 0 / A N 0
V S S
P C 0
P C 1
P C 2
P B 6 / A N 6
P B 7 / A N 7
P A 4
P A 5 / I N T
P A 6 / S D A
P A 7 / S C L
O S C 2
O S C 1
V D D
R E S
P D 1 / P W M 1 / T M R 1
P D 0 / P W M 0
P C 4
P C 3

Pin Description
HT46R47/HT46C47
Pin Name I/O Configuration
Option Description
PA0~PA2
PA3/PFD
PA4/TMR
PA5/INT
PA6~PA7
I/O
Pull-high
Wake-up
PA3 or PFD
Bidirectional 8-bit input/output port. Each individual bit on this
port can be configured as a wake-up input by a configuration
option. Software instructions determine if the pin is a CMOS
output or Schmitt Trigger input. A configuration option deter-
mines which bits on the port have pull-high resistors. Pins
PA3, PA4 and PA5 are pin-shared with PFD, TMR and INT
respectively.
PB0/AN0
PB1/AN1
PB2/AN2
PB3/AN3
I/O Pull-high
Bidirectional 4-bit input/output port. Software instructions de-
termine if the pin is a CMOS output or Schmitt Trigger input. A
configuration option determines which bits on the port have
pull-high resistors. PB is pin-shared with the A/D input pins.
The A/D inputs are selected via software instructions. Once
selected as an A/D input, the I/O function and pull-high resis-
tor functions are disabled automatically.
PD0/PWM I/O Pull-high
I/O or PWM
Bidirectional 1-bit input/output port. Software instructions de-
termine if the pin is a CMOS output or Schmitt Trigger input. A
configuration option determines if this pin has a pull-high re-
sistor. The PWM output is pin-shared with pin PD0 selected
via configuration option.
OSC1
OSC2
I
OCrystal or RC
OSC1, OSC2 are connected to an external RC network or ex-
ternal crystal (determined by configuration option) for the in-
ternal system clock. For external RC system clock operation,
OSC2 is an output pin for 1/4 system clock.
RES I ¾Schmitt Trigger reset input. Active low.
VDD ¾¾
Positive power supply
VSS ¾¾
Negative power supply, ground
Note 1. Each pin on PA can be programmed through a configuration option to have a wake-up function.
2. Each pin on each port can be individually configured to have a pull-high resistor.
8
A/D Type MCU

HT46R22/HT46C22
Pin Name I/O Configuration
Option Description
PA0~PA2
PA3/PFD
PA4/TMR
PA5/INT
PA6/SDA
PA7/SCL
I/O
Pull-high
Wake-up
PA3 or PFD
PA6/PA7 or
SDA/SCL
Bidirectional 8-bit input/output port. Each individual bit on
this port can be configured as a wake-up input by a configu-
ration option. Software instructions determine if the pin is a
CMOS output or Schmitt Trigger input. A configuration op-
tion determines which bits on the port have pull-high resis-
tors. Pins PA3, PA4 and PA5 are pin-shared with PFD,
TMR and INT respectively. Pins PA6 and PA7 are
pin-shared with SDA and SCL respectively and are used to
implement the I2C bus function.
PB0/AN0
PB1/AN1
PB2/AN2
PB3/AN3
PB4/AN4
PB5/AN5
PB6/AN6
PB7/AN7
I/O Pull-high
Bidirectional 8-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines if all pins on the port
have pull-high resistors. PB is pin-shared with the A/D input
pins. The A/D inputs are selected via software instructions.
Once selected as an A/D input, the I/O function and
pull-high resistor functions are disabled automatically.
PC0~PC1 I/O Pull-high
Bidirectional 2-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines if both pins on this
port have pull-high resistors.
PD0/PWM I/O Pull-high
I/O or PWM
Bidirectional 1-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines if this pin has a
pull-high resistor. The PWM output is pin-shared with pin
PD0 selected via configuration option.
OSC1
OSC2
I
OCrystal or RC
OSC1, OSC2 are connected to an external RC network or
external crystal (determined by configuration option) for the
internal system clock. For external RC system clock opera-
tion, OSC2 is an output pin for 1/4 system clock.
RES I ¾Schmitt Trigger reset input. Active low.
VDD ¾¾
Positive power supply
VSS ¾¾
Negative power supply, ground
Note 1. Each pin on PA can be programmed through a configuration option to have a wake-up function.
2. Individual pins on PA can be selected to have a pull-high resistors. However, individual pins on
Port B and Port C cannot be selected to have pull-high resistors. If the pull-high configuration
is chosen for a particular PB or PC port, then all input pins on this port will be connected to
pull-high resistors.
Chapter 1 Hardware Structure
9

HT46R23/HT46C23
Pin Name I/O Configuration
Option Description
PA0~PA2
PA3/PFD
PA4/TMR
PA5/INT
PA6/SDA
PA7/SCL
I/O
Pull-high
Wake-up
PA3 or PFD
PA6/PA7 or
SDA/SCL
Bidirectional 8-bit input/output port. Each individual bit on this
port can be configured as a wake-up input by a configuration
option. Software instructions determine if the pin is a CMOS
output or Schmitt Trigger input. A configuration option deter-
mines which bits on the port have pull-high resistors. Pins PA3,
PA4 and PA5 are pin-shared with PFD, TMR and INT respec-
tively. Pins PA6 and PA7 are pin-shared with SDA and SCL re-
spectively and are used to implement the I2C bus function.
PB0/AN0
PB1/AN1
PB2/AN2
PB3/AN3
PB4/AN4
PB5/AN5
PB6/AN6
PB7/AN7
I/O Pull-high
Bidirectional 8-bit input/output port. Software instructions de-
termine if the pin is a CMOS output or Schmitt Trigger input. A
configuration option determines if all pins on the port have
pull-high resistors. PB is pin-shared with the A/D input pins.
The A/D inputs are selected via software instructions. Once
selected as an A/D input, the I/O function and pull-high resis-
tor functions are disabled automatically.
PC0~PC4 I/O Pull-high
Bidirectional 5-bit input/output port. Software instructions de-
termine if the pin is a CMOS output or Schmitt Trigger input. A
configuration option determines if all pins on this port have
pull-high resistors.
PD0/PWM0
PD1/PWM1 I/O Pull-high
I/O or PWM
Bidirectional 2-bit input/output port. Software instructions de-
termine if the pin is a CMOS output or Schmitt Trigger input. A
configuration option determines if both pins on this port have
pull-high resistors. The PWM0 output is pin-shared with pin
PD0 and the PWM1 output is pin-shared with PD1, selected
via configuration options.
OSC1
OSC2
I
OCrystal or RC
OSC1, OSC2 are connected to an external RC network or ex-
ternal crystal (determined by configuration option) for the in-
ternal system clock. For external RC system clock operation,
OSC2 is an output pin for 1/4 system clock.
RES I ¾Schmitt Trigger reset input. Active low.
VDD ¾¾
Positive power supply
VSS ¾¾
Negative power supply, ground
Note 1. Each pin on PA can be programmed through a configuration option to have a wake-up function.
2. Individual pins on PA can be selected to have a pull-high resistors. However, individual pins on
Port B, Port C and Port D cannot be selected to have pull-high resistors. If the pull-high
configuration is chosen for a particular PB, PC or PD port, then all input pins on this port will
be connected to pull-high resistors.
3. The pin description table is based on the 28-pin device. Due to packaging limitations some pins
may not exist on the 24-pin package.
10
A/D Type MCU

HT46R24/HT46C24
Pin Name I/O Configuration
Option Description
PA0~PA2
PA3/PFD
PA4
PA5/INT
PA6/SDA
PA7/SCL
I/O
Pull-high
Wake-up
PA3 or PFD
PA6/PA7 or
SDA/SCL
Bidirectional 8-bit input/output port. Each individual bit on
this port can be configured as a wake-up input by a configu-
ration option. Software instructions determine if the pin is a
CMOS output or Schmitt Trigger input. A configuration op-
tion determines which bits on the port have pull-high resis-
tors. Pins PA3 and PA5 are pin-shared with PFD and INT
respectively. Pins PA6 and PA7 are pin-shared with SDA
and SCL respectively and are used to implement the I2C bus
function.
PB0/AN0
PB1/AN1
PB2/AN2
PB3/AN3
PB4/AN4
PB5/AN5
PB6/AN6
PB7/AN7
I/O Pull-high
Bidirectional 8-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines which bits on the port
have pull-high resistors. PB is pin-shared with the A/D input
pins. The A/D inputs are selected via software instructions.
Once selected as an A/D input, the I/O function and
pull-high resistor functions are disabled automatically.
PC0~PC7 I/O Pull-high
Bidirectional 8-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines if all pins on this port
have pull-high resistors.
PD0/PWM0
PD1/PWM1
PD2/PWM2
PD3/PWM3
PD4~PD7
I/O Pull-high
I/O or PWM
Bidirectional 8-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines if all pins on this port
have pull-high resistors. The PWM0/PWM1/PWM2 and
PWM3 output pins are pin-shared with pins PD0/PD1/PD2
and PD3 respectively, selected via configuration options.
PF0~PF7 I/O Pull-high
Bidirectional 8-bit input/output port. Software instructions
determine if the pin is a CMOS output or Schmitt Trigger in-
put. A configuration option determines if all pins on this port
have pull-high resistors.
TMR0 I ¾Timer/Event Counter 0 Schmitt Trigger input. No pull-high
resistor connected.
TMR1 I ¾Timer/Event Counter 1 Schmitt Trigger input. No pull-high
resistor connected.
OSC1
OSC2
I
OCrystal or RC
OSC1, OSC2 are connected to an external RC network or
external crystal (determined by configuration option) for the
internal system clock. For external RC system clock opera-
tion, OSC2 is an output pin for 1/4 system clock.
RES I ¾Schmitt Trigger reset input. Active low.
VDD ¾¾
Positive power supply
VSS ¾¾
Negative power supply, ground
Chapter 1 Hardware Structure
11
This manual suits for next models
3
Table of contents
Other Holtek Controllers manuals
Popular Controllers manuals by other brands

Daikin
Daikin DKN-MP130-24M installation instructions

Timotion
Timotion TDH5PR manual

Ampcontrol
Ampcontrol ROCKSTARTER Firmware Update User Manual

Heatcraft Refrigeration Products
Heatcraft Refrigeration Products BEACON II SMART CONTROLLER H-IM-80C Installation and operation manual

RPB
RPB C40 Climate Control instruction manual

MIIDEX LIGHTING
MIIDEX LIGHTING Vision-EL ELV421364 Notice Instructions