EM78P341/2/3N
8-Bit Microprocessor
with OTP ROM
Product
Specification
D
OC
. V
ERSION
1.0
ELAN MICROELECTRONICS CORP.
December 2006
Contents
Trademark Acknowledgments:
IBM is a registered trademark and PS/2 is a trademark of IBM.
Windows is a trademark of Microsoft Corporation.
ELAN and ELAN logo
are trademarks of ELAN Microelectronics Corporation.
All Rights Reserved
Printed in Taiwan
Copyright
©
2005 by ELAN Microelectronics Corporation
The contents of this specification are subject to change without further notice. ELAN Microelectronics assumes no
responsibility concerning the accuracy, adequacy, or completeness of this specification. ELAN Microelectronics
makes no commitment to update, or to keep current the information and material contained in this specification.
Such information and material may change to conform to each confirmed order.
In no event shall ELAN Microelectronics be made responsible for any claims attributed to errors, omissions, or
other inaccuracies in the information or material contained in this specification. ELAN Microelectronics shall not
be liable for direct, indirect, special incidental, or consequential damages arising from the use of such information
or material.
The software (if any) described in this specification is furnished under a license or nondisclosure agreement, and
may be used or copied only in accordance with the terms of such agreement.
ELAN Microelectronics products are not intended for use in life support appliances, devices, or systems. Use of
ELAN Microelectronics product in such applications is not supported and is prohibited.
NO PART OF THIS SPECIFICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY
ANY MEANS WITHOUT THE EXPRESSED WRITTEN PERMISSION OF ELAN MICROELECTRONICS.
ELAN MICROELECTRONICS CORPORATION
Headquarters:
No. 12, Innovation Road 1
Hsinchu Science Park
Hsinchu, TAIWAN 30077
Tel: +886 3 563-9977
Fax: +886 3 563-9966
http://www.emc.com.tw
Hong Kong:
Elan (HK) Microelectronics
Corporation, Ltd.
Flat A, 19F., World Tech Centre
95 How Ming Street, Kwun Tong
Kowloon, HONG KONG
Tel: +852 2723-3376
Fax: +852 2723-7780
elanhk@emc.com.hk
Shenzhen:
Elan Microelectronics
Shenzhen, Ltd.
SSMEC Bldg., 3F, Gaoxin S. Ave.
Shenzhen Hi-Tech Industrial Park
Shenzhen, Guandong, CHINA
Tel: +86 755 2601-0565
Fax: +86 755 2601-0500
USA:
Elan Information
Technology Group (U.S.A.)
1821 Saratoga Ave., Suite 250
Saratoga, CA 95070
U.S.A.
Tel: +1 408 366-8225
Fax: +1 408 366-8220
Europe:
Elan Microelectronics Corp.
(Europe)
Siewerdtstrasse 105
8050 Zurich, SWITZERLAND
Tel: +41 43 299-4060
Fax: +41 43 299-4079
http://www.elan-europe.com
Shanghai:
Elan Microelectronics
Shanghai, Ltd.
23/Bldg. #115 Lane 572, Bibo Road
Zhangjiang Hi-Tech Park
Shanghai, CHINA
Tel: +86 21 5080-3866
Fax: +86 21 5080-4600
Contents
Contents
1
2
3
4
5
General Description ................................................................................................ 3
Features ................................................................................................................... 3
Pin Assignment ....................................................................................................... 4
Functional Block Diagram ...................................................................................... 5
Pin Description........................................................................................................ 6
5.1
5.2
6
EM78P341NP/M............................................................................................... 6
EM78P342NP/M............................................................................................... 7
5.3 EM78P343NP/M/KM......................................................................................... 8
Function Description .............................................................................................. 9
6.1
Operational Registers ....................................................................................... 9
6.1.1
6.1.2
6.1.3
6.1.4
6.1.5
6.1.6
6.1.7
6.1.8
6.1.9
6.1.10
6.1.11
6.1.12
6.1.13
6.1.14
6.1.15
6.1.16
R0 (Indirect Address Register) .......................................................................... 9
R1 (Time Clock /Counter) ................................................................................... 9
R2 (Program Counter) and Stack ....................................................................... 9
6.1.3.1 Data Memory Configuration................................................................11
R3 (Status Register) ......................................................................................... 12
R4 (RAM Select Register) ................................................................................ 12
R5 ~ R6 (Port 5 ~ Port 6).................................................................................. 13
R7 (Port 7) ........................................................................................................ 13
R8 (AISR: ADC Input Select Register) ............................................................. 14
R9 (ADCON: ADC Control Register) ................................................................ 15
RA (ADOC: ADC Offset Calibration Register) .................................................. 17
RB (ADDATA: Converted Value of ADC) .......................................................... 17
RC (ADDATA1H: Converted Value of ADC) ..................................................... 17
RD (ADDATA1L: Converted Value of ADC) ...................................................... 18
RE (Interrupt Status 2 & Wake-up Control Register) ........................................ 18
RF (Interrupt Status 2 Register)........................................................................ 19
R10 ~ R3F ........................................................................................................ 19
A (Accumulator) ................................................................................................ 20
CONT (Control Register) .................................................................................. 20
IOC50 ~ IOC70 (I/O Port Control Register)...................................................... 21
IOC80 (Comparator and TCCA Control Register) ............................................ 21
IOC90 (TCCB and TCCC Control Register) ..................................................... 22
IOCA0 (IR and TCCC Scale Control Register)................................................. 23
IOCB0 (Pull-Down Control Register) ................................................................ 24
IOCC0 (Open-Drain Control Register) ............................................................. 24
IOCD0 (Pull-high Control Register) .................................................................. 25
6.2
Special Purpose Registers.............................................................................. 20
6.2.1
6.2.2
6.2.3
6.2.4
6.2.5
6.2.6
6.2.7
6.2.8
6.2.9
Product Specification (V1.0) 12.01.2006
•iii
Contents
6.2.10
6.2.11
6.2.12
6.2.13
6.2.14
6.2.15
6.2.16
6.2.17
6.2.18
6.2.19
6.2.20
6.2.21
6.2.21
IOCE0 (WDT Control & Interrupt Mask Registers 2) ........................................ 25
IOCF0 (Interrupt Mask Register) ...................................................................... 26
IOC51 (TCCA Counter) .................................................................................... 27
IOC61 (TCCB Counter) .................................................................................... 28
IOC71 (TCCBH/MSB Counter)......................................................................... 28
IOC81 (TCCC Counter) .................................................................................... 28
IOC91 (Low-Time Register).............................................................................. 29
IOCA1 (High Time Register)............................................................................. 29
IOCB1 High/Low Time Scale Control Register)................................................ 29
IOCC1 (TCC Prescaler Counter)...................................................................... 30
IOCD1 (LVD Control Register) ......................................................................... 31
IOCE1 (Output Sink Select Control Register) .................................................. 32
IOCF1 (Pull-high Control Register)................................................................... 33
6.3
6.4
6.5
TCC/WDT and Prescaler ................................................................................ 33
I/O Ports ......................................................................................................... 35
6.4.1
6.5.1
Usage of Port 5 Input Change Wake-up/Interrupt Function ............................. 37
Reset and Wake-up Operation ......................................................................... 37
6.5.1.1 Wake-up and Interrupt Modes Operation Summary.......................... 40
6.5.1.2 Register Initial Values after Reset ..................................................... 46
6.5.1.3 Controller Reset Block Diagram ........................................................ 51
The T and P Status under Status (R3) Register ............................................... 51
Reset and Wake-up ........................................................................................ 37
6.5.2
6.6
6.7
Interrupt .......................................................................................................... 52
Analog-To-Digital Converter (ADC) ................................................................. 55
6.7.1
ADC Control Register (AISR/R8, ADCON/R9, ADOC/RA)............................... 55
6.7.1.1 R8 (AISR: ADC Input Select Register) .............................................. 55
6.7.1.2 R9 (ADCON: AD Control Register).................................................... 56
6.7.1.3 RA (ADOC: AD Offset Calibration Register) ...................................... 57
ADC Sampling Time ......................................................................................... 58
AD Conversion Time......................................................................................... 58
ADC Operation during Sleep Mode .................................................................. 59
Programming Process/Considerations ............................................................. 59
6.7.6.1 Programming Process ....................................................................... 59
6.7.6.2 Sample Demo Programs ................................................................... 60
Overview........................................................................................................... 62
Function Description ......................................................................................... 63
Programming the Related Registers ............................................................... 65
Overview........................................................................................................... 66
Function Description ......................................................................................... 66
Programming the Related Registers ................................................................ 68
6.7.3
6.7.4
6.7.5
6.7.6
6.8
Infrared Remote Control Application/PWM Waveform Generation .................. 62
6.8.1
6.8.2
6.8.3
6.9
Timer/Counter................................................................................................. 66
6.9.1
6.9.2
6.9.3
iv
•
Product Specification (V1.0) 12.01.2006
Contents
6.10 Comparator..................................................................................................... 68
6.10.1
6.10.2
6.10.3
6.10.4
6.10.5
6.11.1
6.11.2
6.11.3
6.11.4
External Reference Signal................................................................................ 69
Comparator Outputs ......................................................................................... 69
Using a Comparator as an Operation Amplifier ................................................ 70
Comparator Interrupt ........................................................................................ 70
Wake-up from Sleep Mode ............................................................................... 70
Oscillator Modes ............................................................................................... 71
Crystal Oscillator/Ceramic Resonators (Crystal) .............................................. 71
External RC Oscillator Mode ............................................................................ 73
Internal RC Oscillator Mode ............................................................................. 74
6.11 Oscillator ........................................................................................................ 71
6.12 Power-on Considerations................................................................................ 75
6.12.1 Programmable WDT Time-out Period .............................................................. 75
6.12.2 External Power-on Reset Circuit ...................................................................... 75
6.12.3 Residual Voltage Protection ............................................................................. 76
6.13 Code Option ................................................................................................... 77
6.13.1 Code Option Register (Word 0) ........................................................................ 77
6.13.2 Code Option Register (Word 1) ........................................................................ 78
6.13.3 Customer ID Register (Word 2) ........................................................................ 79
6.14 Low Voltage Detector...................................................................................... 80
6.14.1 Low Voltage Reset............................................................................................ 80
6.14.2 Low Voltage Detector........................................................................................ 80
6.14.2.1 IOCD1 (LVD Control Register) .......................................................... 80
6.14.2.2 RE (Interrupt Status 2 & Wake-up Control Register) ......................... 81
6.14.3 Programming Process ...................................................................................... 82
6.15 Instruction Set................................................................................................. 83
7
8
Absolute Maximum Ratings.................................................................................. 85
DC Electrical Characteristics................................................................................ 85
8.1
8.2
8.3
9
10
AD Converter Characteristics ......................................................................... 86
Comparator (OP) Characteristics.................................................................... 87
Device Characteristics .................................................................................... 88
AC Electrical Characteristic.................................................................................. 89
Timing Diagrams ................................................................................................... 90
Product Specification (V1.0) 12.01.2006
•v