MSM80C154S MSM83C154S MSM85C154HVS USER'S MANUAL

Similar documents
8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

8051 Microcontroller

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

: 40 to +85 C (Operation at +125 C conforms to the other specification.) Fully static circuit Upward compatible with the MSM80C51F/80C31F

8051 microcontrollers

8051 Microcontroller

Rev. No. History Issue Date Remark

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text


Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION

UNIT IV MICROCONTROLLER

CS 320. Computer Architecture Core Architecture

INTEGRATED CIRCUITS DATA SHEET. P89C738; P89C739 8-bit microcontrollers Dec 15. Product specification File under Integrated Circuits, IC20

8051 MICROCONTROLLER


Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.

Three criteria in Choosing a Microcontroller

DATA SHEET. P80CL31; P80CL51 Low voltage 8-bit microcontrollers with UART INTEGRATED CIRCUITS Apr 15

Introduction To MCS-51

8XC51RA RB RC Hardware Description

AT Bit Spread- Spectrum Microcontroller. Preliminary. Features. Description. Pin Configuration

8051 Microcontrollers


SH57K12. High Performance 8031 Microcontroller. Preliminary. Features. General Description

8-Bit Microcontroller with 8K Bytes QuickFlash Memory

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

Question Bank Microprocessor and Microcontroller

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

8051 MICROCONTROLLER

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

IA8044/IA8344. SDLC Communications Controller. Data Sheet. SDLC Communications Controller January 9, 2015

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

8XC151SA and 8XC151SB Hardware Description

P89V52X2. 1. General description. 2. Features. 8-bit 80C51 low power 8 kb flash microcontroller with 256 B RAM, 192 B data EEPROM

EE6502- MICROPROCESSOR AND MICROCONTROLLER

High-Speed Microcontroller User s Guide

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch

ENE 334 Microprocessors

Preliminary W77E58 8 BIT MICROCONTROLLER. Table of Contents-- Publication Release Date: March Revision A1

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

7.2.1 Timer 2 Capture LSB... 24

The Final Word on 8051 Microcontroller

DS89C420 Ultra High-Speed Microcontroller User s Guide

DATA SHEET. P80CL410; P83CL410 Low voltage 8-bit microcontrollers with I 2 C-bus INTEGRATED CIRCUITS Apr 10

TS80C52X2. 8-bit CMOS Microcontroller 0-60 MHz. Preliminary. 1. Description. 2. Features

Introducing The MCS 251 Microcontroller -- 8XC251SB

PGT302 Embedded Software Technology. PGT302 Embedded Software Technology

W77IE58 8-BIT MICROCONTROLLER. Table of Contents-- Publication Release Date: December Revision A2

MODULE-1. Short Answer Questions

MEGAWIN MPC89L516X2. 8-bit micro-controller. Features

Fig 1. Block diagram of a microcomputer

MICROPROCESSOR & MICROCONTROLLER

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

8-bit Microcontroller 8 Kbytes ROM/OTP, ROMless TS80C32X2 TS87C52X2 TS80C52X2 AT80C32X2 AT80C52X2 AT87C52X2. Features. Description

VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU

MCS -51 Programmer s Guide and Instruction Set

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

CPEG300 Embedded System Design. Lecture 3 Memory

W77LE58/W77L058A Data Sheet 8-BIT MICROCONTROLLER. Table of Contents- Publication Release Date: April 17, Revision A7

W77E058A Data Sheet 8-BIT MICROCONTROLLER. Table of Contents-

THE 8051 MICROCONTROLLER Simple comparison: Pentium vs. 8051

Handshake Solutions. HT80C51 User Manual

8051 Embedded Microcontroller HD 8002

High-Speed Microcontroller User s Guide

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

Preliminary W77C32 8 BIT MICROCONTROLLER GENERAL DESCRIPTION FEATURES

ULTRA-HIGH-SPEED FLASH MICROCONTROLLER USER S GUIDE

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

8-BIT MICROCONTROLLER

UNIT MICROCONTROLLER AND ITS PROGRAMMING

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

C511/C511A C513/C513A C513A-H 8-Bit CMOS Microcontroller. User s Manual Semiconductor/

SECTION 1: INTRODUCTION 5 SECTION 2: ORDERING INFORMATION 5 SECTION 3: ARCHITECTURE 5

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4199

DATA SHEET. P83C524; P80C528; P83C528 8-bit microcontrollers INTEGRATED CIRCUITS Dec 15

8-Bit CMOS Microcontorller

Lecture 1. Course Overview and The 8051 Architecture

SAB-C501 C517A. 8-Bit CMOS Microcontroller. User s Manual Semiconductor/

8-Bit Microcontroller with 8K Bytes Flash AT89S8252. Features. Description

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

HD C51-based microcontroller

Module Contents of the Module Hours COs

SOLUTION MANUAL FOR THE 8051 MICROCONTROLLER 4TH EDITION BY MACKENZIE AND PHAN

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT- IV

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

8051 Core Specification

UNIT 5. Microcontrollers. Syllabus

DS87C520/DS83C520. EPROM/ROM High Speed Micro PRELIMINARY PACKAGE OUTLINE FEATURES

C509-L 8-Bit CMOS Microcontroller. User's Manual Semiconductor/

Vidyalankar T.E. Sem. V [EXTC] Microprocessors and Microcontrollers I Prelim Question Paper Solution V SS (GND)

Microcomputer Architecture and Programming

Chapter 9. Programming Framework

Transcription:

MSM8C54S MSM83C54S MSM85C54HVS USER'S MANUAL

Copyright 988, OKI ELECTRIC INDUSTRY COMPANY, LTD. OKI makes no warranty for the use of its products and assumes no responsibility for any errors which may appear in this document nor does it make a commitment to update the information contained herein. OKI retains the right to make changes to these specifications at any time, without notice.

CONTENTS. INTRODUCTION. MSM8C54S/MSM83C54S/MSM85C54HVS Outline...3.2 MSM8C54S/MSM83C54S Features...5.3 Additional Features in MSM8C54S/MSM83C54S/MSM85C54HVS... 7 2. SYSTEM CONFIGURATION 2. MSM8C54S/MSM83C54S/MSM85C54HVS Logic Symbols... 2.2 MSM8C54S/MSM83C54S Pin Layout...2 2.2. MSM8C54S/MSM83C54S external dimensions...5 2.2.2 MSM85C54HVS pin layout and external dimensions...7 2.3 MSM8C54S Block Diagram...8 2.4 MSM83C54S Block Diagram...9 2.5 MSM85C54HVS Block Diagram...2 2.6 Timing and Control...2 2.6. Outline of MSM8C54S/MSM83C54S timing...2 2.6.2 Major synchronizing signals...23 () ALE...23 (2) PSEN...23 (3) WR... 23 (4) RD... 23 2.6.3 MSM8C54S fundamental operation time charts...24 () External program memory read cycle timing chart...24 (2) MOVX A, @Rr...24 (3) MOVX @Rr, A...25 (4) MOVX A, @DPTR...25 (5) MOVX @DPTR, A...26 (6) MOV direct, PORT[,, 2, 3] execution...26 2.6.4 MSM83C54S fundamental operation time charts...27 () MOVX A, @Rr...27 (2) MOVX @Rr, A... 27 (3) MOVX A, @DPTR...28 (4) MOVX @DPTR, A...28 (5) MOV direct, PORT[,, 2, 3] execution...29 2.7 Instruction Register (IR) and Instruction Decoder (PLA)...3 2.8 Arithmetic Operation Section...3 () Outline...3 (2) Arithmetic operation instruction decoder...3 (3) Arithmetic and logic unit (ALU)...3 2.9 Program Counter...32 2. Program Memory and External Data Memory...33 2.. MSM8C54S/MSM83C54S program area and external ROM connections...33 2..2 Procedures and circuit connections used when external data memory (RAM) is accessed by data pointer (DPTR)...35 2..3 Procedures and circuit connections used when external data memory (RAM) is accessed by registers R and R...38

