EM78P346N
8-Bit Microprocessor
with OTP ROM
Product
Specification
D
OC
. V
ERSION
1.0
ELAN MICROELECTRONICS CORP.
December 2007
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
©
2007 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 308
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.
3F, SSMEC Bldg., Gaoxin S. Ave. I
Shenzhen Hi-tech Industrial Park
(South Area), Shenzhen
CHINA 518057
Tel: +86 755 2601-0565
Fax: +86 755 2601-0500
USA:
Elan Information
Technology Group (USA)
P.O. Box 601
Cupertino, CA 95015
USA
Tel: +1 408 366-8225
Fax: +1 408 366-8225
Shanghai:
Elan Microelectronics
Shanghai, Ltd.
#23, Zone 115, Lane 572, Bibo Rd.
Zhangjiang Hi-Tech Park
Shanghai, CHINA 201203
Tel: +86 21 5080-3866
Fax: +86 21 5080-4600
Contents
Contents
1
2
3
4
General Description ................................................................................................ 1
Features ................................................................................................................... 1
Pin Assignment ....................................................................................................... 2
Pin Description........................................................................................................ 3
4.1
4.2
5
6
EM78P346ND18/SO18..................................................................................... 3
EM78P346ND20/SO20/SS20 ........................................................................... 4
4.3 EM78P346NK24/SO24/SS24 ........................................................................... 5
Block Diagram ......................................................................................................... 6
Function Description .............................................................................................. 7
6.1
Operational Registers ....................................................................................... 7
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
6.1.17
6.1.18
6.1.19
6.1.20
6.1.21
6.1.22
6.1.23
6.1.24
6.1.25
R0 (Indirect Address Register) .......................................................................... 7
R1 (Time Clock/Counter) .................................................................................... 7
R2 (Program Counter) and Stack ....................................................................... 7
6.1.3.1 Data Memory Configuration................................................................. 9
R3 (Status Register) ......................................................................................... 10
R4 (RAM Select Register) ................................................................................ 10
Bank 0 R5 ~ R7 (Port 5 ~ Port 7) ..................................................................... 10
Bank 0 R8 (AISR: ADC Input Select Register) ................................................. 10
Bank 0 R9 (ADCON: ADC Control Register) .................................................... 12
Bank 0 RA (ADOC: ADC Offset Calibration Register) ...................................... 13
Bank 0 RB (ADDATA: Converted Value of ADC).............................................. 13
Bank 0 RC (ADDATA1H: ADC Converted Value) ............................................. 14
Bank 0 RD (ADDATA1L: ADC Converted Value).............................................. 14
Bank 0 RE (WUCR: Wake- up Control Register) ............................................. 14
Bank 0 RF (Interrupt Status Register) .............................................................. 15
Bank 1 R5 (PRDxH: PWM 1, 2, 3 High Period Register) ................................. 16
Bank 1 R6 (LVD Control Register).................................................................... 16
Bank 1 R7 (Output Sink Select Control Register) ............................................ 17
Bank 1 R8 (Pull-down Control Register) .......................................................... 18
Bank 1 R9 (Pull-Down Control Register) .......................................................... 19
Bank 1 RA (Open-Drain Control Register) ....................................................... 19
Bank 1 RB (Open-Drain Control Register) ....................................................... 20
Bank 1 RC (Pull-high Control Register)............................................................ 20
Bank 1 RD (Pull-high Control Register)............................................................ 20
Bank 1 RE (Option Control bits, Only for ROMLESS)...................................... 21
R10 ~ R3F ........................................................................................................ 21
A (Accumulator) ................................................................................................ 22
CONT (Control Register) .................................................................................. 22
IOC50 ~ IOC70 (I/O Port Control Register)...................................................... 23
6.2
Special Purpose Registers.............................................................................. 22
6.2.1
6.2.2
6.2.3
Product Specification (V1.0) 12.25.2007
•
iii
Contents
6.2.4
6.2.5
6.2.6
6.2.7
6.2.8
6.2.9
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.22
IOC80 (PWMCON: PWM Control Register) ..................................................... 23
IOC90 (TMRCON: Timer Control Register) ...................................................... 24
IOCA0 (CMPCON: Comparator Control Register) ........................................... 25
IOCB0 (Pull-Down Control Register) ................................................................ 25
IOCC0 (Open-Drain Control Register) ............................................................. 26
IOCD0 (Pull-high Control Register) .................................................................. 26
IOCE0 (WDT Control Register) ........................................................................ 27
IOCF0 (Interrupt Mask Register) ...................................................................... 28
IOC51 (PRD1L: Least Significant Byte of PWM1 Time Period) ...................... 29
IOC61 (PRD2L: Least Significant Byte of PWM2 Time Period) ...................... 29
IOC71 (PRD3L: Least Significant Byte of PWM3 Time Period) ...................... 29
IOC81 (DT1L: Least Significant Byte of PWM1 Duty Cycle) ........................... 29
IOC91 (DT2L: Least Significant Byte of PWM2 Duty Cycle) ............................ 29
IOCA1 (DT3L: Least Significant Byte of PWM3 Duty Cycle) .......................... 29
IOCB1 (DTH: Most Significant Bits of PWM Duty Cycle) ................................. 30
IOCC1 (TMR1L: Least Significant Byte of PWM1 Timer)................................ 30
IOCD1 (TMR2L: Least Significant Byte of PWM2 Timer)................................ 30
IOCE1 (TMR3L: Least Significant Byte of PWM3 Timer) ................................ 30
IOCF1 (TMRH: Most Significant Bits of PWM Timer)....................................... 30
6.3
6.4
6.5
TCC/WDT and Prescaler ................................................................................ 30
I/O Ports ......................................................................................................... 32
6.4.1
6.5.1
Usage of Port 6 Input Change Wake-up/Interrupt Function ............................. 34
Reset and Wake-up Operation ......................................................................... 34
6.5.1.1 Wake-up and Interrupt Modes Operation Summary.......................... 37
6.5.1.2 Register Initial Values after Reset ..................................................... 40
6.5.1.3 Controller Reset Block Diagram ........................................................ 46
The T and P Status under Status Register ....................................................... 46
Reset and Wake-up ........................................................................................ 34
6.5.2
6.6
6.7
Interrupt .......................................................................................................... 47
Analog-To-Digital Converter (ADC) ................................................................. 49
6.7.1
ADC Control Register (AISR/R8, ADCON/R9, ADOC/RA)............................... 50
6.7.1.1 R8 (AISR: ADC Input Select Register) .............................................. 50
6.7.1.2 R9 (ADCON: ADC Control Register) ................................................. 51
6.7.1.3 RA (ADOC: ADC Offset Calibration Register) ................................... 52
ADC Data Register (ADDATA/RB, ADDATA1H/RC, ADDATA1L/RD) ............. 52
ADC Sampling Time ......................................................................................... 53
AD Conversion Time......................................................................................... 53
ADC Operation during Sleep Mode .................................................................. 53
Programming Process/Considerations ............................................................. 54
6.7.6.1 Programming Process ....................................................................... 54
6.7.6.2 Sample Demo Programs ................................................................... 54
6.7.2
6.7.3
6.7.4
6.7.5
6.7.6
iv
•
Product Specification (V1.0) 12.25.2007
Contents
6.8
Dual Sets of PWM (Pulse Width Modulation) .................................................. 56
6.8.1
6.8.2
6.8.3
6.8.4
6.8.5
6.8.6
Overview........................................................................................................... 56
Increment Timer Counter .................................................................................. 57
PWM Time Period............................................................................................. 57
PWM Duty Cycle............................................................................................... 58
Comparator X ................................................................................................... 58
PWM Programming Process/Steps .................................................................. 58
Overview........................................................................................................... 58
Function Description ......................................................................................... 59
Programming the Related Registers ................................................................ 60
6.9.3.1 Related Control Registers of TMR1, TMR2, and TMR3 .................... 60
Timer Programming Process/Steps .................................................................. 60
External Reference Signal................................................................................ 61
Comparator Outputs ......................................................................................... 61
Using Comparator as an Operation Amplifier ................................................... 62
Comparator Interrupt ........................................................................................ 62
Wake-up from Sleep Mode ............................................................................... 62
Oscillator Modes ............................................................................................... 62
Crystal Oscillator/Ceramic Resonators (Crystal) .............................................. 63
External RC Oscillator Mode ............................................................................ 64
Internal RC Oscillator Mode ............................................................................. 65
6.9
Timer .............................................................................................................. 58
6.9.1
6.9.2
6.9.3
6.9.4
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
6.10 Comparator..................................................................................................... 60
6.11 Oscillator ........................................................................................................ 62
6.12 Power-on Considerations................................................................................ 66
6.12.1 External Power-on Reset Circuit ...................................................................... 66
6.12.2 Residual Voltage Protection ............................................................................. 67
6.13 Code Option ................................................................................................... 68
6.13.1 Code Option Register (Word 0) ........................................................................ 68
6.13.2 Code Option Register (Word 1) ........................................................................ 69
6.13.3 Code Option and Customer ID Register (Word 2)............................................ 70
6.14 Low Voltage Detector...................................................................................... 71
6.14.1 Low Voltage Reset............................................................................................ 71
6.14.2 Low Voltage Detector........................................................................................ 71
6.14.2.1 Bank 1 R6 (LVD Control Register)..................................................... 71
6.14.3 Programming Process ...................................................................................... 72
7
8
6.15 Instruction Set................................................................................................. 73
Absolute Maximum Ratings.................................................................................. 76
DC Electrical Characteristics................................................................................ 76
8.1
AD Converter Characteristic ........................................................................... 78
8.2 Comparator (OP) Characteristic...................................................................... 79
AC Electrical Characteristic.................................................................................. 79
Timing Diagrams ................................................................................................... 80
•
v
9
10
Product Specification (V1.0) 12.25.2007