To provide the most up-to-date information, the revision of our documents on the
World Wide Web will be the most current. Your printed copy may be an earlier
revision. To verify you have the latest information available, refer to:
http://www.motorola.com/semiconductors/
The following revision history table summarizes changes contained in this
document. For your convenience, the page number designators have been linked
to the appropriate location.
This document contains a detailed description of the M68HC11 E series of 8-bit
microcontroller units (MCUs). These MCUs all combine the M68HC11 central
processor unit (CPU) with high-performance, on-chip peripherals.
The E series is comprised of many devices with various configurations of:
With the exception of a few minor differences, the operation of all E-series MCUs
is identical. A fully static design and high-density complementary metal-oxide
semiconductor (HCMOS) fabrication process allow the E-series devices to operate
at frequencies from 3 MHz to dc with very low power consumption.
Features of the E-series devices include:
•M68HC11 CPU
•Power-saving stop and wait modes
•Low-voltage devices available (3.0–5.5 Vdc)
•0, 256, 512, or 768 bytes of on-chip RAM, data retained during standby
•0, 12, or 20 Kbytes of on-chip ROM or EPROM
•0, 512, or 2048 bytes of on-chip EEPROM with block protect for security
•2048 bytes of EEPROM with selectable base address in the MC68HC811E2
•Asynchronous non-return-to-zero (NRZ) serial communications interface
(SCI)
•Additional baud rates available on MC68HC(7)11E20
•52-pin plastic thin quad flat pack, 10 mm x 10 mm (TQFP)
•64-pin quad flat pack (QFP)
•48-pin plastic dual in-line package (DIP), MC68HC811E2 only
•56-pin plastic shrink dual in-line package, .070-inch lead spacing (SDIP)
Most pins on these MCUs serve two or more functions, as described in the
following paragraphs. Refer to Figure 1-2, Figure 1-3, Figure 1-4, Figure 1-5, and
Figure 1-6 which show the M68HC11 E-series pin assignments for the
PLCC/CLCC, QFP, TQFP, SDIP, and DIP packages.
cale Semiconductor,
Frees
EXTAL
STRB/R/WESTRA/AS
7
6
5
4
XTAL
8
PC0/ADDR0/DATA0
PC1/ADDR1/DATA1
PC2/ADDR2/DATA2
PC3/ADDR3/DATA3
PC4/ADDR4/DATA4
PC5/ADDR5/DATA5
PC6/ADDR6/DATA6
PC7/ADDR7/DATA7
RESET
* XIRQ/V
PD0/RxD
* V
applies only to devices with EPROM/OTPROM.
PPE
PPE
IRQ
9
10
11
12
13
14
15
16
17
18
19
20
2122232425
PD1/TxD
PD2/MISO
M68HC11 E SERIES
PD4/SCK
PD3/MOSI
STBY
MODA/LIR
MODB/V
VSSVRHVRLPE7/AN7
312
26
2728293031
DD
V
PD5/SS
PA7/PAI/OC1
52
51
50
PA6/OC2/OC1
PA5/OC3/OC1
PA4/OC4/OC1
PE3/AN3
PE6/AN648PE2/AN2
49
PA2/IC132PA1/IC2
PA3/OC5/IC4/OC1
47
45
44
43
42
41
40
39
38
37
36
35
34
33
PE5/AN546
PE1/AN1
PE4/AN4
PE0/AN0
PB0/ADDR8
PB1/ADDR9
PB2/ADDR10
PB3/ADDR11
PB4/ADDR12
PB5/ADDR13
PB6/ADDR14
PB7/ADDR15
PA0/IC3
Figure 1-2. Pin Assignments for 52-Pin PLCC and CLCC
Data SheetM68HC11E Family — Rev. 5
18General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 19
Freescale Semiconductor, Inc.
General Description
Pin Descriptions
PA1/IC2
PA2/IC1
PA3/OC5/IC4/OC1NCNC
64
63626160595857
PA0/IC3
PB7/ADDR15
PB6/ADDR14
PB5/ADDR13
PB4/ADDR12
PB3/ADDR11
PB2/ADDR10
nc...
I
PB1/ADDR9
PB0/ADDR8
PE0/AN0
PE4/AN4
PE1/AN1
PE5/AN5
1. V
PPE
1
NC
2
NC
3
NC
4
5
6
7
8
9
10
11
12
13
14
15
16
17181920212223
PE2/AN2
PE6/AN6
PE3/AN3
applies only to devices with EPROM/OTPROM.
PA4/OC4/OC1
PA5/OC3/OC1
PA6/OC2/OC1
PA7/PAI/OC1
56
M68HC11 E SERIES
25
24
PE7/AN7
RL
V
SS
RH
VSSV
V
STBY
MODB/V
PD5/SS
VDDPD4/SCK
55
26
NC
PD3/MOSI
5352515049
54
2829303132
27
E
STRA/AS
MODA/LIR
Figure 1-3. Pin Assignments for 64-Pin QFP
cale Semiconductor,
SS
PD2/MISO
PD1/TxD
V
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
NC
EXTAL
STRB/R/W
NC
PD0/RxD
IRQ
XIRQ/V
NC
RESET
PC7/ADDR7/DATA7
PC6/ADDR6/DATA6
PC5/ADDR5/DATA5
PC4/ADDR4/DATA4
PC3/ADDR3/DATA3
PC2/ADDR2/DATA2
PC1/ADDR1/DATA1
NC
PC0/ADDR0/DATA0
XTAL
PPE
(1)
Frees
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAGeneral Description19
For More Information On This Product,
Go to: www.freescale.com
Page 20
General Description
nc...
I
Freescale Semiconductor, Inc.
PA0/IC3
PB7/ADDR15
PB6/ADDR14
PB5/ADDR13
PB4/ADDR12
PB3/ADDR11
PB2/ADDR10
PB1/ADDR9
PB0/ADDR8
PE0/AN0
PE4/AN4
PE1/AN1
PE5/AN5
PA1/IC2
PA2/IC1
PA3/OC5/IC4/OC1
PA4/OC4/OC1
PA5/OC3/OC1
PA6/OC2/OC1
PA7/PAI/OC1
52
51504948474645
1
2
3
4
5
6
7
8
9
10
11
12
13
M68HC11 E SERIES
1415161718192021222423
PD5/SS
VDDPD4/SCK
44
PD3/MOSI
PD2/MISO
PD1/TxD
42
43
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
25
26
PD0/RxD
IRQ
XIRQ/V
RESET
PC7/ADDR7/DATA7
PC6/ADDR6/DATA6
PC5/ADDR5/DATA5
PC4/ADDR4/DATA4
PC3/ADDR3/DATA3
PC2/ADDR2/DATA2
PC1/ADDR1/DATA1
PC0/ADDR0/DATA0
XTAL
PPE
(1)
cale Semiconductor,
Frees
RL
SS
RH
V
V
V
PE2/AN2
PE6/AN6
PE3/AN3
PE7/AN7
1. V
applies only to devices with EPROM/OTPROM.
PPE
STBY
MODB/V
E
STRA/AS
MODA/LIR
EXTAL
STRB/R/W
Figure 1-4. Pin Assignments for 52-Pin TQFP
Data SheetM68HC11E Family — Rev. 5
20General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 21
Freescale Semiconductor, Inc.
General Description
Pin Descriptions
V
SS
STBY
EXTAL
XTAL
PPE
IRQ
EV
SS
V
DD
V
SS
1
2
3
4
E
5
6
7
8
9
10
11
12
13
14
15
M68HC11 E SERIES
16
17
18
19
20
21
22
23
24
25
26
27
28
MODB/V
MODA/LIR
STRA/AS
STRB/R/W
PC0/ADDR0/DATA0
PC1/ADDR1/DATA1
PC2/ADDR2/DATA2
PC3/ADDR3/DATA3
PC4/ADDR4/DATA4
nc...
I
cale Semiconductor,
PC5/ADDR5/DATA5
PC6/ADDR6/DATA6
PC7/ADDR7/DATA7
RESET
* XIRQ/V
PD0/RxD
PD1/TxD
PD2/MISO
PD3/MOSI
PD4/SCK
PD5/SS
* V
applies only to devices with EPROM/OTPROM.
PPE
Figure 1-5. Pin Assignments for 56-Pin SDIP
EV
56
SS
V
RH
55
V
54
RL
PE7/AN7
53
PE3/AN3
52
PE6/AN6
51
PE2/AN2
50
PE5/AN5
49
PE1/AN1
48
PE4/AN4
47
PE0/AN0
46
PB0/ADDR8
45
PB1/ADDR9
44
PB2/ADDR10
43
PB3/ADDR11
42
PB4/ADDR12
41
PB5/ADDR13
40
PB6/ADDR14
39
PB7/ADDR15
38
PA0/IC3
37
PA1/IC2
36
PA2/IC1
35
PA3/OC5/IC4/OC1
34
PA4/OC4/OC1
33
PA5/OC3/OC1
32
PA6/OC2/OC1
31
PA7/PAI/OC1
30
EV
29
DD
Frees
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAGeneral Description21
For More Information On This Product,
Go to: www.freescale.com
Page 22
General Description
Freescale Semiconductor, Inc.
PA7/PAI/OC1
PA6/OC2/OC1
PA5/OC3/OC1
PA4/OC4/OC1
PA3/OC5/IC4/OC1
PA2/IC1
PA1/IC2
PA0/IC3
PB7/ADDR15
PB6/ADDR14
PB5/ADDR13
PB4/ADDR12
PB3/ADDR11
nc...
I
PB2/ADDR10
PB1/ADDR9
PB0/ADDR8
PE0/AN0
PE1/AN1
PE2/AN2
PE3/AN3
MODB/V
V
V
V
STBY
1
2
3
4
5
6
7
8
9
10
11
MC68HC811E2
12
13
14
15
16
17
18
19
20
21
RL
22
RH
23
SS
24
Figure 1-6. Pin Assignments for 48-Pin DIP (MC68HC811E2)
cale Semiconductor,
V
48
DD
PD5/SS
47
PD4/SCK46
PD3/MOSI
45
PD2/MISO44
PD1/TxD
43
PD0/RxD42
IRQ
41
XIRQ
40
RESET
39
PC7/ADDR7/DATA7
38
PC6/ADDR6/DATA6
37
PC5/ADDR5/DATA5
36
PC4/ADDR4/DATA4
35
PC3/ADDR3/DATA3
34
PC2/ADDR2/DATA2
33
PC1/ADDR1/DATA1
32
PC0/ADDR0/DATA0
31
XTAL
30
EXTAL
29
STRB/R/W
28
E27
STRA/AS26
25
MODA/LIR
Frees
Data SheetM68HC11E Family — Rev. 5
22General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 23
1.4.1 VDD and VSS
Freescale Semiconductor, Inc.
General Description
Pin Descriptions
nc...
I
cale Semiconductor,
Frees
Power is supplied to the MCU through V
and VSS. VDD is the power supply, VSS
DD
is ground. The MCU operates from a single 5-volt (nominal) power supply.
Low-voltage devices in the E series operate at 3.0–5.5 volts.
Very fast signal transitions occur on the MCU pins. The short rise and fall times
place high, short duration current demands on the power supply. To prevent noise
problems, provide good power supply bypassing at the MCU. Also, use bypass
capacitors that have good
high-frequency characteristics and situate them as close to the MCU as possible.
Bypass requirements vary, depending on how heavily the MCU pins are loaded.
V
DD
2
IN
RESET
MC34(0/1)64
GND
3
V
DD
4.7 kΩ
1
TO RESET
OF M68HC11
Figure 1-7. External Reset Circuit
MANUAL
RESET SWITCH
4.7 kΩ
V
DD
IN
RESET
V
DD
4.7 kΩ
MC34064
GND
V
DD
4.7 kΩ
TO RESET
OF M68HC11
1.0 µF
IN
RESET
MC34164
GND
OPTIONAL POWER-ON DELAY AND MANUAL RESET SWITCH
Figure 1-8. External Reset Circuit with Delay
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAGeneral Description23
For More Information On This Product,
Go to: www.freescale.com
Page 24
General Description
1.4.2 RESET
Freescale Semiconductor, Inc.
A bidirectional control signal, RESET
known startup state. It also acts as an open-drain output to indicate that an internal
failure has been detected in either the clock monitor or computer operating prop erly
(COP) watchdog circuit. The CPU distinguishes between internal and external
reset conditions by sensing whether the reset pin rises to a logic 1 in less than t wo
E-clock cycles after a reset has occurred. See Figure 1-7 and Figure 1-8.
, acts as an input to initialize the MCU to a
CAUTION:Do not connect an external resistor capacitor (RC) power-up delay circuit to the
reset pin of M68HC11 devices because the circuit charge time constant can cause
the device to misinterpret the type of reset that occurred.
Because the CPU is not able to fetch and execute instructions properly when V
falls below the minimum operating voltage level, reset must be controlled. A
nc...
I
cale Semiconductor,
low-voltage inhibit (LVI) circuit is required primarily for protection of EEPROM
contents. However, since the configuration register (CONFIG) value is read from
the EEPROM, protection is required even if the EEPROM array is not being used.
Presently, there are several economical ways to solve this problem. For example,
two good external components for LVI reset are:
1.The Seiko S0854HN (or other S805 series devices):
a.Extremely low power (2 µA)
a.TO-92 package
a.Limited temperature range, –20°C to +70°C
a.Available in various trip-point voltage ranges
2.The Motorola MC34064:
a.TO-92 or SO-8 package
a.Draws about 300 µA
a.Temperature range –40°C to 85°C
a.Well controlled trip point
a.Inexpensive
DD
Frees
Refer to Section 5. Resets and Interrupts for further information.
1.4.3 Crystal Driver and External Clock Input (XTAL and EXTAL)
These two pins provide the interface for either a crystal or a CMOS- compatible
clock to control the internal clock generator circuitry. The frequency applied to
these pins is four times higher than the desired E-clock rate.
The XTAL pin must be left unterminated when an external CMOS- compatible clock
input is connected to the EXTAL pin. The XTAL output is normally intended to drive
only a crystal. Refer to Figure 1-9 and Figure 1-10.
Data SheetM68HC11E Family — Rev. 5
24General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 25
Freescale Semiconductor, Inc.
General Description
Pin Descriptions
CAUTION:In all cases, use caution around the oscillator pins. Load capacitances shown in the
oscillator circuit are specified by the crystal manufacturer and should include all
stray layout capacitances.
C
EXTAL
L
nc...
I
cale Semiconductor,
Frees
1.4.4 E-Clock Output (E)
E is the output connection for the internally generated E clock. The signal from E
is used as a timing reference. The frequency of the E-clock outpu t is one fourth that
of the input frequency at the XTAL and EXTAL pins. When E-clock output is low,
an internal process is taking place. When it is high, data is being accessed.
All clocks, including the E clock, are halted when the MCU is in stop mode. To
reduce RFI emissions, the E-clock output of most E-series devices can be disabled
while operating in single-chip modes.
The E-clock signal is always enabled on the MC68HC811E2.
MCU
XTAL
Figure 1-9. Common Parallel Resonant Crystal Connections
EXTAL
MCU
XTAL
Figure 1-10. External Oscillator Connections
NC
10 MΩ
4 x E
CRYSTAL
C
L
4 x E
CMOS-COMPATIBLE
EXTERNAL OSCILLATOR
1.4.5 Interrupt Request (IRQ
The IRQ
MCU. Either negative edge-sensitive triggering or level-sensitive triggering is
program selectable (OPTION register). IRQ
triggering at reset. When using IRQ
connect an external pullup resistor, typically 4.7 kΩ, to V
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAGeneral Description25
)
input provides a means of applying asynchronous interrupt requests to the
is always configured to level-sensitive
in a level-sensitive wired-OR configuration,
.
DD
For More Information On This Product,
Go to: www.freescale.com
Page 26
General Description
Freescale Semiconductor, Inc.
nc...
I
cale Semiconductor,
Frees
1.4.6 Non-Maskable Interrupt (XIRQ/V
The XIRQ
reset initialization. During reset, the X bit in the condition code register (CCR) is set
and any interrupt is masked until MCU software enables it. Because the XIRQ
is level-sensitive, it can be connected to a multiple-source wired-OR network with
an external pullup resistor to V
interrupt.
Whenever XIRQ
drive the interrupt input with an open-drain type of driver to avoid contention
between outputs.
NOTE:IRQ
source of IRQ
There should be a single pullup resistor near the MCU interrupt input pin (typically
4.7 kΩ). There must also be an interlock mechanism at each interrupt source so
that the source holds the interrupt line low until the MCU recognizes and
acknowledges the interrupt request. If one or more interrupt sources are still
pending after the MCU services a request, the interrupt line will still be held low and
the MCU will be interrupted again as soon as the interrupt mask bit in the MCU is
cleared (normally upon return from an interrupt). Refer to Section 5. Resets and
Interrupts.
V
PPE
EPROM/OTPROM programming. On devices without EPROM/OTPROM, this pin
is only an XIRQ
input provides a means of requesting a non-maskable interrupt after
or IRQ is used with multiple interrupt sources each source must
must be configured for level-sensitive operation if there is more than one
interrupt.
is the input for the 12-volt nominal programming voltage required for
input.
CAUTION:During EPROM programming of the MC68HC711E9 device, the V
may latch-up and be damaged if the input current is not limited to 10 mA. For mo re
information please refer to MC68HC711E9 8-Bit Microcontroller Unit Mask Set
Errata 3 (Motorola document order number 68HC711E9MSE3.
1.4.7 MODA and MODB (MODA/LIR
During reset, MODA and MODB select one of the four operating modes:
•Single-chip mode
•Expanded mode
•Test mode
•Bootstrap mode
and MODB/V
PPE
)
input
. XIRQ is often used as a power loss detect
DD
STBY
pin circuitry
PPE
)
Refer to Section 2. Operating Modes and On-Chip Memory.
After the operating mode has been selected, the load instru ction register (LIR
provides an open-drain output to indicate that execution of an instruction has
begun. A series of E-clock cycles occurs during execution of each instruction. The
signal goes low during the first E-clock cycle of each instruction (opcode fetch).
LIR
This output is provided for assistance in program debugging.
Data SheetM68HC11E Family — Rev. 5
26General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
) pin
Page 27
Freescale Semiconductor, Inc.
General Description
Pin Descriptions
The V
When the voltage on this pin is more than one MOS threshold (about 0.7 volts)
above the V
from this signal rather than the V
without V
removed and must remain low until V
1.4.7.1 V
nc...
I
1.4.8 STRA/AS
cale Semiconductor,
1.4.9 STRB/R/W
and VRH
RL
These two inputs provide the reference voltages for the analog-to-digital (A/D)
converter circuitry:
•V
•V
For proper A/D converter operation:
•V
•V
The strobe A (STRA) and address strobe (AS) pin performs either o f two separate
functions, depending on the operating mode:
•In single-chip mode, STRA performs an input handshake (strobe input)
•In the expand ed multiplexed mode, AS provides an address strobe function.
AS can be used to demultiplex the address and data signals at port C. Refer to
Section 2. Operating Modes and On-Chip Memory.
The strobe B (STRB) and read/write (R/W
a data bus direction indicator, depending on the operating mode.
pin is used to input random-access memory (RAM) standby power.
STBY
voltage, the internal RAM and part of the reset logic are powered
DD
input. This allows RAM contents to be retained
DD
power applied to the MCU. Reset must be driven low before VDD is
DD
has been restored to a valid level.
DD
is the low reference, typically 0 Vdc.
RL
is the high reference.
RH
should be at least 3 Vdc greater than VRL.
RH
and VRH should be between VSS and VDD.
RL
function.
) pin act as either an output strobe or as
Frees
In single-chip operating mode, STRB acts as a programmable strobe for
handshake with other parallel devices. Refer to Section 6. Parallel Input/Output
(I/O) Ports for further information.
In expanded multiplexed operating mode, R/W
transfers on the external data bus. A low on the R/W
written to the external data bus. A high on this pin indicates that a read cycle is in
progress. R/W
double-byte store. It is possible for data to be driven out of port C, if internal read
visibility (IRV) is enabled and an internal address is read, even though R/W
high-impedance state. Refer to Section 2. Operating Modes and On-Chip
Memory for more information about IRVNE (internal read visibility not E).
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAGeneral Description27
stays low during consecutive data bus write cycles, such as a
For More Information On This Product,
Go to: www.freescale.com
is used to indicate the direction of
pin indicates data is being
is in a
Page 28
General Description
1.4.10 Port Signals
nc...
I
1.4.10.1 Port A
Freescale Semiconductor, Inc.
Port pins have different functions in different operating modes. Pin functions for
port A, port D, and port E are independent of operating modes. Port B and port C,
however, are affected by operating mode. Port B provides eight general-purpose
output signals in single-chip operating modes. When the microcontroller is in
expanded multiplexed operating mode, port B pins are the eight high-order address
lines.
Port C provides eight general-purpose input/output signals when the MCU is in the
single-chip operating mode. When the microcontroller is in the expanded
multiplexed operating mode, port C pins are a multiplexed address/data bus.
Refer to Table 1-1 for a functional description of the 40 port signals within different
operating modes. Terminate unused inputs and input/output (I/O) pins configured
as inputs high or low.
cale Semiconductor,
Frees
In all operating modes, port A can be configured for three timer input capture (IC)
functions and four timer output compare (OC) functions. An additional pin can be
configured as either the fourth IC or the fifth OC. Any port A pin that is not currently
being used for a timer function can be used as either a general-purpose input or
output line. Only port A pins PA7 and PA3 have an associated data direction
control bit that allows the pin to be selectively configured as input or output. Bits
DDRA7 and DDRA3 located in PACTL register control data direction for PA7 and
PA3, respectively. All other port A pins are fixed as either input or output.
PA7 can function as general-purpose I/O or as timer output compare for OC1. PA7
is also the input to the pulse accumulator, even while functioning as a
general-purpose I/O or an OC1 output.
PA6–PA4 serve as either general-purpose outputs, timer input captures, or timer
output compare 2–4. In addition, PA6–PA4 can be controlled by OC1.
PA3 can be a general-purpose I/O pin or a timer IC/OC pin. Timer functions
associated with this pin include OC1 and IC4/OC5. IC4/OC5 is software selectable
as either a fourth input capture or a fifth output compare. PA3 can also be
configured to allow OC1 edges to trigger IC4 captures.
PA2–PA0 serve as general-purpose inputs or as IC1–IC3.
PORTA can be read at any time. Reads of pins configured as inputs return the logic
level present on the pin. Pins configured as outputs return the logic level present
at the pin driver input. If written, PORTA stores the data in an internal latch, bits 7
and 3. It drives the pins only if they are configured as outputs. Writes to PORTA do
not change the pin state when pins are configured for timer input captures or output
compares. Refer to Section 6. Parallel Input/Output (I/O) Ports.
During single-chip operating modes, all port B pins are general-purpose output
pins. During MCU reads of this port, the level sensed at the input side of the po rt B
output drivers is read. Port B can also be used in simple strobed output mode. In
this mode, an output pulse appears at the STRB signal each time data is written to
port B.
In expanded multiplexed operating modes, all of the port B pins act as high order
address output signals. During each MCU cycle, bits 15–8 of the address bus are
output on the PB7–PB0 pins. The PORTB register is treated as an external
address in expanded modes.
1.4.10.3 Port C
Freescale Semiconductor, Inc.
nc...
I
cale Semiconductor,
Frees
While in single-chip operating modes, all port C pins are general-purpose I/O pins.
Port C inputs can be latched into an alternate PORTCL register by providing an
input transition to the STRA signal. Port C can also be used in full handshake
modes of parallel I/O where the STRA input and STRB output act as handshake
control lines.
When in expanded multiplexed modes, all port C pins are configured as
multiplexed address/data signals. During the address portion of each MCU cycle,
bits 7–0 of the address are output on the PC7–PC0 pins. During the data portion
of each MCU cycle (E high), PC7–PC0 are bidirectional data signals,
DATA7–DATA0. The direction of data at the port C pins is indicated by the R/W
signal.
The CWOM control bit in the PIOC register disables the port C P-channel output
driver. CWOM simultaneously affects all eight bits of port C. Because the
N-channel driver is not affected by CWOM, setting CWOM causes port C to
become an open-drain type output port suitable for wired-OR operation.
In wired-OR mode:
•When a port C bit is at logic level 0, it is driven low by the N-channel driver.
•When a port C b it is at logic level 1, the associated pin has high-impedance,
as neither the N-channel nor the P-channel devices are active.
It is customary to have an external pullup resistor on lines that are driven by
open-drain devices. Port C can only be configured for wired-OR operation when
the MCU is in single-chip mode. Refer to Section 6. Parallel Input/Output (I/O)
Ports for additional information about port C functions.
Data SheetM68HC11E Family — Rev. 5
30General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 31
Freescale Semiconductor, Inc.
1.4.10.4 Port D
Pins PD5–PD0 can be used for general-purpose I/O signals. These pins alternately
serve as the serial communication interface (SCI) and serial peripheral interface
(SPI) signals when those subsystems are enabled.
•PD0 is the receive data input (RxD) signal for the SCI.
•PD1 is the transmit data output (TxD) signal for the SCI.
•PD5–PD2 are dedicated to the SPI:
–PD2 is the master in/slave out (MISO) signal.
–PD3 is the master out/slave in (MOSI) signal.
–PD4 is the serial clock (SCK) signal.
–PD5 is the slave select (SS
nc...
I
1.4.10.5 Port E
General Description
Pin Descriptions
) input.
cale Semiconductor,
Frees
Use port E for general-purpose or analog-to-digital (A/D) inputs.
CAUTION:If high accuracy is required for A/D conversions, avoid reading port E during
sampling, as small disturbances can reduce the accuracy of that result.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAGeneral Description31
For More Information On This Product,
Go to: www.freescale.com
Page 32
General Description
nc...
I
Freescale Semiconductor, Inc.
cale Semiconductor,
Frees
Data SheetM68HC11E Family — Rev. 5
32General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 33
Freescale Semiconductor, Inc.
Data Sheet — M68HC11E Family
Section 2. Operating Modes and On-Chip Memory
2.1 Introduction
This section contains information about the operating modes and the on-chip
memory for M68HC11 E-series MCUs. Except for a few minor differences,
operation is identical for all devices in the E series. Differences are noted where
necessary.
nc...
I
2.2 Operating Modes
cale Semiconductor,
Frees
The values of the mode select inputs MODB and MODA during reset determine the
operating mode. Single-chip and expanded multiplexed are the normal modes.
Each of the two normal modes is paired with a special mode:
2.2.1 Single-Chip Mode
In single-chip mode, ports B and C and strobe pins A (STRA) and B (STRB) are
available for general-purpose parallel input/output (I/O). In this mode, all software
needed to control the MCU is contained in internal resources. If present, read-only
memory (ROM) and/or erasable, programmable read-only memory (EPROM) will
always be enabled out of reset, ensuring that the reset and interrupt vectors will be
available at locations $FFC0–$FFFF.
NOTE:For the MC68HC811E2, the vector locations are the same; however, they are
contained in the 2048-byte EEPROM array.
•In single-chip mode only on-chip memory is available.
•Expanded mode, however, allows access to external memory.
•Bootstrap, a variation of the single-chip mode, is a special mode that
executes a bootloader program in an internal bootstrap ROM.
•Test is a special mode that allows privileged access to internal resources.
2.2.2 Expanded Mode
In expanded operating mode, the MCU can access the full 64-Kbyte address
space. The space includes:
•The same on-chip memory addresses used for single-chip mode
•Addresses for external peripherals and memory devices
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory33
For More Information On This Product,
Go to: www.freescale.com
Page 34
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
The expansion bus is made up of ports B and C, and control signals AS (address
strobe) and R/W
8-bit data bus to be multiplexed on the same pins. During the first half of each bus
cycle address information is present. During the second half of each bus cycle the
pins become the bidirectional data bus. AS is an active-high latch enable signal fo r
an external address latch. Address information is allowed through the transparent
latch while AS is high and is latched when AS drives low.
(read/write). R/W and AS allow the low-order address and the
nc...
I
cale Semiconductor,
Frees
The address, R/W
, and AS signals are active and valid for all bus cycles, including
accesses to internal memory locations. The E clock is used to enable external
devices to drive data onto the internal data bus during the second half of a read bus
cycle (E clock high). R/W
when data is being written to the internal data bus. R/W
controls the direction of data transfers. R/W drives low
will remain low during
consecutive data bus write cycles, such as when a double-byte store occurs.
Refer to Figure 2-1.
NOTE:The write enable signal for an external memory is the NAND of the E clock and th e
inverted R/W
signal.
MCU
PB7
PB6
PB5
PB4
PB3
PB2
PB1
PB0
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
AS
R/W
ADDR15
ADDR14
ADDR13
ADDR12
ADDR11
ADDR10
ADDR9
HC373
Q1
D1
Q2
D2
Q3
D3
Q4
D4
Q5
D5
Q6
D6
Q7
D7
Q8
D8
LE
OE
E
ADDR8
ADDR7
ADDR6
ADDR5
ADDR4
ADDR3
ADDR2
ADDR1
ADDR0
WE
OE
DATA7
DATA6
DATA5
DATA4
DATA3
DATA2
DATA1
DATA0
Figure 2-1. Address/Data Demultiplexing
2.2.3 Test Mode
Test mode, a variation of the expanded mode, is primarily used during Motorola’s
internal production testing; however, it is accessible for programming the
Data SheetM68HC11E Family — Rev. 5
34Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 35
Freescale Semiconductor, Inc.
configuration (CONFIG) register, programming calibration data into electrically
erasable, programmable read-only memory (EEPROM), and supporting emulation
and debugging during development.
2.2.4 Bootstrap Mode
When the MCU is reset in special bootstrap mode, a small on-chip read-only
memory (ROM) is enabled at address $BF00–$BFFF. The ROM contains a
bootloader program and a special set of interrupt and reset vectors. The MCU
fetches the reset vector, then executes the bootloader.
Bootstrap mode is a special variation of the single-chip mode. Bootstrap mode
allows special-purpose programs to be entered into internal random-access
memory (RAM). When bootstrap mode is selected at reset, a small bootstrap ROM
becomes present in the memory map. Reset and interrupt vectors are located in
nc...
I
this ROM at $BFC0–$BFFF. The bootstrap ROM contains a small program which
initializes the serial communications interface (SCI) and allows the user to
download a program into on-chip RAM. The size of the downloaded program can
be as large as the size of the on-chip RAM. After a 4-character delay, or after
receiving the character for the highest address in RAM, control passes to the
loaded program at $0000. Refer to Figure 2-2, Figure 2-3, Figure 2-4, Figure 2-5,
and Figure 2-6.
Use of an external pullup resistor is required when using the SCI transmitter pin
because port D pins are configured for wired-OR operation by the bootloader. In
bootstrap mode, the interrupt vectors are directed to RAM. This allows the use of
interrupts through a jump table. Refer to the application note AN1060 entitled
M68HC11 Bootstrap Mode, that is included in this data book.
2.3 Memory Map
cale Semiconductor,
The operating mode determines memory mapping and whether external
addresses can be accessed. Refer to Figure 2-2, Figure 2-3, Figure 2-4,
Figure 2-5, and Figure 2-6, which illustrate the memory maps for each of the three
families comprising the M68HC11 E series of MCUs.
Operating Modes and On-Chip Memory
Memory Map
Frees
Memory locations for on-chip resources are the same for both expanded and
single-chip modes. Control bits in the configuration (CONFIG) register allow
EPROM and EEPROM (if present) to be disabled from the memory map. The RAM
is mapped to $0000 after reset. It can be placed at any 4-Kbyte boundary ($x000 )
by writing an appropriate value to the RAM and I/O map register (INIT). The 64-byte
register block is mapped to $1000 after reset and also can be placed at any 4-Kbyte
boundary ($x000) by writing an appropriate value to the INIT register. If RAM and
registers are mapped to the same boundary, the first 64 bytes of RAM will be
inaccessible.
Refer to Figure 2-7, which details the MCU register and control bit assignments.
Reset states shown are for single-chip mode only.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory35
For More Information On This Product,
Go to: www.freescale.com
Page 36
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
nc...
I
cale Semiconductor,
Frees
$0000
$1000
$B600
$D000
$FFFF
$0000
$1000
$B600
$D000
EXT
EXTEXT
EXPANDED
BOOTSTRAPSPECIAL
Figure 2-2. Memory Map for MC68HC11E0
EXT
EXTEXT
EXT
EXT
TEST
EXT
EXT
0000
512 BYTES RAM
01FF
1000
64-BYTE REGISTER BLOCK
103F
BOOT
BF00
ROM
BFFF
NORMAL
FFC0
MODES
INTERRUPT
FFFF
VECTORS
0000
512 BYTES RAM
01FF
1000
64-BYTE REGISTER BLOCK
103F
B600
512 BYTES EEPROM
B7FF
BOOT
BF00
ROM
BFFF
BFC0
BFFF
BFC0
BFFF
SPECIAL MODES
INTERRUPT
VECTORS
SPECIAL MODES
INTERRUPT
VECTORS
NORMAL
FFC0
MODES
INTERRUPT
FFFF
$FFFF
EXPANDED
BOOTSTRAPSPECIAL
TEST
VECTORS
Figure 2-3. Memory Map for MC68HC11E1
Data SheetM68HC11E Family — Rev. 5
36Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 37
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
Memory Map
nc...
I
cale Semiconductor,
Frees
$0000
$1000
$B600
$D000
$FFFF
$0000
$1000
$9000
$B600
$D000
SINGLE
CHIP
0000
EXT
EXTEXT
EXT
EXPANDED
BOOTSTRAPSPECIAL
EXT
EXT
TEST
01FF
1000
103F
B600
B7FF
BF00
BFFF
D000
FFFF
Figure 2-4. Memory Map for MC68HC(7)11E9
EXT
EXT
EXT
EXT
EXT
EXT
EXT
EXT
512 BYTES RAM
64-BYTE REGISTER BLOCK
512 BYTES EEPROM
BOOT
ROM
12 KBYTES ROM/EPROM
0000
768 BYTES RAM
02FF
1000
64-BYTE REGISTER BLOCK
103F
9000
8 KBYTES ROM/EPROM *
AFFF
B600
512 BYTES EEPROM
B7FF
BOOT
BF00
ROM
BFFF
12 KBYTES ROM/EPROM *
D000
BFC0
BFFF
FFC0
FFFF
BFC0
BFFF
SPECIAL MODES
INTERRUPT
VECTORS
NORMAL
MODES
INTERRUPT
VECTORS
SPECIAL MODES
INTERRUPT
VECTORS
NORMAL
FFC0
MODES
INTERRUPT
VECTORS
$FFFF
SINGLE
CHIP
* 20 Kbytes ROM/EPROM are contained in two segments of 8 Kbytes and 12 Kbytes each.
EXPANDED
BOOTSTRAPSPECIAL
TEST
FFFF
FFFF
Figure 2-5. Memory Map for MC68HC(7)11E20
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory37
For More Information On This Product,
Go to: www.freescale.com
Page 38
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
nc...
I
cale Semiconductor,
Frees
$0000
$1000
$F800
$FFFF
SINGLE
CHIP
EXT
EXTEXT
EXPANDED
BOOTSTRAPSPECIAL
EXT
TEST
0000
256 BYTES RAM
00FF
1000
64-BYTE REGISTER BLOCK
103F
BOOT
BF00
ROM
BFFF
2048 BYTES EEPROM
F800
FFFF
BFC0
BFFF
FFC0
FFFF
SPECIAL MODES
INTERRUPT
VECTORS
NORMAL
MODES
INTERRUPT
VECTORS
Figure 2-6. Memory Map for MC68HC811E2
Addr.Register NameBit 7654321Bit 0
Port A Data Register
$1000
$1001ReservedRRRRRRRR
Parallel I/O Control Register
$1002
Port C Data Register
$1003
Port B Data Register
$1004
(PORTA)
See page 110.
(PIOC)
See page 115.
(PORTC)
See page 111.
(PORTB)
See page 111.
Read:
Write:
Reset:I000IIII
Read:
Write:
Reset:00000U11
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:00000000
PA7PA6PA5PA4PA3PA2PA1PA0
STAFSTAICWOMHNDSOINPLSEGAINVB
PC7PC6PC5PC4PC3PC2PC1PC0
PB7PB6PB5PB4PB3PB2PB1PB0
= UnimplementedR= ReservedU = Unaffected
I = Indeterminate after reset
Figure 2-7. Register and Control Bit Assignments (Sheet 1 of 6)
Data SheetM68HC11E Family — Rev. 5
38Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 39
Freescale Semiconductor, Inc.
Addr.Register NameBit 7654321Bit 0
Port C Latched Register
$1005
$1006ReservedRRRRRRRR
(PORTCL)
See page 112.
Read:
Write:
Reset:Indeterminate after reset
Operating Modes and On-Chip Memory
Memory Map
PCL7PCL6PCL5PCL4PCL3PCL2PCL1PCL0
nc...
I
cale Semiconductor,
Frees
Port C Data Direction Register
$1007
Port D Data Register
$1008
Port D Data Direction Register
$1009
Port E Data Register
$100A
Timer Compare Force Register
$100B
Output Compare 1 Mask Register
$100C
Output Compare 1 Data Register
$100D
Timer Counter Register High
$100E
Timer Counter Register Low
$100F
Timer Input Capture 1 Register
$1010
Timer Input Capture 1 Register
$1011
(DDRC)
See page 112.
(PORTD)
See page 112.
(DDRD)
See page 113.
(PORTE)
See page 113.
(CFORC)
See page 151.
(OC1M)
See page 152.
(OC1D)
See page 152.
(TCNTH)
See page 153.
(TCNTL)
See page 153.
High (TIC1H)
See page 147.
Low (TIC1L)
See page 147.
Read:
DDRC7DDRC6DDRC5DDRC4DDRC3DDRC2DDRC1DDRC0
Write:
Reset:00000000
Read:
Write:
Reset:UUIIIIII
Read:
Write:
Reset:00000000
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read: Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Write:
Reset:00000000
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:00000000
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:Indeterminate after reset
00PD5PD4PD3PD2PD1PD0
DDRD5DDRD4DDRD3DDRD2DDRD1DDRD0
PE7PE6PE5PE4PE3PE2PE1PE0
FOC1FOC2FOC3FOC4FOC5
OC1M7OC1M6OC1M5OC1M4OC1M3
OC1D7OC1D6OC1D5OC1D4OC1D3
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
= UnimplementedR= ReservedU = Unaffected
I = Indeterminate after reset
Figure 2-7. Register and Control Bit Assignments (Sheet 2 of 6)
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory39
For More Information On This Product,
Go to: www.freescale.com
Page 40
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
Addr.Register NameBit 7654321Bit 0
Read:
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
I = Indeterminate after reset
nc...
I
cale Semiconductor,
Frees
Timer Input Capture 2 Register
$1012
TImer Input Capture 2 Register
$1013
Timer Input Capture 3 Register
$1014
Timer Input Capture 3 Register
$1015
Timer Output Compare 1 Register
$1016
Timer Output Compare 1 Register
$1017
Timer Output Compare 2 Register
$1018
Timer Output Compare 2 Register
$1019
Timer Output Compare 3 Register
$101A
Timer Output Compare 3 Register
$101B
Timer Output Compare 4 Register
$101C
Timer Output Compare 4 Register
$101D
High (TIC2H)
See page 147.
Low (TIC2L)
See page 147.
High (TIC3H)
See page 147.
Low (TIC3L)
See page 147.
High (TOC1H)
See page 149.
Low (TOC1L)
See page 149.
High (TOC2H)
See page 150.
Low (TOC2L)
See page 150.
High (TOC3H)
See page 150.
Low (TOC3L)
See page 150.
High (TOC4H)
See page 150.
Low (TOC4L)
See page 150.
= UnimplementedR= ReservedU = Unaffected
Figure 2-7. Register and Control Bit Assignments (Sheet 3 of 6)
Data SheetM68HC11E Family — Rev. 5
40Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 41
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Addr.Register NameBit 7654321Bit 0
Timer Input Capture 4/Output
$101E
$101F
$1020
$1021
$1022
$1023
$1024
$1025
$1026
$1027
$1028
$1029
Compare 5 Register High
(TI4/O5) See page 148.
Timer Input Capture 4/Output
Compare 5 Register Low
(TI4/O5) See page 148.
Timer Control Register 1
Timer Control Register 2
Timer Interrupt Mask 1 Register
Timer Interrupt Flag 1
Timer Interrupt Mask 2 Register
Timer Interrupt Flag 2
Pulse Accumulator Control
Pulse Accumulator Count
Serial Peripheral Control Register
Serial Peripheral Status Register
(TCTL1)
See page 153.
(TCTL2)
See page 146.
(TMSK1)
See page 154.
(TFLG1)
See page 154.
(TMSK2)
See page 155.
(TFLG2)
See page 158.
Register (PACTL)
See page 159.
Register (PACNT)
See page 162.
(SPCR)
See page 138.
(SPSR)
See page 139.
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:11 1 1 1 1 11
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:000001UU
Read:
Write:
Reset:00000000
Operating Modes and On-Chip Memory
Memory Map
Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
OM2OL2OM3OL3OM4OL4OM5OL5
EDG4BEDG4AEDG1BEDG1AEDG2BEDG2AEDG3BEDG3A
OC1IOC2IOC3IOC4II4/O5IIC1IIC2IIC3I
OC1FOC2FOC3FOC4FI4/O5FIC1FIC2FIC3F
TOIRTIIPAOVIPAII
TOFRTIFPAOVFPAIF
DDRA7PAENPAMODPEDGEDDRA3I4/O5RTR1RTR0
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
SPIESPEDWOMMSTRCPOLCPHASPR1SPR0
SPIFWCOL
= UnimplementedR= ReservedU = Unaffected
I = Indeterminate after reset
MODF
PR1PR0
Figure 2-7. Register and Control Bit Assignments (Sheet 4 of 6)
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory41
For More Information On This Product,
Go to: www.freescale.com
Page 42
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
Addr.Register NameBit 7654321Bit 0
Read:
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:00000UUU
Read:
Write:
Reset:II000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:11000000
Read:
Write:
Reset:Indeterminate after reset
Read:CCF
Write:
Reset:00Indeterminate after reset
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
Read:
Write:
Reset:00011111
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
TCLRSCP2
R8T8
TIETCIERIEILIETERERWUSBK
TDRETCRDRFIDLEORNFFE
R7/T7R6/T6R5/T5R4/T4R3/T3R2/T2R1/T1R0/T0
I = Indeterminate after reset
nc...
I
cale Semiconductor,
Frees
Serial Peripheral Data I/O
$102A
$102B
Serial Communications Control
$102C
Serial Communications Control
$102D
Serial Communications Status
$102E
1. SCP2 adds ÷39 to SCI prescaler and is present only in MC68HC(7)11E20.
Serial Communications Data
$102F
Analog-to-Digital Control Status
$1030
$1031
$1032
$1033
$1034
$1035
Register (SPDR)
See page 140.
Baud Rate Register
(BAUD)
See page 126.
Register 1 (SCCR1)
See page 123.
Register 2 (SCCR2)
See page 124.
Register (SCSR)
See page 125.
Register (SCDR)
See page 122.
Register (ADCTL)
See page 69.
Analog-to-Digital Results
Register 1 (ADR1)
See page 71.
Analog-to-Digital Results
Register 2 (ADR2)
See page 71.
Analog-to-Digital Results
Register 3 (ADR3)
See page 71.
Analog-to-Digital Results
Register 4 (ADR4)
See page 71.
Block Protect Register
(BPROT)
See page 58.
(1)
SCP1SCP0RCKBSCR2SCR1SCR0
MWAKE
SCANMULTCDCCCBCA
PTCONBPRT3BPRT2BPRT1BPRT0
= UnimplementedR= ReservedU = Unaffected
Figure 2-7. Register and Control Bit Assignments (Sheet 5 of 6)
Data SheetM68HC11E Family — Rev. 5
42Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 43
Freescale Semiconductor, Inc.
Addr.Register NameBit 7654321Bit 0
EPROM Programming Control
$1036
$1037ReservedRRRRRRRR
1. MC68HC711E20 only
$1038ReservedRRRRRRRR
Register (EPROG)
See page 59.
Read:
(1)
Write:
Reset:00000000
MBE
Operating Modes and On-Chip Memory
Memory Map
ELATEXCOLEXROWT1T0PGM
nc...
I
cale Semiconductor,
Frees
System Configuration Options
$1039
Arm/Reset COP Timer Circuitry
$103A
$103B
$103C
$103D
$103EReservedRRRRRRRR
$103F
$103F
1. Can be written only once in first 64 cycles out of reset in normal modes or at any time during special modes.
2. MC68HC711E9 only
3. MC68HC811E2 only
Programming Control Register
Highest Priority I Bit Interrupt and
Miscellaneous Register (HPRIO)
RAM and I/O Mapping Register
System Configuration Register
System Configuration Register
Register (OPTION)
See page 51.
Register (COPRST)
See page 91.
EPROM and EEPROM
(PPROG) See page 54.
See page 46.
See page 50.
(CONFIG)
See page 48.
(CONFIG)
See page 48.
Read:
Write:
Reset:00010000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000110
Read:
(INIT)
Write:
Reset:00000001
Read:
Write:
Reset:0000UU1U
Read:
(3)
Write:
Reset:1111UU11
ADPUCSELIRQE
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
ODDEVENELAT
RBOOTSMODMDAIRV(NE)PSEL3PSEL2PSEL1PSEL0
RAM3RAM2RAM1RAM0REG3REG2REG1REG0
EE3EE2EE1EE0NOSECNOCOP
= UnimplementedR= ReservedU = Unaffected
I = Indeterminate after reset
(1)
(2)
(1)
DLY
BYTEROWERASEEELATEPGM
CMECR1
NOSECNOCOPROMONEEON
(1)
CR0
EEON
(1)
Figure 2-7. Register and Control Bit Assignments (Sheet 6 of 6)
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory43
For More Information On This Product,
Go to: www.freescale.com
Page 44
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
2.3.1 RAM and Input/Output Mapping
Hardware priority is built into RAM and I/O mapping. Registers have priority over
RAM and RAM has priority over ROM. When a lower priority resource is mapped
at the same location as a higher priority resource, a read/write of a location results
in a read/write of the higher priority resource only. For example, if both the register
block and the RAM are mapped to the same location, only the register block will be
accessed. If RAM and ROM are located at the same position, RAM has priority.
The fully static RAM can be used to store instructions, variables, and temporary
data. The direct addressing mode can access RAM locations using a 1-byte
address operand, saving program memory space and execution time, depending
on the application.
RAM contents can be preserved during periods of processor inactivity by two
nc...
I
methods, both of which reduce power consumption. They are:
1.In the software-based stop mode, the clocks are stopped while V
the MCU. Because power supply current is directly related to operating
frequency in CMOS integrated circuits, only a very small amount of leakage
exists when the clocks are stopped.
2.In the second method, the MODB/V
battery backup or from a second power supply. Figure 2-8 shows a typical
standby voltage circuit for a standard 5-volt device. Adjustments to the
circuit must be made for devices that operate at lower voltages. Using the
MODB/V
a significant amount of external circuitry is operating from V
used to maintain RAM contents, reset must be held low whenever V
below normal operating level. Refer to Section 5. Resets and Interrupts.
STBY
cale Semiconductor,
Frees
powers
DD
pin can supply RAM power from a
STBY
pin may require external hardware, but can be justified when
. If V
4.8-V
NiCd
DD
V
DD
MAX
690
V
DD
V
OUT
V
BATT
+
4.7 k
TO MODB/V
OF M68HC11
STBY
STBY
DD
is
is
Figure 2-8. RAM Standby MODB/V
The bootloader program is contained in the internal bootstrap ROM. This ROM,
which appears as internal memory space at locations $BF00–$BFFF, is enabled
only if the MCU is reset in special bootstrap mode.
Data SheetM68HC11E Family — Rev. 5
44Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Connections
STBY
Page 45
Freescale Semiconductor, Inc.
In expanded modes, the ROM/EPROM/OTPROM (if present) is enabled out of
reset and located at the top of the memory map if the ROMON bit in the CONFIG
register is set. ROM or EPROM is enabled out of reset in single-chip and bootstrap
modes, regardless of the state of ROMON.
For devices with 512 bytes of EEPROM, the EEPROM is located at $B600–$B7FF
and has the same read cycle time as the internal ROM. The 512 bytes of EEPROM
cannot be remapped to other locations.
For the MC68HC811E2, EEPROM is located at $F800–$FFFF and can be
remapped to any 4-Kbyte boundary. EEPROM mapping control bits (EE[3:0] in
CONFIG) determine the location of the 2048 bytes of EEPROM and are present
only on the MC68HC811E2. Refer to 2.3.3.1 System Configuration Register for
a description of the MC68HC811E2 CONFIG register.
Operating Modes and On-Chip Memory
Memory Map
nc...
I
cale Semiconductor,
Frees
2.3.2 Mode Selection
EEPROM can be programmed or erased by software and an on-chip charge pump,
allowing EEPROM changes using the single V
The four mode variations are selected by the logic states of the MODA and MODB
pins during reset. The MODA and MODB logic levels determine the logic state of
SMOD and the MDA control bits in the highest priority I-bit interrupt and
miscellaneous (HPRIO) register.
After reset is released, the mode select pins no longer influence the MCU ope rating
mode. In single-chip operating mode, the MODA pin is connected to a logic level 0.
In expanded mode, MODA is normally connected to V
of 4.7 kΩ. The MODA pin also functions as the load instruction register LIR
when the MCU is not in reset. The open-drain active low LIR
during the first E cycle of each instruction. The MODB pin also functions as standby
power input (V
.
V
DD
Refer to Table 2-1, which is a summary of mode pin operation, the mode control
bits, and the four operating modes.
), which allows RAM contents to be maintained in absence of
A normal mode is selected when MODB is logic 1 during reset. One of thre e reset
vectors is fetched from address $FFFA–$FFFF, and program execution begins
from the address indicated by this vector. If MODB is logic 0 during reset, the
special mode reset vector is fetched from addresses $BFFA–$BFFF, and software
has access to special test features. Refer to Section 5. Resets and Interrupts.
Address:$103C
Bit 7654321Bit 0
Read:
Write:
Resets:
Single chip:0000 0110
Expanded:00100110
nc...
I
Bootstrap:1100 0110
Test:0111 0110
1. The reset values depend on the mode selected at the RESET pin rising edge.
RBOOT
(1)
SMOD
(1)
MDA
(1)
IRV(NE)
(1)
PSEL3PSEL2PSEL1PSEL0
cale Semiconductor,
Frees
Figure 2-9. Highest Priority I-Bit Interrupt and Miscellaneous
Register (HPRIO)
RBOOT — Read Bootstrap ROM Bit
Valid only when SMOD is set (bootstrap or special test mode); can be written
only in special modes
0 = Bootloader ROM disabled and not in map
1 = Bootloader ROM enabled and in map at $BE00–$BFFF
SMOD and MDA — Special Mode Select and Mode Select A Bits
The initial value of SMOD is the inverse of the logic level present on the MODB
pin at the rising edge of reset. The initial value of MDA equals the logic level
present on the MODA pin at the rising edge of reset. These two bits can be read
at any time. They can be written anytime in special modes. MDA can be written
only once in normal modes. SMOD cannot be set once it has been cleared.
IRVNE can be written once in any mode. In expanded modes, IRVNE
determines whether IRV is on or off. In special test mode, IRVNE is reset to 1.
In all other modes, IRVNE is reset to 0. For the MC68HC811E2, this bit is IRV
and only controls the internal read visibility function.
0 = No internal read visibility on external bus
1 = Data from internal reads is driven out the external data bus.
In single-chip modes this bit determines whether the E clock drives out from the
chip. For the MC68HC811E2, this bit has no meaning or effect in single-chip and
bootstrap modes.
0 = E is driven out from the chip.
1 = E pin is driven low. Refer to the following table.
nc...
I
cale Semiconductor,
Frees
Mode
Single chip0OnOffEOnce
Expanded0OnOffIRVOnce
Bootstrap0OnOffEOnce
Special test1OnOnIRVOnce
IRVNE Out
of Reset
E Clock Out
of Reset
IRV Out
of Reset
IRVNE
Affects Only
PSEL[3:0] — Priority Select Bits
Refer to Section 5. Resets and Interrupts.
2.3.3 System Initialization
Registers and bits that control initialization and the basic operation of the MCU are
protected against writes except under special circumstances. Table 2-2 lists
registers that can be written only once after reset or that must be written within th e
first 64 cycles after reset.
SMOD = 1$x024Timer interrupt mask 2 (TMSK2)—All, set or clear
Register
Address
$x035Block protect register (BPROT)Clear bits, once onlySet bits only
$x039System configuration options (OPTION)Bits [5:4], bits [2:0], once onlyBits [7:6], bit 3
$x03C
$x03DRAM and I/O map register (INIT)Yes, once only —
$x035Block protect register (BPROT)—All, set or clear
$x039System configuration options (OPTION)—All, set or clear
$x03C
$x03DRAM and I/O map register (INIT)—All, set or clear
Highest priority I-bit interrupt
and miscellaneous (HPRIO)
Highest priority I-bit interrupt an d
miscellaneous (HPRIO)
Register Name
Must be Written
in First 64 Cycles
See HPRIO descriptionSee HPRIO description
See HPRIO descriptionSee HPRIO description
Write
Anytime
IRVNE Can
Be Written
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory47
For More Information On This Product,
Go to: www.freescale.com
Page 48
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
2.3.3.1 System Configuration Register
The system configuration register (CONFIG) consists of an EEPROM byte and
static latches that control the startup configuration of the MCU. The contents of the
EEPROM byte are transferred into static working latches during reset sequences.
The operation of the MCU is controlled directly by these latches and not by
CONFIG itself. In normal modes, changes to CONFIG do not affect operation of the
MCU until after the next reset sequence. When programming, the CONFIG register
itself is accessed. When the CONFIG register is read, the static latches are
accessed. See 2.5.1 EEPROM and CONFIG Programming and Erasure for
information on modifying CONFIG.
To take full advantage of the MCU’s functionality, customers can program the
CONFIG register in bootstrap mode. This can be accomplished by setting the
mode pins to logic 0 and downloading a small program to internal RAM. For more
Mode has been included at the back of this document. The downloadable talker
will consist of:
cale Semiconductor,
Frees
•Bulk erase
•Byte programming
•Communication server
All of this functionality is provided by PCbug11 which can be found on the Motorola
Web site at http://www.motorola.com/semiconductors/. For more information
on using PCbug11 to program an E-series device, Motorola engineering bulletin
EB296 entitled Programming MC68HC711E9 Devices with PCbug11 and the
M68HC11EVBU has been included at the back of this document.
NOTE:The CONFIG register on the 68HC11 is an EEPROM cell and must be
programmed accordingly.
Operation of the CONFIG register in the MC68HC811E2 differs from other devices
in the M68HC11 E series. See Figure 2-10 and Figure 2-11.
Address: $103F
Bit 7654321Bit 0
Read:
Write:
Resets:
Single chip:
Bootstrap:
Expanded:
Test:
U indicates a previously programmed bit. U(L) indicates that the bit resets to the logic level held in the latch prior to reset,
but the function of COP is controlled by the DISR bit in TEST1 register.
0
0
0
0
0
0
0
0
= Unimplemented
0
0
0
0
0
0
0
0
NOSECNOCOPROMONEEON
U
U
1
1
U
U(L)
U
U(L)
1
U
U
U
U
U
U
U
Figure 2-10. System Configuration Register (CONFIG)
Data SheetM68HC11E Family — Rev. 5
48Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 49
Freescale Semiconductor, Inc.
Address:$103F
Read:
Write:
Resets:
Single chip:
Bootstrap:
Expanded:
Test:
U indicates a previously programmed bit. U(L) indicates that the bit resets to the logic level held in the latch prior to reset,
but the function of COP is controlled by the DISR bit in TEST1 register.
Operating Modes and On-Chip Memory
Memory Map
Bit 7654321Bit 0
EE3EE2EE1EE0NOSECNOCOP
1
1
U
U
1
1
U
U
= Unimplemented
1
1
U
U
1
1
U
U
U
U
1
1
U
U(L)
U
U(L)
1
1
1
1
EEON
1
1
U
0
Figure 2-11. MC68HC811E2 System Configuration Register (CONFIG)
nc...
I
EE[3:0] — EEPROM Mapping Bits
EE[3:0] apply only to MC68HC811E2 and allow the 2048 bytes of EEPROM to
be remapped to any 4-Kbyte boundary. See Table 2-3.
NOSEC is invalid unless the security mask option is specified before the MCU
is manufactured. If the security mask option is omitted NOSEC always reads 1.
The enhanced security feature is available in the MC68S711E9 MCU. The
enhancement to the standard security feature protects the EPROM as well as
RAM and EEPROM.
0 = Security enabled
1 = Security disabled
NOCOP — COP System Disable Bit
Refer to Section 5. Resets and Interrupts.
1 = COP disabled
0 = COP enabled
ROMON — ROM/EPROM/OTPROM Enable Bit
nc...
I
When this bit is 0, the ROM or EPROM is disabled and that memory space
becomes externally addressed. In single-chip mode, ROMON is forced to 1 to
enable ROM/EPROM regardless of the state of the ROMON bit.
0 = ROM disabled from the memory map
1 = ROM present in the memory map
cale Semiconductor,
Frees
EEON — EEPROM Enable Bit
When this bit is 0, the EEPROM is disabled and that memory space becomes
externally addressed.
0 = EEPROM removed from the memory map
1 = EEPROM present in the memory map
2.3.3.2 RAM and I/O Mapping Register
The internal registers used to control the operation of the MCU can be relocated
on 4-Kbyte boundaries within the memory space with the use of the RAM and I/O
mapping register (INIT). This 8-bit special-purpose register can change the default
locations of the RAM and control registers within the MCU memory map. It can be
written only once within the first 64 E-clock cycles after a reset in normal modes,
and then it becomes a read-only register.
Address: $103D
Bit 7654321Bit 0
Read:
Write:
Reset:00000001
RAM3RAM2RAM1RAM0REG3REG2REG1REG0
Figure 2-12. RAM and I/O Mapping Register (INIT)
RAM[3:0] — RAM Map Position Bits
These four bits, which specify the upper hexadecimal digit of the RAM address,
control position of RAM in the memory map. RAM can be positioned at the
beginning of any 4-Kbyte page in the memory map. It is initialized to address
$0000 out of reset. Refer to Table 2-4.
Data SheetM68HC11E Family — Rev. 5
50Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 51
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
Memory Map
REG[3:0] — 64-Byte Register Block Position
These four bits specify the upper hexadecimal digit of the address for the
64-byte block of internal registers. The register block, positioned at the
beginning of any 4-Kbyte page in the memory map, is initialized to address
$1000 out of reset. Refer to Table 2-5.
The 8-bit, special-purpose system configuration options register (OPTION) sets
cale Semiconductor,
internal system configuration options during initialization. The time protected
control bits, IRQE, DLY, and CR[1:0], can be written only once after a reset and
then they become read-only. This minimizes the possibility of any accidental
changes to the system configuration.
1. Can be written only once in first 64 cycles out of reset in normal modes or at any time during
special modes.
ADPUCSELIRQE
= Unimplemented
(1)
DLY
(1)
CMECR1
(1)
CR0
(1)
Figure 2-13. System Configuration Options Register (OPTION)
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory51
For More Information On This Product,
Go to: www.freescale.com
Page 52
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
ADPU — Analog-to-Digital Converter Power-Up Bit
Refer to Section 3. Analog-to-Digital (A/D) Converter.
CSEL — Clock Select Bit
Selects alternate clock source for on-chip EEPROM charge pump. Refer to
2.5.1 EEPROM and CONFIG Programming and Erasure for more information
on EEPROM use.
CSEL also selects the clock source for the A/D converter, a function discussed
in Section 3. Analog-to-Digital (A/D) Converter.
IRQE — Configure IRQ
Refer to Section 5. Resets and Interrupts.
DLY — Enable Oscillator Startup Delay Bit
0 = The oscillator startup delay coming out of stop mode is bypassed and the
MCU resumes processing within about four bus cycles.
nc...
I
1 = A delay of approximately 4000 E-clock cycles is imposed as the MCU is
started up from the stop power-saving mode. This delay allows the
crystal oscillator to stabilize.
CME — Clock Monitor Enable Bit
Refer to Section 5. Resets and Interrupts.
Bit 2 — Not implemented
Always reads 0
CR[1:0] — COP Timer Rate Select Bits
The internal E clock is divided by 2
These control bits determine a scaling factor for the watchdog timer. Refer to
Section 5. Resets and Interrupts.
2.4 EPROM/OTPROM
Certain devices in the M68HC11 E series include on-chip EPROM/OTPROM. For
cale Semiconductor,
instance:
•The MC68HC711E9 devices contain 12 Kbytes of on-chip EPROM
(OTPROM in non-windowed package).
for Edge-Sensitive Only Operation Bit
15
before it enters the COP watchdog system.
Frees
•The MC68HC711E20 has 20 Kbytes of EPROM (OTPROM in
non-windowed package).
•The MC68HC711E32 has 32 Kbytes of EPROM (OTPROM in
non-windowed package).
Standard MC68HC71E9 and MC68HC711E20 devices are shipped with the
EPROM/OTPROM contents erased (all 1s). The programming operation programs
zeros. Windowed devices must be erased using a suitable ultraviolet light source
before reprogramming. Depending on the light source, erasing can take from 15 to
45 minutes.
Data SheetM68HC11E Family — Rev. 5
52Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 53
Freescale Semiconductor, Inc.
Using the on-chip EPROM/OTPROM programming feature requires an external
12-volt nominal power supply (V
the EPROM/OTPROM programming register (PPROG).
PPROG is the combined EPROM/OTPROM and EEPROM programming register
on all devices with EPROM/OTPROM except the MC68HC711E20. For the
MC68HC711E20, there is a separate register for EPROM/OTPROM programming
called the EPROG register.
As described in the following subsections, these two methods of programming and
verifying EPROM are possible:
1.Programming an individual EPROM address
2.Programming the EPROM with downloaded data
Operating Modes and On-Chip Memory
EPROM/OTPROM
). Normal programming is accomplished using
PPE
nc...
I
cale Semiconductor,
Frees
2.4.1 Programming an Individual EPROM Address
In this method, the MCU programs its own EPROM by controlling the PPROG
register (EPROG in MC68HC711E20). Use these procedures to program the
EPROM through the MCU with:
•The ROMON bit set in the CONFIG register
•The 12-volt nominal programming voltage present on the XIRQ
•The IRQ
NOTE:Any operating mode can be used.
This example applies to all devices with EPROM/OTPROM except for the
MC68HC711E20.
EPROGLDAB #$20
pin must be pulled high.
STAB$103BSet ELAT bit in (EPGM = 0) to enable
STAA$0,XStore data to EPROM address
LDAB#$21
STAB$103BSet EPGM bit with ELAT = 1 to enable
JSRDLYEPDelay 2–4 ms
CLR$103BTurn off programming voltage and set
EPROM latches.
EPROM programming voltage
to READ mode
/V
PPE
pin
This example applies only to MC68HC711E20.
EPROGLDAB#$20
STAB$1036Set ELAT bit (EPGM = 0) to enable
STAA$0,XStore data to EPROM address
LDAB#$21
STAB$1036Set EPGM bit with ELAT = 1 to enable
JSRDLYEPDelay 2–4 ms
CLR$1036Turn off programming voltage and set
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory53
For More Information On This Product,
Go to: www.freescale.com
EPROM latches.
EPROM programming voltage
to READ mode
Page 54
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
2.4.2 Programming the EPROM with Downloaded Data
When using this method, the EPROM is programmed by software while in the
special test or bootstrap modes. User-developed software can be uploaded
through the SCI or a ROM-resident EPROM programming utility can be used. The
12-volt nominal programming voltage must be present on the XIRQ
use the resident utility, bootload a 3-byte program consisting of a single jump
instruction to $BF00. $BF00 is the starting address of a resident EPROM
programming utility. The utility program sets the X and Y index registers to default
values, then receives programming data from an external host, and puts it in
EPROM. The value in IX determines programming delay time. The value in IY is a
pointer to the first address in EPROM to be programmed (default = $D000).
When the utility program is ready to receive programming data, it sends the host
the $FF character. Then it waits. When the host sees the $FF character, the
nc...
I
EPROM programming data is sent, starting with the first location in the EPROM
array. After the last byte to be programmed is sent and the corresponding
verification data is returned, the programming operation is terminated by resetting
the MCU.
/V
PPE
pin. To
cale Semiconductor,
Frees
For more information, Motorola application note AN1060 entitled M68HC11
Bootstrap Mode has been included at the back of this document.
2.4.3 EPROM and EEPROM Programming Control Register
The EPROM and EEPROM programming control register (PPROG) enables the
EPROM programming voltage and controls the latching of data to be programmed.
•For MC68HC711E9, PPROG is also the EEPROM programming control
register.
•For the MC68HC711E20, EPROM programming is controlled by the
EPROG register and EEPROM programming is controlled by the PPROG
register.
Address: $103B
Bit 7654321Bit 0
Read:
Write:
Reset:00000000
1. MC68HC711E9 only
ODDEVENELAT
Figure 2-14. EPROM and EEPROM Programming
Control Register (PPROG)
(1)
BYTEROWERASEEELATEPGM
ODD — Program Odd Rows in Half of EEPROM (Test) Bit
Refer to 2.5 EEPROM.
EVEN — Program Even Rows in Half of EEPROM (Test) Bit
Refer to 2.5 EEPROM.
Data SheetM68HC11E Family — Rev. 5
54Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 55
Freescale Semiconductor, Inc.
ELAT — EPROM/OTPROM Latch Control Bit
When ELAT = 1, writes to EPROM cause address and data to be latched and
the EPROM/OTPROM cannot be read. ELAT can be read any time. ELAT can
be written any time except when EPGM = 1; then the write to ELAT is disabled.
0 = EPROM address and data bus configured for normal reads
1 = EPROM address and data bus configured for programming
For the MC68HC711E9:
a.EPGM enables the high voltage necessary for both EEPROM and
b.ELAT and EELAT are mutually exclusive and cannot both equal 1.
BYTE — Byte/Other EEPROM Erase Mode Bit
Refer to 2.5 EEPROM.
ROW — Row/All EEPROM Erase Mode Bit
nc...
I
Refer to 2.5 EEPROM.
ERASE — Erase Mode Select Bit
Refer to 2.5 EEPROM.
Operating Modes and On-Chip Memory
EPROM/OTPROM
EPROM/OTPROM programming.
cale Semiconductor,
Frees
EELAT — EEPROM Latch Control Bit
Refer to 2.5 EEPROM.
EPGM —EPROM/OTPROM/EEPROM Programming Voltage Enable Bit
EPGM can be read any time and can be written only when ELAT = 1 (for
EPROM/OTPROM programming) or when EELAT = 1 (for EEPROM
programming).
0 = Programming voltage to EPROM/OTPROM/EEPROM array
disconnected
1 = Programming voltage to EPROM/OTPROM/EEPROM array connected
Address: $1036
Bit 7654321Bit 0
Read:
Write:
Reset:00000000
MBE — Multiple-Byte Programming Enable Bit
When multiple-byte programming is enabled, address bit 5 is considered a don’t
care so that bytes with address bit 5 = 0 and address bit 5 = 1 both get
programmed. MBE can be read in any mode and always reads 0 in normal
modes. MBE can be written only in special modes.
0 = EPROM array configured for normal programming
1 = Program two bytes with the same data
MBE
= Unimplemented
Figure 2-15. MC68HC711E20 EPROM Programming
ELATEXCOLEXROWT1T0PGM
Control Register (EPROG)
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory55
For More Information On This Product,
Go to: www.freescale.com
Page 56
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
Bit 6 — Unimplemented
Always reads 0
ELAT — EPROM/OTPROM Latch Control Bit
When ELAT = 1, writes to EPROM cause address and data to be latched and
the EPROM/OTPROM cannot be read. ELAT can be read any time. ELAT can
be written any time except when PGM = 1; then the write to ELAT is disabled.
0 = EPROM/OTPROM address and data bus configured for normal reads
1 = EPROM/OTPROM address and data bus configured for programming
EXCOL — Select Extra Columns Bit
0 = User array selected
1 = User array is disabled and extra columns are accessed at bits [7:0].
Addresses use bits [13:5] and bits [4:0] are don’t care. EXCOL can be
read and written only in special modes and always returns 0 in normal
nc...
I
EXROW — Select Extra Rows Bit
modes.
0 = User array selected
1 = User array is disabled and two extra rows are available. Addresses use
bits [7:0] and bits [13:8] are don’t care. EXROW can be read and written
only in special modes and always returns 0 in normal modes.
cale Semiconductor,
Frees
T[1:0] — EPROM Test Mode Select Bits
These bits allow selection of either gate stress or drain stress test modes. They
can be read and written only in special modes and always read 0 in normal
modes.
PGM can be read any time and can be written only when ELAT = 1.
0 = Programming voltage to EPROM array disconnected
1 = Programming voltage to EPROM array connected
Data SheetM68HC11E Family — Rev. 5
56Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 57
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
EEPROM
2.5 EEPROM
Some E-series devices contain 512 bytes of on-chip EEPROM. The
MC68HC811E2 contains 2048 bytes of EEPROM with selectable base address. All
E-series devices contain the EEPROM-based CONFIG register.
2.5.1 EEPROM and CONFIG Programming and Erasure
The erased state of an EEPROM bit is 1. During a read operation, bit lines are
precharged to 1. The floating gate devices of programmed bits conduct and pull the
bit lines to 0. Unprogrammed bits remain at the precharged level and are read as
ones. Programming a bit to 1 causes no change. Programming a bit to 0 changes
the bit so that subsequent reads return 0.
When appropriate bits in the BPROT register are cleared, the PPROG register
nc...
I
controls programming and erasing the EEPROM. The PPROG register can be read
or written at any time, but logic enforces defined programming and erasing
sequences to prevent unintentional changes to EEPROM data. When the EELAT
bit in the PPROG register is cleared, the EEPROM can be read as if it were a ROM.
cale Semiconductor,
Frees
The on-chip charge pump that generates the EEPROM programming voltage from
uses MOS capacitors, which are relatively small in value. The efficiency of this
V
DD
charge pump and its drive capability are affected by the level of V
frequency of the driving clock. The load depends on the number of bits being
programmed or erased and capacitances in the EEPROM array.
The clock source driving the charge pump is software selectable. When the clock
select (CSEL) bit in the OPTION register is 0, the E clock is used; when CSEL is 1,
an on-chip resistor-capacitor (RC) oscillator is used.
The EEPROM programming voltage power supply voltage to the EEPROM array
is not enabled until there has been a write to PPROG with EELAT set and PGM
cleared. This must be followed by a write to a valid EEPROM location or to the
CONFIG address, and then a write to PPROG with both the EELAT and EPGM bits
set. Any attempt to set both EELAT and EPGM during the same write operation
results in neither bit being set.
2.5.1.1 Block Protect Register
This register prevents inadvertent writes to both the CONFIG register and
EEPROM. The active bits in this register are initialized to 1 out of reset and can be
cleared only during the first 64 E-clock cycles after reset in the normal modes.
When these bits are cleared, the associated EEPROM section and the CONFIG
register can be programmed or erased. EEPROM is only visible if the EEON bit in
the CONFIG register is set. The bits in the BPROT register can be written to 1 at
any time to protect EEPROM and the CONFIG register. In test or bootstrap modes,
write protection is inhibited and BPROT can be written repeatedly. Address ranges
for protected areas of EEPROM differ significantly for the MC68HC811E2. Refer to
Figure 2-16.
and the
DD
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory57
For More Information On This Product,
Go to: www.freescale.com
Page 58
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
Address: $1035
Bit 7654321Bit 0
Read:
Write:
Reset:00011111
Figure 2-16. Block Protect Register (BPROT)
Bits [7:5] — Unimplemented
Always read 0
PTCON — Protect CONFIG Register Bit
0 = CONFIG register can be programmed or erased normally.
1 = CONFIG register cannot be programmed or erased.
nc...
I
BPRT[3:0] — Block Protect Bits for EEPROM
When set, these bits protect a block of EEPROM from being programmed or
electronically erased. Ultraviolet light, however, can erase the entire
EEPROM contents regardless of BPRT[3:0] (windowed packages only). Refer
to Table 2-6 and Table 2-7.
PTCONBPRT3BPRT2BPRT1BPRT0
= Unimplemented
cale Semiconductor,
Frees
When cleared, BPRT[3:0] allow programming and erasure of the associated
block.
Table 2-7. EEPROM Block Protect in MC68HC811E2 MCUs
Bit NameBlock ProtectedBlock Size
BPRT0
BPRT1
BPRT2
BPRT3
1. x is determined by the value of EE[3:0] in CONFIG register. Refer to Figure 2-13.
2.5.1.2 EPROM and EEPROM Programming Control Register
$x800–$x9FF
$xA00–$xBFF
$xC00–$xDFF
$xE00–$xFFF
(1)
(1)
(1)
(1)
512 bytes
512 bytes
512 bytes
512 bytes
The EPROM and EEPROM programming control register (PPROG) selects and
controls the EEPROM programming function. Bits in PPROG enable the
programming voltage, control the latching of data to be programmed, and select
the method of erasure (for example, byte, row, etc.).
Data SheetM68HC11E Family — Rev. 5
58Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 59
Freescale Semiconductor, Inc.
Address: $103B
Read:
Write:
Reset:0
1. MC68HC711E9 only
ODD — Program Odd Rows in Half of EEPROM (Test) Bit
EVEN — Program Even Rows in Half of EEPROM (Test) Bit
ELAT — EPROM/OTPROM Latch Control Bit
nc...
I
For the MC68HC711E9, EPGM enables the high voltage necessary for both
EPROM/OTPROM and EEPROM programming.
For MC68HC711E9, ELAT and EELAT are mutually exclusive and cannot both
equal 1.
0 = EPROM address and data bus configured for normal reads
1 = EPROM address and data bus configured for programming
0 = EEPROM address and data bus configured for normal reads and cannot
be programmed
1 = EEPROM address and data bus configured for programming or erasing
and cannot be read
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory59
For More Information On This Product,
Go to: www.freescale.com
Page 60
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
EPGM — EPROM/OTPROM/EEPROM Programming Voltage Enable Bit
0 = Programming voltage to EEPROM array switched off
1 = Programming voltage to EEPROM array switched on
During EEPROM programming, the ROW and BYTE bits of PPROG are not used.
If the frequency of the E clock is 1 MHz or less, set the CSEL bit in the OPTION
register. Recall that 0s must be erased by a separate erase operation before
programming. The following examples of how to program an EEPROM byte
assume that the appropriate bits in BPROT are cleared.
PROG LDAB#$02EELAT = 1
STAB$103BSet EELAT bit
STAA$XXXXStore data to EEPROM address
LDAB#$03EELAT = 1, EPGM = 1
nc...
I
STAB$103BTurn on programming voltage
JSRDLY10Delay 10 ms
CLR$103BTurn off high voltage and set
(for valid EEPROM address see memory
map for each device)
to READ mode
cale Semiconductor,
Frees
2.5.1.3 EEPROM Bulk Erase
This is an example of how to bulk erase the entire EEPROM. The CONFIG register
is not affected in this example.
BULKELDAB#$06EELAT = 1, ERASE = 1
2.5.1.4 EEPROM Row Erase
This example shows how to perform a fast erase of large sections of EEPROM.
ROWELDAB#$0EROW = 1, ERASE = 1, EELAT = 1
STAB$103BSet to BULK erase mode
STAA$XXXXStore data to any EEPROM address (for
valid EEPROM address see memory map
for each device)
LDAB#$07EELAT = 1, EPGM = 1, ERASE = 1
STAB$103BTurn on high voltage
JSRDLY10Delay 10 ms
CLR$103BTurn off high voltage and set
to READ mode
STAB$103BSet to ROW erase mode
STAB0,XWrite any data to any address in ROW
LDAB#$0FROW = 1, ERASE = 1, EELAT = 1, EPGM = 1
STAB$103BTurn on high voltage
JSRDLY10Delay 10 ms
CLR$103BTurn off high voltage and set
to READ mode
Data SheetM68HC11E Family — Rev. 5
60Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 61
Freescale Semiconductor, Inc.
2.5.1.5 EEPROM Byte Erase
This is an example of how to erase a single byte of EEPROM.
BYTEE LDAB#$16BYTE = 1, ERASE = 1, EELAT = 1
2.5.1.6 CONFIG Register Programming
STAB$103BSet to BYTE erase mode
STAB0,XWrite any data to address to be erased
LDAB#$17BYTE = 1, ERASE = 1, EELAT = 1,
STAB$103BTurn on high voltage
JSRDLY10Delay 10 ms
CLR$103BTurn off high voltage and set
Operating Modes and On-Chip Memory
EEPROM
EPGM = 1
to READ mode
nc...
I
cale Semiconductor,
Frees
Because the CONFIG register is implemented with EEPROM cells, use EEPROM
procedures to erase and program this register. The procedure for programming is
the same as for programming a byte in the EEPROM array, except that the
CONFIG register address is used. CONFIG can be programmed or erased
(including byte erase) while the MCU is operating in any mode, provided that
PTCON in BPROT is clear.
To change the value in the CONFIG register, complete this procedure.
NOTE:Do not initiate a reset until the procedure is complete.
2.5.2 EEPROM Security
The optional security feature, available only on ROM-based MCUs, protects the
EEPROM and RAM contents from unauthorized access. A program, or a key
portion of a program, can be protected against unauthorized duplication. To
accomplish this, the protection mechanism restricts operation of protected devices
to the single-chip modes. This prevents the memory locations from being
monitored externally because single-chip modes do not allow visibility of the
internal address and data buses. Resident programs, however, have unlimited
access to the internal EEPROM and RAM and can read, write, or transfer the
contents of these memories.
1.Erase the CONFIG register.
2.Program the new value to the CONFIG address.
3.Initiate reset.
An enhanced security feature which protects EPROM contents, RAM, and
EEPROM from unauthorized accesses is available in MC68S711E9. Refer to
Section 11. Ordering Information and Mechanical Specifications for the exact
part number.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAOperating Modes and On-Chip Memory61
For More Information On This Product,
Go to: www.freescale.com
Page 62
Freescale Semiconductor, Inc.
Operating Modes and On-Chip Memory
For further information, these engineering bulletins have been included at the back
of this data book:
•EB183 — Enabling the Security Feature on the MC68HC711E9 Devices
with PCbug11 on the M68HC711E9PGMR
•EB188 — Enabling the Security Feature on M68HC811E2 Devices with
PCbug11 on the M68HC711E9PGMR
nc...
I
cale Semiconductor,
Frees
Data SheetM68HC11E Family — Rev. 5
62Operating Modes and On-Chip MemoryMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 63
Freescale Semiconductor, Inc.
Data Sheet — M68HC11E Family
3.1 Introduction
The analog-to-digital (A/D) system, a successive approximation converter, uses an
all-capacitive charge redistribution technique to convert analog signals to digital
values.
Section 3. Analog-to-Digital (A/D) Converter
nc...
I
cale Semiconductor,
Frees
3.2 Overview
3.2.1 Multiplexer
The A/D system is an 8-channel, 8-bit, multiplexed-input converter. The converte r
does not require external sample and hold circuits because of the type of charge
redistribution technique used. A/D converter timing can be synchronized to the
system E clock or to an internal resistor capacitor (RC) oscillator.
The A/D converter system consists of four functional blocks: multiplexer, analog
converter, digital control, and result storage. Refer to Figure 3-1.
The multiplexer selects one of 16 inputs for conversion. Input selection is controlled
by the value of bits CD:CA in the ADCTL register. The eight port E pins are
fixed-direction analog inputs to the multiplexer, and additional internal analog
signal lines are routed to it.
Port E pins also can be used as digital inputs. Digital reads of port E pins are not
recommended during the sample portion of an A/D conversion cycle, when the
gate signal to the N-channel input gate is on. Because no P-channel devices are
directly connected to either input pins or reference voltage pins, voltages above
do not cause a latchup problem, although current should be limited according
V
DD
to maximum ratings. Refer to Figure 3-2, which is a functional diagram of an
input pin.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAAnalog-to-Digital (A/D) Converter63
For More Information On This Product,
Go to: www.freescale.com
Page 64
Freescale Semiconductor, Inc.
Analog-to-Digital (A/D) Converter
nc...
I
cale Semiconductor,
Frees
PE0
AN0
PE1
AN1
PE2
AN2
PE3
AN3
PE4
AN4
PE5
AN5
PE6
AN6
PE7
AN7
ANALOG
INPUT
PIN
8-BIT CAPACITIVE DAC
WITH SAMPLE AND HOLD
SUCCESSIVE APPROXIMATION
REGISTER AND CONTROL
ANALOG
MUX
ADR1 A/D RESULT 1ADR2 A/D RESULT 2ADR3 A/D RESULT 3ADR4 A/D RESULT 4
RESULT
RESULT REGISTER INTERFACE
CCF
SCAN
MULTCDCCCBCA
ADCTL A/D CONTROL
Figure 3-1. A/D Converter Block Diagram
DIFFUSION/POLY
COUPLER
< 2 pF
INPUT
PROTECTION
DEVICE
+ ~20 V
– ~0.7 V
+ ~12V
– ~0.7V
DUMMY N-CHANNEL
OUTPUT DEVICE
ð 4 kΩ
400 nA
JUNCTION
LEAKAGE
*
~ 20 pF
CAPACITANCE
V
RL
V
RH
V
Rl
INTERNAL
DATA BU S
DAC
* THIS ANALOG SWITCH IS CLOSED ONLY DURING THE 12-CYCLE SAMPLE TIME.
Figure 3-2. Electrical Model of an A/D Input Pin (Sample Mode)
Data SheetM68HC11E Family — Rev. 5
64Analog-to-Digital (A/D) ConverterMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 65
Freescale Semiconductor, Inc.
3.2.2 Analog Converter
Conversion of an analog input selected by the multiplexer occurs in this block. It
contains a digital-to-analog capacitor (DAC) array, a comparator, and a successive
approximation register (SAR). Each conversion is a sequence of eight comparison
operations, beginning with the most significant bit (MSB). Each comparison
determines the value of a bit in the successive approximation register.
The DAC array performs two functions. It acts as a sample and hold circuit during
the entire conversion sequence and provides comparison voltage to the
comparator during each successive comparison.
The result of each successive comparison is stored in the SAR. When a conversion
sequence is complete, the contents of the SAR are transferred to the appropriate
result register.
nc...
I
A charge pump provides switching voltage to the gates of analog switches in the
multiplexer. Charge pump output must stabilize between 7 and 8 volts within up to
100 µs before the converter can be used. The charge pump is enabled by the
ADPU bit in the OPTION register.
Analog-to-Digital (A/D) Converter
Overview
cale Semiconductor,
Frees
3.2.3 Digital Control
All A/D converter operations are controlled by bits in register ADCTL. In addition to
selecting the analog input to be converted, ADCTL bits indicate conversion status
and control whether single or continuous conversions are performed. Finally, the
ADCTL bits determine whether conversions are performed on single or multiple
channels.
3.2.4 Result Registers
Four 8-bit registers ADR[4:1] store conversion results. Each of these registers can
be accessed by the processor in the CPU. The conversion complete flag (CCF)
indicates when valid data is present in the result registers. The result registers are
written during a portion of the system clock cycle when reads do not occur, so there
is no conflict.
3.2.5 A/D Converter Clocks
The CSEL bit in the OPTION register selects whether the A/D converter uses the
system E clock or an internal RC oscillator for synchronization. When E-clock
frequency is below 750 kHz, charge leakage in the capacitor array can cause
errors, and the internal oscillator should be used. When the RC clock is used,
additional errors can occur because the comparator is sensitive to the additional
system clock noise.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAAnalog-to-Digital (A/D) Converter65
For More Information On This Product,
Go to: www.freescale.com
Page 66
Freescale Semiconductor, Inc.
Analog-to-Digital (A/D) Converter
3.2.6 Conversion Sequence
A/D converter operations are performed in sequences of four conversions each. A
conversion sequence can repeat continuously or stop after one iteration. The
conversion complete flag (CCF) is set after the fourth conversion in a sequence to
show the availability of data in the result registers. Figure 3-3 shows the timing of
a typical sequence. Synchronization is referenced to the system E clock.
E CLOCK
nc...
I
cale Semiconductor,
Frees
12 E CYCLES
SAMPLE ANALOG INPUTSUCCESSIVE APPROXIMATION SEQUENCE
WRITE TO ADCTL
CONVERT FIRST
CHANNEL, UPDATE
0326496128 — E CYCLES
ADR1
CONVERT SECOND
CHANNEL, UPDATE
MSB
CYCLES
ADR2
BIT 6
4
CYC
2
Figure 3-3. A/D Conversion Sequence
3.3 A/D Converter Power-Up and Clock Select
Bit 7 of the OPTION register controls A/D converter power-up. Clearing ADPU
removes power from and disables the A/D converter system. Setting ADPU
enables the A/D converter system. Stabilization of the analog bias voltages
requires a delay of as much as 100 µs after turning on the A/D converter. When the
A/D converter system is operating with the MCU E clock, all switching and
comparator operations are inherently synchronized to the main MCU clocks. This
allows the comparator output to be sampled at relatively quiet times during MCU
clock cycles. Since the internal RC oscillator is asynchronous to the MCU clock,
there is more error attributable to internal system clock noise. A/D converter
accuracy is reduced slightly while the internal RC oscillator is being used
(CSEL = 1).
Address: $1039
Bit 7654321Bit 0
Read:
Write:
Reset:00010000
1. Can be written only once in first 64 cycles out of reset in normal modes or at any time in special modes
ADPUCSELIRQE
= Unimplemented
BIT 5
BIT 4
2
CYC
ADR3
DLY
BIT 3
CYC
2
(1)
2
CYC
CONVERT THIRD
CHANNEL, UPDATE
(1)
BIT 2
BIT 1
LSB
2
2
CYC
CYC
CONVERT FOURTH
CHANNEL, UPDATE
CMECR1
2
CYC
ADR4
2
CYC
END
SET CC FLAG
REPEAT SEQUENCE, SCAN = 1
(1)
CR0
(1)
Figure 3-4. System Configuration Options Register (OPTION)
Data SheetM68HC11E Family — Rev. 5
66Analog-to-Digital (A/D) ConverterMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 67
Freescale Semiconductor, Inc.
ADPU — A/D Power-Up Bit
0 = A/D powered down
1 = A/D powered up
CSEL — Clock Select Bit
0 = A/D and EEPROM use system E clock.
1 = A/D and EEPROM use internal RC clock.
Analog-to-Digital (A/D) Converter
Conversion Process
nc...
I
cale Semiconductor,
Frees
IRQE — Configure IRQ
Refer to Section 5. Resets and Interrupts.
DLY — Enable Oscillator Startup Delay Bit
0 = The oscillator startup delay coming out of stop is bypassed and the MCU
1 = A delay of approximately 4000 E-clock cycles is imposed as the MCU is
CME — Clock Monitor Enable Bit
Refer to Section 5. Resets and Interrupts.
Bit 2 — Not implemented
Always reads 0
CR[1:0] — COP Timer Rate Select Bits
Refer to Section 5. Resets and Interrupts and Section 9. Timing System.
3.4 Conversion Process
The A/D conversion sequence begins one E-clock cycle after a write to the A/D
control/status register, ADCTL. The bits in ADCTL select the channel and the mode
of conversion.
An input voltage equal to V
converts to $FF (full scale), with no overflow indication. For ratiometric conversions
of this type, the source of each analog input should use V
and be referenced to V
3.5 Channel Assignments
The multiplexer allows the A/D converter to select one of 16 analog signals. Eight
of these channels correspond to port E input lines to the MCU, four of the channels
are internal reference points or test functions, and four channels are reserved.
Refer to Table 3-1.
for Edge-Sensitive Only Operation
resumes processing within about four bus cycles.
started up from the stop power-saving mode. This delay allows the
1.When SCAN = 0, the single selected channel is converted four consecutive
times. The first result is stored in A/D result register 1 (ADR1), an d the fourth
result is stored in ADR4. After the fourth conversion is complete, all
conversion activity is halted until a new conversion command is written to
the ADCTL register.
2.When SCAN = 1, conversions continue to be performed on the selected
cale Semiconductor,
channel with the fifth conversion being stored in register ADR1 (overwriting
the first conversion result), the sixth conversion overwriting ADR2, and so
on.
Channel
Signal
(1)
V
RH
(1)
V
RL
)/2
(V
RH
Reserved
(1)
(1)
Result in ADRx
if MULT = 1
ADR1
ADR2
ADR3
ADR4
Frees
3.7 Multiple-Channel Operation
The two types of multiple-channel operation are:
1.When SCAN = 0, a selected group of four channels is converted one time
each. The first result is stored in A/D result register 1 (ADR1), and the fourth
result is stored in ADR4. After the fourth conversion is complete, all
conversion activity is halted until a new conversion command is written to
the ADCTL register.
2.When SCAN = 1, conversions continue to be performed on the selected
group of channels with the fifth conversion being stored in register ADR1
(replacing the earlier conversion result for the first channel in the group), the
sixth conversion overwriting ADR2, and so on.
Data SheetM68HC11E Family — Rev. 5
68Analog-to-Digital (A/D) ConverterMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 69
Freescale Semiconductor, Inc.
Analog-to-Digital (A/D) Converter
Operation in Stop and Wait Modes
3.8 Operation in Stop and Wait Modes
If a conversion sequence is in progress when either the stop or wait mode is
entered, the conversion of the current channel is suspended. When the MCU
resumes normal operation, that channel is resampled and the conversion
sequence is resumed. As the MCU exits wait mode, the A/D circuits are stable and
valid results can be obtained on the first conversion. However, in stop mode, all
analog bias currents are disabled and it is necessary to allow a stabilization period
when leaving stop mode. If stop mode is exited with a delay (DLY = 1), there is
enough time for these circuits to stabilize before the first conversion. If stop mode
is exited with no delay (DLY bit in OPTION register = 0), allow 10 ms for the A/D
circuitry to stabilize to avoid invalid results.
3.9 A/D Control/Status Register
nc...
I
All bits in this register can be read or written, except bit 7, which is a read-only
status indicator, and bit 6, which always reads as 0. Write to ADCTL to initiate a
conversion. To quit a conversion in progress, write to this register and a new
conversion sequence begins immediately.
cale Semiconductor,
Frees
Address: $1030
Bit 7654321Bit 0
Read:CCF
Write:
Reset:00Indeterminate after reset
= Unimplemented
Figure 3-5. A/D Control/Status Register (ADCTL)
CCF — Conversion Complete Flag
A read-only status indicator, this bit is set when all four A/D result registers
contain valid conversion results. Each time the ADCTL register is overwritten,
this bit is automatically cleared to 0 and a conversion sequence is started. In the
continuous mode, CCF is set at the end of the first conversion sequence.
Bit 6 — Unimplemented
Always reads 0
SCAN — Continuous Scan Control Bit
When this control bit is clear, the four requested conversions are performed
once to fill the four result registers. When this control bit is set, conversions are
performed continuously with the result registers updated as data becomes
available.
SCANMULTCDCCCBCA
MULT — Multiple Channel/Single Channel Control Bit
When this bit is clear, the A/D converter system is configured to perform four
consecutive conversions on the single channel specified by the four channel
select bits CD:CA (bits [3:0] of the ADCTL register). When this bit is set, the A/D
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAAnalog-to-Digital (A/D) Converter69
For More Information On This Product,
Go to: www.freescale.com
Page 70
Freescale Semiconductor, Inc.
Analog-to-Digital (A/D) Converter
system is configured to perform a conversion on each of four channels where
each result register corresponds to one channel.
NOTE:When the multiple-channel continuous scan mode is used, extra care is needed in
the design of circuitry driving the A/D inputs. The charge on the capacitive DAC
array before the sample time is related to the voltage on the previously converted
channel. A charge share situation exists between the internal DAC capacitance
and the external circuit capacitance. Although the amount of charge involved is
small, the rate at which it is repeated is every 64 µs for an E clock of 2 MHz. The
RC charging rate of the external circuit must be balanced against this charge
sharing effect to avoid errors in accuracy. Refer to M68HC11 Reference Manual,
Motorola document order number M68HC11RM/AD, for further information.
CD:CA — Channel Selects D:A Bits
Refer to Table 3-2. When a multiple channel mode is selected (MULT = 1), the
nc...
I
two least significant channel select bits (CB and CA) have no meaning and the
CD and CC bits specify which group of four channels is to be converted.
These read-only registers hold an 8-bit conversion result. Writes to these registers
have no effect. Data in the A/D converter result registers is valid when the CCF flag
in the ADCTL register is set, indicating a conversion sequence is complete. If
conversion results are needed sooner, refer to Figure 3-3, which shows the A/D
conversion sequence diagram.
Register name: Analog-to-Digital Converter Result Register 1Address: $1031
Bit 7654321Bit 0
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
nc...
I
cale Semiconductor,
Register name: Analog-to-Digital Converter Result Register 2Address: $1032
Bit 7654321Bit 0
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
Register name: Analog-to-Digital Converter Result Register 3Address: $1033
Bit 7654321Bit 0
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
Register name: Analog-to-Digital Converter Result Register 4Address: $1034
Bit 7654321Bit 0
Read:Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Write:
Reset:Indeterminate after reset
= Unimplemented
Figure 3-6. Analog-to-Digital Converter
Result Registers (ADR1–ADR4)
Frees
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAAnalog-to-Digital (A/D) Converter71
For More Information On This Product,
Go to: www.freescale.com
Page 72
Freescale Semiconductor, Inc.
Analog-to-Digital (A/D) Converter
nc...
I
cale Semiconductor,
Frees
Data SheetM68HC11E Family — Rev. 5
72Analog-to-Digital (A/D) ConverterMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 73
Freescale Semiconductor, Inc.
Data Sheet — M68HC11E Family
4.1 Introduction
Features of the M68HC11 Family include:
•Central processor unit (CPU) architecture
•Data types
Section 4. Central Processor Unit (CPU)
nc...
I
cale Semiconductor,
Frees
4.2 CPU Registers
•Addressing modes
•Instruction set
•Special operations such as subroutine calls and interrupts
The CPU is designed to treat all peripheral, input/output (I/O), and memory
locations identically as addresses in the 64-Kbyte memory map. This is referred to
as memory-mapped I/O. There are no special instructions for I/O that are separate
from those used for memory. This architecture also allows accessing an operand
from an external memory location with no execution time penalty.
M68HC11 CPU registers are an integral part of the CPU and are not addressed as
if they were memory locations. The seven registers, discussed in the following
paragraphs, are shown in Figure 4-1.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)73
For More Information On This Product,
Go to: www.freescale.com
Page 74
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
nc...
I
cale Semiconductor,
Frees
7070
150
4.2.1 Accumulators A, B, and D
AB
Accumulators A and B are general-purpose 8-bit registers that hold operands and
results of arithmetic calculations or data manipulations. For some instructions,
these two accumulators are treated as a single double-byte (16-bit) accumulator
called accumulator D. Although most instructions can use accumulators A or B
interchangeably, these exceptions apply:
•The ABX and ABY instructions add the contents of 8-bit accumulator B to
the contents of 16-bit register X or Y, but there are no equivalent instructions
that use A instead of B.
•The TAP and TPA instructions transfer data from accumulator A to the
condition code register or from the condition code register to accumulator A.
However, there are no equivalent instructions that use B rather than A.
8-BIT ACCUMULATORS A & B
D
IX
IY
SP
PC
70
Figure 4-1. Programming Model
OR 16-BIT DOUBLE ACCUMULATOR D
INDEX REGISTER X
INDEX REGISTER Y
STACK POINTER
PROGRAM COUNTER
CONDITION CODES
CVZNIHXS
CARRY/BORROW FROM MSB
OVERFLOW
ZERO
NEGATIVE
I-INTERRUPT MASK
HALF CARRY (FROM BIT 3)
X-INTERRUPT MASK
STOP DISABLE
•The decimal adjust accumulator A (DAA) instruction is used after
binary-coded decimal (BCD) arithmetic operations, but there is no
equivalent BCD instruction to adjust accumulator B.
•The add, subtract, and compare instructions associated with both A and B
(ABA, SBA, and CBA) only operate in one direction, making it important to
plan ahead to ensure that the correct operand is in the correct accumulator.
Data SheetM68HC11E Family — Rev. 5
74Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 75
4.2.2 Index Register X (IX)
The IX register provides a 16-bit indexing value that can be added to the 8-bit offset
provided in an instruction to create an effective address. The IX register can also
be used as a counter or as a temporary storage register.
4.2.3 Index Register Y (IY)
The 16-bit IY register performs an indexed mode function similar to that of the IX
register. However, most instructions using the IY register require an extra byte of
machine code and an extra cycle of execution time because of the way the opcode
map is implemented. Refer to 4.4 Opcodes and Operands for further information.
4.2.4 Stack Pointer (SP)
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
CPU Registers
nc...
I
cale Semiconductor,
Frees
The M68HC11 CPU has an automatic program stack. This stack can be located
anywhere in the address space and can be any size up to the amount of memory
available in the system. Normally, the SP is initialized by one of the first instructions
in an application program. The stack is configured as a data structure that grows
downward from high memory to low memory. Each time a new byte is pushed onto
the stack, the SP is decremented. Each time a byte is pulled from the stack, the SP
is incremented. At any given time, the SP holds the 16-bit address of the next free
location in the stack. Figure 4-2 is a summary of SP operations.
When a subroutine is called by a jump-to-subroutine (JSR) or branch-tosubroutine (BSR) instruction, the address of the instruction after the JSR or BSR
is automatically pushed onto the stack, least significant byte first. When the
subroutine is finished, a return-from-subroutine (RTS) instruction is executed. The
RTS pulls the previously stacked return address from the stack and loads it into the
program counter. Execution then continues at this recovered return address.
When an interrupt is recognized, the current instruction finishes normally, the
return address (the current value in the program counter) is pushed onto the stack,
all of the CPU registers are pushed onto the stack, and execution continues at the
address specified by the vector for the interrupt.
At the end of the interrupt service routine, an return-from interrupt (RTI) instruction
is executed. The RTI instruction causes the saved registers to be pulled off the
stack in reverse order. Program execution resumes at the return address.
Certain instructions push and pull the A and B accumulators and the X and Y index
registers and are often used to preserve program context. For example, pushing
accumulator A onto the stack when entering a subroutine that uses accumulator A
and then pulling accumulator A off the stack just before leaving the subroutine
ensures that the contents of a register will be the same after returning from the
subroutine as it was before starting the subroutine.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)75
For More Information On This Product,
Go to: www.freescale.com
Page 76
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
nc...
I
cale Semiconductor,
Frees
JSR, JUMP TO SUBROUTINE
MAIN PROGRAM
PC
$9D = JSR
DIRECT
RTN
PC
INDEXED, X
RTN
PC
INDEXED, Y
RTN
PC
INDEXED, Y
BSR, BRANCH TO SUBROUTINE
RTS, RETURN FROM
SUBROUTINE
MAIN PROGRAM
PC
MAIN PROGRAM
PC
RTN
$8D = BSR
$39 = RTS
dd
NEXT MAIN INSTR.
MAIN PROGRAM
$AD = JSR
ff
NEXT MAIN INSTR.
MAIN PROGRAM
$18 = PRE
$AD = JSR
ff
NEXT MAIN INSTR.
MAIN PROGRAM
$BD = PRE
hh
ll
NEXT MAIN INSTR.
➩ SP–2
SP–1
SP+1
➩ SP+2
4.2.5 Program Counter (PC)
The program counter, a 16-bit register, contains the address of the next instruction
to be executed. After reset, the program counter is initialized from one of six
possible vectors, depending on operating mode and the cause of reset. See
Table 4-1.
STACK
70
➩ SP–2
SP–1
SP
STACK
70
RTN
SP
SP
RTN
STACK
70
RTN
RTN
RTN
H
RTN
L
LEGEND:
H
L
H
L
RTN = ADDRESS OF NEXT INSTRUCTION IN MAIN PROGRAM TO
RTN
RTN
Figure 4-2. Stacking Operations
RTI, RETURN FROM INTERRUPT
STACK
INTERRUPT ROUTINE
PC
$3B = RTI
SWI, SOFTWARE INTERRUPT
MAIN PROGRAM
PC
$3F = SWI
WAI, WAIT FOR INTERRUPT
MAIN PROGRAM
PC
$3E = WAI
BE EXECUTED UPON RETURN FROM SUBROUTINE
= MOST SIGNIFICANT BYTE OF RETURN ADDRESS
H
= LEAST SIGNIFICANT BYTE OF RETURN ADDRESS
L
➩ = STACK POINTER POSITION AFTER OPERATION IS COMPLETE
dd = 8-BIT DIRECT ADDRESS ($0000–$00FF) (HIGH BYTE ASSUMED
TO BE $00)
ff = 8-BIT POSITIVE OFFSET $00 (0) TO $FF (255) IS ADDED TO INDEX
hh = HIGH-ORDER BYTE OF 16-BIT EXTENDED ADDRESS
ll = LOW-ORDER BYTE OF 16-BIT EXTENDED ADDRESS
rr= SIGNED RELATIVE OFFSET $80 (–128) TO $7F (+127) (OFFSET
RELATIVE TO THE ADDRESS FOLLOWING THE MACHINE CODE
OFFSET BYTE)
70
SP
SP+1
SP+2
SP+3
SP+4
SP+5
SP+6
SP+7
SP+8
➩ SP+9
CCR
ACCB
ACCA
IX
H
IX
L
IY
H
IY
L
RTN
H
RTN
L
STACK
70
➩ SP–9
SP–8
SP–7
SP–6
SP–5
SP–4
SP–3
SP–2
SP–1
SP
CCR
ACCB
ACCA
IX
H
IX
L
IY
H
IY
L
RTN
RTN
H
L
Table 4-1. Reset Vector Comparison
ModePOR or RESET PinClock MonitorCOP Watchdog
Normal$FFFE, F$FFFC, D$FFFA, B
Test or Boot$BFFE, F$BFFC, D$BFFA, B
Data SheetM68HC11E Family — Rev. 5
76Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 77
Freescale Semiconductor, Inc.
4.2.6 Condition Code Register (CCR)
This 8-bit register contains:
•Five condition code indicators (C, V, Z, N, and H),
Central Processor Unit (CPU)
CPU Registers
•Two interrupt masking bits (IRQ
•A stop disable bit (S)
In the M68HC11 CPU, condition codes are updated automatically by most
instructions. For example, load accumulator A (LDAA) and store accumulator A
(STAA) instructions automatically set or clear the N, Z, and V condition code flags.
Pushes, pulls, add B to X (ABX), add B to Y (ABY), and transfer/exchange
instructions do not affect the condition codes. Refer to Table 4-2, which shows
what condition codes are affected by a particular instruction.
nc...
I
cale Semiconductor,
4.2.6.1 Carry/Borrow (C)
The C bit is set if the arithmetic logic unit (ALU) performs a carry or borrow during
an arithmetic operation. The C bit also acts as an error flag for multiply and divide
operations. Shift and rotate instructions operate with and through the carry bit to
facilitate multiple-word shift operations.
4.2.6.2 Overflow (V)
The overflow bit is set if an operation causes an arithmetic overflow. Otherwise, the
V bit is cleared.
4.2.6.3 Zero (Z)
The Z bit is set if the result of an arithmetic, logic, or data manipulation operation
is 0. Otherwise, the Z bit is cleared. Compare instructions do an internal implied
subtraction and the condition codes, including Z, reflect the results of that
subtraction. A few operations (INX, DEX, INY, and DEY) affect the Z bit and no
other condition flags. For these operations, only = and ≠ conditions can be
determined.
and XIRQ)
Frees
4.2.6.4 Negative (N)
The N bit is set if the result of an arithmetic, logic, or data manipulation operation
is negative (MSB = 1). Otherwise, the N bit is cleared. A result is said to be negative
if its most significant bit (MSB) is a 1. A quick way to test whether the contents of a
memory location has the MSB set is to load it into an accumulator and then check
the status of the N bit.
4.2.6.5 Interrupt Mask (I)
The interrupt request (IRQ) mask (I bit) is a global mask that disables all maskable
interrupt sources. While the I bit is set, interrupts can become pending, but the
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)77
For More Information On This Product,
Go to: www.freescale.com
Page 78
Central Processor Unit (CPU)
operation of the CPU continues uninterrupted until the I bit is cleared. After any
reset, the I bit is set by default and can only be cleared by a software instruction.
When an interrupt is recognized, the I bit is set after the registers are stacked, but
before the interrupt vector is fetched. After the interrupt has been serviced, a
return-from-interrupt instruction is normally executed, restoring the registers to the
values that were present before the interrupt occurred. Normally, the I bit is 0 after
a return from interrupt is executed. Although the I bit can be cleared within an
interrupt service routine, "nesting" interrupts in this way should only be done when
there is a clear understanding of latency and of the arbitration mechanism. Refer
to Section 5. Resets and Interrupts.
4.2.6.6 Half Carry (H)
The H bit is set when a carry occurs between bits 3 and 4 of the arithmetic logic
nc...
I
unit during an ADD, ABA, or ADC instruction. Otherwise, the H bit is cleared. Half
carry is used during BCD operations.
Freescale Semiconductor, Inc.
cale Semiconductor,
Frees
4.2.6.7 X Interrupt Mask (X)
The XIRQ mask (X) bit disables interrupts from the XIRQ
set by default and must be cleared by a software instruction. When an XIRQ
interrupt is recognized, the X and I bits are set after the registers are stacked, but
before the interrupt vector is fetched. After the interrupt has been serviced , an RTI
instruction is normally executed, causing the registers to be restored to the va lues
that were present before the interrupt occurred. The X interrupt mask bit is set only
by hardware (RESET
instruction (TAP, where the associated bit of A is 0; or RTI, where bit 6 of the value
loaded into the CCR from the stack has been cleared). There is no hardware action
for clearing X.
4.2.6.8 STOP Disable (S)
Setting the STOP disable (S) bit prevents the STOP instruction from putting the
M68HC11 into a low-power stop condition. If the STOP instruction is encountered
by the CPU while the S bit is set, it is treated as a no-operation (NOP) instruction,
and processing continues to the next instruction. S is set by reset; STOP is
disabled by default.
4.3 Data Types
pin. After any reset, X is
or XIRQ acknowledge). X is cleared only by program
The M68HC11 CPU supports four data types:
1.Bit data
2.8-bit and 16-bit signed and unsigned integers
3.16-bit unsigned fractions
4.16-bit addresses
Data SheetM68HC11E Family — Rev. 5
78Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 79
Freescale Semiconductor, Inc.
A byte is eight bits wide and can be accessed at any byte location. A word is
composed of two consecutive bytes with the most significant byte at the lower
value address. Because the M68HC11 is an 8-bit CPU, there are no special
requirements for alignment of instructions or operands.
Central Processor Unit (CPU)
Opcodes and Operands
4.4 Opcodes and Operands
The M68HC11 Family of microcontrollers uses 8-bit opcodes. Each opcode
identifies a particular instruction and associated addressing mode to the CPU.
Several opcodes are required to provide each instruction with a range of
addressing capabilities. Only 256 opcodes would be available if the range of values
were restricted to the number able to be expressed in 8-bit binary numbers.
A 4-page opcode map has been implemented to expand the number of
nc...
I
instructions. An additional byte, called a prebyte, directs the processor from page
0 of the opcode map to one of the other three pages. As its name implies, the
additional byte precedes the opcode.
cale Semiconductor,
Frees
A complete instruction consists of a prebyte, if any, an opcode, and zero, one, t wo,
or three operands. The operands contain information the CPU needs for executing
the instruction. Complete instructions can be from one to five bytes long.
4.5 Addressing Modes
Six addressing modes can be used to access memory:
•Immediate
•Direct
•Extended
•Indexed
•Inherent
•Relative
These modes are detailed in the following paragraphs. All modes except inherent
mode use an effective address. The effective address is the memory address from
which the argument is fetched or stored or the address from which execution is to
proceed. The effective address can be specified within an instruction, or it can be
calculated.
4.5.1 Immediate
In the immediate addressing mode, an argument is contained in the byte(s)
immediately following the opcode. The number of bytes following the opcode
matches the size of the register or memory location being operated on. There are
2-, 3-, and 4- (if prebyte is required) byte immediate instructions. The effective
address is the address of the byte following the instruction.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)79
For More Information On This Product,
Go to: www.freescale.com
Page 80
Central Processor Unit (CPU)
4.5.2 Direct
In the direct addressing mode, the low-order byte of the operand address is
contained in a single byte following the opcode, and the high-order byte of the
address is assumed to be $00. Addresses $00–$FF are thus accessed directly,
using 2-byte instructions. Execution time is reduced by eliminating the additional
memory access required for the high-order address byte. In most applications, this
256-byte area is reserved for frequently referenced data. In M68HC11 MCUs, the
memory map can be configured for combinations of internal registers, RAM, or
external memory to occupy these addresses.
4.5.3 Extended
In the extended addressing mode, the effective address of the argument is
contained in two bytes following the opcode byte. These are 3-byte instructions (or
nc...
I
4-byte instructions if a prebyte is required). One or two bytes are needed for the
opcode and two for the effective address.
Freescale Semiconductor, Inc.
cale Semiconductor,
Frees
4.5.4 Indexed
4.5.5 Inherent
4.5.6 Relative
In the indexed addressing mode, an 8-bit unsigned offset contained in the
instruction is added to the value contained in an index register (IX or IY). The sum
is the effective address. This addressing mode allows referencing any memory
location in the 64-Kbyte address space. These are 2- to 5-byte instructions,
depending on whether or not a prebyte is required.
In the inherent addressing mode, all the information necessary to execute the
instruction is contained in the opcode. Operations that use only t he index registers
or accumulators, as well as control instructions with no arguments, are included in
this addressing mode. These are
1- or 2-byte instructions.
The relative addressing mode is used only for branch instructions. If the branch
condition is true, an 8-bit signed offset included in the instruction is added to the
contents of the program counter to form the effective branch address. Otherwise,
control proceeds to the next instruction. These are usually 2-byte instructions.
4.6 Instruction Set
Refer to Table 4-2, which shows all the M68HC11 instructions in all possible
addressing modes. For each instruction, the table shows the operand construction,
the number of machine code bytes, and execution time in CPU E-clock cycles.
Data SheetM68HC11E Family — Rev. 5
80Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 81
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
Instruction Set
Table 4-2. Instruction Set (Sheet 1 of 7)
MnemonicOperationDescription
ABAAdd
ABXAdd B to XI X + (0 0 : B) ⇒ IXINH3A—3 ————————
ABYAdd B to YI Y + (0 0 : B) ⇒ IYINH18 3A—4 ————————
ADCA (opr)Add with Carry
ADCB (opr)Add with Carry
ADDA (opr) Add Memory t o
ADDB (opr) Add Memory t o
ADDD (opr) Add 16-Bit to D D + (M : M + 1) ⇒ DIMM
ANDA (opr) AND A with
ANDB (opr) AND B with
ASL (opr)Arithmetic Shift
ASLAArithmetic Shift
ASLBArithmetic Shift
ASLDArithmeti c Shift
ASR Arithmetic Shift
ASRAArithmetic Shift
ASRBArithmetic Shift
BCC (rel)Branch if Car ry
BCLR (opr)
BCS (rel)Branch if Carry
Accumulators
to A
to B
A
B
Memory
Memory
Left
Left A
Left B
Left D
Right
Right A
Right B
Clear
Clear Bit(s) M • (mm
(msk)
Set
A + B ⇒ AINH1B—2——∆—∆∆∆∆
A + M + C ⇒ AA IMM
B + M + C ⇒ BB IMM
A + M ⇒ AAIMM
B + M ⇒ BBIMM
A • M ⇒ AA IMM
B • M ⇒ BBIMM
b7b0
C
b0
b7
C
b7b0
C
b0
b7b0
ABb7
C
b7b0
b7b0
b7b0
? C = 0REL24rr3 ————————
) ⇒ MDIR
? C = 1REL25rr3 ————————
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
89
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
DIR
EXT
IND,X
IND,Y
A DIR
A EXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
EXT
0
0
0
0
C
C
C
IND,X
IND,Y
A INH48—2 ————∆∆∆∆
B INH58—2 ————∆∆∆∆
INH05—3————∆∆∆∆
EXT
IND,X
IND,Y
A INH47—2 ————∆∆∆∆
B INH57—2 ————∆∆∆∆
IND,X
IND,Y
18A9
18E9
18AB
18EB
18 E3
18 A4
18E4
1868
1867
181D
99
B9
A9
C9
D9
F9
E9
8B
9B
BB
AB
CB
DB
FB
EB
C3
D3
F3
E3
84
94
B4
A4
C4
D4
F4
E4
78
68
77
67
15
1D
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
hh ll
ff
ff
hh ll
ff
ff
dd mm
ff mm
ff mm
2
——∆—∆∆∆∆
3
4
4
5
2
——∆—∆∆∆∆
3
4
4
5
2
——∆—∆∆∆∆
3
4
4
5
2
——∆—∆∆∆∆
3
4
4
5
4
————∆∆∆∆
5
6
6
7
2
————∆∆0—
3
4
4
5
2
————∆∆0—
3
4
4
5
6
————∆∆∆∆
6
7
6
————∆∆∆∆
6
7
6
————∆∆0—
7
8
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)81
For More Information On This Product,
Go to: www.freescale.com
Page 82
Central Processor Unit (CPU)
MnemonicOperationDescription
BEQ (rel)Branch if = Zero? Z = 1REL27rr3————————
BGE (rel)Branch if ∆ Zero? N ⊕ V = 0REL2Crr3 ————————
BGT (rel)Branch if > Zero? Z + (N ⊕ V) = 0REL2Err3 ————————
nc...
I
cale Semiconductor,
Frees
BHI (rel)Branch if
BHS (rel)Branch if
BITA (opr) Bit(s) Test A
BITB (opr)Bit(s) Test B
BLE (rel)Branch if ∆ Zero? Z + (N ⊕ V) = 1REL2Frr3 ————————
BLO (rel)Branch if Lower? C = 1REL25rr3 ————————
BLS (rel)Branch if Lo wer
BLT (rel)Branch if < Zero? N ⊕ V = 1REL2Drr3 ————————
BMI (rel)Branch if Minus? N = 1REL2Brr3 ————————
BNE (rel)Branch if not =
BPL (rel)Branch if Plus? N = 0REL2Arr3 ————————
BRA (rel)Branch Always? 1 = 1REL20rr3 ————————
BRCLR(opr)
(msk)
(rel)
BRN (rel)Branch Never? 1 = 0REL21rr3 ————————
BRSET(opr)
(msk)
(rel)
BSET (opr)
(msk)
BSR (rel)Branch to
BVC (rel)Branch if
BVS (rel)Branch if
CBACompare A to BA – BINH11—2————∆∆∆∆
CLCClear Carry Bit0 ⇒ CINH0C —2 ——————— 0
CLIClear Interrupt
CLR (opr)Clear Memory
CLRAClear
CLRBClear
CLVClear Overflow
Higher
Higher or Same
with Memory
with Memory
or Same
Zero
Branch if
Bit(s) Clear
Branch if Bit(s)
Set
Set Bit(s)M + mm ⇒ MDIR
Subroutine
Overflow Clear
Overflow Set
Mask
Byte
Accumulator A
Accumulator B
Flag
? C + Z = 0REL22rr3 ————————
? C + Z = 1REL23rr3 ————————
? M • mm = 0DIR
? (M
See Figure 3–2REL8Drr6 ————————
Freescale Semiconductor, Inc.
Table 4-2. Instruction Set (Sheet 2 of 7)
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
? C = 0REL24rr3 ————————
A • MAIMM
B • MBIMM
? Z = 0REL26rr3 ————————
) • mm = 0DIR
? V = 0REL28rr3 ————————
? V = 1REL29rr3 ————————
0 ⇒ IINH0E —2 ——— 0 ————
0 ⇒ MEXT
0 ⇒ AAINH4F—2————0100
0 ⇒ BBINH5F—2————0100
0 ⇒ VINH0A—2 ——————0—
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
IND,X
IND,Y
IND,X
IND,Y
IND,X
IND,Y
IND,X
IND,Y
85
95
B5
A5
18A5
C5
D5
F5
E5
18E5
13
1F
181F
12
1E
181E
14
1C
181C
7F
6F
186F
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
dd mm
rr
ff mm
rr
ff mm
rr
dd mm
rr
ff mm
rr
ff mm
rr
dd mm
ff mm
ff mm
hh ll
ff
ff
2
————∆∆0—
3
4
4
5
2
————∆∆0—
3
4
4
5
6
————————
7
8
6
————————
7
8
6
————∆∆0—
7
8
6
————0 1 0 0
6
7
Data SheetM68HC11E Family — Rev. 5
82Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 83
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
Instruction Set
Table 4-2. Instruction Set (Sheet 3 of 7)
MnemonicOperationDescription
CMPA (opr)Compare A to
CMPB (opr)Compare B to
COM (opr)Ones
COMAOnes
COMBOnes
CPD (opr)Compare D to
CPX (opr)Compare X to
CPY (opr)Compare Y to
DAADecimal Adjust AAdjust Sum to BCDINH19—2————∆∆∆∆
DEC (opr)Decrement
DECADecrement
DECBDecrement
DESDecrement
DEXDecrement
DEYDecrement
EORA (opr) Exclusive OR A
EORB (opr)Exclusive OR B
FDIVFractional
IDIVInteger Divide
Memory
Memory
Complement
Memory Byte
Complement
A
Complement
B
Memory 16-Bit
Memory 16-Bit
Memory 16-Bit
Memory Byte
Accumulator
A
Accumulator
B
Stack Pointer
Index Register
X
Index Register
Y
with Memory
with Memory
Divide 16 by 16
16 by 16
A – MAIMM
B – MBIMM
$FF – M ⇒ MEXT
$FF – A ⇒ AA INH43 —2————∆∆01
$FF – B ⇒ BB INH53 —2————∆∆01
D – M : M + 1IMM
IX – M : M + 1IMM
IY – M : M + 1IMM
M – 1 ⇒ MEXT
A – 1 ⇒ AAINH4A— 2————∆∆∆—
B – 1 ⇒ BBINH5A— 2————∆∆∆—
SP – 1 ⇒ SPINH34—3 —————— ——
IX – 1 ⇒ IXINH09—3—————∆——
IY – 1 ⇒ IYINH1809—4—————∆——
A ⊕ M ⇒ AAIMM
B ⊕ M ⇒ BBIMM
D / IX ⇒ IX; r ⇒ DINH03—41 —————∆∆∆
D / IX ⇒ IX; r ⇒ DINH02—41 —————∆0∆
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
IND,X
IND,Y
DIR
EXT
IND,X
IND,Y
DIR
EXT
IND,X
IND,Y
DIR
EXT
IND,X
IND,Y
IND,X
IND,Y
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
81
91
B1
A1
18A1
C1
D1
F1
E1
18E1
73
63
1863
1A83
1A93
1AB3
1AA3
CDA3
8C
9C
BC
AC
CDAC
188C
189C
18BC
1AAC
18AC
7A
6A
186A
88
98
B8
A8
18A8
C8
D8
F8
E8
18E8
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
2
————∆∆∆∆
3
4
4
5
2
————∆∆∆∆
3
4
4
5
6
————∆∆01
6
7
5
————∆∆∆∆
6
7
7
7
4
————∆∆∆∆
5
6
6
7
5
————∆∆∆∆
6
7
7
7
6
————∆∆∆—
6
7
2
————∆∆0—
3
4
4
5
2
————∆∆0—
3
4
4
5
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)83
For More Information On This Product,
Go to: www.freescale.com
Page 84
Central Processor Unit (CPU)
MnemonicOperationDescription
nc...
I
cale Semiconductor,
Frees
INC (opr)Increment
INCAIncrement
INCBIncrement
INSIncrement
INXIncrement
INYIncrement
JMP (opr)JumpSee Figure 3–2EXT
JSR (opr)Jump to
LDAA (opr)Load
LDAB (opr)Load
LDD (opr)Load Double
LDS (opr)Load Stack
LDX (opr)Load Index
LDY (opr)Load Index
LSL (opr)Logical Shift
LSLA Logical Shift
LSLBLogical Shift
LSLDLogical Shift
Memory Byte
Accumulator
A
Accumulator
B
Stack Pointer
Index Register
X
Index Register
Y
Subroutine
Accumulator
A
Accumulator
B
Accumulator
D
Pointer
Register
X
Register
Y
Left
Left A
Left B
Left Double
M + 1 ⇒ MEXT
A + 1 ⇒ AAINH4C—2————∆∆∆—
B + 1 ⇒ BBINH5C—2————∆∆∆—
SP + 1 ⇒ SPINH31—3 ————————
IX + 1 ⇒ IXINH08—3 ————— ∆——
IY + 1 ⇒ IYINH18 08—4 ————— ∆——
See Figure 3–2DIR
M ⇒ A,M + 1 ⇒ BIMM
M : M + 1 ⇒ SPIMM
M : M + 1 ⇒ IXIMM
M : M + 1 ⇒ IYIMM
C
C
C
b7b0ABb7
C
Freescale Semiconductor, Inc.
Table 4-2. Instruction Set (Sheet 4 of 7)
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
IND,X
IND,Y
IND,X
IND,Y
EXT
IND,X
M ⇒ AAIMM
M ⇒ BBIMM
0
b0
b7
b7b0
b7b0
0
0
b0
0
IND,Y
A DIR
A EXT
A IND,X
A IND,Y
B DIR
B EXT
B IND,X
B IND,Y
DIR
EXT
IND,X
IND,Y
DIR
EXT
IND,X
IND,Y
DIR
EXT
IND,X
IND,Y
DIR
EXT
IND,X
IND,Y
EXT
IND,X
IND,Y
A INH48—2 ————∆∆∆∆
B INH58—2 ————∆∆∆∆
INH05—3————∆∆∆∆
7C
6C
186C
7E
6E
186E
9D
BD
AD
18 AD
86
96
B6
A6
18A6
C6
D6
F6
E6
18E6
CC
DC
FC
EC
18EC
8E
9E
BE
AE
18AE
CE
DE
FE
EE
CDEE
18CE
18DE
18FE
1AEE
18EE
78
68
1868
hh ll
ff
ff
hh ll
ff
ff
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
hh ll
ff
ff
6
6
7
3
3
4
5
6
6
7
2
3
4
4
5
2
3
4
4
5
3
4
5
5
6
3
4
5
5
6
3
4
5
5
6
4
5
6
6
6
6
6
7
————∆∆∆—
————————
————————
————∆∆0—
————∆∆0—
————∆∆0—
————∆∆0—
————∆∆0—
————∆∆0—
————∆∆∆∆
Data SheetM68HC11E Family — Rev. 5
84Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 85
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
Instruction Set
Table 4-2. Instruction Set (Sheet 5 of 7)
MnemonicOperationDescription
LSR (opr)Logical Shift
LSRALogical Shift
LSRBLogical Shift
LSRDLogical Shift
MULMultiply 8 by 8A ∗ B ⇒ DINH3D—10 ———————∆
NEG (opr)Two’s
NEGATwo’s
NEGBTwo’s
NOPNo operationNo OperationINH01—2————————
ORAA (opr)OR
ORAB (opr)OR
PSHAPush A onto
PSHBPush B onto
PSHXPush X onto
PSHYPush Y onto
PULAPull A from
PULBPull B from
PULXPull X From
PULYPull Y from
ROL (opr)Rotate Left EXT
ROLARotate Left AAINH49—2————∆∆∆∆
ROLBRotate Left BBINH59—2————∆∆∆∆
ROR (opr)Rotate Right EXT
Right
Right A
Right B
Right Double
Complement
Memory Byte
Complement
A
Complement
B
Accumulator
A (Inclusive)
Accumulator
B (Inclusive)
Stack
Stack
Stack (Lo
First)
Stack (Lo
First)
Stack
Stack
Stack (Hi
First)
Stack (Hi
First)
0
b7b0
0
b7b0
0
b7b0
0
b0
ABb7
b7b0
0 – M ⇒ MEXT
0 – A ⇒ AAINH40 — 2————∆∆∆∆
0 – B ⇒ BBINH50 — 2————∆∆∆∆
A + M ⇒ AAIMM
B + M ⇒ BBIMM
A ⇒ Stk,SP = SP – 1 AINH36—3————————
B ⇒ Stk,SP = SP – 1 BINH37—3————————
IX ⇒ Stk,SP = SP – 2 INH3C—4 ————————
IY ⇒ Stk,SP = SP – 2 INH18 3C—5 ————————
SP = SP + 1, A ⇐ StkA INH32—4 ————————
SP = SP + 1, B ⇐ StkB INH33—4 ————————
SP = SP + 2, IX ⇐ StkINH38—5 ————————
SP = SP + 2, IY ⇐ StkINH18 38—6 ————————
b7b0
C
b7b0
C
b7
C
b7b0
C
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
EXT
IND,X
C
C
C
C
b0
IND,Y
A INH44—2 ———— 0 ∆∆∆
B INH54—2 ———— 0 ∆∆∆
INH04—3————0∆∆∆
IND,X
IND,Y
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
IND,X
IND,Y
IND,X
IND,Y
74
64
1864
70
60
1860
8A
9A
BA
AA
18AA
CA
DA
FA
EA
18EA
79
69
1869
76
66
1866
hh ll
ff
ff
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
hh ll
ff
ff
hh ll
ff
ff
6
————0 ∆∆∆
6
7
6
————∆∆∆∆
6
7
————∆∆0—
2
3
4
4
5
————∆∆0—
2
3
4
4
5
6
————∆∆∆∆
6
7
6
————∆∆∆∆
6
7
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)85
For More Information On This Product,
Go to: www.freescale.com
Page 86
Central Processor Unit (CPU)
MnemonicOperationDescription
RORARotate Right AAINH46—2————∆∆∆∆
RORBRotate Right BBINH56—2————∆∆∆∆
RTIReturn from
RTSReturn from
SBASubtract B from
SBCA (opr)Subtract with
nc...
I
SBCB (opr)Subtract with
SECSet Carry1 ⇒ CINH0D—2 ——————— 1
SEISet Interrupt
SEVSet Overflow
STAA (opr)Store
STAB (opr)Store
STD (opr)Store
STOPStop Internal
STS (opr)Store Stack
Interrupt
Subroutine
A
Carry from A
Carry from B
Mask
Flag
Accumulator
A
Accumulator
B
Accumulator
D
Clocks
Pointer
b7b0
b7b0
See Figure 3–2INH3B—12∆↓∆∆∆∆∆∆
See Figure 3–2INH39—5————————
A – B ⇒ AINH10—2 ————∆∆∆∆
A – M – C ⇒ AA IMM
B – M – C ⇒ BB IMM
A ⇒ M, B ⇒ M + 1DIR
SP ⇒ M : M + 1DIR
cale Semiconductor,
Frees
STX (opr)Store Index
STY (opr)Store Index
SUBA (opr)Subtract
SUBB (opr)Subtract
SUBD (opr)Subtract
Register X
Register Y
Memory from
A
Memory from
B
Memory from
D
IX ⇒ M : M + 1DIR
IY ⇒ M : M + 1DIR
A – M ⇒ AAIMM
B – M ⇒ BAIMM
D – M : M + 1 ⇒ DIMM
Freescale Semiconductor, Inc.
Table 4-2. Instruction Set (Sheet 6 of 7)
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
C
C
82
ADIR
AEXT
AIND,X
AIND,Y
BDIR
BEXT
BIND,X
BIND,Y
1 ⇒ IINH0F—2 ——— 1 ————
1 ⇒ VINH0B—2 ——————1—
A ⇒ MADIR
B ⇒ MBDIR
—INHCF —2 ————————
AEXT
AIND,X
AIND,Y
BEXT
BIND,X
BIND,Y
EXT
IND,X
IND,Y
EXT
IND,X
IND,Y
EXT
IND,X
IND,Y
EXT
IND,X
IND,Y
ADIR
AEXT
AIND,X
AIND,Y
ADIR
AEXT
AIND,X
AIND,Y
DIR
EXT
IND,X
IND,Y
18A2
18E2
18 A7
18 E7
18 ED
18 AF
CD EF
18DF
18FF
1AEF
18EF
18A0
18E0
18A3
92
B2
A2
C2
D2
F2
E2
97
B7
A7
D7
F7
E7
DD
FD
ED
9F
BF
AF
DF
FF
EF
80
90
B0
A0
C0
D0
F0
E0
83
93
B3
A3
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
dd
hh ll
ff
ff
dd
hh ll
ff
ff
dd
hh ll
ff
ff
dd
hh ll
ff
ff
dd
hh ll
ff
ff
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
ii
dd
hh ll
ff
ff
jj kk
dd
hh ll
ff
ff
2
————∆∆∆∆
3
4
4
5
2
————∆∆∆∆
3
4
4
5
3
————∆∆0—
4
4
5
3
————∆∆0—
4
4
5
4
————∆∆0—
5
5
6
4
————∆∆0—
5
5
6
4
————∆∆0—
5
5
6
5
————∆∆0—
6
6
6
2
————∆∆∆∆
3
4
4
5
2
————∆∆∆∆
3
4
4
5
4
————∆∆∆∆
5
6
6
7
Data SheetM68HC11E Family — Rev. 5
86Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 87
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Central Processor Unit (CPU)
Instruction Set
Table 4-2. Instruction Set (Sheet 7 of 7)
MnemonicOperationDescription
SWISoftware
TABTransfer A to BA ⇒ BINH16—2 ———— ∆∆0—
TAPTransfer A to
TBATransfer B to AB ⇒ AINH17—2 ———— ∆∆0—
TESTTEST (Only in
TPATransfer CC
TST (opr)Test for Zero or
TSTATest A for Zero
TSTBTest B for Zero
TSXTransfer Stack
TSYTransfer Stack
TXSTransfer X to
TYSTransfer Y to
WAIWait for
XGDXExchange D
XGDYExchange D
Cycle
* Infinity or until reset occurs
**12 cycles are used beginning with the opcode fetch. A wait state is entered which remains in effect for an int eger number of MPU E-clock
cycles (n) until an interrupt is recognized. Finally, two additional cycles are used to fetch the appropriat e interrupt vector (14 + n total).
Operands
dd= 8-bit direct address ($0000–$00FF) (high byte assumed to be $00)
ff= 8-bit positive offset $00 (0) to $FF (255) (is added to index)
hh= High-order byte of 16-bit extended address
ii= One byte of immediate data
jj= High-order byte of 16-bit immediate data
kk= Low-order byte of 16-bit immediate data
ll= Low-order byte of 16-bit extended address
mm= 8-bit mask (set bits to be affected)
rr= Signed relative offset $80 (–128) to $7F (+127)
Interrupt
CC Register
Test Modes)
Register to A
Minus
or Minus
or Minus
Pointer to X
Pointer to Y
Stack Pointer
Stack Pointer
Interrupt
with X
with Y
(offset relative to address following machine code offset byte))
See Figure 3–2INH3F—14———1————
A ⇒ CCR INH06—2∆↓∆∆∆∆∆∆
Address Bus CountsINH00—*————————
CCR ⇒ AINH07—2 ————————
M – 0 EXT
A – 0AINH4D—2————∆∆00
B – 0BINH5D—2————∆∆00
SP + 1 ⇒ IXINH30—3 ——— ——— ——
SP + 1 ⇒ IYINH18 30—4 ————————
IX – 1 ⇒ SPINH35—3 ————————
IY – 1 ⇒ SPINH18 35—4 ————————
Stack Regs & WAITINH3E—**————————
IX ⇒ D, D ⇒ IX INH8F—3 ————————
IY ⇒ D, D ⇒ IYINH18 8F —4 ————————
AddressingInstructionCondition Codes
Mode OpcodeOperand CyclesSXHINZVC
7D
IND,X
IND,Y
6D
186D
hh ll
ff
ff
6
————∆∆00
6
7
Operators
( )Contents of register shown inside parentheses
⇐Is transferred to
⇑Is pulled from stack
⇓Is pushed onto stack
•Boolean AND
+Arithmetic addition symbol except where used as inclusive-OR symbol
in Boolean formula
⊕Exclusive-OR
∗Multiply
:Concatenation
–Arithmetic subtraction symbol or negation symbol (two’s complement)
Condition Codes
—Bit not changed
0Bit always cleared
1Bit always set
∆Bit cleared or set, depending on operation
↓Bit can be cleared, cannot become set
M68HC11E Family — Rev. 5Data Sheet
MOTOROLACentral Processor Unit (CPU)87
For More Information On This Product,
Go to: www.freescale.com
Page 88
Central Processor Unit (CPU)
nc...
I
Freescale Semiconductor, Inc.
cale Semiconductor,
Frees
Data SheetM68HC11E Family — Rev. 5
88Central Processor Unit (CPU)MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 89
Freescale Semiconductor, Inc.
Data Sheet — M68HC11E Family
Section 5. Resets and Interrupts
5.1 Introduction
Resets and interrupt operations load the program counter with a vector that points
to a new location from which instructions are to be fetched. A reset immediately
stops execution of the current instruction and forces the program counter to a
known starting address. Internal registers and control bits are initialized so the
nc...
I
MCU can resume executing instructions. An interrupt temporarily suspends normal
program execution while an interrupt service routine is being executed. After an
interrupt has been serviced, the main program resumes as if there had been no
interruption.
cale Semiconductor,
Frees
5.2 Resets
The four possible sources of reset are:
•Power-on reset (POR)
•External reset (RESET
•Computer operating properly (COP) reset
•Clock monitor reset
POR and RESET
reset each has its own vector.
5.2.1 Power-On Reset (POR)
A positive transition on V
for power-up conditions. POR cannot be used to detect drops in power supply
voltages. A 4064 t
active allows the clock generator to stabilize. If RESET
4064 t
The POR circuit only initializes internal circuitry during cold starts. Refer to
Figure 1-7. External Reset Circuit.
NOTE:It is important to protect the MCU during power transitions. Most M68HC11
systems need an external circuit that holds the RESET
below the minimum operating level. This external voltage level detector, or other
external reset circuits, are the usual source of reset in a system.
CYC
)
share the normal reset vector. COP reset and the clock monitor
generates a power-on reset (POR), which is used only
DD
(internal clock cycle) delay after the oscillator becomes
CYC
is at logical 0 at the end of
, the CPU remains in the reset condition until RESET goes to logical 1.
pin low whenever VDD is
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAResets and Interrupts89
For More Information On This Product,
Go to: www.freescale.com
Page 90
Freescale Semiconductor, Inc.
Resets and Interrupts
5.2.2 External Reset (RESET)
The CPU distinguishes between internal and external reset conditions by sensing
whether the reset pin rises to a logic 1 in less than two E-clock cycles after an
internal device releases reset. When a reset condition is sensed, the RESET
driven low by an internal device for four E-clock cycles, then released. Two E-clock
cycles later it is sampled. If the pin is still held low, the CPU assumes that an
external reset has occurred. If the pin is high, it indicates that the reset was initiated
internally by either the COP system or the clock monitor.
CAUTION:Do not connect an external resistor capacitor (RC) power-up delay circuit to the
reset pin of M68HC11 devices because the circuit charge time constant can cause
the device to misinterpret the type of reset that occurred.
pin is
nc...
I
cale Semiconductor,
Frees
5.2.3 Computer Operating Properly (COP) Reset
The MCU includes a COP system to help protect against software failures. When
the COP is enabled, the software is responsible for keeping a free-running
watchdog timer from timing out. When the software is no longer being executed in
the intended sequence, a system reset is initiated.
The state of the NOCOP bit in the CONFIG register determines whether the COP
system is enabled or disabled. To change the enable status of the COP system,
change the contents of the CONFIG register and then perform a system reset. In
the special test and bootstrap operating modes, the COP system is initially
inhibited by the disable resets (DISR) control bit in the TEST1 register. The DISR
bit can subsequently be written to 0 to enable COP resets.
The COP timer rate control bits CR[1:0] in the OPTION register determine the COP
timeout period. The system E clock is divided by 2
factor shown in Table 5-1. After reset, these bits are 0, which selects the fastest
timeout period. In normal operating modes, these bits can be written only once
within 64 bus cycles after reset.
Table 5-1. COP Timer Rate Select
XTAL = 4.0 MHz
By
Timeout
– 0 ms, + 32.8 ms
CR[1:0]
Divide
15
E/2
XTAL = 8.0 MHz
Timeout
– 0 ms, + 16.4 ms
15
and then further scaled by a
XTAL = 12.0 MHz
Timeout
– 0 ms, + 10.9 ms
XTAL = 16.0 MHz
Timeout
– 0 ms, + 8.2 ms
0 0132.768 ms16.384 ms10.923 ms 8.19 ms
0 14131.072 ms65.536 ms43.691 ms 32.8 ms
1 016524.28 ms262.14 ms174.76 ms 131 ms
1 1642.098 s1.049 s699.05 ms 524 ms
Complete this 2-step reset sequence to service the COP timer:
1.Write $55 to COPRST to arm the COP timer clearing mechanism.
2.Write $AA to COPRST to clear the COP timer.
Performing instructions between these two steps is possible as long
nc...
I
5.2.4 Clock Monitor Reset
as both steps are completed in the correct sequence before the timer times out.
Resets and Interrupts
Resets
Bit 7654321Bit 0
BIT 7BIT 6BIT 5BIT 4BIT 3BIT 2BIT 1BIT 0
0000000
cale Semiconductor,
Frees
The clock monitor circuit is based on an internal resistor capacitor (RC) time delay.
If no MCU clock edges are detected within this RC time delay, the clock monitor
can optionally generate a system reset. The clock monitor function is enabled or
disabled by the CME control bit in the OPTION register. The presence of a timeout
is determined by the RC delay, which allows the clock monitor to operate without
any MCU clocks.
Clock monitor is used as a backup for the COP system. Because the COP needs
a clock to function, it is disabled when the clock stops. Therefore, the clock monitor
system can detect clock failures not detected by the COP system.
Semiconductor wafer processing causes variations of the RC timeout values
between individual devices. An E-clock frequency below 10 kHz is detected as a
clock monitor error. An E-clock frequency of 200 kHz or more prevents clock
monitor errors. Using the clock monitor function when the E-clock is below 200 kHz
is not recommended.
Special considerations are needed when a STOP instruction is executed and the
clock monitor is enabled. Because the STOP function causes the clocks to be
halted, the clock monitor function generates a reset sequence if it is enabled at the
time the stop mode was initiated. Before executing a STOP instruction, clear the
CME bit in the OPTION register to 0 to disable the clock monitor. After recovery
from STOP, set the CME bit to logic 1 to enable the clock monitor. Alternatively,
executing a STOP instruction with the CME bit set to logic 1 can be used as a
software initiated reset.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAResets and Interrupts91
For More Information On This Product,
Go to: www.freescale.com
Page 92
Resets and Interrupts
5.2.5 System Configuration Options Register
nc...
I
Freescale Semiconductor, Inc.
Address:$1039
Read:
Write:
Reset:0
1. Can be written only once in first 64 cycles out of reset in normal mode or at any time in special modes
Figure 5-2. System Configuration Options Register (OPTION)
ADPU — Analog-to-Digital Converter Power-Up Bit
Refer to Section 3. Analog-to-Digital (A/D) Converter.
CSEL — Clock Select Bit
Refer to Section 3. Analog-to-Digital (A/D) Converter.
Bit 7654321Bit 0
ADPUCSELIRQE
0010000
= Unimplemented
(1)
DLY
(1)
CMECR1
(1)
CR0
(1)
cale Semiconductor,
Frees
IRQE — Configure IRQ
0 = IRQ
1 = IRQ
DLY — Enable Oscillator Startup Delay Bit
Refer to Section 2. Operating Modes and On-Chip Memory and Section 3.
Analog-to-Digital (A/D) Converter.
CME — Clock Monitor Enable Bit
This control bit can be read or written at any time and controls whether or not
the internal clock monitor circuit triggers a reset sequence when the system
clock is slow or absent. When it is clear, the clock monitor circuit is disabled, and
when it is set, the clock monitor circuit is enabled. Reset clears the CME bit.
0 = Clock monitor circuit disabled
1 = Slow or stopped clocks cause reset
Bit 2 — Unimplemented
Always reads 0
CR[1:0] — COP Timer Rate Select Bit
The internal E clock is first divided by 2
system. These control bits determine a scaling factor for the watchdog timer.
See Table 5-1 for specific timeout settings.
is configured for level-sensitive operation.
is configured for edge-sensitive-only operation.
for Edge-Sensitive-Only Operation Bit
15
before it enters the COP watchdog
Data SheetM68HC11E Family — Rev. 5
92Resets and InterruptsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 93
Freescale Semiconductor, Inc.
5.2.6 Configuration Control Register
Address:$103F
Read:
Write:
Reset:0
EE[3:0] — EEPROM Mapping Bits
EE[3:0] apply only to MC68HC811E2. Refer to Section 2. Operating Modes
and On-Chip Memory.
Bit 7654321Bit 0
EE3EE2EE1EE0NOSECNOCOPROMONEEON
Figure 5-3. Configuration Control Register (CONFIG)
Resets and Interrupts
Effects of Reset
0001111
nc...
I
cale Semiconductor,
Frees
NOSEC — Security Mode Disable Bit
NOCOP — COP System Disable Bit
ROMON — ROM (EPROM) Enable Bit
EEON — EEPROM Enable Bit
5.3 Effects of Reset
When a reset condition is recognized, the internal registers and control bits are
forced to an initial state. Depending on the cause of the reset and the operating
mode, the reset vector can be fetched from any of six possible locations. Refer to
Table 5-2.
Refer to Section 2. Operating Modes and On-Chip Memory.
0 = COP enabled (forces reset on timeout)
1 = COP disabled (does not force reset on timeout)
Refer to Section 2. Operating Modes and On-Chip Memory.
Refer to Section 2. Operating Modes and On-Chip Memory.
Table 5-2. Reset Cause, Reset Vector, and Operating Mode
Cause of Reset
POR or RESET
Normal Mode
Vector
pin$FFFE, FFFF$BFFE, $BFFF
Special Test
or Bootstrap
Clock monitor failure$FFFC, FFFD$BFFC, $BFFD
COP Watchdog Timeout$FFFA, FFFB$BFFA, $BFFB
These initial states then control on-chip peripheral systems to force them to known
startup states, as described in the following subsections.
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAResets and Interrupts93
For More Information On This Product,
Go to: www.freescale.com
Page 94
Resets and Interrupts
5.3.1 Central Processor Unit (CPU)
5.3.2 Memory Map
nc...
I
Freescale Semiconductor, Inc.
After reset, the central processor unit (CPU) fetches the restart vector from the
appropriate address during the first three cycles and begins executing instructions.
The stack pointer and other CPU registers are indeterminate immediately after
reset; however, the X and I interrupt mask bits in the condition code register (CCR)
are set to mask any interrupt requests. Also, the S bit in the CCR is set to inhibit
stop mode.
After reset, the INIT register is initialized to $01, mapping the RAM at $00 and the
control registers at $1000.
For the MC68HC811E2, the CONFIG register resets to $FF. EEPROM mapping
bits (EE[3:0]) place the EEPROM at $F800. Refer to the memory map diagram for
MC68HC811E2 in Section 2. Operating Modes and On-Chip Memory.
cale Semiconductor,
Frees
5.3.3 Timer
During reset, the timer system is initialized to a count of $0000. The prescaler bits
are cleared, and all output compare registers are initialized to $FFFF. All input
capture registers are indeterminate after reset. The output compare 1 mask
(OC1M) register is cleared so that successful OC1 compares do not affect any I/O
pins. The other four output compares are configured so that they do not affect any
I/O pins on successful compares. All input capture edge-detector circuits are
configured for capture disabled operation. The timer overflow interrupt flag and all
eight timer function interrupt flags are cleared. All nine timer interrupts are disabled
because their mask bits have been cleared.
The I4/O5 bit in the PACTL register is cleared to configure the I4/O5 function as
OC5; however, the OM5:OL5 control bits in the TCTL1 register are clear so OC5
does not control the PA3 pin.
5.3.4 Real-Time Interrupt (RTI)
The real-time interrupt flag (RTIF) is cleared and automatic hardware interrupts are
masked. The rate control bits are cleared after reset and can be initialized by
software before the real-time interrupt (RTI) system is used.
5.3.5 Pulse Accumulator
The pulse accumulator system is disabled at reset so that the pulse accumulator
input (PAI) pin defaults to being a general-purpose input pin.
Data SheetM68HC11E Family — Rev. 5
94Resets and InterruptsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 95
Freescale Semiconductor, Inc.
5.3.6 Computer Operating Properly (COP)
The COP watchdog system is enabled if the NOCOP control bit in the CONFIG
register is cleared and disabled if NOCOP is set. The COP rate is set for the
shortest duration timeout.
5.3.7 Serial Communications Interface (SCI)
The reset condition of the SCI system is independent of the operating mode. At
reset, the SCI baud rate control register (BAUD) is initialized to $04. All transmit
and receive interrupts are masked and both the transmitter and receiver are
disabled so the port pins default to being general-purpose I/O lines. The SCI frame
format is initialized to an 8-bit character size. The send break and receiver wakeup
functions are disabled. The TDRE and TC status bits in the SCI status register
(SCSR) are both 1s, indicating that there is no transmit data in either the transmit
nc...
I
data register or the transmit serial shift register. The RDRF, IDLE, OR, NF, FE, PF,
and RAF receive-related status bits in the SCI control register 2 (SCCR2) are
cleared.
Resets and Interrupts
Effects of Reset
cale Semiconductor,
Frees
5.3.8 Serial Peripheral Interface (SPI)
The SPI system is disabled by reset. The port pins associated with this function
default to being general-purpose I/O lines.
5.3.9 Analog-to-Digital (A/D) Converter
The analog-to-digital (A/D) converter configuration is indeterminate after reset. The
ADPU bit is cleared by reset, which disables the A/D system. The conversion
complete flag is indeterminate.
5.3.10 System
The EEPROM programming controls are disabled, so the memory system is
configured for normal read operation. PSEL[3:0] are initialized with the value
%0110, causing the external IRQ
pin is configured for level-sensitive operation (for wired-OR systems). The
IRQ
RBOOT, SMOD, and MDA bits in the HPRIO register reflect the status of the
MODB and MODA inputs at the rising edge of reset. MODA and MODB inputs
select one of the four operating modes. After reset, writing SMOD and MDA in
special modes causes the MCU to change operating modes. Refer to the
description of HPRIO register in Section 2. Operating Modes and On-Chip
Memory for a detailed description of SMOD and MDA. The DLY control bit is set
to specify that an oscillator startup delay is imposed upon recovery from stop
mode. The clock monitor system is disabled because CME is cleared.
pin to have the highest I-bit interrupt priority. The
M68HC11E Family — Rev. 5Data Sheet
MOTOROLAResets and Interrupts95
For More Information On This Product,
Go to: www.freescale.com
Page 96
Resets and Interrupts
5.4 Reset and Interrupt Priority
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Resets and interrupts have a hardware priority that determines which reset or
interrupt is serviced first when simultaneous requests occur. Any maskable
interrupt can be given priority over other maskable interrupts.
The first six interrupt sources are not maskable. The priority arrangement for these
sources is:
1.POR or RESET
2.Clock monitor reset
3.COP watchdog reset
4.XIRQ
5.Illegal opcode interrupt
6.Software interrupt (SWI)
The maskable interrupt sources have this priority arrangement:
1.IRQ
2.Real-time interrupt
3.Timer input capture 1
4.Timer input capture 2
5.Timer input capture 3
6.Timer output compare 1
7.Timer output compare 2
8.Timer output compare 3
9.Timer output compare 4
10.Timer input capture 4/output compare 5
11.Timer overflow
12.Pulse accumulator overflow
13.Pulse accumulator input edge
14.SPI transfer complete
15.SCI system (refer to Figure 5-7)
Any one of these interrupts can be assigned the highest maskable interrupt priority
by writing the appropriate value to the PSEL bits in the HPRIO register. Otherwise,
the priority arrangement remains the same. An interrupt that is assigned highest
priority is still subject to global masking by the I bit in the CCR, or by any associated
local bits. Interrupt vectors are not affected by priority assignment. To avoid race
conditions, HPRIO can be written only while I-bit interrupts are inhibited.
pin
interrupt
Data SheetM68HC11E Family — Rev. 5
96Resets and InterruptsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 97
Freescale Semiconductor, Inc.
5.4.1 Highest Priority Interrupt and Miscellaneous Register
Address:$103C
Read:
Write:
Reset:
Single chip:00000110
Expanded:00100110
Bootstrap:11000110
Special test:01110110
1. The values of the RBOOT, SMOD, and MDA reset bits depend on the mode selected at the
RESET pin rising edge. Refer to Table 2-1. Hardware Mode Select Summary.
nc...
I
Resets and Interrupts
Reset and Interrupt Priority
Bit 7654321Bit 0
RBOOT
(1)
Figure 5-4. Highest Priority I-Bit Interrupt
(1)
SMOD
and Miscellaneous Register (HPRIO)
MDA
(1)
IRVNEPSEL2PSEL2PSEL1PSEL0
cale Semiconductor,
Frees
RBOOT — Read Bootstrap ROM Bit
Has meaning only when the SMOD bit is a 1 (bootstrap mode or special test
mode). At all other times this bit is clear and cannot be written. Refer to Section
2. Operating Modes and On-Chip Memory for more information.
SMOD — Special Mode Select Bit
This bit reflects the inverse of the MODB input pin at the rising edge of reset.
Refer to Section 2. Operating Modes and On-Chip Memory for more
information.
MDA — Mode Select A Bit
The mode select A bit reflects the status of the MODA input pin at the rising
edge of reset. Refer to Section 2. Operating Modes and On-Chip Memory for
more information.
IRVNE — Internal Read Visibility/Not E Bit
The IRVNE control bit allows internal read accesses to be available on the
external data bus during operation in expanded modes. In single-chip and
bootstrap modes, IRVNE determines whether the E clock is driven out an
external pin. For the MC68HC811E2, this bit is IRV and only controls internal
read visibility. Refer to Section 2. Operating Modes and On-Chip Memory for
more information.
PSEL[3:0] — Priority Select Bits
These bits select one interrupt source to be elevated above all other I- bit-related
sources and can be written only while the I bit in the CCR is set (interrupts
disabled).
The MCU has 18 interrupt vectors that support 22 interrupt sources. The 15
maskable interrupts are generated by on-chip peripheral systems. These interrupts
are recognized when the global interrupt mask bit (I) in the condition code register
(CCR) is clear. The three non-maskable interrupt sources are illegal opcode trap,
software interrupt, and XIRQ
sources and vector assignments for each source.
For some interrupt sources, such as the SCI interrupts, the flags are automatically
cleared during the normal course of responding to the interrupt requests. For
example, the RDRF flag in the SCI system is cleared by the automatic clearing
mechanism consisting of a read of the SCI status register while RDRF is set,
followed by a read of the SCI data register. The normal response to an RDRF
interrupt request would be to read the SCI status register to check for receive
errors, then to read the received data from the SCI data register. These steps
satisfy the automatic clearing mechanism without requiring special instructions.
pin. Refer to Table 5-4, which shows the interrupt
Data SheetM68HC11E Family — Rev. 5
98Resets and InterruptsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Page 99
Freescale Semiconductor, Inc.
Table 5-4. Interrupt and Reset Vector Assignments
Resets and Interrupts
Interrupts
nc...
I
cale Semiconductor,
Frees
Vector AddressInterrupt Source
FFC0, C1 – FFD4, D5 Reserved——
SCI serial system
• SCI receive data register full
FFD6, D7
FFD8, D9SPI serial transfer completeISPIE
FFDA, DBPulse accumulator input edgeIPAII
An interrupt can be recognized at any time after it is enabled by its local mask, if
any, and by the global mask bit in the CCR. Once an interrupt source is recognized,
the CPU responds at the completion of the instruction being executed. Interrupt
latency varies according to the number of cycles required to complete the current
instruction. When the CPU begins to service an interrupt, the contents of the CPU
registers are pushed onto the stack in the order shown in Table 5-5. After the CCR
value is stacked, the I bit and the X bit, if XIRQ is pending, are set to inhibit further
interrupts. The interrupt vector for the highest priority pending source is fetched
and execution continues at the address specified by the vector. At the end of the
interrupt service routine, the return-from-interrupt instruction is executed and the
saved registers are pulled from the stack in reverse order so that normal program
execution can resume. Refer to Section 4. Central Processor Unit (CPU).
Non-maskable interrupts are useful because they can always interrupt CPU
operations. The most common use for such an interrupt is for serious system
problems, such as program runaway or power failure. The XIRQ
updated version of the NMI
Upon reset, both the X bit and I bit of the CCR are set to inhibit all maskable
interrupts and XIRQ
bit by a TAP instruction, enabling XIRQ
the X bit. Thus, an XIRQ
operation of the I-bit-related interrupt structure has no effect on the X bit, the
internal XIRQ
interrupt has a higher priority than any source that is maskable by the I bit. All
I-bit-related interrupts operate normally with their own priority relationship.
pin remains unmasked. In the interrupt priority logic, the XIRQ
. After minimum system initialization, software can clear the X
SPPCL
)
input is an
(non-maskable interrupt) input of earlier MCUs.
interrupts. Thereafter, software cannot set
interrupt is a non-maskable interrupt. Because the
When an I-bit-related interrupt occurs, the I bit is automatically set by hardware
after stacking the CCR byte. The X bit is not affected. When an X-bit-related
interrupt occurs, both the X and I bits are automatically set by hardware after
Data SheetM68HC11E Family — Rev. 5
100Resets and InterruptsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.