3. CONTROL 3. Oscillators [XTAL.2]...43 3.2 CPU Resetting...45 3.2. Outline...45 3.2.2 Reset Schmitt trigger circuit...5 3.2.3 CPU internal status by reset...5 3.3 EA(CPU Memory Separate)...52 3.3. Outline...52 () Internal ROM mode...52 (2) External ROM mode...52 4. INTERNAL SPECIFICATIONS 4. Internal Data Memory (RAM) and Special Function Registers...55 4.. Outline...55 4.2 Internal Data Memory (RAM)...57 4.2. Internal data memory (RAM)...57 4.2.2 Internal data memory registers R thru R7...59 4.2.3 Stack...6 4.3 Internal Data Memory (RAM) Operating Procedures...6 4.3. Internal data memory indirect addressing...6 4.3.2 Internal data memory register R thru R7 designation...62 4.3.3 Internal data memory -bit data designation...63 4.4 Special Function Registers(TCON, SCON,...ACC, B)...65 4.4. Outline...65 4.4.2 Special function registers...67 4.4.2. Timer mode register (TMOD)...67 4.4.2.2 Power control register (PCON)...68 4.4.2.3 Timer control register (TCON)...69 4.4.2.4 Serial port control register (SCON)...7 4.4.2.5 Interrupt enable register (IE)...7 4.4.2.6 Interrupt priority register (IP)...72 4.4.2.7 Program status word register (PSW)...73 4.4.2.8 I/O control register (IOCON)...74 4.4.2.9 Timer 2 control register (T2CON)...75 4.5 Timer/Counters,, and 2...76 4.5. Outline...76 4.5.2 Timer/counters and...76 4.5.2. Outline...76 4.5.2.2 Timer/counter and counting control...76 4.5.2.3 Timer/counter and count clock designation...78 4.5.2.3. External clock detector circuit for timer/counters and...79 4.5.2.4 Counting control of timer/counters and by INT pin...8 4.5.2.5 Timer/counters / timer modes...82 4.5.2.5. Outline...82 4.5.2.5.2 Mode...82 4.5.2.5.3 Mode...84 4.5.2.5.4 Mode 2...86 4.5.2.5.5 Mode 3...88 4.5.2.5.6 32-bit timer mode...89

4.5.2.5.7 Caution about use of timer counters and...9 4.5.2.5.8 Caution about use of timer counters and when setting software power down mode...9 4.5.3 Timer/counter 2...92 4.5.3. Outline...92 4.5.3.2 Timer 2 control register (T2CON)...92 4.5.3.3 Timer/counter 2 operation modes...93 4.5.3.3. 6-bit auto reload mode...93 4.5.3.3.2 6-bit capture mode...94 4.5.3.3.3 6-bit baud rate generator mode...95 4.5.3.4 Timer/counter 2 detector circuit...97 4.5.3.4. T2(timer/counter 2 external clock detector)...97 4.5.3.4.2 T2EX(timer/counter 2 external flag input detector)...97 4.5.3.5 Timer/counter carry signal detector circuit...98 4.6 Serial Port...99 4.6. Outline...99 4.6.2 Special function registers for serial port... 4.6.2. SCON... 4.6.2.2 SBUF...3 4.6.2.3 TCLK...3 4.6.2.4 RCLK...3 4.6.2.5 SMOD...4 4.6.2.6 SERR...5 4.6.3 Operating modes...6 4.6.3. Mode...6 4.6.3.. Outline...6 4.6.3..2 Mode baud rate...6 4.6.3..3 Mode transmit operation...6 4.6.3..4 Mode receive operation...6 4.6.3.2 Mode... 4.6.3.2. Outline... 4.6.3.2.2 Mode baud rate... 4.6.3.2.3 Mode transmit operation... 4.6.3.2.4 Mode receive operation... 4.6.3.2.5 Mode UART error detection...2 4.6.3.3 Mode 2...5 4.6.3.3. Outline...5 4.6.3.3.2 Mode 2 baud rate...5 4.6.3.3.3 Mode 2 transmit operation...5 4.6.3.3.4 Mode 2 receive operation...5 4.6.3.3.5 Mode 2 UART error detection...6 4.6.3.4 Mode 3...9 4.6.3.4. Outline...9 4.6.3.4.2 Mode 3 baud rate...9 4.6.3.4.3 Mode 3 transmit operation...2 4.6.3.4.4 Mode 3 receive operation....2 4.6.3.4.5 Mode 3 UART error detection...2 4.6.4 Serial port application examples...24 4.6.4. I/O extension...24

4.6.4.2 Multi-processor systems...28 4.7 Interrupt...29 4.7. Outline...29 4.7.2 Interrupt enable register (IE)...3 4.7.3 Interrupt priority register (IP)...32 4.7.3. Priority interrupt routine flow...33 4.7.3.2 Interrupt routine flow when priority circuit is stopped...34 4.7.3.3 Interrupt priority when priority register (IP) contents are all... 35 4.7.4 Detection of external interrupt signals INT and INT...36 4.7.4. Outline of INT signal detection...36 4.7.4.2 External interrupt signal and level detection...36 4.7.4.3 External interrupt signal and trigger detection...37 4.7.5 MSM8C54S/MSM83C54S interrupt response time charts...38 4.7.5. Interrupt response time chart when interrupt conditions are satisfied during execution of ordinary instruction in main routine...38 4.7.5.2 Interrupt response time chart when interrupt conditions are satisfied during execution of IE or IP register operation instruction in main routine...4 4.7.5.3 Interrupt response time chart when an ordinary instruction is executed after temporarily returning to the main routine from continuous interrupt processing...42 4.7.5.4 Interrupt response time chart when an IE or IP manipulating instruction is executed after temporarily returning to the main routine from continuous interrupt processing...44 4.8 CPU Power Down...46 4.8. Outline...46 4.8.2 Idle mode (IDLE) setting...46 4.8.3 Soft power down mode (PD) setting...5 4.8.3. Caution about software power down mode setting...5 4.8.4 Hard power down mode (HPD) setting...6 4.9 CPU Power Down Mode (IDLE, PD, and HPD) Cancellation (CPU Activation) 69 4.9. Outline...69 4.9.2 Cancellation by CPU resetting (RESET pin)...69 4.9.3 Cancellation of CPU power down mode(idle, PD)by interrupt signal...76 4.9.3. Cancellation of CPU power down mode (IDLE, PD) from interrupt address...76 4.9.3.2 Cancellation of CPU power down mode (IDLE, PD) by interrupt request signal and restart from next address of stop address... 82 4. MSM8C54S/83C54S Battery Backup with Hard Power Down Mode... 87 5. INPUT/OUTPUT PORTS 5. Outline...92 5.2 Port...92 5.3 Port...95 5.4 Port 2...2 5.5 Port 3...23 5.6 Port,, 2, and 3 Output and Floating Status Settings in CPU Power Down Mode (PD, HPD)...25

5.7 High Impedance Input Port Setting of Each Quasi-bidirectional Port, 2, and 3...27 5.8 kw Pull-Up Resistance Setting for Quasi-bidirectional Input Ports, 2, and 3...27 5.9 Precautions When Driving External Transistors by Quasi-bidirectional Port Output Signals...28 5. Port Output Timing...2 ) One machine cycle instruction output timing...2 2) Two machine cycle instruction output timing...2 5. Port Data Manipulating Instructions...22 6. ELECTRICAL CHARACTERISTICS 6. Absolute Maximum Ratings...26 6.2 Operational Ranges....26 6.3 DC Characteristics...27 6.4 External Program Memory Access AC Characteristics...22 6.5 External Data Memory Access AC Characteristics...223 6.6 Serial Port (I/O Extension Mode) AC Characteristics...225 6.7 AC Characteristics Measuring Conditions...227 6.8 XTAL External Clock Input Waveform Conditions...228 7. DESCRIPTION OF INSTRUCTIONS 7. Outline...23 7.2 Description of Instruction Symbols...232 7.3 List of Instructions....233 7.4 Simplified Description of Instructions...234 7.5 Detailed Description of MSM8C54S/MSM83C54S Instructions...246

. INTRODUCTION

MSM8C54S/83C54S/85C54HVS 2

