Apr. 2001
Ver 1.0
8-BIT SINGLE-CHIP MICROCONTROLLERS
HMS87C1304(2)A
HMS87C1204(2)A
HMS87C1104(2)A
User’s Manual
HMS87C130XA/120XA/110XA
1. OVERVIEW ....................................................................................................................... 1
1.1
1.2
1.3
1.4
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. BLOCK DIAGRAM ........................................................................................................... 4
3. PIN ASSIGNMENT ........................................................................................................... 5
4. PACKAGE DIAGRAM ...................................................................................................... 6
5. PIN FUNCTION ................................................................................................................. 9
6. PORT STRUCTURES ..................................................................................................... 11
7. ELECTRICAL CHARACTERISTICS .............................................................................. 16
7.1
7.2
7.3
7.4
7.5
7.6
Absolute Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Recommended Operating Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
A/D Converter Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
AC Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Typical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8. MEMORY ORGANIZATION ........................................................................................... 22
8.1
8.2
8.3
8.4
Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Data Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
9. I/O PORTS ...................................................................................................................... 34
9.1
9.2
9.3
9.4
RA and RAIO registers
RB and RBIO registers
RC and RCIO registers
RD and RDIO registers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
10. CLOCK GENERATOR ................................................................................................. 38
10.1 Oscillation Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11. BASIC INTERVAL TIMER ............................................................................................ 40
12. TIMER / COUNTER ...................................................................................................... 41
12.1 8-bit Timer/Counter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Apr. 2001 ver1.0
HMS87C130XA/120XA/110XA
12.2
12.3
12.4
12.5
12.6
16-bit Timer/Counter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8-bit Compare Output (16-bit) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8-bit Capture Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
16-bit Capture Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
PWM Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
13. BUZZER OUTPUT FUNCTION .................................................................................... 50
14. ANALOG TO DIGITAL CONVERTER .......................................................................... 51
15. INTERRUPTS ............................................................................................................... 54
15.1 Interrupt Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
15.2 External Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
16. WATCHDOG TIMER .................................................................................................... 59
17. POWER SAVING MODE .............................................................................................. 60
17.1 Minimizing Current Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
18. RESET .......................................................................................................................... 66
19. POWER FAIL PROCESSOR ........................................................................................ 68
20. OTP PROGRAMMING .................................................................................................. 70
20.1 DEVICE CONFIGURATION AREA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
APPENDIX
Instruction Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Apr. 2001 ver 1.0
HMS87C130XA/120XA/110XA
HMS87C1304A / HMS87C1302A
HMS87C1204A / HMS87C1202A
HMS87C1104A / HMS87C1102A
CMOS SINGLE-CHIP 8-BIT MICROCONTROLLER
1. OVERVIEW
1.1 Description
The HMS87C1X0XA is an advanced CMOS 8-bit microcontroller with 4K/2K bytes of EPROM. The Hynix
HMS87C1X0XA is a powerful microcontroller which provide a highly flexible and cost effective solution to many small
applications such as controller for battery charger. The HMS87C1X0XA provides the following standard features: 4K/2K
bytes of EPROM, 128bytes of RAM, 8-bit timer/counter, 8-bit A/D converter, 10-bit high speed PWM output, programmable
buzzer driving port, power-on reset circuit, on-chip oscillator and clock circuitry. In addition, the HMS87C1X0XA supports
power saving modes to reduce power consumption.
This document is
only explained for the base of HMS87C1304A,
the other’s eliminated functions are same as below.
Device name
HMS87C1304A
HMS87C1302A
HMS87C1204A
HMS87C1202A
HMS87C1104A
HMS87C1102A
EPROM
4K bytes
2K bytes
4K bytes
2K bytes
4K bytes
2K bytes
RAM
128bytes
128bytes
128bytes
128bytes
128bytes
128bytes
EXT.INT
2
2
2
2
1
1
BUZ
O
O
O
O
X
X
I/O
19
19
15
15
11
11
Operating
Voltage
2.0 ~ 5.5V
2.0 ~ 5.5V
2.0 ~ 5.5V
2.0 ~ 5.5V
2.0 ~ 5.5V
2.0 ~ 5.5V
Package
24 SKDIP or SOP
24 SKDIP or SOP
20 PDIP or SOP
20 PDIP or SOP
16 PDIP or SOP
16 PDIP or SOP
1.2 Features
• 4K/2K Bytes On-chip Program Memory
• 128 Bytes of On-chip Data RAM
(Included stack memory)
• Instruction Cycle Time:
- 250nS at 8MHz
• Programmable I/O pins
(LED direct driving can be source and sink)
- HMS87C1304A/1302A : 19
- HMS87C1204A/1202A : 15
- HMS87C1104A/1102A : 11
• 2.0V to 5.5V Wide Operating Range
• 8-bit A/D Converter
- 8 channels
• One 8-bit Basic Interval Timer
• Two 8-bit Timer / Counters
• One 10-bit High Speed PWM Outputs
• Watchdog timer
• Seven Interrupt sources
- External input: 2 ( 1 for HMS87C1104/2A )
- A/D Conversion: 1
- Timer: 4
• One Programmable Buzzer Driving port
( except HMS87C1104/2A )
- 500Hz ~ 130kHz
Apr. 2001 ver1.0
1
HMS87C130XA/120XA/110XA
• Oscillator Type
- Crystal
- Ceramic Resonator
- RC-oscillation ( C can be omitted )
• Power-On Reset
• Noise Immunity Circuit
- Power Fail Processor
• Power Down Mode
- STOP mode
- Wake-up Timer mode
- Internal RC-WDT mode
1.3 Development Tools
The HMS87C1X0XA is supported by a full-featured mac-
ro assembler, an in-circuit emulator CHOICE-Dr
TM
and
OTP programmers.
The marco assembler operates under the MS-Windows 95/
98
TM
.
The OTP programmer can be supplied three types of pro-
grammer such as emulator add-on board type single pro-
grammer (Dr.Writer
TM
), univeral stand-alone type single
programmer (CHOICE-SIGMA
TM
) and gang type pro-
grammer (CHOICE-SIGMA
TM
). .
In Circuit
Emulators
Assembler
CHOICE-Dr.
TM
Hynix Macro Assembler
Single Programmer : Dr. Writer
TM
Universal Programmer : CHOICE-
OTP
Programmer
SIGMA
TM
Gang Programmer : CHOICE-GANG4
TM
Figure 1-2 OTP Single Programmer Dr.Writer
TM
Figure 1-3 OTP Gang Programmer CHOICE-GANG4
TM
Figure 1-1 In Circuit Emulator CHOICE-Dr.
TM
2
Apr. 2001 ver 1.0