EM785840/5841/5842
8-BIT MICRO-CONTROLLER
Version 1.2
ELAN MICROELECTRONICS CORP.
No. 12, Innovation 1
st
RD., Science-Based Industrial Park
Hsin Chu City, Taiwan, R.O.C.
TEL: (03) 5639977
FAX: (03) 5630118
Version History
Specification Revision History
Version
eFH785840
1.0
1.1
1.2
Content
Initial version
1. Remove Crystal mode’s Idle application
2. Modify operating temperature
1. Rename EM78785840/41/42
→EM785840/41/42
2. Change IRC frequency deviation from +/- 5% to +/- 10%
Relative to EM785840s ROM-less, OTP and mask:
ROM-less
ICE5830
OTP
EM78P5840
EM78P5841
EM78P5842
Mask
EM785840
EM785841
EM785842
Table1: the relation between EM785830 and EM785840 series:
EM785830 series
EM78P5840 series
PACKAGE
EM785830ACP
EM78P840P
18 pin PDIP
EM785830ACM
EM785840M
18 pin SOP
EM785830ABP
EM785841P
20 pin PDIP
EM785830ABM
EM785841M
20 pin SOP
EM785830AFP
EM785842P
24 pin PDIP
EM785830AFM
EM785842M
24 pin SOP
Table2: the major differences between EM78P5830 and EM78P5840 series:
EM785830 series
EM785840 series
CID RAM
256 byte
NA
ERIC mode
NA
Under 6M Hz
IRC mode
NA
2M / 4M Hz
WDT source
Crystal or PLL
IRC1
External CNT1 input
NA
Shared with P94
P71 pull high
Internal pull high
External pull high
/RESET pin
/RESET only
Shared with P71
PLLC pin
PLLC only
Shared with P70 and ERCI
XIN, XOUT
Crystal input
Shared with P60 and P61
Table3: the major differences between ICE5840, EM78P5840 and EM785840:
ICE5840
EM78P5840 series
CID RAM
1024 byte
NA
CID RAM address auto
V
NA
+1
CNT1(**)
8 bit counter
8 bit counter
EM785840 series
NA
NA
8 or 16 (shared with
CNT2) bit counter
CNT2(**)
V
X
V
STACK
12
8
8
** CNT2 is only exist on EM78P5840/41/42 and EM785840/41/42, CNT2 is un-support on ICE5840.
EM785840/5841/5842
8-bit Micro-controller
Table4: Differences between EM78P5840, EM78P5841 and EM78P5842:
EM78P5840
EM78P5841
Pin count
18
20
PWM
X
2 channel
IO (MAX)
16
18
EM78P5842
24
2 channel
22
User Application Note
(Before using this chip, take a look at the following description note, it includes important messages.)
1. There are some undefined bits in the registers. The values in these bits are unpredicted. These
bits are not allowed to use. We use the symbol “-” in the spec to recognize them.
A fixed value
must be write in some specific unused bits by software or some unpredicted wrong will occur.
2. You will see some names for the register bits definitions. Some name will be appear very
frequently in the whole spec. The following describes the meaning for the register’s definitions
such as bit type, bit name, bit number and so on.
RA
PAGE0
7
RAB7
R/W-0
Bit type
Bit name
Bit number
6
RAB6
R/W-0
5
BAB5
R-1
4
RAB4
R/W-1
read/write
(default value=1)
3
X
2
RAB2
R
1
RAB1
R-0
0
RAB0
R/W
read/write
(w/o default value)
read/write
(default value=0)
read only
(w/o default value)
(undefined) not allowed to use
read only
(default value=1)
read only
(default value=0)
Register name and its page
3. Please do not switch MCU operation mode from normal mode to sleep mode directly. Before
into sleep mode, please switch MCU to green mode.
4. While switching main clock (regardless of high freq to low freq or on the other hand), adding 6
instructions delay (NOP) is required.
5.
Offset voltage will effect ADC’s result, please refer to figure 16 to detail.
__________________________________________________________________________________________________________________________________________________________________
* This specification is subject to change without notice.
1
2004/11/10 V1.2
EM785840/5841/5842
8-bit Micro-controller
I. General Description
The EM785840 series are 8-bit RISC type microprocessor with low power, high speed CMOS technology. There
are 4Kx13 bits ROM within it. This integrated single chip has an on_chip watchdog timer (WDT), RAM, programmable
real time clock/counter, internal interrupt, power down mode, dual PWM (Pulse Width Modulation), 8-channel 10-bit
A/D converter and tri-state I/O.
II. Feature
CPU
·
Operating voltage : 2.2V~5.5V at main CLK less then 3.58MHz.
Main CLK(Hz)
Under 3.58M
14.3M
Operating Voltage(min)
2.2V
3.6V
•
4k x 13 on chip mask ROM
•
144 x 8 on chip general propose RAM
•
Up to 21 bi-directional and 1 input only general purpose I/O (For 24 pin package)
•
8 level stack for subroutine nesting
•
8-bit real time clock/counter (TCC)
•
One 8-bit counter interrupt
•
On-chip watchdog timer (WDT)
•
99.9% single instruction cycle commands
•
Four action modes in Crystal mode (Main clock can be programmed to 3.58M or 14.3M Hz)
Mode
CPU status
Main clock
32.768kHz clock status
Sleep mode
Turn off
Turn off
Turn off
Green mode
Turn on
Turn off
Turn on
Normal mode Turn on
Turn on
Turn on
•
2 level Normal mode frequency: 3.58M and 14.3MHz.
•
Input port interrupt function
•
Dual clocks operation (Internal PLL main clock , External 32.768KHz)
Operating frequency mode
•
Crystal mode (XIN,XOUT pin connect external crystal and capacitance)
•
ERIC mode (ERCI pin connect resister to VDD)
•
IRC mode
PWM
•
Dual PWM (Pulse Width Modulation) with 10-bit resolution
•
Programmable period (or baud rate)
•
Programmable duty cycle
ADC
·
Operating : 2.5V∼5.5V
Converter Rate
Operating Voltage(min)
74.6K
3.5V
37.4K
3.0V
18.7K
2.5V
9.3K
2.5V
·
8 channel 10-bit successive approximation A/D converter
·
Internal (VDD) reference voltage
POR
·
Power-on reset
PACKAGE
EM785840M
EM785840P
18 pin SOP, EM785841M
18 pin PDIP, EM785841P
20 pin SOP, EM785842M
20 pin PDIP, EM785842P
24 pin SOP
24 pin PDIP
__________________________________________________________________________________________________________________________________________________________________
* This specification is subject to change without notice.
2
2004/11/10 V1.2
EM785840/5841/5842
8-bit Micro-controller
III. Application
General products application.
IV. Pin Configuration
CIN/P94
P95
P96
AVDD
PLLC/ERIC
/P70/INT0
1
2
3
4
5
6
7
8
9
18
17
16
15
14
13
12
11
10
AD8/P93
AD7/P92
AD2/P91
AD1/P90
INT3/P73
/RESET/P71/INT1
XOUT/P60
XIN/P61
AD3/P62
AVSS
AD6/P65
AD5/P64
AD4/P63
(a)
CIN/P94
CIN/P94
P95
P96
AVDD
PLLC/ERIC
/P70/INT0
AVSS
AD6/P65
AD5/P64
AD4/P63
AD3/P62
1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
AD8/P93
AD7/P92
AD2/P91
AD1/P90
PWM2/PC2
PWM1/PC1
INT3/P73
1
2
3
4
5
6
7
8
9
10
11
12
24
23
22
21
20
19
18
17
16
15
14
13
AD8/P93
AD7/P92
AD2/P91
AD1/P90
PWM2/PC2
PWM1/PC1
INT3/P73
P74
P75
P76
/RESET/P71/INT1
XOUT/P60
P95
P96
P97
AVDD
PLLC/ERIC
/P70/INT0
AVSS
AD6/P65
/RESET/P71/INT1
XOUT/P60
XIN/P61
AD5/P64
AD4/P63
AD3/P62
XIN/P61
(b)
Fig.1: EM785840 series pin assignment.
(a): EM785840M, EM785840P
(b): EM785841M, EM785841P
(c): EM785842M, EM785842P
(c)
__________________________________________________________________________________________________________________________________________________________________
* This specification is subject to change without notice.
3
2004/11/10 V1.2