INTRODUCTION. INTRODUCTION. MSM8C54S/MSM83C54S/MSM85C54HVS Outline MSM8C54S/MSM83C54S/MSM85C54HVS are single-chip 8-bit fully static microcontrollers featuring high performance and low power consumption. All MSM8C3F /MSM8C5F instructions and functions have been retained. Apart from being without the internal program memory (ROM), MSM8C54S is identical to MSM83C54S. And the difference between MSM85C54HVS and MSM83C54S is that the internal program memory (ROM) in MSM83C54S is replaced by an external ROM connected to MSM85C54HVS by using a piggy-back package. While the MSM83C54S microcontroller integrates a 6384-word 8-bit program memory (ROM) in a single chip, MSM8C54S/MSM83C54S/MSM85C54HVS all feature computer functions including a 256-word 8-bit data memory (RAM), 32 input/ output ports, three 6-bit timer/counters, six interrupts, serial I/O, an 8-bit parallel processing circuit, and a clock generator. The internal operation in these CPUs is based on an instruction code address method for greater efficiency. In this method, operations are specified in the instruction code (OP) section, and the objective registers are specified by part of that instruction code and the second or third byte following the code. A feature of this method is the ability to achieve several operations by simply changing the manipulation register designation in a single instruction code. Inclusion of 8-bit multiplication and division instructions further increases the processing capacity of these CPUs. In addition to expansion of the bit processing area, a comprehensive range of bit processing instructions has also been included. Processing operations include logical processing of the carry flag and specified bit within each register, transfer between the carry flag and specified bit in certain registers, transfer of specified bits between different registers, setting, resetting, and complement of the specified bit in each register, and execution of various bit tests within a wide area. To make a relative jump after the execution of a bit test instruction, jumps can be made within a wide address range between 28 and +27 relative to the address of the instruction and there is no page field restriction. The contents of specified registers can be saved in stack by using the PUSH instruction, and the saved contents can be returned from stack to a specified register by the POP instruction. Absolute interrupt priority can be allocated to any interrupt when in priority circuit operation mode. And by controlling only the interrupt enable register (IE) when in priority circuit stop mode, multi-level interrupt processing can be executed to make interrupt processing much easier than in conventional CPUs. Employing the low-power consumption feature of C-MOS devices, these CPUs are designed to operate in a number of CPU power down modes. In idle mode the IDL bit in the power control register (PCON) is set to to halt CPU operations while the oscillator continues to run. In soft power down mode the PD bit in the power control register is set to to halt CPU operations as well as the oscillator. And in hard power down mode where the HPD bit in the power control register is set in advance to, CPU operations and the oscillator are stopped if the HPDI pin (P3.5) power failure detect signal level is changed from to. CPU power down modes can be cancelled by resetting the CPU via reset pin and restarting execution from address, by restarting execution from the relevant interrupt address, or by resuming 3

MSM8C54S/83C54S/85C54HVS execution from the next address after the stop address where CPU power down mode was activated. Each of the quasi-bidirectional ports, 2, and 3 can be set independently as high impedance input ports. And the kw pull-up resistance for these input ports can be isolated from the power supply (VCC), leaving only the kw pull-up resistance and thereby enabling the quasi-bidirectional ports to be driven by devices with low drive capacity. Furthermore, the outputs of ports,,, 2, and 3 can be switched to floating status during CPU power down modes (PD, HPD). Three built-in 6-bit timer/counters capable of operating in a wide range of modes enable the CPUs to be used in many different ways. And since timer/counters and can be operated by external clock during CPU power down modes (PD, HPD) where the oscillator is stopped, these two counters can also be used in cancelling CPU power down modes. UART based serial communication can be executed at any baud rate by carry signal from timer/counter or timer/counter 2. If an overrun or framing error is generated during data reception, the SERR bit in the I/O control register is set. And by testing this SERR bit, the accuracy of the data can be checked quite easily to ensure correct serial communication. As can be seen, these CPUs are equipped with a very comprehensive range of functions. Also note that EASE8C5mkII is available for use as the program development support system for these CPUs. Equipped with the MSM85C54E dedicated evachip, EASE8C5mkII is capable of program area mapping, realtime tracing, generating breaks according to accumulator contents, and various other functions designed for accurate and efficient support of program development of these CPUs. With this great line-up of functions and with EASE8C5mkII capable of developing programs in a very short time, MSM8C54S/MSM83C54S/MSM85C54HVS give a highly integrated high performance solution. 4

INTRODUCTION.2 MSM8C54S/MSM83C54S Features Full static circuitry Internal program memory (ROM) 6384 words 8 bits (MSM83C54S) External program memory (ROM) Connectable up to 64K bytes Internal data memory (RAM) 256 words 8 bits External data memory (RAM) Connectable up to 64K bytes Four sets of working registers (R thru R7 4) Stack Free use of 256-word 8-bit internal data memory area Four input/output ports (8-bit 4) Serial ports (UART operation) Six types of interrupts () Two external interrupts (2) Three timer interrupts (3) One serial port interrupt * Priority allocated interrupt processing * Multi-level interrupt processing by software management CPU power down function () Idle mode CPU stopped while oscillation continued. (Software setting) (2) PD mode CPU and oscillation all stopped. (Software setting) (Setting I/O ports to floating status possible) (3) HPD mode CPU and oscillation all stopped. (Hardware setting) (Setting I/O ports to floating status possible) CPU power down mode cancellation () Execution commenced from address by CPU resetting. (IDLE, PD, and HPD mode cancellation) * RESET pin is used (2) Execution from interrupt address by interrupt request, or execution resumed from next address after the stop address. (IDLE and PD mode cancellation) * External, timer, and serial port interrupts I/O control registers (F8H) b Port,, 2, and 3 floating setting (PD, HPD) b Port high impedance input port setting b2 Port 2 high impedance input port setting b3 Port 3 high impedance input port setting b4 Port, 2, and 3 pull-up resistance switching ( kw pull-up resistance switch off to leave only kw) b5 Serial port reception error detector bit b6 32-bit timer mode setting (TL+TH+TL+TH) 5

MSM8C54S/83C54S/85C54HVS Timer/counters (three 6-bit timer/counters) () 8-bit timer with 5-bit prescalar (2) 6-bit timer (3) 8-bit timer with 8-bit auto-reloader (4) 8-bit separate timer (5) 6-bit timer with 6-bit auto-reloader (6) 6-bit capture timer (7) 6-bit baud rate generator timer (8) 32-bit timer Wide operating temperature range 4 to +85 C Wide operating voltage range () When operating VCC=+2.2 to 6V (varies according to frequency) (2) When stopped VCC=+2 to +6V (PD or HPD mode) Instruction execution cycle () 2-byte -machine cycle instructions (2) Multiplication/division instructions Direct initialization of ports,, 2, and 3 by input of reset signal even if oscillator have been stopped. (All ports output.) High noise margin (with Schmitt trigger input for each I/O) 4-pin plastic DIP/44-pin plastic flat package/44-pin plastic PLCC/44/pin plastic TQFP Software compatibility with MSM8C3F and MSM8C5F 6

INTRODUCTION.3 Additional Features in MSM8C54S/MSM83C54S/MSM85C54HVS In addition to the basic operations of MSM8C3F/MSM8C5F, the MSM8C54S/ MSM83C54S/MSM85C54HVS devices also include the following functions. ROM capacity increased from 4K bytes to 6K bytes RAM capacity increased from 28 bytes to 256 bytes An additional timer counter 2 An additional timer interrupt 2 An additional 8-bit timer 2 control register (T2CON C8H) An additional 8-bit I/O control register (IOCON F8H) Addition of two bits (bit 5, PT2 and bit 7, PCT) to the priority register (IP B8H) Addition of one bit (bit 5, ET2) to the interrupt enable register (IE A8H) Addition of two bits (bit 5, RPD and bit 6, HPD) to the power control register (PCON 87H) Addition of these extra functions has further increased the performance and widen the range of application of these CPU devices. 7

MSM8C54S/83C54S/85C54HVS 8

2. SYSTEM CONFIGURATION

MSM8C54S/83C54S/85C54HVS

SYSTEM CONFIGURATION 2. SYSTEM CONFIGURATION 2. MSM8C54S/MSM83C54S/MSM85C54HVS Logic Symbols RESET ADDRESS LATCH ENABLE PROGRAM STORE ENABLE CPU MEMORY SEPARATE +5(V) XTAL XTAL2 RESET ALE PSEN EA VCC P. P. P.2 P.3 P.4 P.5 P.6 P.7 P. P. P.2 P.3 P.4 P.5 P.6 P.7 P2. P2. P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 PORT (BUS PORT) T2 T2EX PORT 2 PORT (V) VSS P3. P3. P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 RXD TXD INT INT T T/HPDI WR RD PORT 3 Figure 2- MSM8C54S/83C54S/85C54HVS logic symbols

MSM8C54S/83C54S/85C54HVS 2.2 MSM8C54S/MSM83C54S pin layouts MSM8C54SRS/MSM83C54SRS (Top View) 4 Pin Plastic DIP P./T2 P./T2EX 2 P.2 3 P.3 4 P.4 5 P.5 6 P.6 7 P.7 8 RESET 9 P3./RXD P3./TXD P3.2/INT 2 P3.3/INT 3 P3.4/T 4 P3.5/T/HPDI 5 P3.6/WR 6 P3.7/RD 7 XTAL2 8 XTAL 9 VSS 2 MSM8C54SRS/MSM83C54SRS 4 VCC 39 P. 38 P. 37 P.2 36 P.3 35 P.4 34 P.5 33 P.6 32 P.7 3 EA 3 ALE 29 PSEN 28 P2.7 27 P2.6 26 P2.5 25 P2.4 24 P2.3 23 P2.2 22 P2. 2 P2. MSM8C54SGS/MSM83C54SGS (Top View) 44 Pin Plastic Package P.5 P.6 P.7 RESET P3./RXD NC P3./TXD P3.2/INT P3.3/INT P3.4/T P3.5/T/HPDI 44 43 42 4 4 39 38 37 36 35 34 33 2 32 3 3 4 3 5 29 6 28 7 27 8 26 9 25 24 23 2 3 4 5 6 7 8 9 2 2 22 MSM8C54SGS/ MSM83C54SGS P3.6/WR P3.7/RD XTAL2 XTAL VSS VSS P2. P2. P2.2 P2.3 P2.4 P.4 P.3 P.2 P./T2EX P./T2 NC VCC P. O. P.2 P.3 P.4 P.5 P.6 P.7 EA NC ALE PSEN P2.7 P2.6 P2.5 2

SYSTEM CONFIGURATION MSM8C54SJS/MSM83C54SJS (Top View) 44 Pin Plastic QFJ P.5 P.6 P.7 RESET P3./RXD NC P3./TXD P3.2/INT P3.3/INT P3.4/T P3.5/T/HPDI 7 8 9 2 3 4 5 6 7 MSM8C54SJS/MSM83C54SJS P3.6/WR P3.7/RD XTAL2 XTAL VSS NC P2. P2. P2.2 P2.3 P2.4 P.4 P.3 P.2 P./T2EX P./T2 NC VCC P. P. P.2 P.3 6 5 4 3 2 44 43 42 4 4 39 P.4 38 P.5 37 P.6 36 P.7 35 EA 34 NC 33 ALE 32 PSEN 3 P2.7 3 P2.6 29 P2.5 8 9 2 2 22 23 24 25 26 27 28 MSM8C54STS/MSM83C54STS (Top View) 44 Pin Plastic Package P.5 P.6 P.7 RESET P3./RXD NC P3./TXD P3.2/INT P3.3/INT P3.4/T P3.5/T/HPDI 44 43 42 4 4 39 38 37 36 35 34 33 2 32 3 3 4 3 5 29 6 28 7 27 8 26 9 25 24 23 2 3 4 5 6 7 8 9 2 2 22 MSM8C54STS/ MSM83C54STS P3.6/WR P3.7/RD XTAL2 XTAL VSS VSS P2. P2. P2.2 P2.3 P2.4 P.4 P.3 P.2 P./T2EX P./T2 NC VCC P. O. P.2 P.3 P.4 P.5 P.6 P.7 EA NC ALE PSEN P2.7 P2.6 P2.5 Figure 2-2 MSM8C54S/MSM83C54S pin layout (top view) 3

MSM8C54S/83C54S/85C54HVS Applicable Packages 4-Pin Plastic DIP (DIP4-P-6-2.54) 44-Pin Plastic QFJ (QFJ44-P-S65-.27) 44-Pin Plastic QFP (DFP44-P-9-.8-2K) 44-Pin Plastic TQFP (TQFP44-P--.8-K) 4-Pin Ceramic Piggy Back (ADIP4-C-6-2.54) MSM8C54S RS MSM83C54S-XXX RS MSM8C54S JS MSM83C54S-XXX JS MSM8C54S GS-2K MSM83C54S-XXX GS-2K MSM8C54S TS-K MSM83C54S-XXX TS-K MSM85C54HVS 4

SYSTEM CONFIGURATION 2.2. MSM8C54S/MSM83C54S external dimensions MSM8C54SRS/MSM83C54SRS 4-pin Plastic DIP (DIP4-P-6-2.54) MSM8C54SGS/MSM83C54SGS 44-Pin Plastic QFP (QFP44-P-9-.8-2K) MSM8C54SJS/MSM83C54SJS 44-Pin Plastic QFJ (QFJ44-P-S65-.27) Figure 2-3 MSM8C54S/MSM83C54S external dimensions 5

MSM8C54S/83C54S/85C54HVS MSM8C54STS/MSM83C54STS 44-Pin Plastic TQFP (TQFP44-P--.8-K) 6

SYSTEM CONFIGURATION 2.2.2 MSM85C54HVS pin layout and external dimensions 2764/2728 M85C54H OKI JAPAN XXXX Pin for 2764, 2728 * The MSM85C54HVS pin layout of bottom side is the same as the pin layout for MSM83C54SRS. * The 27C64/28 device should be used for EPROM. 4-Pin Ceramic Piggy Back (ADIP4-C-6-2.54) Figure 2-4 MSM85C54HVS pin layout and external dimensions 7

MSM8C54S/83C54S/85C54HVS 2.3 MSM8C54S Block Diagram TH 256WORD 8bit PORT 2 PORT PCON IOCON P2. P2.7 P. P.7 OSC AND TIMING PORT PORT 3 XTAL XTAL2 ALE PSEN EA RESET P. P.7 P3. P3.7 DPH CONTROL SIGNAL R/W SIGNAL PCHL PCLL PCH PCL DPL SP PLA IR AIR SPECIAL FUNCTION REGISTER ADDRESS DECODER C-ROM T2CON TL2 RCAP 2L TIMER/ COUNTER 2 TH2 RCAP 2H R/W AMP RAMDP ACC TR2 TR PSW ALU BR TL TH TL TMOD TCON IE IP SCON TIMER/COUNTER & INTERRUPT SBUF (T) SBUF (R) SERIAL IO Figure 2-5 MSM8C54S block diagram 8

SYSTEM CONFIGURATION 2.4 MSM83C54S Block Diagram XTAL XTAL2 ALE PSEN EA RESET P. P.7 P3. P3.7 P2. P2.7 P. P.7 TH DPH CONTROL SIGNAL R/W SIGNAL PCHL PCLL PCH PCL ROM 6KWORD 8bit SENSE AMP DPL SP PLA IR AIR SPECIAL FUNCTION REGISTER ADDRESS DECODER C-ROM T2CON TL2 RCAP 2L TIMER/ COUNTER 2 TH2 RCAP 2H R/W AMP 256WORD 8bit RAMDP ACC TR2 TR PSW ALU BR TL TH TL TMOD TCON IE IP SBUF SBUF SCON (T) (R) TIMER/COUNTER & INTERRUPT SERIAL IO PORT 2 PORT PCON IOCON OSC AND TIMING PORT PORT 3 Figure 2-6 MSM83C54S block diagram 9

MSM8C54S/83C54S/85C54HVS 2.5 MSM85C54HVS Block Diagram XTAL XTAL2 ALE PSEN EA RESET P. P.7 P3. P3.7 P2. P2.7 P. P.7 PCHL PCLL PCH PCL SOCKET A EXTERNAL ROM A3 6KWORD 8bit D... D7 DPH DPL SP CONTROL SIGNAL R/W SIGNAL PLA IR AIR SPECIAL FUNCTION REGISTER ADDRESS DECODER C-ROM T2CON TL2 RCAP 2L TIMER/ COUNTER 2 TH2 RCAP 2H R/W AMP 256WORD 8bit RAMDP ACC TR2 TR PSW ALU BR TH TL TH TL TMOD TCON IE IP SBUF SBUF SCON (T) (R) TIMER/COUNTER & INTERRUPT SERIAL IO PORT 2 PORT PCON IOCON OSC AND TIMING PORT PORT 3 Figure 2-7 MSM85C54HVS block diagram 2

SYSTEM CONFIGURATION 2.6 Timing and Control 2.6. Outline of MSM8C54S/MSM83C54S timing The MSM8C54S/MSM83C54S devices are both equipped with a built-in oscillation inverter (see Figure 2-8) for use in the generation of clock pulses by external crystal or ceramic resonator. These clock pulses are passed to the timing counter and control circuits where the basic timing and control signals required for internal control purposes are generated. The basic timing consists of state (S) thru state 6 (S6) (see Figure 2-9) where each state cycle is based on two XTAL 2 fundamental clock pulses. The interval from S thru S6 forms a single machine cycle with a total of 2 fundamental clock pulses. -byte -machine cycle and 2-byte -machine cycle instructions are fetched into the instruction register during M S, decoded during M S2, and executed during M S3 thru M S6. The second byte is fetched during M S4. -byte 2-machine cycle, 2-byte 2-machine cycle, and 3-byte 2- machine cycle instructions are also fetched during M S, decoded during M S2, and executed during M S3 thru M2 S6. The second and third bytes are fetched during M S4, M2 S, or M2 S4. The number of clocks used is 24. -byte 4-machine cycle instructions are involved in multiplication and division operations where 48 clocks are used. S S2 S3 S4 S5 S6 DQ DQ DQ DQ DQ DQ S I/O & TIMER CONTROL S I/O TIMER & INTERRUPT XTAL2 XTAL /2 /2 CPU CONTROL POWER DOWN IDLE CPU PLA RESET INT PLA OUT Figure 2-8 Oscillator, timing counter, and control stage block diagram 2

MSM8C54S/83C54S/85C54HVS M M2 M M S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 CYCLE STEP XTAL DPL & Rr PCL PCL PCL ACC & RAM PCL PCL PCL PCH PCH PCH PCH DPH & PORT DATA PCH PCH PCH DATA STABLE DATA STABLE PORT NEW DATA PORT OLD DATA Instruction decoding Instruction decoding Instruction decoding Instruction excecution Instruction excecution Instruction excecution PC+ PC+ PC+ PC+ PC+ ALE TM+ TM+ TM+ TM+ PSEN RD/WR PORT PORT 2 CPU PORT PORT CPU Figure 2-9 MSM8C54S/MSM83C54S fundamental timing 22

SYSTEM CONFIGURATION 2.6.2 Major synchronizing signals () ALE (Address Latch Enable) The ALE signal is used as a clock signal where the address signals thru 7 output from CPU port can be latched externally when external program or external data memory (RAM) is used. Although two ALE signal outputs are obtained in a single machine cycle during normal operations, no output is obtained during output of the RD/WR signal when an external memory instruction (MOVX... ) is executed. (2) PSEN (Program Store Enable) The PSEN output signal is generated during execution of an external program. The output is obtained when an instruction or data is fetched. The PSEN signal is valid when at level, and external program data is enabled when in this valid state. Although two PSEN signal outputs are obtained in a single machine cycle during normal operations, no output is obtained during output of the RD/WR signal when an external data memory instruction (MOVX... ) is executed. (3) WR (Write Strobe) The WR output signal is obtained when an external data memory instruction (MOVX @Rr, A or MOVX @ DPTR, A) is executed. CPU port output data is written in the external RAM when the WR signal is at level. (4) RD (Read Strobe) The RD output signal is obtained when an external data memory instruction (MOVX A, @ Rr or MOVX A, @ DPTR) is executed. The external RAM is enabled and output data is passed to CPU port when the RD signal is at level. 23

MSM8C54S/83C54S/85C54HVS 2.6.3 MSM8C54S fundamental operation time charts () External program memory read cycle timing chart M M or M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN PORT PORT 2 INST IN PCL OUT INST IN PCL OUT INST IN PCL OUT PCH OUT PCH OUT PCH OUT PCH OUT INST IN PCL OUT INST IN PCH OUT Figure 2- MSM8C54S external program memory read cycle timing chart (2) MOVX A, @Rr M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN RD PORT INST IN PCL OUT Rr OUT RAM DATA IN EXT RAM DATA PCL OUT INST IN PORT 2 PCH OUT PCH OUT PORT 2 LATCH DATA OUT PCH OUT Figure 2- MSM8C54S MOVX A, @Rr execution 24

SYSTEM CONFIGURATION (3) MOVX @Rr, A M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN WR PORT INST IN PCL OUT Rr OUT ACC DATA OUT PCL OUT INST IN PORT 2 PCH OUT PCH OUT PORT 2 LATCH DATA OUT PCH OUT Figure 2-2 MSM8C54S MOVX @Rr, A execution (4) MOVX A, @DPTR M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN RD PORT INST IN PCL OUT DPL OUT RAM DATA IN EXT RAM DATA PCL OUT INST IN PORT 2 PCH OUT PCH OUT DPH OUT PCH OUT Figure 2-3 MSM8C54S MOVX A, @DPTR execution 25

MSM8C54S/83C54S/85C54HVS (5) MOVX @DPTR, A M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN WR PORT INST IN PCL OUT DPL OUT ACC DATA OUT PCL OUT INST IN PORT 2 PCH OUT PCH OUT DPH OUT PCH OUT Figure 2-4 MSM8C54S MOVX @DPTR, A execution (6) MOV direct, PORT [,, 2, 3] execution M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN PORT,,2,3 PIN DATA CPU DATA SAMPLED PIN DATA STABLE Figure 2-5 MSM8C54S MOV direct, PORT[,, 2, 3] execution 26

SYSTEM CONFIGURATION 2.6.4 MSM83C54S fundamental operation time charts () MOVX A, @Rr M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN RD PORT PORT LATCH DATA Rr OUT RAM DATA IN EXT RAM DATA FLOATING PORT 2 PORT 2 LATCH DATA OUT Figure 2-6 MSM83C54S MOVX A, @Rr execution (2) MOVX @Rr, A M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN WR PORT PORT LATCH DATA Rr OUT ACC DATA OUT FLOATING PORT 2 PORT 2 LATCH DATA OUT Figure 2-7 MSM83C54S MOVX @Rr, A execution 27

MSM8C54S/83C54S/85C54HVS (3) MOVX A, @DPTR M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN RD PORT PORT LATCH DATA DPL OUT RAM DATA IN EXT RAM DATA FLOATING PORT 2 PORT 2 LATCH DATA OUT DPH OUT PORT 2 LATCH DATA OUT Figure 2-8 MSM83C54S MOVX A, @DPTR execution (4) MOVX @DPTR, A M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN WR PORT PORT LATCH DATA DPL OUT ACC DATA OUT FLOATING PORT 2 PORT 2 LATCH DATA OUT DPH OUT PORT 2 LATCH DATA OUT Figure 2-9 MSM83C54S MOVX @DPTR, A execution 28

SYSTEM CONFIGURATION (5) MOV direct, PORT [,, 2, 3] execution M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 S XTAL ALE PSEN PORT,,2,3 PIN DATA CPU DATA SAMPLED PIN DATA STABLE Figure 2-2 MSM83C54S MOV direct, PORT[,, 2, 3] execution 29

MSM8C54S/83C54S/85C54HVS 2.7 Instruction Register (IR) and Instruction Decoder (PLA) MSM8C54S/MSM83C54S operations are based on an instruction code address method. Hence, in addition to the instruction code instruction register (IR) and instruction decoder (PLA), these devices also include an instruction register (AIR) and register manipulation decoder (PLA) for data addresses and bit addresses. Operation codes are passed to the IR, and data and bit addresses are passed to the AIR. CPU control signals are formed at the respective PLA for each instruction register, thereby activating the CPU. The block diagram is outlined in Figure 2-2. Timing Matrix AND Control signals Data bus AIR Decoder PLA WAIR Timing Matrix AND Control signals Data bus IR Decoder PLA WIR Figure 2-2 lr and PLA block diagram 3

SYSTEM CONFIGURATION 2.8 Arithmetic Operation Section () Outline The MSM8C54S/MSM83C54S arithmetic operation section consists of () an arithmetic operation instruction decoder, and (2) an arithmetic and logic unit [ALU]. (2) Arithmetic operation instruction decoder Arithmetic operation instructions are passed to the instruction register (IR) and then to the PLA where they are converted into control signals. The control signals from the PLA are used to control ALU peripheral circuits and ALU arithmetic operations (ADD, AND, OR, EOR). (3) Arithmetic and logic unit [ALU] Upon reception of 8-bit data from one or two data sources the ALU processes that data in accordance with control signals from the PLA. The ALU is capable of executing the following processes Additions and subtractions with and without carry Increments (+) and decrements ( ) Bit complements Rotations (either direction with and without carry) BCD (decimal adjust) Carry, auxiliary carry, and overflow signal output Multiplications and divisions Bit detection Exchange of low and high order nibbles Logical AND, logical OR, and exclusive OR If a bit-3 auxiliary carry (AC), a bit-7 carry (CY), or an overflow (OV) is generated as a result of the arithmetic operation executed by the ALU, that result is set in the program status word (PSW DH). PSW(DH) CY AC F RS RS OV F P 7 6 5 4 3 2 Figure 2-22 Program status word 3

MSM8C54S/83C54S/85C54HVS 2.9 Program Counter The MSM8C54S/MSM83C54S program counter has a 6-bit configuration PC thru PC5, as shown in Figure 2-23. ENABLE ROM CPU INTERNAL DATA BUS MSM83C54S INTERNAL ROM 6KWORD 8BIT EXTERNAL ROM MODE Q5 Q4 Q3 Q2 Q Q Q9 Q8 Q7 Q6 Q5 Q4 Q3 Q2 Q Q PC+ D5 D4 D3 D2 D D D9 D8 D7 D6 D5 D4 D3 D2 D D CPU INTERNAL DATA BUS Figure 2-23 MSM8C54S/MSM83C54S program ounter This program counter is a binary up-counter which is incremented by each time one byte of instruction code is fetched. When the program counter is counted by after counter contents have reached FFFFH, the counter is returned to H. MSM83C54S is automatically switched to external ROM mode when the counter contents exceed 3FFFH. 32

SYSTEM CONFIGURATION 2. Program Memory and External Data Memory 2.. MSM8C54S/MSM83C54S program area and external ROM connections Since MSM8C54S/MSM83C54S are equipped with a 6-bit program counter, these devices can execute programs of up to 64K bytes (including both internal and external programs). Since the MSM8C54S is not equipped with an internal program ROM, however, only external instructions are executed. MSM83C54S, on the other hand, is equipped with a 6K byte program ROM which enables it to execute internal instructions from address thru address 6383. External instructions are executed when the address is greater than 6383. The program area is outlined in Figure 2-24, and a diagram of ROM connections made when external instructions are executed is shown in Figure 2-25. MSM8C54S external ROM area MSM83C54S internal ROM area MSM83C54S external ROM area 65535 6384 6383 44 43 FFFFH 4H 3FFFH 2CH 2BH Timer interrupt 2 start address 43 2BH Serial I/O interrupt start address 35 23H Timer interrupt start address 2BH External interrupt start address 9 3H Timer interrupt start address BH External interrupt start address 3 3H 2 2H H 7 6 5 4 3 2 CPU reset start address H Figure 2-24 MSM8C54S/MSM83C54S program area 33

MSM8C54S/83C54S/85C54HVS Q Q Q2 Q3 Q4 Q5 Q6 Q7 MSM74HC373 P. P. P.2 P.3 P.4 P.5 P.6 P.7 D D D2 D3 D4 D5 D6 D7 ALE LATCH P2. P2. P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 PSEN A Q Q Q2 Q3 Q4 Q5 Q6 Q7 A A2 A3 A4 A5 A6 A7 A8 A9 A A A2 A3 A4 A5 CS ROM 64kW 8BIT OUTPUT ENABLE MSM8C54S/MSM83C54S Figure 2-25 MSM8C54S/MSM83C54S external ROM connection diagram 34

SYSTEM CONFIGURATION 2..2 Procedures and circuit connections used when external data memory (RAM) is accessed by data pointer (DPTR) The MSM8C54S/MSM83C54S can be connected to an external 64K word 8-bit data memory (RAM) when accessing the memory by data pointer (DPTR). The data pointer (DPTR) consists of DPL and DPH registers. The DPL register contents serve as addresses thru 7 of the external data memory, and the DPH register contents serve as addresses 8 thru 5. The MOVX @DPTR, A instruction is used when accumulator contents are transferred to an external data memory, and the MOVX A, @DPTR instruction is used when external data memory contents are transferred to the accumulator. The external data memory connection diagram is shown in Figure 2-26 and the external data memory access time chart is shown in Figure 2-27. When the data pointer indirect external memory instruction is executed, the CPU passes the DPL register contents to port, and the port contents are latched externally by ALE signal. Data stored in the latch serves as the lower order addresses thru 7 of the external data memory (RAM), and the DPH register contents passed to port 2 serve as the higher order addresses 8 thru 5 for addressing of the external data memory. The WR or RD external data memory control signal is subsequently generated by the CPU to enable transfer of data between port and the external data memory. 35

MSM8C54S/83C54S/85C54HVS Q Q Q2 Q3 Q4 Q5 Q6 Q7 MSM74HC373 P. P. P.2 P.3 P.4 P.5 P.6 P.7 ALE P2. P2. P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 D D D2 D3 D4 D5 D6 D7 WR LATCH RD I/O A A A2 A3 A4 A5 A6 A7 A8 A9 A A A2 A3 A4 A5 R/W CS 2 3 4 ROM 64kW 8BIT 5 6 7 MSM8C54S/MSM83C54S Figure 2-26 Connection circuit for external data memory addressed by DPTR 36

SYSTEM CONFIGURATION XTAL ALE PSEN PORT PORT 2 WR XTAL ALE PSEN PORT PORT 2 RD S6 PCL S6 PCL M S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 M2 S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 INSTRUCTION IN PCL PCL PCL DPL ACC DATA PCL PCL PCL PCH PCH PCH PCH DPH PCH PCH PCH MOVX @DPTR, A M S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 M2 S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 INSTRUCTION IN RAM DATA IN PCL PCL PCL DPL PCL PCL PCL PCH PCH PCH PCH DPH PCH PCH PCH MOVX A, @DPTR Figure 2-27 DPTR external data memory access timing 37

MSM8C54S/83C54S/85C54HVS 2..3 Procedures and circuit connections used when external data memory (RAM) is accessed by registers R and R The MSM8C54S/MSM83C54S can be connected to an external 256 word 8-bit data memory (RAM) when addressing the memory according to the contents of registers R and R in the internal data memory (RAM). The MOVX @Rr, A instruction is used when accumulator contents are transferred to an external data memory, and the MOVX A, @Rr instruction is used when external data memory contents are transferred to the accumulator. The external data memory connection diagram is shown in Figure 2-28 and the external data memory access time chart is shown in Figure 2-29. When the indirect register external memory instruction is executed, the CPU passes the R or R register contents to port, and the port contents are latched externally by the ALE signal. Data stored in the latch serves as the addresses thru 7 of the external data memory. The WR or RD external data memory control signal is subsequently generated by the CPU to enable transfer of data between port and the external data memory. However, if the port 2 latched data is used in addresses 8 thru 5 of the external data memory, the circuit connections are the same as when the data pointer (DPTR) is used, thereby enabling a 64K byte 8-bit data memory to be accessed. 38

SYSTEM CONFIGURATION Q Q Q2 Q3 Q4 Q5 Q6 Q7 MSM74HC373 P. P. P.2 P.3 P.4 P.5 P.6 P.7 ALE WR RD I/O A A A2 A3 A4 A5 A6 A7 D D D2 D3 D4 D5 D6 D7 LATCH R/W CS 2 3 4 ROM 256W 8BIT 5 6 7 MSM8C54S/MSM83C54S Figure 2-28 Connection circuit for external data memory addressed by register R or R 39

MSM8C54S/83C54S/85C54HVS XTAL ALE PSEN PORT PORT 2 WR XTAL ALE PSEN PORT PORT 2 RD S6 PCL S6 PCL M S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 M2 S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 INSTRUCTION IN PCL PCL PCL Rr ACC DATA PCL PCL PCL PCH PCH PCH PCH PORT 2 LATCH DATA PCH PCH PCH MOVX @Rr, A M S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 M2 S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 INSTRUCTION IN RAM DATA IN PCL PCL PCL Rr PCL PCL PCL PCH PCH PCH PCH PORT 2 LATCH DATA PCH PCH PCH MOVX A, @Rr Figure 2-29 Register R/R external data memory access timing 4

3. CONTROL

MSM8C54S/83C54S/85C54HVS 42

CONTROL 3. CONTROL 3. Oscillators XTAL XTAL2 An oscillator is formed by connecting a crystal or ceramic resonator between the XTAL and XTAL2 pins of the MSM8C54S/MSM83C54S devices. If an external clock is applied to XTAL, the input should be at 5% duty and C-MOS level. IDLE MODE CPU CONTROL CLOCK PD & HPD MODE TIMER, S I/O & INTERRUPT C * C * XTAL XTAL MΩ XTAL2 MSM8C54S/MSM83C54S * The capacity of the compensating capacitor depends on the crystal resonator. * The XTAL 2 frequency depends on VCC. Figure 3- Crystal resonator connection diagram 43

MSM8C54S/83C54S/85C54HVS IDLE MODE CPU CONTROL CLOCK PD & HPD MODE TIMER, S I/O & INTERRUPT C * C * XTAL MΩ XTAL2 MSM8C54S/MSM83C54S * The capacity of the compensating capacitor depends on the ceramic resonator. * The XTAL 2 frequency depends on VCC. Figure 3-2 Ceramic resonator connection diagram IDLE MODE CPU CONTROL CLOCK PD & HPD MODE TIMER, S I/O & INTERRUPT *CLOCK 74HC4 XTAL XTAL2 MΩ MSM8C54S/MSM83C54S * Supply of 5% duty clock Figure 3-3 External clock supply circuit 44

CONTROL 3.2 CPU Resetting 3.2. Outline If a reset signal (kept at level for at least µsec) is applied to the RESET pin when the correct voltage (in respect to the various specifications) is applied to the MSM8C54S/ MSM83C54S VCC pin, a reset signal is stored in the CPU even if the XTAL 2 oscillators have been stopped. The internally stored reset signal is used in direct initialization (setting to ) of ports,, 2, and 3. All of the special function registers are then initialized (set to ) two machine cycles after the XTAL 2 oscillator commences regular operation. When the reset is released, instruction execution is started in the third machine cycle if the reset signal is changed from level to level before the M S signal leading edge, and in the fifth machine cycle if the reset signal is changed from to after the leading edge. The reset circuit block diagram is shown in Figure 3-4, the reset start time charts in Figures 3-5 and 3-6, and the reset release time charts in Figures 3-7 and 3-8. VCC + RESET IN CPU RESET CONTROL R=4KΩ Figure 3-4 MSM8C54S/MSM83C54S reset circuit block diagram 45

MSM8C54S/83C54S/85C54HVS XTAL ALE PSEN PORT PORT PORT 2 PORT 3 RESET CPU RESET CONTROL RESET EXCECUTE S6 M or M2 S S2 S3 S4 S5 S6 PORT DATA PORT DATA PORT DATA PORT DATA M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 FLOATING PORT DATA = PORT DATA = PORT DATA = CPU RESET EXCECUTE CYCLE M S S2 S3 S4 S5 S6 Figure 3-5 Reset execution time chart (internal ROM mode) 46

CONTROL XTAL ALE PSEN PORT PORT 2 RESET CPU RESET CONTROL RESET EXCECUTE PORT PORT 3 S6 M or M2 S S2 S3 S4 S5 S6 PCL PCH PCH PORT DATA PORT DATA M M2 S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 FLOATING PORT DATA = CPU RESET EXCECUTE CYCLE PORT DATA = PORT DATA = M S S2 S3 S4 S5 S6 Figure 3-6 Reset execution time chart (external ROM mode) 47

MSM8C54S/83C54S/85C54HVS XTAL ALE PSEN PORT PORT PORT 2 PORT 3 RESET CPU RESET CONTROL RESET EXCECUTE S6 M M S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 FLOATING PORT DATA = PORT DATA = PORT DATA = CPU RESET EXCECUTE CYCLE M2 S S2 S3 S4 S5 S6 M S S2 S3 S4 S5 S6 EXCECUTE CYCLE Figure 3-7 Reset release time chart (internal ROM mode) 48

CONTROL XTAL ALE PSEN PORT PORT 2 RESET CPU RESET CONTROL RESET EXCECUTE PORT PORT 3 S6 M M S S2 S3 S4 S5 S6 S S2 S3 S4 S5 S6 FLOATING PORT DATA = CPU RESET EXCECUTE CYCLE PORT DATA = PORT DATA = M2 S S2 S3 S4 S5 S6 PCL M S S2 S3 S4 S5 S6 PCL PCL PCH PCH PCH EXCECUTE CYCLE Figure 3-8 Reset release time chart (external ROM mode) 49

MSM8C54S/83C54S/85C54HVS 3.2.2 Reset Schmitt trigger circuit The Schmitt trigger circuit connected to the RESET pin shown in the MSM8C54S/ MSM- 83C54S reset circuit block diagram in Figure 3-4 operates in the following way when the VCC power supply voltage is +5V. If the voltage of the reset signal applied to the RESET pin exceeds 3V when the level of that signal is changed from to, the Schmitt trigger output level is changed from to, and the reset signal is set in the CPU reset control circuit, resulting in the reset operation being started by the CPU. The CPU reset state is released when the level on the RESET pin is changed to. An input signal level below.5v is regarded as level, and the Schmitt trigger output level is changed from to. When the reset signal is changed to level, the CPU reset control circuit is ready for reset release. The Schmitt trigger circuit operation time chart for changes in the reset input voltage is outlined in Figure 3-9. VCC 5 [V] [V] RESET 5 [V] [V] VIH = 3.[V] VTH =.5[V] VIL =.5[V] Schmitt trigger gate output 5 [V] [V] CPU reset control input Figure 3-9 Reset Schmitt trigger gate detector time chart 5

CONTROL 3.2.3 CPU internal status by reset When a reset signal is applied to the CPU with normal voltage applied to the MSM8C54S/ MSM83C54S VCC power supply pin, ports,, 2, and 3 are set to (input mode) even if XTAL 2 oscillation has been stopped. The output status of the ALE and PSEN pins also becomes. The CPU is then reset after normal XTAL 2 oscillation has resumed. The internal CPU status when the CPU is reset is shown in Table 3-. Table 3- MSM8C54S/MSM83C54S reset internal status Register Name PC SP IP IE PCON PSW, DPH, DPL, A, B SCON, TCON, TMOD T2CON, IOCON, TL TL, TL2, TH, TH TH2, RCAP2L, RCAP2H P, P2, P3 P SBUF INTERNAL RAM ALE, PSEN Register Reset Status H 7H 4H( ) 4H( ) H( ) H *FFH(input port) *FFH(floating) Undefined * OUT * Denotes direct resetting even if XTAL 2 has stopped. 5

MSM8C54S/83C54S/85C54HVS 3.3 EA (CPU Memory Separate) 3.3. Outline The function of the EA pin is to determine whether a CPU internal program memory (ROM) instruction or an external program instruction is to be executed. () Internal ROM mode If the EA pin is connected to VCC and a reset signal is applied to the RESET pin to reset the CPU, an internal program memory (ROM) is executed from address. (MSM83C54S, MSM85C54HVS) (2) External ROM mode If the EA pin is connected to VSS and a reset signal is applied to the RESET pin to reset the CPU, an external program memory is executed from address. 52

4. INTERNAL SPECIFICATIONS

MSM8C54S/83C54S/85C54HVS 54

INTERNAL SPECIFICATIONS 4. INTERNAL SPECIFICATIONS 4. Internal Data Memory (RAM) and Special Function Registers 4.. Outline MSM8C54S/MSM83C54S operation is based on an instruction code address method where operations are specified in an instruction code (OP) section, and the data memory (RAM) and special function registers (ACC, B, TCON, P... ) are specified directly by part of the instruction code and the second or third byte of data following that instruction code. According to this instruction code address method, all eight bits of data in the data memory and special function register may be specified, or one bit of data memory and one bit of data in the special function register may be specified. Direct designation of all eight bits of data is called data addressing, and direct designation of one bit of data is called bit addressing. Since these CPU devices specify data memory (RAM) and special function register contents by the above method, specific addresses are assigned to the respective CPU data memory (RAM) and special function registers (ACC, B, TCON, P,... ). Data addresses consist of eight bits, and range from to FFH in binary (which correspond to thru 255 in decimal). All data memory (RAM) and special function registers (ACC, B, TCON, P,... ) exist in these 256 locations. The data memory contains 256 bytes. The data memory between addresses thru 7FH can be specified directly by data address, and the data memory from address 8H to FFH can be specified by indirect register instruction where R or R contents are set to 8H thru FFH. Note that the entire data memory (RAM) from thru FFH can be specified by indirect register instruction. Special function registers are located between addresses 8H thru FFH, and can also be specified directly by data address. Bit addresses consist of eight bits, the manipulation bits being specified by the three lower order bits and the data memory (RAM) or special function register (ACC, B, TCON, P,... ) by the five higher order bits. Data memory between addresses 2 thru 2FH can be specified by bit addressing. Other areas cannot be specified by bit designation. The special function registers which can be specified by bit address are P, P, P2, P3, TCON, SCON, IE, IP, T2CON, PSW, ACC, B, and IOCON, a total of 3 registers. The data memory (RAM) and special function register address space layout is shown in Figure 4-. 55

MSM8C54S/83C54S/85C54HVS HEX OFF IOCON FFH~F8H 248 (F8H) B F7H~FH 24 (FH) ACC E7H~EH 224 (EH) PSW D7H~DH 28 (DH) TH2 25 (CDH) TL2 24 (CCH) RCAP2H 23 (CBH) RCAP2L 22 (CAH) T2CON CFH~C8H 2 (C8H) REGISTER INDIRECT ADDRESSING USER DATA RAM SPECIAL FUNCTION REGISTERS IP P3 IE P2 SBUF SCON P TH TH TL TL TMOD TCON PCON DPH DPL SP BFH~B8H B7H~BH AFH~A8H A7H~AH 9FH~98H 97H~9H 8FH~88H 84 (B8H) 76 (BH) 68 (A8H) 6 (AH) 53 (99H) 52 (98H) 44 (9H) 4 (8DH) 4 (8CH) 39 (8BH) 38 (8AH) 37 (89H) 36 (88H) 35 (87H) 3 (83H) 3 (82H) 29 (8H) 8 7F P 87H~8H 28 (8H) USER DATA RAM 3 2F 7F BIT RAM 78 2 7 F R7 8 R 7 R7 R F R7 8 R 7 R7 R BANK 3 BANK 2 BANK BANK BIT ADDRESSING DATA ADDRESSING Figure 4- Data memory and special function register layout 56

INTERNAL SPECIFICATIONS 4.2 Internal Data Memory (RAM) 4.2. Internal data memory (RAM) The storage capacity of the MSM8C54S/MSM83C54S data memory is 256 words 8 bits. The layout diagram is shown in Figure 4-2. The data memory can be accessed (R/W) in four different ways - direct register designation, indirect register designation, data addressing, and bit addressing. Four banks of registers group (R thru R7 4) exist within the data memory address range from to FH. Banks are specified by RS and RS data combinations within the PSW. The data memory address range from 2 to 2FH is an area where bit addressing is possible. One bit of data can be manipulated directly by bit manipulation instructions. The data memory address range from to 7FH is an area where data addressing is possible. 8-bit data manipulations can be handled directly by data address manipulation instructions. The data memory address range from 8H to FFH is an area where data addressing is not possible. To manipulate data in this data memory area, the contents of register R or R are set in 8H thru FFH, then an indirect register instruction is used. (Indirect register instructions can be used to specify the entire data memory from address to FFH.) In addition to data storage in the CPU, the data memory is used as the place for saving stack data. This stack data storage area is addressed by a stack pointer (SP 8H). Since the stack pointer can be set any desired value by software, the data memory can be used as stack from any data memory address. Note that 7H data is set automatically in the stack pointer when the CPU is reset. 57

MSM8C54S/83C54S/85C54HVS FFH 8H 7FH 3H 2FH USER DATA RAM USER DATA RAM 7F 7E 7D 7C 7B 7A 79 78 255 28 27 48 47 2EH 77 76 75 74 73 72 7 7 46 2DH 2CH 2BH 2AH 29H 28H 27H 26H 25H 24H 23H 22H 2H 2H FH 8H 7H H FH 8H 7H H 6F 6E 6D 6C 6B 6A 69 68 67 66 65 64 63 62 6 6 5F 5E 5D 5C 5B 5A 59 58 57 56 55 54 53 52 5 5 4F 4E 4D 4C 4B 4A 49 48 47 46 45 44 43 42 4 4 3F 3E 3D 3C 3B 3A 39 38 37 36 35 34 33 32 3 3 2F 2E 2D 2C 2B 2A 29 28 27 26 25 24 23 22 2 2 F E D C B A 9 8 7 6 5 4 3 2 F E D C B A 9 8 6 5 4 3 2 BANK 3 BANK 2 BANK BANK 45 44 43 42 4 4 39 38 37 36 35 34 33 32 3 24 23 6 5 8 7 BIT ADDRESSING REGISTER ~7 DIRECT ADDRESSING DATA ADDRESSING REGISTER, INDIRECT ADDRESSING Figure 4-2 RAM layout diagram 58

INTERNAL SPECIFICATIONS 4.2.2 Internal data memory registers R thru R7 Four banks of registers group exist in the data memory (RAM) between memory addresses thru FH. Banks are specified by RS and RS bit combinations within the program status word (PSW). Note that the register area R thru R7 can also be used as normal data memory. The PSW table is shown in Table 4-, and the data memory register bank layout in Figure 4-3. Table 4- Program status word (PSW) Bit 7 6 5 4 3 2 Flag CY AC F RS RS OV F P Set OFF 255 D7 D6 D5 D4 D3 D2 D D USER DATA RAM STACK & DATA RAM 3 48 D7 D6 D5 D4 D3 D2 D D 2F 47 D7 D6 D5 D4 D3 D2 D D BIT ADDRESSING 2 32 D7 D6 D5 D4 D3 D2 D D F 3 D7 D6 D5 D4 D3 D2 D D R7 8 24 D7 D6 D5 D4 D3 D2 D D R 7 23 D7 D6 D5 D4 D3 D2 D D R7 6 D7 D6 D5 D4 D3 D2 D D R F 5 D7 D6 D5 D4 D3 D2 D D R7 8 8 D7 D6 D5 D4 D3 D2 D D R 7 7 D7 D6 D5 D4 D3 D2 D D R7 6 6 D7 D6 D5 D4 D3 D2 D D R6 5 5 D7 D6 D5 D4 D3 D2 D D R5 4 4 D7 D6 D5 D4 D3 D2 D D R4 3 3 D7 D6 D5 D4 D3 D2 D D R3 2 2 D7 D6 D5 D4 D3 D2 D D R2 D7 D6 D5 D4 D3 D2 D D R D7 D6 D5 D4 D3 D2 D D R BANK 3 BANK 2 BANK BANK RS RS Figure 4-3 Internal data memory register bank layout 59