MC68HC705C8A
MC68HC705C8A
MC68HC705C8A
Freescale Semiconductor, Inc...
MC68HSC705C8A
Technical Data
M68HC05
Microcontrollers
MC68HC705C8A/D
Rev. 3, 3/2002
MC68HC705C8A
MC68HSC705C8A
Freescale Semiconductor, Inc...
Technical Data
http://www.freescale.com
Revision History
Revision Page
Date Description
Level Number(s)
May, 2001 2.1 Removed note following 1.7.11 Port D I/O Pins (PD7 and
33
PD5PD0)
List of Sections
6 List of Sections
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table of Contents
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4 Programmable Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Section 2. Memory
2.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.5 RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Freescale Semiconductor, Inc...
Section 4. Interrupts
4.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Section 5. Resets
5.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8 Table of Contents
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table of Contents
6.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.3 Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.3.1 SCI During Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
6.3.2 SPI During Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.3.3 Programmable COP Watchdog in Stop Mode . . . . . . . . . . . 71
6.3.4 Non-Programmable COP Watchdog in Stop Mode . . . . . . . 73
7.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.3 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3.2 Data Direction Register A. . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.3.3 Port A Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.4.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.4.2 Data Direction Register B. . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.4.3 Port B Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.5 Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.5.1 Port C Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.5.2 Data Direction Register C. . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.5.3 Port C Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.6 Port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
8.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
10 Table of Contents
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table of Contents
12 Table of Contents
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table of Contents
Appendix A. MC68HSC705C8A
A.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Freescale Semiconductor, Inc...
Index
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
14 Table of Contents
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Figures
16 List of Figures
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Figures
18 List of Figures
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Tables
20 List of Tables
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
1.1 Contents
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Freescale Semiconductor, Inc...
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4 Programmable Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.2 Introduction
The MC68HC705C8A, an enhanced version of the MC68HC705C8, is a
member of the low-cost, high-performance M68HC05 Family of 8-bit
microcontroller units (MCU). The MC68HSC705C8A, introduced in
Appendix A. MC68HSC705C8A, is an enhanced, high-speed version of
the MC68HC705C8A. The M68HC05 Family is based on the
customer-specified integrated circuit (CSIC) design strategy. All MCUs
in the family use the M68HC05 central processor unit (CPU) and are
available with a variety of subsystems, memory sizes and types, and
Freescale Semiconductor, Inc...
package types.
1.3 Features
Features of the MC68HC705C8A include:
22 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
General Description
Programmable Options
NOTE: A line over a signal name indicates an active low signal. For example,
RESET is active high and RESET is active low. Any reference to voltage,
current, or frequency specified in this document will refer to the nominal
values. The exact values and their tolerance or limits are specified in
Section 13. Electrical Specifications.
Freescale Semiconductor, Inc...
These options are programmable in the option register (see Figure 1-1):
One of four selectable memory configurations
Programmable read-only memory (PROM) security1
External interrupt sensitivity
Address: $1FDF
Bit 7 6 5 4 3 2 1 Bit 0
Read:
RAM0 RAM1 0 0 SEC* IRQ 0
Write:
Reset: 0 0 0 0 * U 1 0
*Implemented as an EPROM cell
= Unimplemented U = Unaffected
24 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
General Description
Block Diagram
PA0
EPROM PROGRAMMING PA1
PROGRAM REGISTER
DATA DIRECTION A
VPP CONTROL
PA2
PORT A
PA3
PA4
EPROM/OTPROM 7744 BYTES
(144 BYTES CONFIGURABLE) PA5
PA6
OPTION PA7
REGISTER
PB0*
PB1*
DATA DIRECTION B
RAM 176 BYTES
(304 BYTES MAXIMUM) PB2*
Freescale Semiconductor, Inc...
PORT B
PB3*
PB4*
BOOT ROM 240 BYTES
PB5*
PB6*
RESET PB7*
CPU ARITHMETIC
CONTROL LOGIC UNIT PC0
IRQ
PC1
DATA DIRECTION C
M68HC05 CPU PC2
PORT C
CPU REGISTERS PC3
ACCUMULATOR
PC4
INDEX REGISTER PC5
PC6
0 0 0 0 0 1 1 STACK POINTER
PC7
PROGRAM COUNTER
PD7
CONDITION CODE REGISTER 1 1 1 H I N Z C
RDI (PD0)
SCI PORT D TDO (PD1)
VDD
POWER 16-BIT TCMP
VSS CAPTURE/COMPARE
TIMER SYSTEM TCAP
The pin assignments for these packages are shown in Figure 1-3,
Figure 1-4, Figure 1-5, and Figure 1-6.
RESET 1 40 VDD
IRQ 2 39 OSC1
VPP 3 38 OSC2
PA7 4 37 TCAP
PA6 5 36 PD7
PA5 6 35 TCMP
PA4 7 34 PD5/SS
PA3 8 33 PD4/SCK
PA2 9 32 PD3/MOSI
PA1 10 31 PD2/MISO
PA0 11 30 PD1/TDO
PB0 12 29 PD0/RDI
PB1 13 28 PC0
PB2 14 27 PC1
PB3 15 26 PC2
PB4 16 25 PC3
PB5 17 24 PC4
PB6 18 23 PC5
PB7 19 22 PC6
VSS 20 21 PC7
26 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
General Description
Pin Assignments
RESET
OSC1
OSC2
TCAP
PA6
PA7
VDD
IRQ
VPP
NC
NC
1
41
2
6
5
4
3
44
43
42
40
PA5 7 39 PD7
PA4 8 38 TCMP
PA3 9 37 PD5/SS
PA2 10 36 PD4/SCK
PA1 11 35 PD3/MOSI
PA0 12 34 PD2/MISO
PB0 13 33 PD1/TDO
PB1 14 32 PD0/RDI
PB2 15 31 PC0
Freescale Semiconductor, Inc...
PB3 16 30 PC1
PB4 17 29 PC2
20
21
22
23
24
25
26
27
28
18
19
NC
NC
VSS
PB5
PB6
PB7
PC7
PC6
PC5
PC4
PC3
Figure 1-4. 44-Lead PLCC/CLCC Pin Assignments
PD3/MOSI
PD2/MISO
PD4/SCK
PD1/TDO
PD0/RDI
PD5/SS
TCMP
PC0
PC1
PC2
PC3
33 32 31 30 29 28 27 26 25 24 23
PD7 34 22 NC
TCAP 35 21 PC4
OSC2 36 20 PC5
OSC1 37 19 PC6
VDD 38 18 PC7
NC 39 17 VSS
NC 40 16 NC
RESET 41 15 PB7
IRQ 42 14 PB6
VPP 43 13 PB5
44
PA7 1 12 PB4
2 3 4 5 6 7 8 9 10 11
PA6
PA5
PA4
PA3
PA2
PA1
PA0
PB0
PB1
PB2
PB3
RESET 1 42 VDD
IRQ 2 41 OSC1
VPP 3 40 OSC2
PA7 4 39 TCAP
PA6 5 38 PD7
PA5 6 37 TCMP
PA4 7 36 PD5/SS
PA3 8 35 PD4/SCK
PA2 9 34 PD3/MOSI
Freescale Semiconductor, Inc...
PA1 10 33 PD2/MISO
PA0 11 32 PD1/TDO
PB0 12 31 PD0/RDI
PB1 13 30 PC0
PB2 14 29 PC1
PB3 15 28 PC2
NC 16 27 NC
PB4 17 26 PC3
PB5 18 25 PC4
PB6 19 24 PC5
PB7 20 23 PC6
VSS 21 22 PC7
28 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
General Description
Pin Functions
VDD and VSS are the power supply and ground pins. The MCU operates
from a single power supply.
Freescale Semiconductor, Inc...
1.7.2 VPP
This pin provides the programming voltage to the EPROM array. For
normal operation, VPP shuld be tied to VDD.
NOTE: Connecting the VPP pin (programming voltage) to VSS (ground) could
result in damage to the MCU.
The OSC1 and OSC2 pins are the control connections for the 2-pin
on-chip oscillator. The oscillator can be driven by:
Crystal resonator
Ceramic resonator
External clock signal
NOTE: The frequency of the internal oscillator is fOSC. The MCU divides the
internal oscillator output by two to produce the internal clock with a
Freescale Semiconductor, Inc...
frequency of fOP.
NOTE: Use an AT-cut crystal and not a strip or tuning fork crystal. The MCU
might overdrive or have the incorrect characteristic impedance for a strip
or tuning fork crystal.
30 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
General Description
Pin Functions
MCU
OSC1 OSC2
CERAMIC
RESONATOR
NOTE: The bus frequency (fOP) is one-half the external or crystal frequency
(fOSC), while the processor clock cycle (tCYC) is two times the fOSC
period.
OSC1
OSC2
unconnected, as Figure 1-11 shows.
EXTERNAL
CMOS CLOCK
Clock
NOTE: The bus frequency (fOP) is one-half the external frequency (fOSC) while
the processor clock cycle is two times the fOSC period.
The IRQ pin is an asynchronous external interrupt pin. The IRQ pin
contains an internal Schmitt trigger as part of its input to improve noise
immunity. See 4.3.2 External Interrupt (IRQ).
The TCAP pin is the input capture pin for the on-chip capture/compare
timer. The TCAP pin contains an internal Schmitt trigger as part of its
input to improve noise immunity. See Section 8. Capture/Compare
Timer.
32 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
General Description
Pin Functions
The TCMP pin is the output compare pin for the on-chip
capture/compare timer. See Section 8. Capture/Compare Timer.
These seven lines comprise port D, a fixed input port. All special
functions that are enabled (SPI and SCI) affect this port. See 7.6 Port D.
34 General Description
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 2. Memory
2.1 Contents
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Freescale Semiconductor, Inc...
2.5 RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2 Introduction
This section describes the organization of the on-chip memory.
I/O registers are memory-mapped so that the CPU can access their
locations in the same way that it accesses all other memory locations.
The shared stack area is used during processing of an interrupt or
MOTOROLA Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
subroutine call to save the CPU state. The stack pointer decrements
during pushes and increments during pulls.
2.5 RAM
One of four selectable memory configurations is selected by the state of
the RAM1 and RAM0 bits in the option register located at $1FDF. Reset
or power-on reset (POR) clears these bits, automatically selecting the
first memory configuration as shown in Table 2-1. See 9.5.1 Option
Register.
0 0 176 7744
1 0 208 7696
0 1 272 7648
1 1 304 7600
36 Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
EPROM/OTPROM (PROM)
MOTOROLA Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
38 Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
Bootloader ROM
Read:
Port A Data Register PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
$0000 (PORTA) Write:
See page 78.
Reset: Unaffected by reset
Read:
Port B Data Register PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
$0001 (PORTB) Write:
See page 81.
Reset: Unaffected by reset
Read:
Freescale Semiconductor, Inc...
Port C Data Register PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
$0002 (PORTC) Write:
See page 85.
Reset: Unaffected by reset
Read:
Port A Data Direction DDRA7 DDRA6 DDRA5 DDRA4 DDRA3 DDRA2 DDRA1 DDRA0
$0004 Register (DDRA) Write:
See page 79.
Reset: 0 0 0 0 0 0 0 0
Read:
Port B Data Direction DDRB7 DDRB6 DDRB5 DDRB4 DDRB3 DDRB2 DDRB1 DDRB0
$0005 Register (DDRB) Write:
See page 82.
Reset: 0 0 0 0 0 0 0 0
Read:
Port C Data Direction DDRC7 DDRC6 DDRC5 DDRC4 DDRC3 DDRC2 DDRC1 DDRC0
$0006 (DDRC) Write:
See page 86.
Reset: 0 0 0 0 0 0 0 0
$0007 Unimplemented
$0008 Unimplemented
$0009 Unimplemented
= Unimplemented U = Unaffected
MOTOROLA Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
Read:
SPI Control Register SPIE SPE MSTR CPOL CPHA SPR1 SPR0
$000A (SPCR) Write:
See page 149.
Reset: 0 0 0 U U U U
Read:
Freescale Semiconductor, Inc...
SPI Data Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 BIt 2 Bit 1 Bit 0
$000C (SPDR) Write:
See page 149.
Reset: Unaffected by reset
Read:
Baud Rate Register SCP1 SCP0 SCR2 SCR1 SCR0
$000D (Baud) Write:
See page 136.
Reset: U U 0 0 U U U U
Read:
SCI Control Register 1 R8 T8 M WAKE
$000E (SCCR1) Write:
See page 130.
Reset: U U U U
Read:
SCI Control Register 2 TIE TCIE RIE ILIE TE RE RWU SBK
$000F (SCCR2) Write:
See page 131.
Reset: 0 0 0 0 0 0 0 0
Read:
SCI Data Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
$0011 (SCDR) Write:
See page 129.
Reset: Unaffected by reset
Read:
Timer Control Register ICIE OCIE TOIE 0 0 0 IEDG OLVL
$0012 (TCR) Write:
See page 94.
Reset: 0 0 0 0 0 0 U 0
= Unimplemented U = Unaffected
40 Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
Bootloader ROM
Read:
Output Compare Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
$0017 Low (OCRL) Write:
See page 101.
Reset: Unaffected by reset
= Unimplemented U = Unaffected
MOTOROLA Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Memory
Read:
EPROM Programming 0 0 0 0 0 LAT 0 PGM
$001C Register (PROG) Write:
See page 109.
Reset: 0 0 0 0 0 0 0 0
Read:
Programmable COP Reset
$001D Register (COPRST) Write: Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
See page 64.
Reset: U U U U U U U U
Read: 0 0 0 COPF
Freescale Semiconductor, Inc...
$001F Unimplemented
Read:
Option Register RAM0 RAM1 0 0 SEC* IRQ 0
$1FDF (Option) Write:
See page 116.
Reset: 0 0 0 0 * U 1 0
Read:
Mask Option Register 2 NCOPE
$1FF1 (MOR2) Write:
See page 118.
Reset: Unaffected by reset
= Unimplemented U = Unaffected
42 Memory
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
3.1 Contents
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Freescale Semiconductor, Inc...
3.2 Introduction
This section describes the central processor unit (CPU) registers.
Bit 7 6 5 4 3 2 1 Bit 0
ACCUMULATOR (A)
Bit 7 6 5 4 3 2 1 Bit 0
Freescale Semiconductor, Inc...
Bit 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Bit 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Bit 7 6 5 4 3 2 1 Bit 0
HALF-CARRY FLAG
INTERRUPT MASK
NEGATIVE FLAG
ZERO FLAG
CARRY/BORROW FLAG
3.3.1 Accumulator
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Write:
Freescale Semiconductor, Inc...
In the indexed addressing modes, the CPU uses the byte in the index
register (X) shown in Figure 3-3 to determine the conditional address of
the operand. See 12.3.5 Indexed, No Offset, 12.3.6 Indexed, 8-Bit
Offset, and 12.3.7 Indexed, 16-Bit Offset for more information on
indexed addressing.
The 8-bit index register also can serve as a temporary data storage
location.
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Write:
The stack pointer (SP) shown in Figure 3-4 is a 13-bit register that
contains the address of the next free location on the stack. During a reset
or after the reset stack pointer (RSP) instruction, the stack pointer
initializes to $00FF. The address in the stack pointer decrements as data
is pushed onto the stack and increments as data is pulled from the stack.
The seven most significant bits of the stack pointer are fixed
permanently at 0000011, so the stack pointer produces addresses from
$00C0 to $00FF. If subroutines and interrupts use more than 64 stack
Freescale Semiconductor, Inc...
locations, the stack pointer wraps around to address $00FF and begins
writing over the previously stored data. A subroutine uses two stack
locations. An interrupt uses five locations.
Bit 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Read: 0 0 0 0 0 1 1
Write:
Reset: 0 0 0 0 0 1 1 1 1 1 1 1 1
= Unimplemented
The program counter (PC) shown in Figure 3-5 is a 13-bit register that
contains the address of the next instruction or operand to be fetched.
Bit 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Read:
Write:
Reset: Loaded with reset vector from $1FFE and $1FFF
Bit 7 6 5 4 3 2 1 Bit 0
Read: 1 1 1
H I N Z C
Freescale Semiconductor, Inc...
Write:
Reset: 1 1 1 U 1 U U U
= Unimplemented U = Unaffected
H Half-Carry Bit
The CPU sets the half-carry flag when a carry occurs between bits 3
and 4 of the accumulator during an add without carry (ADD) or add
with carry (ADC) operation. The half-carry bit is required for
binary-coded decimal (BCD) arithmetic operations. Reset has no
affect on the half-carry flag.
N Negative Flag
The CPU sets the negative flag when an arithmetic operation, logical
operation, or data manipulation produces a negative result (bit 7 in the
results is a logic 1). Reset has no effect on the negative flag.
Z Zero Flag
The CPU sets the zero flag when an arithmetic operation, logical
operation, or data manipulation produces a result of $00. Reset has
no effect on the zero flag.
Freescale Semiconductor, Inc...
C Carry/Borrow Flag
The CPU sets the carry/borrow flag when an addition operation
produces a carry out of bit 7 of the accumulator or when a subtraction
operation requires a borrow. Some logical operations and data
manipulation instructions also clear or set the carry/borrow bit. Reset
has no effect on the carry/borrow flag.
Section 4. Interrupts
4.1 Contents
4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Freescale Semiconductor, Inc...
4.2 Introduction
This section describes how interrupts temporarily change the normal
processing sequence.
MOTOROLA Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
The IRQ pin, port B pins, SCI, and SPI can be masked (disabled) by
setting the I bit of the condition code register (CCR). The software
interrupt (SWI) instruction is non-maskable.
50 Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
Interrupt Sources
If the IRQ latch is set and the I bit is clear, the CPU then begins the
Freescale Semiconductor, Inc...
interrupt sequence. The CPU clears the IRQ latch while it fetches the
interrupt vector, so that another external interrupt request can be latched
during the interrupt service routine. As soon as the I bit is cleared during
the return-from-interrupt (RTI) instruction, the CPU can recognize the
new interrupt request. Figure 4-1 shows the logic for external interrupts.
1. Two single pulses on the interrupt line are spaced far enough
apart to be serviced. The minimum time between pulses is a
function of the length of the interrupt service.
Once a pulse occurs, the next pulse normally should not occur
until an RTI occurs. This time (tILIL) is obtained by adding 19
instruction cycles to the total number of cycles needed to complete
the service routine (not including the RTI instruction).
2. Many interrupt lines are wire-ORed to the IRQ line. If the interrupt
line remains low after servicing an interrupt, then the CPU
continues to recognize an interrupt.
NOTE: The internal interrupt latch is cleared in the first part of the interrupt
service routine. Therefore, a new external interrupt pulse could be
latched and serviced as soon as the I bit is cleared.
MOTOROLA Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
VDD
EXTERNAL
D Q INTERRUPT
REQUEST
I BIT (CCR)
IRQ LATCH
INTERRUPT PIN C Q
Freescale Semiconductor, Inc...
POR
R
INTERNAL RESET (COP)
EXTERNAL RESET
tILIL
a. Edge-Sensitive Trigger Condition. The minimum pulse width (tILIH) is either 125 ns (fOP = 2.1 MHz)
or 250 ns (fOP = 1 MHz). The period tILIL should not be less than the number of tCYC cycles it takes to
execute the interrupt service routine plus 19 tCYC cycles.
IRQ1 tILIH
.
.
NORMALLY .
USED WITH IRQn
WIRED-OR
CONNECTION
IRQ
(INTERNAL)
b. Level-Sensitive Trigger Condition. If the interrupt line remains low after servicing an interrupt, then the
CPU continues to recognize an interrupt.
52 Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
Interrupt Sources
When these three conditions are true, a port B pin (PBx) acts as an
external interrupt pin:
The corresponding port B pullup bit (PBPUx) in mask option
register 1 (MOR1) is programmed to a logic 1.
The corresponding port B data direction bit (DDRBx) in data
direction register B (DDRB) is a logic 0.
The clear interrupt mask (CLI) instruction has cleared the I bit in
Freescale Semiconductor, Inc...
the CCR.
When the IRQ bit is a logic 1, a falling edge or a low level on a port B
external interrupt pin latches an external interrupt request. As long as
any port B external interrupt pin is low, an external interrupt request is
present, and the CPU continues to execute the interrupt service routine.
MOTOROLA Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
VDD
PBPU7
FROM MOR1
READ $0005
WRITE $0005
DATA DIRECTION
REGISTER B
RESET BIT DDRB7
INTERNAL DATA BUS
REGISTER PB7
BIT PB7
READ $0001
IRQ
FROM OPTION
REGISTER
VDD
EXTERNAL
D Q INTERRUPT
REQUEST
FROM OTHER
PORT B PINS C Q
R
I BIT
FROM CCR
IRQ
RESET
EXTERNAL INTERRUPT VECTOR FETCH
54 Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
Interrupt Sources
Setting the I bit in the CCR disables all interrupts except for SWI.
MOTOROLA Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
56 Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
Interrupt Processing
Power-on
Reset logic None None 1 $1FFE$1FFF
RESET pin
TDRE bit
TCIE bit
TC bit
SCI
RDRF bit I bit 4 $1FF6$1FF7
interrupts RIE bit
OR bit
MOTOROLA Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
STACKING
ORDER
$00FD
$00FE
$00FF (TOP OF STACK)
NOTE: If more than one interrupt request is pending, the CPU fetches the vector
of the higher priority interrupt first. A higher priority interrupt does not
interrupt a lower priority interrupt service routine unless the lower priority
interrupt service routine clears the I bit. See Table 4-1 for a priority
listing.
58 Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
Interrupt Processing
FROM
RESET
YES I BIT IN
CCR REGISTER
SET?
NO
EXTERNAL YES
IRQ CLEAR IRQ REQUEST LATCH
INTERRUPT?
Freescale Semiconductor, Inc...
NO
TIMER YES
INTERRUPT?
NO
SCI YES
INTERRUPT?
NO
SPI YES
INTERRUPT?
NO
1. STACK PC, X, A, CCR
2. SET I BIT
3. LOAD PC WITH VECTOR
SWI: $1FFC$1FFD
IRQ: $1FFA$1FFB
TIMER: $1FF8$1FF9
FETCH NEXT SCI: $1FF6$1FF7
INSTRUCTION SPI: $1FF4$1FF5
YES
SWI
INSTRUCTION?
NO
RTI YES
INSTRUCTION? RESTORE REGISTERS FROM STACK:
CCR, A, X, PC
NO
EXECUTE INSTRUCTION
MOTOROLA Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Interrupts
Freescale Semiconductor, Inc...
60 Interrupts
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 5. Resets
5.1 Contents
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Freescale Semiconductor, Inc...
5.2 Introduction
This section describes how resets initialize the microcontroller unit
(MCU).
MOTOROLA Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
A 4064 tCYC (internal clock cycle) delay after the oscillator becomes
active allows the clock generator to stabilize. If the RESET pin is at
logic 0 at the end of 4064 tCYC, the MCU remains in the reset condition
until the signal on the RESET pin goes to logic 1.
Freescale Semiconductor, Inc...
The minimum time required for the MCU to recognize a reset is 1 1/2
tCYC. However, to guarantee that the MCU recognizes an external reset
as an external reset and not as a COP or clock monitor reset, the RESET
pin must be low for eight tCYC. After six tCYC, the input on the RESET pin
is sampled. If the pin is still low, an external reset has occurred. If the
input is high, then the MCU assumes that the reset was initiated
internally by either the COP watchdog timer or by the clock monitor. This
method of differentiating between external and internal reset conditions
assumes that the RESET pin will rise to a logic 1 less than two tCYC after
its release and that an externally generated reset should stay active for
at least eight tCYC.
One COP has four programmable timeout periods and the other has a
fixed non-programmable timeout period.
62 Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
Reset Sources
1. $55
2. $AA
The $55 write must precede the $AA write. Instructions may be executed
between the write operations provided that the COP watchdog does not
time out before the second write.
213 CM0
CM1
215
217
RESET
219
4 2 2 2 2 2 2 221 PCOPE
COPRST
MOTOROLA Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
Address: $001D
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Reset: U U U U U U U U
= Unimplemented U = Unaffected
Address: $001E
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 0 0 0 U 0 0 0 0
= Unimplemented U = Unaffected
64 Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
Reset Sources
NOTE: Do not enable the clock monitor in applications with an internal clock
frequency of 200 kHz or less.
Freescale Semiconductor, Inc...
Bits 75 Unused
Bits 75 always read as logic 0s. Reset clears bits 75.
MOTOROLA Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
262,144
Timeout period =
fOSC
NOTE: Writing a logic 1 to the programmable COP enable bit (PCOPE) in the
COP control register enables the programmable COP watchdog. Setting
the PCOPE bit while the NCOPE bit is programmed to logic 1 enables
both COP watchdogs to operate at the same time.
66 Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
Reset Sources
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
When the CME bit in the COP control register is set, the clock monitor
detects the absence of the internal bus clock for a certain period of time.
The timeout period depends on processing parameters and varies from
5 s to 100 s, which implies that systems using a bus clock rate of
200 kHz or less should not use the clock monitor function.
MOTOROLA Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Resets
68 Resets
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
6.1 Contents
6.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Freescale Semiconductor, Inc...
6.2 Introduction
This section describes the three low-power modes:
Stop mode
Wait mode
Data-retention mode
STOP WAIT
OSCILLATOR ACTIVE
STOP OSCILLATOR TIMER, SCI, AND SPI
AND ALL CLOCKS CLOCKS ACTIVE
CLEAR I BIT CPU CLOCKS STOPPED
CLEAR I BIT
Freescale Semiconductor, Inc...
NO NO
RESET RESET
YES YES
INTERNAL TIMER
INTERRUPT
YES
NO
TURN ON OSCILLATOR
WAIT FOR TIME RESTART CPU CLOCK
DELAY TO STABILIZE
YES
INTERNAL SCI
INTERRUPT
During stop mode, the I bit in the condition code register (CCR) is
cleared to enable external interrupts. All other registers and memory
remain unaltered. All input/output (I/O) lines remain unchanged. The
processor can be brought out of stop mode only by an external interrupt
or reset.
70 Low-Power Modes
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Low-Power Modes
Stop Mode
When the MCU enters stop mode, the baud rate generator stops, halting
all SCI activity. If the STOP instruction is executed during a transmitter
transfer, that transfer is halted. If a low input to the IRQ pin is used to exit
stop mode, the transfer resumes.
If the SCI receiver is receiving data and stop mode is entered, received
data sampling stops because the baud rate generator stops, and all
subsequent data is lost. Therefore, all SCI transfers should be in the idle
state when the STOP instruction is executed.
Freescale Semiconductor, Inc...
When the MCU enters stop mode, the baud rate generator stops,
terminating all master mode SPI operations. If the STOP instruction is
executed during an SPI transfer, that transfer halts until the MCU exits
stop mode by a low signal on the IRQ pin. If reset is used to exit stop
mode, the SPI control and status bits are cleared, and the SPI is
disabled.
If the MCU is in slave mode when the STOP instruction is executed, the
slave SPI continues to operate and can still accept data and clock
information in addition to transmitting its own data back to a master
device. At the end of a possible transmission with a slave SPI in stop
mode, no flags are set until a low on the IRQ pin wakes up the MCU.
NOTE: Although a slave SPI in stop mode can exchange data with a master SPI,
the status bits of a slave SPI are inactive in stop mode.
The STOP instruction turns off the internal oscillator and suspends the
computer operating properly (COP) watchdog counter. If the RESET pin
brings the MCU out of stop mode, the reset function clears and disables
the COP watchdog.
If the IRQ pin brings the MCU out of stop mode, the COP counter
resumes counting from its suspended value after the 4064-tCYC clock
stabilization delay. See Figure 6-2.
NOTE: If the clock monitor is enabled (CME = 1), the STOP instruction causes
the clock monitor to time out and reset the MCU.
STOP
EXTERNAL YES
RESET?
NO
NO
EXTERNAL TURN ON INTERNAL OSCILLATOR
INTERRUPT? CLEAR COP COUNTER
CLEAR PCOPE BIT IN COPCR
YES
NO
END OF YES
STABILIZATION
DELAY?
NO
TURN ON INTERNAL CLOCK
72 Low-Power Modes
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Low-Power Modes
Wait Mode
If the RESET pin brings the MCU out of stop mode, the COP watchdog
begins counting immediately. The reset function clears the COP counter
again after the 4064-tCYC clock stabilization delay.
Freescale Semiconductor, Inc...
If the IRQ pin brings the MCU out of stop mode, the COP watchdog
begins counting immediately. The IRQ function does not clear the
COP counter again after the 4064-tCYC clock stabilization delay. See
Figure 6-3.
NOTE: If the clock monitor is enabled (CME = 1), the STOP instruction causes
it to time out and reset the MCU.
The WAIT instruction does not affect any other registers or I/O lines. The
capture/compare timer, SCI, and SPI can be enabled to allow a periodic
exit from wait mode.
STOP
EXTERNAL YES
RESET?
Freescale Semiconductor, Inc...
NO
NO
EXTERNAL
INTERRUPT? TURN ON INTERNAL OSCILLATOR
TURN ON COP WATCHDOG
YES
NO
END OF YES
STABILIZATION
DELAY?
NO
CLEAR COP COUNTER
TURN ON INTERNAL CLOCK
74 Low-Power Modes
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Low-Power Modes
Data-Retention Mode
76 Low-Power Modes
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
7.1 Contents
7.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Freescale Semiconductor, Inc...
7.3 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3.2 Data Direction Register A. . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.3.3 Port A Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.4.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.4.2 Data Direction Register B. . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.4.3 Port B Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.5 Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.5.1 Port C Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.5.2 Data Direction Register C. . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.5.3 Port C Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.6 Port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.2 Introduction
This section describes the programming of ports A, B, C, and D.
7.3 Port A
Port A is an 8-bit, general-purpose, bidirectional input/output (I/O) port.
The port A data register (PORTA) shown in Figure 7-1 contains a data
latch for each of the eight port A pins. When a port A pin is programmed
to be an output, the state of its data register bit determines the state of
the output pin. When a port A pin is programmed to be an input, reading
Freescale Semiconductor, Inc...
the port A data register returns the logic state of the pin.
Address: $0000
Bit 7 6 5 4 3 2 1 Bit 0
Read:
PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
Write:
Address: $0004
Bit 7 6 5 4 3 2 1 Bit 0
Freescale Semiconductor, Inc...
Read:
DDRA7 DDRA6 DDRA5 DDRA4 DDRA3 DDRA2 DDRA1 DDRA0
Write:
Reset: 0 0 0 0 0 0 0 0
NOTE: Avoid glitches on port A pins by writing to the port A data register before
changing DDRA bits from logic 0 to logic 1.
READ $0004
WRITE $0004
DATA DIRECTION
REGISTER A
RESET BIT DDRAx
INTERNAL DATA BUS
Freescale Semiconductor, Inc...
READ $0000
The data latch can always be written, regardless of the state of its DDRA
bit. Table 7-1 summarizes the operation of the port A pins.
NOTE: To avoid excessive current draw, tie all unused input pins to VDD or VSS,
or change I/O pins to outputs by writing to DDRA in user code as early
as possible.
7.4 Port B
Port B is an 8-bit, general-purpose, bidirectional I/O port. Port B pins can
also be configured to function as external interrupts. The port B pullup
devices are enabled in mask option register 1 (MOR1). See 9.5.2 Mask
Option Register 1 and 4.3.3 Port B Interrupts.
The port B data register (PORTB) shown in Figure 7-4 contains a data
Freescale Semiconductor, Inc...
Address: $0001
Bit 7 6 5 4 3 2 1 Bit 0
Read:
PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
Write:
Address: $0005
Bit 7 6 5 4 3 2 1 Bit 0
Read:
DDRB7 DDRB6 DDRB5 DDRB4 DDRB3 DDRB2 DDRB1 DDRB0
Write:
Reset: 0 0 0 0 0 0 0 0
NOTE: Avoid glitches on port B pins by writing to the port B data register before
changing DDRB bits from logic 0 to logic 1.
VDD
PBPU7
FROM MOR1
READ $0005
WRITE $0005
Freescale Semiconductor, Inc...
DATA DIRECTION
REGISTER B
RESET BIT DDRB7
INTERNAL DATA BUS
READ $0001
IRQ
FROM OPTION
REGISTER
VDD
EXTERNAL
D Q INTERRUPT
IRQ REQUEST
FROM OTHER LATCH
PORT B PINS C Q
R
I BIT
FROM CCR
IRQ
RESET
EXTERNAL INTERRUPT VECTOR FETCH
When a port B pin is programmed as an output, reading the port bit reads
the value of the data latch and not the voltage on the pin itself. When a
port B pin is programmed as an input, reading the port bit reads the
voltage level on the pin. The data latch can always be written, regardless
of the state of its DDRB bit.
NOTE: To avoid excessive current draw, tie all unused input pins to VDD or VSS,
or for I/O pins change to outputs by writing to DDRB in user code as early
as possible.
7.5 Port C
Port C is an 8-bit, general-purpose, bidirectional I/O port. PC7 has a high
current sink and source capability.
The port C data register (PORTC) shown in Figure 7-7 contains a data
latch for each of the eight port C pins. When a port C pin is programmed
to be an output, the state of its data register bit determines the state of
Freescale Semiconductor, Inc...
Address: $0002
Bit 7 6 5 4 3 2 1 Bit 0
Read:
PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
Write:
Address: $0006
Bit 7 6 5 4 3 2 1 Bit 0
Freescale Semiconductor, Inc...
Read:
DDRC7 DDRC6 DDRC5 DDRC4 DDRC3 DDRC2 DDRC1 DDRC0
Write:
Reset: 0 0 0 0 0 0 0 0
NOTE: Avoid glitches on port C pins by writing to the port C data register before
changing DDRC bits from logic 0 to logic 1.
READ $0006
WRITE $0006
DATA DIRECTION
REGISTER C
RESET BIT DDRCx
INTERNAL DATA BUS
Freescale Semiconductor, Inc...
READ $0002
When a port C pin is programmed as an output, reading the port bit reads
the value of the data latch and not the voltage on the pin. When a port C
pin is programmed as an input, reading the port bit reads the voltage
level on the pin. The data latch can always be written, regardless of the
state of its DDRC bit. Table 7-3 summarizes the operation of the port C
pins.
NOTE: To avoid excessive current draw, tie all unused input pins to VDD or VSS
or change I/O pins to outputs by writing to DDRC in user code as early
as possible.
7.6 Port D
Port D is a 7-bit, special-purpose, input-only port that has no data
register. Reading address $0003 returns the logic states of the port D
pins.
Port D shares pins PD5PD2 with the serial peripheral interface module
(SPI). When the SPI is enabled, PD5PD2 read as logic 0s. When the
SPI is disabled, reading address $0003 returns the logic states of the
PD5PD2 pins.
Freescale Semiconductor, Inc...
Port D shares pins PD1 and PD0 with the SCI module. When the SCI is
enabled, PD1 and PD0 read as logic 0s. When the SCI is disabled,
reading address $0003 returns the logic states of the PD1 and PD0 pins.
Address: $0003
Bit 7 6 5 4 3 2 1 Bit 0
Write:
= Unimplemented
8.1 Contents
8.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Freescale Semiconductor, Inc...
8.2 Introduction
This section describes the operation of the 16-bit capture/compare timer.
Figure 8-1 shows the structure of the timer module. Figure 8-2 is a
summary of the timer input/output (I/O) registers.
EDGE
SELECT/
TCAP DETECT ICRH ($0014) ICRL ($0015)
LOGIC
16-BIT COUNTER
OVERFLOW
PIN
16-BIT COMPARATOR CONTROL TCMP
LOGIC
TIMER
INTERRUPT
REQUEST
OCF
TOF
ICF
OCIE
IEDG
OLVL
TOIE
ICIE
90 Capture/Compare Timer
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Capture/Compare Timer
Timer Operation
Because of the 16-bit timer architecture, the I/O registers for the input
capture and output compare functions are pairs of 8-bit registers.
The input capture function can record the time at which an external event
Freescale Semiconductor, Inc...
occurs. When the input capture circuitry detects an active edge on the
input capture pin (TCAP), it latches the contents of the timer registers
into the input capture registers. The polarity of the active edge is
programmable.
15 $0018 8 7 $0019 0
TIMER REGISTER HIGH TIMER REGISTER LOW
15 8 7 0
EDGE LATCH
TCAP SELECT/DETECT INPUT CAPTURE REGISTER HIGH INPUT CAPTURE REGISTER LOW
LOGIC
$0014 $0015
TIMER
INTERRUPT
REQUEST
OCIE
OLVL
TOIE
OCF
TOF
ICIE
ICF
92 Capture/Compare Timer
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Capture/Compare Timer
Timer Operation
The output compare function can generate an output signal when the
16-bit counter reaches a selected value. Software writes the selected
value into the output compare registers. On every fourth internal clock
cycle the output compare circuitry compares the value of the counter to
the value written in the output compare registers. When a match occurs,
the timer transfers the programmable output level bit (OLVL) from the
timer control register to the output compare pin (TCMP).
Software can use the output compare register to measure time periods,
Freescale Semiconductor, Inc...
15 0
COUNTER HIGH BYTE COUNTER LOW BYTE
PIN
16-BIT COMPARATOR CONTROL TCMP
LOGIC
15 8 7 0
OUTPUT COMPARE REGISTER HIGH OUTPUT COMPARE REGISTER LOW
$0016 $0017
TIMER
INTERRUPT
REQUEST
OCIE
TOIE
OCF
TOF
ICIE
ICF
The timer control register (TCR) as shown in Figure 8-5 performs these
functions:
Address: $0012
Bit 7 6 5 4 3 2 1 Bit 0
Read:
ICIE OCIE TOIE 0 0 0 IEDG OLVL
Write:
Reset: 0 0 0 0 0 0 U 0
U = Unaffected
94 Capture/Compare Timer
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Capture/Compare Timer
Timer I/O Registers
Address: $0013
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: U U U 0 0 0 0 0
= Unimplemented U = Unaffected
96 Capture/Compare Timer
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Capture/Compare Timer
Timer I/O Registers
The read-only timer registers (TRH and TRL) shown in Figure 8-7
contain the current high and low bytes of the 16-bit counter. Reading
TRH before reading TRL causes TRL to be latched until TRL is read.
Reading TRL after reading the timer status register clears the timer
overflow flag bit (TOF). Writing to the timer registers has no effect.
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Write:
= Unimplemented
Reading TRH returns the current value of the high byte of the counter
and causes the low byte to be latched into a buffer, as shown in
Figure 8-8. The buffer value remains fixed even if the high byte is read
more than once. Reading TRL reads the transparent low byte buffer and
completes the read sequence of the timer registers.
7 0
Freescale Semiconductor, Inc...
LATCH
LOW BYTE BUFFER
15 8 7 0
$0018 TIMER REGISTER HIGH TIMER REGISTER LOW $0019
READ TRH
NOTE: To prevent interrupts from occurring between readings of TRH and TRL,
set the interrupt mask (I bit) in the condition code register before reading
TRH, and clear the mask after reading TRL.
The alternate timer registers (ATRH and ATRL) shown in Figure 8-9
contain the current high and low bytes of the 16-bit counter. Reading
ATRH before reading ATRL causes ATRL to be latched until ATRL is
read. Reading does not affect the timer overflow flag (TOF). Writing to
the alternate timer registers has no effect.
98 Capture/Compare Timer
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Capture/Compare Timer
Timer I/O Registers
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Write:
Freescale Semiconductor, Inc...
= Unimplemented
Reading ATRH returns the current value of the high byte of the counter
and causes the low byte to be latched into a buffer, as shown in
Figure 8-10.
7 0
LATCH
LOW BYTE BUFFER
15 8 7 0
$001A ALTERNATE TIMER REGISTER HIGH ALTERNATE TIMER REGISTER LOW $001B
READ ATRH
When a selected edge occurs on the TCAP pin, the current high and low
bytes of the 16-bit counter are latched into the read-only input capture
registers (ICRH and ICRL) shown in Figure 8-11. Reading ICRH before
reading ICRL inhibits further captures until ICRL is read. Reading ICRL
after reading the timer status register clears the input capture flag (ICF).
Writing to the input capture registers has no effect.
Bit 7 6 5 4 3 2 1 Bit 0
Freescale Semiconductor, Inc...
Write:
Write:
= Unimplemented
When the value of the 16-bit counter matches the value in the read/write
output compare registers (OCRH and OCRL) shown in Figure 8-12, the
planned TCMP pin action takes place. Writing to OCRH before writing to
OCRL inhibits timer compares until OCRL is written. Reading or writing
to OCRL after reading the timer status register clears the output
compare flag (OCF).
Bit 7 6 5 4 3 2 1 Bit 0
Freescale Semiconductor, Inc...
Read:
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Write:
To prevent OCF from being set between the time it is read and the time
the output compare registers are updated, use this procedure:
9.1 Contents
9.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Freescale Semiconductor, Inc...
9.2 Introduction
This section describes erasable, programmable read-only
memory/one-time programmable read-only memory (EPROM/OTPROM
(PROM)) programming.
U4 MC145406 9 16 1 8 Driver/receiver
START
APPLY VPP
NTRYS = 0
START AT BEGINNING
OF MEMORY
Freescale Semiconductor, Inc...
LAT = 1
PGM = 1
WAIT 1 ms
PGM = 0
LAT = 0
YES WRITE
ADDITIONAL
BYTE
NO
NTRYS = NTRYS + 1
NO
NTRYS = 2
YES
VPP OFF
END
VR1 NMA0512S
OFF S1 DC-DC CONVERTER A
(OPTIONAL)
+5 V
1 5
ON
VCC 0V R15
P1 + C1
10 K
+V V GND 100 F
+5 V 4 OFF 6 4 2
+12 V 40
+12 V 2 VDD
ON 39
12 V 3 12 V OSC1 B
38
3 OSC2 C
VPP 5 VPP
D1
GND 1 1N4001 VPP
1
RESET D
Freescale Semiconductor, Inc...
+5 V 2
16 9 IRQ E
P3 37
30 TCAP F
RXD 3 14 PD1
3 PD1 36
PD7 G
35
2 15 29 TCMP H
TXD PD0
2 PD0 34
10 (A0) PA0 11 PD5 I
U4 U1 A0 PA0 33
MC145406 2764 9 (A1) PA1 10 PD4 J
1 8 A1 PA1 32
+5 V 8 (A2) PA2 9 PD3 K
+12 V 12 V A2 PA2 31
1 7 (A3) PA3 8 PD2 L
VPP A3 PA3
26 6 (A4) PA4 7
U2
NC A4 PA4 40-PIN DIP
27 5 (A5) PA5 6 SOCKET
PGM A5 PA5
28 4 (A6) PA6 5
CTS VCC A6 PA6 23
5 PC5 M
3 (A7) PA7 4
DSR C5 A7 PA7 22
6 0.1 F PC6 N
DCD
8 11 (D0) PB0 12 28 (A8)
20
DTR CE D0 PB0 PC0
20 12 (D1) PB1 13 27 (A9)
GND D1 PB1 PC1
1 (A8) 25 13 (D2) PB2 14 26 (A10)
GND A8 D2 PB2 PC2
7 (A9) 24 15 (D3) PB3 15
A9 D3 25 (A11)
PB3
(A10) 21 16 (D4) PB4 16 PC3
A10 D4 PB4 24 (A12)
(A11) 23 17 (D5) PB5 17 PC4
A11 D5 PB5
(A12) 2 18 (D6) PB6 18
A12 D6 PB6
22 19 (D7) PB7 19 21
OE D7 PB7 PC7 O
GND VSS
14 20
Notes:
1. The asterisk (*) denotes option T P
command only.
2. Unless otherwise specified, resistors are in ohms, Q
5% 1/4 W; capacitors are in F; voltages are dc. (ENABLE)
J1 R2
NC
R3 10 K 3 2 1 1
10 K NC
A +5 V 3
R1 NC
B +12 V 38
NC
C 2.7 K 39
NC NC
R5 40
+5 V C2 S2
1.0 F OUT
10 M
Y1 RESET
R13 R4
10 K 10 K
C4 C3 P2
2.0 MHz +5 V
22 pF 22 pF IRQ
2
D +5 V
E
F
Freescale Semiconductor, Inc...
G S3 S4 S5 S6
H
PD5
I 34
PD4
J 33
PD3
K 32
PD2
L 31
PD7
+5 V +5 V 36
R10* 1 2
470 R12
VERF R9 R8 R7 R6 10 K
J2
10 K 10 K 10 K 10 K
DS2* TCAP
+5 V 37
TCMP
(VERF) 35
M PB0
12
(PROG) PB1
N NC NC C6 13
0.1 F PB2
6 (A6)
5 (A7)
PROG 14
PB3
41
1
3
VDD 44
43
42
VPP 4
40
15
PB4
16
OSC1
PA6
TCAP
OSC2
NC
NC
PA7
IRQ
RESET
DS1* PB5
(A5) 7 39 17
PA5 PD7 PB6
(A4) 8 38 18
PA4 TCMP PB7
(A3) 9 37 PD5 19
R11* PA3 PD5
470 (A2) 10 36 PD4 PA0
PA2 PD4 11
(A1) 11 35 PD3 PA1
PA1 PD3 10
(A0) 12 U3 34 PD2 PA2
+5 V PA0 44-LEAD PLCC PD2 9
(D0) 13 33 PD1 PA3
PB0 SOCKET PD1 8
(D1) 14 32 PD0 PA4
PB1 PD0 7
(D2) 15 31 (A8) PA5
PB2 PC0 6
(D3) 16 30 (A9) PA6
PB3 PC1 5
(D4) 17 29 (A10) PA7
PB4 PC2 4
PC0
PC7
PC5
PC4
PB5
PB7
PC6
PC3
PB6
VSS
NC
NC
28
PC1
27
21
(PROG) 25
19
23
(A11) 28
18
20
22
24
(A12) 27
(VERF) 26
PC2
26
PC3
(D5)
(D6)
(D7)
25
O PC4
NC NC 24
P PD1
30
Q PD0
29
R PC5
23
PC6
22
PC7
S 21
VSS
20
To program the PROM MCU, the MCU is installed in the PCB, along with
an EPROM device programmed with user code; the MCU is then
subjected to a series of routines. The routines necessary to program,
verify, and secure the PROM MCU are:
Program and verify PROM
Verify PROM contents only
Secure PROM and verify
Secure PROM and dump through the serial communications
interface (SCI)
Freescale Semiconductor, Inc...
The user first configures the MCU for the bootstrap mode of operations
by installing a fabricated jumper across pins 1 and 2 of the boards mode
select header, J1. Next, the boards mode switches (S3, S4, S5, and S6)
are set to determine the routine to be executed after the next reset, as
shown in Table 9-2.
The program register (PROG) shown in Figure 9-3 is used for PROM
programming.
Address: $001C
Bit 7 6 5 4 3 2 1 Bit 0
Read:
0 0 0 0 0 LAT 0 PGM
Write:
Freescale Semiconductor, Inc...
Reset: 0 0 0 0 0 0 0 0
NOTE: If the VPP level at the MCU exceeds +16 Vdc, then the MC68HC705C8A
MCU device will suffer permanent damage.
Once those conditions are met, the user should take these steps before
beginning programming:
NOTE: No PROM MCU should be inserted in or removed from its board socket
(U2 or U3) while VPP (P1, slot 5) or VDD (switch 1) is active on the board.
The program and verify PROM routine copies the contents of the
external EPROM into the MCU PROM with direct correspondence
between the addresses. Memory addresses in the MCU that are not
Freescale Semiconductor, Inc...
To run the program and verify the PROM routine on the PROM MCU,
take these steps:
The verify PROM contents routine is normally run automatically after the
PROM is programmed. Direct entry to this routine causes the PROM
contents of the MCU to be compared to the contents of the external
memory locations of the EPROM at the same addresses.
To invoke the verify PROM contents routine of the MCU, take these
steps:
The secure PROM routines are used after the PROM is successfully
programmed and verified. Only the SEC bit of the option register
($1FDF) is programmed, but VPP is necessary. Once this bit is
programmed, PROM is secure and can be neither verified nor dumped.
No LED is illuminated during this routine. Further, the end of the routine
does not mean that the SEC bit was verified. To ensure that security is
properly enabled, attempt to perform another verify routine. If the green
LED does not light, the PROM has been secured properly.
No LED is illuminated during this routine. Further, the end of the routine
does not mean that the SEC bit was verified. To ensure that security is
properly enabled, attempt to perform another verify routine. If the green
LED does not light, the PROM has been secured properly.
In the load program in RAM and execute routine, user programs are
loaded via the SCI port and then executed. Data is loaded sequentially
starting at address $0050. After the last byte is loaded, control is
Freescale Semiconductor, Inc...
transferred to the RAM program starting at $0051. The first byte loaded
is the count of the total number of bytes in the program plus the count
byte. The program starts at location $0051 in RAM. During initialization,
the SCI is configured for eight data bits and one stop bit. The baud rate
is 4800 with a 2-MHz crystal or 9600 with a 4-MHz crystal.
To load a program into RAM and execute it, take these steps:
Execution of the routine can be held off by setting the byte count in the
count byte (the first byte loaded) to a value greater than the number of
bytes to be loaded. After loading the last byte, the firmware waits for
more data. Program execution does not begin. At this point, placing
switch 2 in the RESET position resets the MCU with the RAM data intact.
Any other routine can be entered, including the one to execute the
program in RAM, simply by setting switches S3S6 as necessary to
select the desired routine, then setting switch 2 in the OUT position.
In the dump PROM contents routine, the PROM contents are dumped
sequentially to the SCI output, provided the PROM has not been
secured. The first location sent is $0020 and the last location sent is
$1FFF. Unused locations are skipped so that no gaps exist in the data
stream. The external memory address lines indicate the current location
being sent. Data is sent with eight data bits and one stop bit at 4800 baud
with a 2-MHz crystal or 9600 baud with a 4-MHz crystal.
The option register shown in Figure 9-4 is used to select the IRQ
sensitivity, enable the PROM security, and select the memory
Freescale Semiconductor, Inc...
configuration.
Address: $1FDF
Bit 7 6 5 4 3 2 1 Bit 0
Read:
RAM0 RAM1 0 0 SEC* IRQ 0
Write:
Reset: 0 0 0 0 * U 1 0
*Implemented as an EPROM cell
= Unimplemented U = Unaffected
Address: $1FF0
Bit 7 6 5 4 3 2 1 Bit 0
Read: PBPU0/
PBPU7 PBPU6 PBPU5 PBPU4 PBPU3 PBPU2 PBPU1
Write: COPC
Erased: 0 0 0 0 0 0 0 0
NOTE: PBPU0/COPC programmed to a 1 enables the port B pullup bit. This bit
is also used to clear the non-programmable COP (MC68HC05C4A
type). Writing to this bit to clear the COP will not affect the state of the
port B pull-up (bit 0). See 5.3.3 Programmable and
Non-Programmable COP Watchdog Resets.
Address: $1FF1
Bit 7 6 5 4 3 2 1 Bit 0
Read:
NCOPE
Write:
Erased: 0 0 0 0 0 0 0 0
= Unimplemented
10.1 Contents
10.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Freescale Semiconductor, Inc...
10.2 Introduction
The serial communications interface (SCI) module allows high-speed
asynchronous communication with peripheral devices and other
microcontroller units (MCUs).
10.3 Features
Features of the SCI module include:
10.5.1 Transmitter
Figure 10-2 shows the structure of the SCI transmitter. Figure 10-3 is a
summary of the SCI transmitter input/output (I/O) registers.
SCDR ($0011)
1X
BAUD RATE TRANSMIT SHIFT REGISTER
CLOCK PIN BUFFER PD1/
H 8 7 6 5 4 3 2 1 0 L AND CONTROL TDO
TRANSMITTER
CONTROL LOGIC
RDRF
IDLE
TC
OR
NF
FE
R8
T8
TDRE
TIE
TC
SCI RECEIVE TCIE
REQUESTS
RWU
TCIE
SBK
ILIE
RIE
TIE
RE
TE
SCCR2 ($000F)
SCI INTERRUPT
REQUEST
10.5.2 Receiver
16X
BAUD RATE 16
START
STOP
CLOCK RECEIVE SHIFT REGISTER
DISABLE
Freescale Semiconductor, Inc...
RE
M
WAKEUP
INTERNAL DATA BUS
LOGIC
IDLE
RDRF
WAKE
TDRE
OR
TC
NF
R8
FE
T8
RDRF
RIE
IDLE
SBK
ILIE
RIE
TIE
RE
TE
SCCR2 ($000F)
SCI INTERRUPT
REQUEST
Framing Errors If the data recovery logic does not detect a logic
1 where the stop bit should be in an incoming character, it sets the
framing error (FE) bit in the SCSR. The FE bit is set at the same
time that the RDRF bit is set.
Receiver Interrupts These sources can generate SCI receiver
interrupt requests:
Receive Data Register Full (RDRF) The RDRF bit in the
SCSR indicates that the receive shift register has transferred a
character to the SCDR.
Freescale Semiconductor, Inc...
The SCI data register (SCDR) shown in Figure 10-5 is the buffer for
characters received and for characters transmitted.
Address: $0011
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Write:
Address: $000E
Bit 7 6 5 4 3 2 1 Bit 0
Read:
R8 T8 M WAKE
Write:
Reset: U U U U
= Unimplemented U = Unaffected
R8 Bit 8 (Received)
When the SCI is receiving 9-bit characters, R8 is the ninth bit of the
received character. R8 receives the ninth bit at the same time that the
SCDR receives the other eight bits. Reset has no effect on the R8 bit.
T8 Bit 8 (Transmitted)
When the SCI is transmitting 9-bit characters, T8 is the ninth bit of the
transmitted character. T8 is loaded into the transmit shift register at
the same time that SCDR is loaded into the transmit shift register.
Reset has no effect on the T8 bit.
Address: $000F
Bit 7 6 5 4 3 2 1 Bit 0
Read:
TIE TCIE RIE ILIE TE RE RWU SBK
Write:
Reset: 0 0 0 0 0 0 0 0
idle input or an address mark brings the receiver out of the standby
state. Reset clears the RWU bit.
1 = Standby state
0 = Normal operation
The SCI status register (SCSR) shown in Figure 10-8 contains flags to
signal these conditions:
Transfer of SCDR data to transmit shift register complete
Transmission complete
Transfer of receive shift register data to SCDR complete
Receiver input idle
Receiver overrun
Noisy data
Framing error
Address: $0010
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 1 1 0 0 0 0 0 U
= Unimplemented U = Unaffected
The baud rate register shown in Figure 10-9 selects the baud rate for
both the receiver and the transmitter.
Address: $000D
Bit 7 6 5 4 3 2 1 Bit 0
Read:
SCP1 SCP0 SCR2 SCR1 SCR0
Write:
Freescale Semiconductor, Inc...
Reset: U U 0 0 U U U U
= Unimplemented U = Unaffected
00 Internal clock 1
01 Internal clock 3
10 Internal clock 4
11 Internal clock 13
Prescaled clock 4
Freescale Semiconductor, Inc...
010
Table 10-3 shows all possible SCI baud rates derived from crystal
frequencies of 2 MHz, 4 MHz, and 4.194304 MHz.
11.1 Contents
11.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Freescale Semiconductor, Inc...
11.2 Introduction
The serial peripheral interface (SPI) module allows full-duplex,
synchronous, serial communication with peripheral devices.
11.3 Features
Features of the SPI include:
Full-duplex operation
Master and slave modes
Four programmable master mode frequencies (1.05 MHz
maximum)
2.1-MHz maximum slave mode frequency
Freescale Semiconductor, Inc...
Figure 11-1 shows the structure of the SPI module. Figure 11-2 is a
summary of the SPI input/output (I/O) registers.
INTERNAL S PD2/
CLOCK MISO
(XTAL 2) M
SPI SHIFT REGISTER M
7 6 5 4 3 2 1 0 S PD3/
MOSI
SS
Freescale Semiconductor, Inc...
MSTR MSTR
SPE SPE
SPI CONTROL
SPIE DWOM
DWOM
MSTR
CPHA
CPOL
SPR1
SPR0
MODF
WCOL
SPIE
SPE
SPIF
SPCR ($000A)
SPSR ($000B)
Read:
SPI Control Register SPIE SPE MSTR CPOL CPHA SPR1 SPR0
$000A (SPCR) Write:
See page 149.
Reset: 0 0 0 U U U U
Read:
Freescale Semiconductor, Inc...
SPI Data Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 BIt 2 Bit 1 Bit 0
$000C (SPDR) Write:
See page 149.
Reset: Unaffected by reset
= Unimplemented U = Unaffected
11.4 Operation
The master/slave SPI allows full-duplex, synchronous, serial
communication between the microcontroller unit (MCU) and peripheral
devices, including other MCUs. As the 8-bit shift register of a master SPI
transmits each byte to another device, a byte from the receiving device
enters the master SPI shift register. A clock signal from the master SPI
synchronizes data transmission.
In a slave SPI, data enters the shift register under the control of the serial
clock from the master SPI. After a byte enters the shift register of a slave
SPI, it transfers to the SPDR. To prevent an overrun condition, slave
software must then read the byte in the SPDR before another byte enters
the shift register and is ready to transfer to the SPDR.
Figure 11-3 shows how a master SPI exchanges data with a slave SPI.
PD3/MOSI
Freescale Semiconductor, Inc...
PD4/SCK
Setting the MSTR bit in the SPI control register (SPCR) configures the
SPI for operation in master mode. The master-mode functions of the SPI
pins are:
Clearing the MSTR bit in the SPCR configures the SPI for operation in
slave mode. The slave-mode functions of the SPI pins are:
PD4/SCK (serial clock) In slave mode, the PD4/SCK pin is the
input for the synchronizing clock signal from the master SPI.
PD3/MOSI (master output, slave input) In slave mode, the
PD3/MOSI pin is the serial input.
PD2/MISO (master input, slave output) In slave mode, the
Freescale Semiconductor, Inc...
When CPHA = 0, the shift clock is the OR of SS with SCK. In this clock
phase mode, SS must go high between successive characters in an SPI
message. When CPHA = 1, SS may be left low for several SPI
characters. In cases with only one SPI slave MCU, the slave MCU SS
line can be tied to VSS as long as CPHA = 1 clock modes are used.
The WCOL flag bit can be improperly set when attempting the first
transmission after a reset if these conditions are present: MSTR = 0,
CPOL = 0, CPHA = 1, SS pin = 0, and SCK pin = 1. The reset states of
the CPOL and CPHA bits are 0 and 1, respectively. Under normal
operating conditions (CPOL = 0, CPHA = 1), the SCK input will be low.
The incorrect setting of the WCOL bit can be prevented in two ways:
1. Send a dummy transmission after reset, clear the WCOL flag, and
then proceed with the real transmission.
2. Use the MSTR bit in the SPCR (SPI control register). This is
accomplished by setting the MSTR bit at the same time the CPOL
and CPHA bits are programmed to the desired logic levels. Then,
the data register can be written to if desired. After this, the MSTR
bit should be set to a logic 0, the SPE (SPI enable bit) should be
set to a logic 1, and the CPOL, CPHA, SPR1, and SPR0 bits set
to the desired logic levels. If this procedure is followed after a reset
and before the first access to the SPDR, the WCOL flag will not be
set.
Example:
LDA #$1C ; MSTR = 1, CPOL = 1, CPHA = 1,
; SPR1 = SPR0 = 0
STA SPCR ; SPI control register
LDA #$4C ; MSTR = 0, SPE = 1, CPOL = 1, CPHA = 1,
; SPR1 = SPR0 = 0
STA SPCR ; SPI control register
Before a transmission, one SPI is configured as master and the rest are
configured as slaves. Figure 11-4 is a block diagram showing a single
master SPI and three slave SPIs.
MASTER MCU
PD2/MISO
PD3/MOSI
PD4/SCK
PD5/SS VDD
2
I/O
PORT 1
0
PD3/MOSI
PD3/MOSI
PD3/MOSI
PD5/SS
PD4/SCK
PD2/MISO
PD5/SS
PD4/SCK
PD2/MISO
PD5/SS
PD4/SCK
PD2/MISO
Figure 11-5 is another block diagram with two master/slave SPIs and
three slave SPIs.
MASTER/SLAVE MASTER/SLAVE
MCU 1 MCU 2
PD2/MISO PD2/MISO
PD3/MOSI PD3/MOSI
PD4/SCK PD4/SCK
PD5/SS PD5/SS
0 0
I/O 1 1 I/O
PORT PORT
2 2
3 3
Freescale Semiconductor, Inc...
PD5/SS
PD4/SCK
PD2/MISO
PD5/SS
PD4/SCK
PD2/MISO
PD5/SS
PD4/SCK
PD2/MISO
PD3/MOSI
PD3/MOSI
PD3/MOSI
SLAVE MCU 2 SLAVE MCU 1 SLAVE MCU 0
SS
CPHA CPOL
0 0 SCK (A)
1 0 SCK (B)
0 1 SCK (C)
1 1 SCK (D)
CAPTURE STROBE
A mode fault error results when a logic 0 occurs on the PD5/SS pin of a
master SPI. The MCU takes these actions when a mode fault error
occurs:
Puts the SPI in slave mode by clearing the MSTR bit
Disables the SPI by clearing the SPE bit
Sets the MODF bit
Failing to read the byte in the SPDR before a subsequent byte enters the
shift register causes an overrun condition. In an overrun condition, all
Freescale Semiconductor, Inc...
incoming data is lost until software clears SPIF. The overrun condition
has no flag.
The MODF bit in the SPSR indicates a mode error and is a source of SPI
interrupt requests. The MODF bit is set when a logic 0 occurs on the
PD5/SS pin while the MSTR bit is set. The SPI interrupt enable bit (SPIE)
in the SPCR is the local mask for MODF interrupts.
The SPDR shown in Figure 11-7 is the read buffer for characters
received by the SPI. Writing a byte to the SPDR places the byte directly
into the SPI shift register.
Address: $000C
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Write:
Freescale Semiconductor, Inc...
Address: $000A
Bit 7 6 5 4 3 2 1 Bit 0
Read:
SPIE SPE MSTR CPOL CPHA SPR1 SPR0
Write:
Reset: 0 0 0 U U U U
= Unimplemented U = Unaffected
Address: $000B
Freescale Semiconductor, Inc...
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 0 0 0
= Unimplemented
12.1 Contents
12.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Freescale Semiconductor, Inc...
12.2 Introduction
The MCU instruction set has 62 instructions and uses eight addressing
modes. The instructions include all those of the M146805 CMOS Family
plus one more: the unsigned multiply (MUL) instruction. The MUL
instruction allows unsigned multiplication of the contents of the
accumulator (A) and the index register (X). The high-order product is
stored in the index register, and the low-order product is stored in the
accumulator.
Freescale Semiconductor, Inc...
Inherent
Immediate
Direct
Extended
Indexed, no offset
Indexed, 8-bit offset
Indexed, 16-bit offset
Relative
12.3.1 Inherent
12.3.2 Immediate
Freescale Semiconductor, Inc...
12.3.3 Direct
Direct instructions can access any of the first 256 memory locations with
two bytes. The first byte is the opcode, and the second is the low byte of
the operand address. In direct addressing, the CPU automatically uses
$00 as the high byte of the operand address.
12.3.4 Extended
Extended instructions use three bytes and can access any address in
memory. The first byte is the opcode; the second and third bytes are the
high and low bytes of the operand address.
When using the Motorola assembler, the programmer does not need to
specify whether an instruction is direct or extended. The assembler
automatically selects the shortest form of the instruction.
Indexed, 8-bit offset instructions are 2-byte instructions that can access
data with variable addresses within the first 511 memory locations. The
CPU adds the unsigned byte in the index register to the unsigned byte
following the opcode. The sum is the effective address of the operand.
These instructions can access locations $0000$01FE.
Indexed 8-bit offset instructions are useful for selecting the kth element
in an n-element table. The table can begin anywhere within the first 256
memory locations and could extend as far as location 510 ($01FE). The
k value is typically in the index register, and the address of the beginning
of the table is in the byte following the opcode.
Indexed, 16-bit offset instructions are 3-byte instructions that can access
data with variable addresses at any location in memory. The CPU adds
the unsigned byte in the index register to the two unsigned bytes
following the opcode. The sum is the effective address of the operand.
The first byte after the opcode is the high byte of the 16-bit offset; the
second byte is the low byte of the offset.
Indexed, 16-bit offset instructions are useful for selecting the kth element
in an n-element table anywhere in memory.
12.3.8 Relative
When using the Motorola assembler, the programmer does not need to
Freescale Semiconductor, Inc...
calculate the offset, because the assembler determines the proper offset
and verifies that it is within the span of the branch.
Decrement DEC
Increment INC
Jump instructions allow the CPU to interrupt the normal sequence of the
program counter. The unconditional jump instruction (JMP) and the
jump-to-subroutine instruction (JSR) have no register operand. Branch
instructions allow the CPU to interrupt the normal sequence of the
program counter when a test condition is met. If the test condition is not
met, the branch is not performed.
The BRCLR and BRSET instructions cause a branch based on the state
of any readable bit in the first 256 memory locations. These 3-byte
Freescale Semiconductor, Inc...
The CPU can set or clear any writable bit in the first 256 bytes of
memory, which includes I/O registers and on-chip RAM locations. The
CPU can also test and branch based on the state of any bit in any of the
first 256 memory locations.
No operation NOP
Operand
Address
Effect on
Opcode
Cycles
Mode
Source CCR
Operation Description
Form
H I N Z C
ADC #opr IMM A9 ii 2
ADC opr DIR B9 dd 3
ADC opr EXT C9 hh ll 4
ADC opr,X
Add with Carry A (A) + (M) + (C) IX2 D9 ee ff 5
ADC opr,X IX1 E9 ff 4
Freescale Semiconductor, Inc...
ADC ,X IX F9 3
Operand
Effect on
Address
Opcode
Cycles
Mode
Source CCR
Operation Description
Form
H I N Z C
BIH rel Branch if IRQ Pin High PC (PC) + 2 + rel ? IRQ = 1 REL 2F rr 3
BIL rel Branch if IRQ Pin Low PC (PC) + 2 + rel ? IRQ = 0 REL 2E rr 3
BIT #opr IMM A5 ii 2
BIT opr DIR B5 dd 3
BIT opr EXT C5 hh ll 4
BIT opr,X
Bit Test Accumulator with Memory Byte (A) (M)
IX2 D5 ee ff 5
BIT opr,X IX1 E5 ff 4
BIT ,X IX F5 3
Freescale Semiconductor, Inc...
Operand
Effect on
Address
Opcode
Cycles
Mode
Source CCR
Operation Description
Form
H I N Z C
CLR opr M $00 DIR 3F dd 5
CLRA A $00 INH 4F 3
CLRX Clear Byte X $00 0 1 INH 5F 3
CLR opr,X M $00 IX1 6F ff 6
CLR ,X M $00 IX 7F 5
Operand
Effect on
Address
Opcode
Cycles
Mode
Source CCR
Operation Description
Form
H I N Z C
JSR opr DIR BD dd 5
PC (PC) + n (n = 1, 2, or 3)
JSR opr EXT CD hh ll 6
Push (PCL); SP (SP) 1
JSR opr,X Jump to Subroutine IX2 DD ee ff 7
Push (PCH); SP (SP) 1
JSR opr,X IX1 ED ff 6
PC Effective Address
JSR ,X IX FD 5
1
MUL Unsigned Multiply X : A (X) (A) 0 0 INH 42
1
Operand
Effect on
Address
Opcode
Cycles
Mode
Source CCR
Operation Description
Form
H I N Z C
ROR opr DIR 36 dd 5
RORA INH 46 3
RORX Rotate Byte Right through Carry Bit C INH 56 3
ROR opr,X b7 b0 IX1 66 ff 6
ROR ,X IX 76 5
Operand
Effect on
Address
Opcode
Cycles
Mode
Source CCR
Operation Description
Form
H I N Z C
TST opr DIR 3D dd 4
TSTA INH 4D 3
TSTX Test Memory Byte for Negative or Zero (M) $00 INH 5D 3
TST opr,X IX1 6D ff 5
TST ,X IX 7D 4
170
Table 12-7. Opcode Map
Bit Manipulation Branch Read-Modify-Write Control Register/Memory
DIR DIR REL DIR INH INH IX1 IX INH INH IMM DIR EXT IX2 IX1 IX
MSB MSB
Technical Data
0 1 2 3 4 5 6 7 8 9 A B C D E F
LSB LSB
5 5 3 5 3 3 6 5 9 2 3 4 5 4 3
Instruction Set
0 BRSET0 BSET0 BRA NEG NEGA NEGX NEG NEG RTI SUB SUB SUB SUB SUB SUB 0
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 6 2 3 4 5 4 3
1 BRCLR0 BCLR0 BRN RTS CMP CMP CMP CMP CMP CMP 1
3 DIR 2 DIR 2 REL 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 11 2 3 4 5 4 3
2 BRSET1 BSET1 BHI MUL SBC SBC SBC SBC SBC SBC 2
3 DIR 2 DIR 2 REL 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 10 2 3 4 5 4 3
3 BRCLR1 BCLR1 BLS COM COMA COMX COM COM SWI CPX CPX CPX CPX CPX CPX 3
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 3 4 5 4 3
4 BRSET2 BSET2 BCC LSR LSRA LSRX LSR LSR AND AND AND AND AND AND 4
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 2 3 4 5 4 3
5 BRCLR2 BCLR2 BCS/BLO BIT BIT BIT BIT BIT BIT 5
3 DIR 2 DIR 2 REL 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 3 4 5 4 3
6 BRSET3 BSET3 BNE ROR RORA RORX ROR ROR LDA LDA LDA LDA LDA LDA 6
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 4 5 6 5 4
7 BRCLR3 BCLR3 BEQ ASR ASRA ASRX ASR ASR TAX STA STA STA STA STA 7
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 2 3 4 5 4 3
8 BRSET4 BSET4 BHCC ASL/LSL ASLA/LSLA ASLX/LSLX ASL/LSL ASL/LSL CLC EOR EOR EOR EOR EOR EOR 8
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
Instruction Set
5 5 3 5 3 3 6 5 2 2 3 4 5 4 3
9 BRCLR4 BCLR4 BHCS ROL ROLA ROLX ROL ROL SEC ADC ADC ADC ADC ADC ADC 9
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 2 3 4 5 4 3
A BRSET5 BSET5 BPL DEC DECA DECX DEC DEC CLI ORA ORA ORA ORA ORA ORA A
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 2 2 3 4 5 4 3
Go to: www.freescale.com
B BRCLR5 BCLR5 BMI SEI ADD ADD ADD ADD ADD ADD B
3 DIR 2 DIR 2 REL 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 2 3 4 3 2
5 5 3 4 3 3 5 4 2 6 5 6 7 6 5
D BRCLR6 BCLR6 BMS TST TSTA TSTX TST TST NOP BSR JSR JSR JSR JSR JSR D
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 REL 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 2 2 3 4 5 4 3
E BRSET7 BSET7 BIL STOP LDX LDX LDX LDX LDX LDX E
3 DIR 2 DIR 2 REL 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 5 3 5 3 3 6 5 2 2 4 5 6 5 4
F BRCLR7 BCLR7 BIH CLR CLRA CLRX CLR CLR WAIT TXA STX STX STX STX STX F
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
MC68HC705C8A Rev. 3
Freescale Semiconductor, Inc.
13.1 Contents
13.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Freescale Semiconductor, Inc...
13.2 Introduction
This section contains electrical and timing specifications.
The MCU contains circuitry to protect the inputs against damage from
high static voltages; however, do not apply voltages higher than those
shown in the table here. Keep VIn and VOut within the range
VSS (VIn or VOut) VDD. Connect unused inputs to the appropriate
voltage level, either VSS or VDD.
Freescale Semiconductor, Inc...
VSS 0.3
Input voltage VIn V
to VDD +0.3
VDD 0.3 to
Programming voltage VPP
16.0
VSS 0.3
Bootstrap mode (IRQ pin only) VIn V
to 2 x VDD + 0.3
VDD = 4.5 V
VDD Pins R1 R2 C
PA7PA0
R2
(SEE TABLE) PB7PB0 3.26 k 2.38 k 50 pF
TEST PC7PC0
POINT PD4PD1
C R1
(SEE TABLE) (SEE TABLE) VDD = 3.0 V
Pins R1 R2 C
PA7PA0
PB7PB0 10.91 k 6.32 k 50 pF
PC7PC0
PD4PD1
PD7, PD5, PD0 6 k 6 k 200 pF
Where:
TA = ambient temperature in C
JA = package thermal resistance, junction to ambient in C/W
PD = PINT + PI/O
PINT = ICC VCC = chip internal power dissipation
Freescale Semiconductor, Inc...
ILoad = 1.6 mA
VOL V
PA7PA0, PB7PB0, PC6PC0, PD4PD1 0.4
ILoad = 20 mA, PC7 0.4
Input high voltage
PA7PA0, PB7PB0, PC7PC0, PD5PD0, PD7, VIH 0.7 x VDD VDD V
TCAP, IRQ, RESET, OSC1
Input low voltage
PA7PA0, PB7PB0, PC7PC0, PD5PD0, PD7, VIL VSS 0.2 x VDD V
TCAP, IRQ, RESET, OSC1
EPROM programming voltage VPP 14.5 14.75 15.0 V
EPROM/OTPROM programming current IPP 5 10 mA
User mode current IPP 10 mA
Data-retention mode (0C to 70C) VRM 2.0 V
(3)
Supply current
Run(4) 5.0 7.0 mA
Wait(5) IDD
1.95 3.0 mA
Stop(6)
5.0 50 A
25C
5.0 50 A
40C to +85C
I/O ports hi-z leakage current
IIL 10 A
PA7PA0, PB7PB0, PC7PC0, PD4PD1, PD7, RESET
Input current, IRQ, TCAP, OSC1, PD0, PD5 IIn 1 A
Capacitance COut 12
Ports (as input or output) pF
CIn 8
RESET, IRQ, TCAP, PD0PD5, PD7
1. VDD = 5 V 10%; VSS = 0 Vdc, TA = TL to TH, unless otherwise noted
2. Typical values reflect average measurements at midpoint of voltage range at 25C.
3. IDD measured with port B pullup devices disabled.
4. Run (operating) IDD measured using external square wave clock source (fOSC = 4.2 MHz). All inputs 0.2 V from rail. No dc
loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. OSC2 capacitance linearly affects run IDD.
5. Wait IDD measured using external square wave clock source (fOSC = 4.2 MHz). All inputs 0.2 V from rail. No dc loads. Less
than 50 pF on all outputs. CL = 20 pF on OSC2. VIL = 0.2 V, VIH = VDD 0.2 V. All ports configured as inputs. SPI and SCI
disabled. If SPI and SCI enabled, add 10% current draw. OSC2 capacitance linearly affects wait IDD.
6. Stop IDD measured with OSC1 = V DD. All ports configured as inputs. VIL = 0.2 V, VIH = VDD 0.2 V.
ILoad = 1.5 mA
PC7
Supply current(3)
Run(4) 1.53 3.0 mA
IDD
Wait(5) 0.711 1.0 mA
2.0 20 A
Stop(6)
I/O ports hi-z leakage current
PA7PA0, PB7PB0, PC7PC0, PD4PD1, IIL 10 A
PD7, RESET
Input current
IIn 1 A
IRQ, TCAP, OSC1, PD5, PD0
1. VDD = 3.3 V 10%; VSS = 0 Vdc, TA = TL to TH, unless otherwise noted
2. Typical values at midpoint of voltage range, 25C only.
3. IDD measured with port B pullup devices disabled.
4. Run (operating) IDD measured using external square wave clock source (fOSC = 2.0 MHz). All inputs 0.2 V from rail. No dc
loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. OSC2 capacitance linearly affects run IDD.
5. Wait IDD measured using external square wave clock source (fOSC = 2.0 MHz). All inputs 0.2 V from rail. No dc loads. Less
than 50 pF on all outputs. C L = 20 pF on OSC2. V IL = 0.2 V, VIH = VDD 0.2 V. All ports configured as inputs. SPI and SCI
disabled. If SPI and SCI enabled, add 10% current draw. OSC2 capacitance linearly affects wait IDD.
6. Stop IDD measured with OSC1 = V DD. All ports configured as inputs. VIL = 0.2 V; VIH = VDD 0.2 V.
5.0
4.0
.0 V
=5
V DD
3.0
IOH (mA)
2.0
0V
= 3.
V DD
SEE NOTE 1
1.0
Freescale Semiconductor, Inc...
0.8
SEE NOTE 2
0.2
0
0 0.2 0.4 0.6 0.8
VDD VOH (VOLTS)
Notes:
1. At VDD = 5.0 V, devices are specified and tested for (VDD VOH )
800 mV @ IOH = 0.8 mA.
2. At VDD = 3.3 V, devices are specified and tested for (VDD VOH )
300 mV @ IOH = 0.2 mA.
(a) VOH versus IOH for Ports A, B, PC6PC0, and TCMP
8.0
6.0
V
.0
=5
V DD
IOH (mA)
4.0
SEE NOTE 1
2.0 .0 V
=3
1.6 V DD
SEE NOTE 2
0.4
0
0 0.2 0.4 0.6
VDD VOH (VOLTS)
Notes:
1. At VDD = 5.0 V, devices are specified and tested for
(V DD VOH) 800 mV @ IOH = 1.6 mA.
2. At VDD = 3.3 V, devices are specified and tested for
(V DD VOH) 300 mV @ IOH = 0.4 mA.
6.0
5.0
4.0 V
.0
=5
V DD
IOL (MA)
3.0
V
.0
=3
2.0 V DD SEE NOTE 1
Freescale Semiconductor, Inc...
1.6
0.4
0
0 0.1 0.2 0.3 0.4
VOL (VOLTS)
Notes:
1. At VDD = 5.0 V, devices are specified and tested for
VOL 400 mV @ IOL = 1.6 mA.
2. At VDD = 3.3 V, devices are specified and tested for
VOL 300 mV @ IOL = 0.4 mA.
(c) VOL versus IOL for All Ports Except PC7
2.0
1.8
1.6
1.4
V
.0
=5
1.2
DD
IDD (mA)
V
1.0
0.8
Freescale Semiconductor, Inc...
0.6
V
.3
0.4 =3
V DD
0.2
0.0
0.0 0.5 1.0 1.5 2.0
INTERNAL FREQUENCY 1 tCYC (MHz)
(a) Wait Mode
5.5
5.0
4.5
4.0 V
.0
=5
3.5
DD
V
3.0
IDD (mA)
2.5
2.0
1.5
V
1.0 .3
=3
V DD
0.5
0.0
0.0 0.5 1.0 1.5 2.0
INTERNAL FREQUENCY 1 tCYC (MHz)
(b) Run Mode
3.0 mA
T = 40C to 85C
VDD = 3.3 V 10%
2.5 mA
D
G )ID
2.0 mA
TIN
1.0 mA
I DD
WAIT
Freescale Semiconductor, Inc...
500 mA
7.0 mA
T = 40C to 85C
VDD = 5.0 V 10%
6.0 mA
5.0 mA D
G )ID
TIN
SUPPLY CURRENT (IDD)
R A
4.0 mA PE
(O
N
RU
3.0 mA
IT I DD
2.0 mA WA
1.0 mA
Frequency of operation
Crystal option fOSC 4.2 MHz
External clock option dc 4.2
Frequency of operation
2.0
Crystal option fOSC MHz
dc 2.0
External clock option
Timer
Resolution(2) tRESL 4.0 tCYC
Input capture pulse width (see Figure 13-5) tTH, tTL 250 ns
tTLTL (3) tCYC
Input capture pulse period (see Figure 13-5)
EXTERNAL SIGNAL
(TCAP PIN 37)
*
Refer to timer resolution data in Figure 13-6 and Figure 13-7.
(1)
OSC1
tRL
RESET
IRQ(2) tILIH
INTERNAL
CLOCK
INTERNAL
ADDRESS 1FFE 1FFE 1FFE 1FFE 1FFF(4)
BUS
RESET OR INTERRUPT
VECTOR FETCH
Notes:
1. Represents the internal gating of the OSC1 pin
2. IRQ pin edge-sensitive option
3. IRQ pin level and edge-sensitive option
4. RESET vector address shown for timing example
184
Technical Data
tVDDR
OSC1*
tOXOV
tCYC
INTERNAL
PROCESSOR
CLOCK
INTERNAL
ADDRESS 1FFE 1FFF NEW PC 1FFE 1FFE 1FFE 1FFE 1FFF NEW PC
BUS **
INTERNAL
NEW NEW OP OP
Electrical Specifications
DATA PCH PCL CODE PCH PCL CODE
BUS ***
tRL
Go to: www.freescale.com
RESET
* * *
* OSC1 line is not meant to represent frequency. It is only used to represent time.
** Internal timing signal and bus information are not available externally.
*** The next rising edge of the internal processor clock following the rising edge of RESET initiates the reset sequence.
MC68HC705C8A Rev. 3
Freescale Semiconductor, Inc.
Electrical Specifications
5.0-Volt Serial Peripheral Interface (SPI) Timing
Operating frequency
Master fOP(M) dc 0.5 fOP
Slave fOP(S) dc 2.1 MHz
Cycle time
1 Master tCYC(M) 2.0 tCYC
Slave tCYC(S) 480 ns
8
Access time(4) tA 0 120 ns
Slave
9
Disable time(5) tDIS 240 ns
Slave
Continued
Rise time(7)
12 SPI outputs (SCK, MOSI, MISO) tR(M) 100 ns
SPI inputs (SCK, MOSI, MISO, SS) tR(S) 2.0 s
Fall time(8)
13 SPI outputs (SCK, MOSI, MISO) tF(M) 100 ns
SPI inputs (SCK, MOSI, MISO, SS) tF(S) 2.0 s
Freescale Semiconductor, Inc...
Operating frequency
Master fOP(M) 0.5 fOP
dc
Slave fOP(S) 2.1 MHz
Cycle time
1 Master tCYC(M) 2.0 tCYC
Slave tCYC(S) 1 ns
8
Access time(4) tA 0 250 ns
Slave
9
Disable time(5) tDIS 500 ns
Slave
Continued
Rise time(7)
12 SPI outputs (SCK, MOSI, MISO) tR(M) 200 ns
SPI inputs (SCK, MOSI, MISO, SS) tR(S) 2.0 s
SS
INPUT SS pin of master held high.
1 12 13 12
SCK (CPOL = 0) 5
OUTPUT NOTE
4
12 13
SCK (CPOL = 1) 5
OUTPUT NOTE
4
6 7
MISO
INPUT MSB IN BITS 61 LSB IN
Freescale Semiconductor, Inc...
10 11 10 11
MOSI
OUTPUT MASTER MSB OUT BITS 61 MASTER LSB OUT
13 12
Note: This first clock edge is generated internally, but is not seen at the SCK pin.
SS
INPUT SS pin of master held high.
1 13 12
SCK (CPOL = 0) 5
OUTPUT NOTE
4
12 13
SCK (CPOL = 1) 5
OUTPUT NOTE
4
6 7
MISO
INPUT MSB IN BITS 61 LSB IN
10 11 10 11
MOSI
OUTPUT MASTER MSB OUT BITS 61 MASTER LSB OUT
13 12
Note: This last clock edge is generated internally, but is not seen at the SCK pin.
SS
INPUT
1 13 12 3
SCK (CPOL = 0) 11
5
(INPUT 4
2
SCK (CPOL = 1) 5
INPUT
4
8 12 13 9
MISO
INPUT SLAVE MSB OUT BITS 61 SLAVE LSB OUT NOTE
Freescale Semiconductor, Inc...
6 7 10 11
MOSI
OUTPUT MSB IN BITS 61 LSB IN
SS
INPUT
1 13 12
SCK (CPOL = 0) 5
INPUT 4
2 3
SCK (CPOL = 1) 5
INPUT
4
10 12 13 9
8
MISO
OUTPUT NOTE SLAVE MSB OUT BITS 61 SLAVE LSB OUT
6 7 10 11
MOSI
INPUT MSB IN BITS 61 LSB IN
14.1 Contents
14.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Freescale Semiconductor, Inc...
14.2 Introduction
Package dimensions available at the time of this publication for the
MC68HC705C8A are provided in this section. The packages are:
40 21
MILLIMETERS INCHES
DIM MIN MAX MIN MAX
B A 51.69 52.45 2.035 2.065
B 13.72 14.22 0.540 0.560
C 3.94 5.08 0.155 0.200
1 20 D 0.36 0.56 0.014 0.022
F 1.02 1.52 0.040 0.060
G 2.54 BSC 0.100 BSC
A L H 1.65 2.16 0.065 0.085
C J 0.20 0.38 0.008 0.015
K 2.92 3.43 0.115 0.135
Freescale Semiconductor, Inc...
K M
H G F D
SEATING
PLANE
NOTES:
1.POSITION TOLERANCE OF LEADS (D), SHALL
BEWITHIN 0.25 (0.010) AT MAXIMUM MATERIAL
CONDITIONS, IN RELATION TO SEATING PLANE
AND EACH OTHER.
2.DIMENSION L TO CENTER OF LEADS WHEN
FORMED PARALLEL.
3.DIMENSION B DOES NOT INCLUDE MOLD FLASH.
40 21
1 20
A
L
N
C
Freescale Semiconductor, Inc...
INCHES MILLIMETERS
T DATUM
PLANE DIM MIN MAX MIN MAX
SEATING K J A 2.020 2.096 51.31 53.23
PLANE B 0.500 0.610 12.70 15.94
G M C 0.160 0.240 4.06 6.09
D 0.015 0.022 0.38 0.55
F F 0.050 0.065 1.27 1.65
D 40 PL G 0.100 BSC 2.54 BSC
J 0.008 0.012 0.20 0.30
0.25(0.010) M T A M
K 0.125 0.160 3.17 4.06
L 0.600 BSC 15.24 BSC
M 0 15 0 15
N 0.020 0.050 0.51 1.27
Z
-L- -M-
Freescale Semiconductor, Inc...
V X G1
44 1 W D
0.010 (0.25) S T L-M S N S
VIEW D-D
A 0.007(0.180) M T L-M S N S
J
K1
E
0.004 (0.10)
C G K
-T- SEATING
PLANE
G1 F
VIEW S
0.010 (0.25) S T L-M S N S 0.007(0.180) M T L-M S N S
VIEW S
NOTES:
1. DATUMS -L-, -M-, AND -N- ARE DETERMINED INCHES MILLIMETERS
WHERE TOP OF LEAD SHOLDERS EXITS DIM MIN MAX MIN MAX
PLASTIC BODY AT MOLD PARTING LINE. A 0.685 0.695 17.40 17.65
2. DIMENSION G1, TRUE POSITION TO BE
B 0.685 0.695 17.40 17.65
MEASURED AT DATUM -T-, SEATING PLANE.
3. DIMENSION R AND U DO NOT INCLUDE MOLD C 0.165 0.180 4.20 4.57
FLASH. ALLOWABLE MOLD FLASH IS 0.010 E 0.090 0.110 2.29 2.79
(0.25) PER SIDE. F 0.013 0.019 0.33 0.48
4. DIMENSIONING AND TOLERANCING PER ANSI G 0.050 BSC 1.27 BSC
Y14.5M, 1982. H 0.026 0.032 0.66 0.81
5. CONTROLLING DIMENSION: INCH.
J 0.020 0.51
6. THE PACKAGE TOP MAY BE SMALLER THAN
THE PACKAGE BOTTOM BY UP TO 0.012 K 0.025 0.64
(0.300). DIMENSIONS R AND U ARE DETERMINED R 0.650 0.656 16.51 16.66
AT THE OUTERMOST EXTREMES OF THE U 0.650 0.656 16.51 16.66
PLASTIC BODY EXCLUSIVE OF THE MOLD V 0.042 0.048 1.07 1.21
FLASH, TIE BAR BURRS, GATE BURRS AND W 0.042 0.048 1.07 1.21
INTERLEAD FLASH, BUT INCLUDING ANY X 0.042 0.056 1.07 1.42
MISMATCH BETWEEN THE TOP AND BOTTOM
Y 0.020 0.50
OF THE PLASTIC BODY.
7. DIMINSION H DOES NOT INCLUDE DAMBAR Z 2 10 2 10
PROTRUSION OR INTRUSION. THE DAMBAR G1 0.610 0.630 15.50 16.00
PROTUSION(S) SHALL NOT CAUSE THE H K1 0.040 1.02
DIMINSION TO BE GREATER THAN 0.037
(0.940198). THE DAMBAR INTRUSION(S) SHALL
NOT CAUSE THE H DIMINISION TO SMALLER
THAN 0.025 (0.635).
B 0.18 (0.007) M T N S -P S L S
-N- Y BRK 0.18 (0.007) M T N S -P S L S
U
D
-L-
Freescale Semiconductor, Inc...
D DETAIL D-D G1
44 1
S 0.25 (0.010) M T N S -P S L S
-P-
0.20 (0.008) M T L M N M -P M
V
NOTES:
1. DATUMS -L-, -N-, AND -P- DETERMINED
WHERE TOP OF LEAD SHOULDER EXIT
BODY.
A 0.18 (0.007) M T L S N S -P S 2. DIMINSION G1, TRUE POSITION TO BE
MEASURED AT DATUM -T-, SEATING
PLANE.
R 0.18 (0.007) M T L S N S -P S 3. DIMINSIONS R AND U DO NOT INCLUDE
GLASS MENISCUS. ALLOWABLE GLASS
RUNOUT IS 0.25 (0.010) PER SIDE.
4. DIMINSIONING AND TOLERANCING PER
ANSI Y14.5M, 1982.
C
E MILLIMETERS INCHES
0.10 (0.004) DIM MIN MAX MIN MAX
J A 17.40 17.65 0.685 0.695
G -T- SEATING B 17.40 17.65 0.685 0.695
PLANE
DETAIL S C 4.20 4.57 0.165 0.180
G1 E 2.29 2.79 0.090 0.110
F 0.33 0.48 0.013 0.019
0.25 (0.010) S T L S N S -P S G 1.27 BSC 0.050 BSC
H 0.66 0.81 0.026 0.032
J 0.51 --- 0.020 ---
K 0.64 --- 0.025 ---
R 16.51 16.66 0.650 0.656
0.18 (0.007) M T L S N S -P S S 6.94 7.26 0.273 0.286
H U 16.51 16.66 0.650 0.656
0.18 (0.007) M T N S -P S L S V 1.07 1.21 0.042 0.048
W 1.07 1.21 0.042 0.048
Y --- 0.50 --- 0.020
G1 14.99 16.00 0.590 0.630
K1 K1 1.02 --- 0.040 ---
0.18 (0.007) M T L S N S -P S
F
0.18 (0.007) M T N S -P S L S
DETAIL S
B
L
B
33 23
34 22
-A-, -B-, -D-
S
D
D
DETAIL A
S
0.20 (0.008) M C A-B
H A-B
-A- -B- F
V
B
BASE METAL
(0.008) M
J N
0.20
DETAIL A
D
44 12 0.20 (0.008) M C A-B S D S
1 11 SECTION B-B
NOTES:
1. 1. DIMENSIONING AND TOLERANCING PER ANSI
-D- Y14.5M, 1982.
A 2. 2. CONTROLLING DIMENSION: MILLIMETER.
3. 3. DATUM PLANE -H- IS LOCATED AT BOTTOM OF
0.20 (0.008) M C A-B S D S
LEAD AND IS COINCIDENT WITH THE LEAD WHERE
0.05 (0.002) A-B THE LEAD EXITS THE PLASTIC BODY AT THE
BOTTOM OF THE PARTING LINE.
S 4. 4. DATUMS -A-, -B- AND -D- TO BE DETERMINED AT
DATUM PLANE -H-.
0.20 (0.008) M H A-B S D S
5. 5. DIMENSIONS S AND V TO BE DETERMINED AT
SEATING PLANE -C-.
6. 6. DIMENSIONS A AND B DO NOT INCLUDE MOLD
M DETAIL C PROTRUSION. ALLOWABLE PROTRUSION IS 0.25
(0.010) PER SIDE. DIMENSIONS A AND B DO
INCLUDE MOLD MISMATCH AND ARE DETERMINED
AT DATUM PLANE -H-.
C E -H- DATUM 7. 7. DIMENSION D DOES NOT INCLUDE DAMBAR
PLANE
PROTRUSION. ALLOWABLE DAMBAR
-C- PROTRUSION SHALL BE 0.08 (0.003) TOTAL IN
0.01 (0.004) EXCESS OF THE D DIMENSION AT MAXIMUM
SEATING H MATERIAL CONDITION. DAMBAR CANNOT BE
PLANE G M LOCATED ON THE LOWER RADIUS OR THE FOOT.
MILLIMETERS INCHES
DIM MIN MAX MIN MAX
A 9.90 10.10 0.390 0.398
M B 9.90 10.10 0.390 0.398
C 2.10 2.45 0.083 0.096
D 0.30 0.45 0.012 0.018
T E 2.00 2.10 0.079 0.083
F 0.30 0.40 0.012 0.016
G 0.80 BSC 0.031 BSC
DATUM
PLANE -H- R H --- 0.25 --- 0.010
J 0.013 0.23 0.005 0.009
K 0.65 0.95 0.026 0.037
L 8.00 REF 0.315 REF
K M 5 10 5 10
W Q N 0.13 0.17 0.005 0.007
Q 0 7 0 7
X R 0.13 0.30 0.005 0.012
S 12.95 13.45 0.510 0.530
T 0.13 --- 0.005 ---
U 0 --- 0 ---
DETAIL C V 12.95 13.45 0.510 0.530
W 0.40 --- 0.016 ---
X 1.6 REF 0.063 REF
-A-
NOTES:
1. DIMENSIONS AND TOLERANCING PER ANSI
42 22 Y14.5M, 1982.
2. CONTROLLING DIMENSION: INCH.
3. DIMENSION L TO CENTER OF LEAD WHEN
FORMED PARALLEL.
-B- 4. DIMENSIONS A AND B DO NOT INCLUDE MOLD
FLASH. MAXIMUM MOLD FLASH 0.25 (0.010).
1 21 INCHES MILLIMETERS
L DIM MIN MAX MIN MAX
A 1.435 1.465 36.45 37.21
H B 0.540 0.560 13.72 14.22
C C 0.155 0.200 3.94 5.08
D 0.014 0.022 0.36 0.56
F 0.032 0.046 0.81 1.17
Freescale Semiconductor, Inc...
15.1 Contents
15.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Freescale Semiconductor, Inc...
15.2 Introduction
This section contains ordering information for the available package
types.
40-pin plastic dual in-line package (PDIP) 40C to +85C MC68HC705C8AC (1)P(2)
Appendix A. MC68HSC705C8A
A.1 Contents
A.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Freescale Semiconductor, Inc...
A.2 Introduction
The MC68HSC705C8A is an enhanced, high-speed version of the
MC68HC705C8A, featuring a 4-MHz bus speed.
The computer operating properly (COP) mode bits (CM1 and CM0 in the
COP control register) select the timeout period of the programmable
COP watchdog, as shown in Table A-1. See Figure 5-3.
Programmable COP Control Register (COPCR).
MOTOROLA MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Supply current(3)
Run(4) 5.92 14 mA
Wait(5) 2.27 7.0 mA
IDD
Stop(6)
5 50 A
25C
2.0 50 A
40C to +85C
1. VDD = 5 V 10%; VSS = 0 Vdc, TA = TL to TH, unless otherwise noted
2. Typical values reflect average measurements at midpoint of voltage range at 25C.
3. IDD measured with port B pullup devices disabled.
4. Run (operating) IDD measured using external square wave clock source (fOSC = 8.0 MHz). All inputs 0.2 V from rail. No dc
loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. OSC2 capacitance linearly affects run IDD.
5. Wait IDD measured using external square wave clock source (fOSC = 8.0 MHz). All inputs 0.2 V from rail. No dc loads. Less
than 50 pF on all outputs. CL = 20 pF on OSC2. VIL = 0.2 V, VIH = VDD 0.2 V. All ports configured as inputs. SPI and SCI
disabled. If SPI and SCI enabled, add 10% current draw. OSC2 capacitance linearly affects wait IDD.
6. Stop IDD measured with OSC1 = V DD. All ports configured as inputs. VIL = 0.2 V, VIH = VDD 0.2 V.
202 MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Supply current(3)
Run(4) 1.91 6.0 mA
IDD
Wait(5) 0.915 2.0 mA
2.0 20 A
Stop(6)
1. VDD = 3.3 V 10%; VSS = 0 Vdc, TA = TL to TH, unless otherwise noted
2. Typical values reflect average measurements at midpoint of voltage range at 25C.
3. IDD measured with port B pullup devices disabled.
4. Run (operating) IDD measured using external square wave clock source (fOSC = 4.2 MHz). All inputs 0.2 V from rail. No dc
loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. OSC2 capacitance linearly affects run IDD.
5. Wait IDD measured using external square wave clock source (fOSC = 4.2 MHz). All inputs 0.2 V from rail. No dc loads. Less
than 50 pF on all outputs. C L = 20 pF on OSC2. V IL = 0.2 V, VIH = VDD 0.2 V. All ports configured as inputs. SPI and SCI
disabled. If SPI and SCI enabled, add 10% current draw. OSC2 capacitance linearly affects wait IDD.
6. Stop IDD measured with OSC1 = V DD. All ports configured as inputs. VIL = 0.2 V; VIH = VDD 0.2 V.
MOTOROLA MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Oscillator frequency
Crystal oscillator fOSC 8.0 MHz
External clock dc 8.0
Oscillator frequency
Crystal oscillator fOSC 4.0 MHz
External clock dc 4.0
204 MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Diagram
Characteristic(2) Symbol Min Max Unit
Number(1)
Operating frequency
Master fOP(S) dc 0.5 fOP
Slave fOP(S) dc 4.0 MHz
Cycle time
1 Master tCYC(M) 2.0 tCYC
Slave tCYC(S) 250 ns
Freescale Semiconductor, Inc...
8 Access time(4) tA 0 60 ns
Slave
Continued
MOTOROLA MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Diagram
Characteristic(2) Symbol Min Max Unit
Number(1)
Rise time(7)
12 SPI outputs (SCK, MOSI, MISO) tRM 50 ns
SPI inputs (SCK, MOSI, MISO, SS) tRS 2.0 s
Fall time(8)
13 SPI outputs (SCK, MOSI, MISO) tFM 50 ns
Freescale Semiconductor, Inc...
1. Diagram numbers refer to dimensions in Figure 13-8. SPI Master Timing and Figure 13-9. SPI Slave Timing.
2. VDD = 5 V 10%; VSS = 0 Vdc, TA = TL to TH, unless otherwise noted
3. Signal production depends on software.
4. Time to data active from high-impedance state
5. Hold time to high-impedance state
6. With 200 pF on all SPI pins.
7. 20% of VDD to 70% of VDD; CL = 200 pF
8. 70% of VDD to 20% of VDD; CL = 200 pF
206 MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Diagram
Characteristic(2) Symbol Min Max Unit
Number(1)
Operating frequency
Master fOP(S) dc 0.5 fOP
Slave fOP(S) dc 2.1 MHz
Cycle time
1 Master tCYC(M) 2.0 tCYC
Slave tCYC(S) 480 ns
Freescale Semiconductor, Inc...
8 Access time(4) tA ns
Slave 0 120
Continued
MOTOROLA MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Diagram
Characteristic(2) Symbol Min Max Unit
Number(1)
Rise time(7)
12 SPI outputs (SCK, MOSI, MISO) tRM 100 ns
SPI inputs (SCK, MOSI, MISO, SS) tRS 2.0 s
Fall time(8)
13 SPI outputs (SCK, MOSI, MISO) tFM 100 ns
Freescale Semiconductor, Inc...
1. Diagram numbers refer to dimensions in Figure 13-8. SPI Master Timing and Figure 13-9. SPI Slave Timing.
2. VDD = 3.3 V 10%; VSS = 0 Vdc, TA = TL to TH, unless otherwise noted
3. Signal production depends on software.
4. Time to data active from high-impedance state
5. Hold time to high-impedance state
6. With 200 pF on all SPI pins
7. 20% of VDD to 70% of VDD; CL = 200 pF
8. 70% of VDD to 20% of VDD; CL = 200 pF
208 MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
MOTOROLA MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HSC705C8A
Freescale Semiconductor, Inc...
210 MC68HSC705C8A
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
A
accumulator (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45, 154, 155, 158
addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Freescale Semiconductor, Inc...
B
block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
bootloader ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
C
C bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
condition code register (CCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 47, 160
COP watchdog (non-programmable)
diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
in stop mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
timeout period formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
when clock monitor enabled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
COP watchdog (programmable)
COP control register (COPCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 64
COP reset register (COPRST) . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
in stop mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
timeout period selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
MOTOROLA Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
CPU
instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155, 158, 163
accumulator (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154, 155, 158
condition code register (CCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 160
index register (X) . . . . . . . . . . . . . . . . . . . . . . . . 154, 155, 156, 158
Freescale Semiconductor, Inc...
D
data-retention mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
E
electrical specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
DC electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
power considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
electrical specifications (high-speed part)
control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
DC electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
SPI timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
EPROM/OTPROM (PROM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 103
control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
EPROM erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
mask option register 1 (MOR1) . . . . . . . . . . . . . . . . . . . . . . . . . 117
mask option register 2 (MOR2) . . . . . . . . . . . . . . . . . . . . . . . . . 118
option register (option) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
preprogramming steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
program register (PROG). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
MC68HC05PGMR programmer board . . . . . . . . . . . . . . . . . 104
programming circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
212 Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
F
features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
H
high-speed part (MC68HSC705C8A) . . . . . . . . . . . . . . . . . . . . . . . 201
I
Freescale Semiconductor, Inc...
I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 77
data direction register A (DDRA) . . . . . . . . . . . . . . . . . . . . . . . . . 79
data direction register B (DDRB) . . . . . . . . . . . . . . . . . . . . . . . . . 82
data direction register C (DDRC) . . . . . . . . . . . . . . . . . . . . . . . . . 86
port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
port A data register (PORTA). . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
port A I/O logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
port A pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
port B data register (PORTB). . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
port B I/O logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
port B pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
port C data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
port C I/O logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
port C pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
I/O bits
C bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
I/O register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
index register (X) . . . . . . . . . . . . . . . . . . . . . . . . 45, 154, 155, 156, 158
instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
MOTOROLA Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
reset/interrupt vector addresses. . . . . . . . . . . . . . . . . . . . . . . . . . 57
stacking order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
interrupts
external interrupt (IRQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
internal function diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
masking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Freescale Semiconductor, Inc...
port B interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
enabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
port B I/O logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
SCI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
software interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
SPI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
timer interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
IRQ pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
J
junction temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
L
low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
data-retention mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
stop mode
non-programmable COP in stop mode flowchart . . . . . . . . . . 74
non-programmable COP watchdog in stop mode. . . . . . . . . . 73
programmable COP in stop mode flowchart. . . . . . . . . . . . . . 72
programmable COP watchdog in stop mode . . . . . . . . . . . . . 71
SCI during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
SPI during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
stop/wait mode function flowchart. . . . . . . . . . . . . . . . . . . . . . 70
wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
non-programmable COP watchdog in wait mode . . . . . . . . . . 75
programmable COP watchdog in wait mode . . . . . . . . . . . . . 75
214 Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
M
mask option registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23, 117, 118
MC68HSC705C8A (high-speed part) . . . . . . . . . . . . . . . . . . . . . . . 201
control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
DC electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
programmable COP timeout period selection . . . . . . . . . . . . . . 202
SPI timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
mechanical specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Freescale Semiconductor, Inc...
memory
bootloader ROM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
I/O register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 38
PROM (EPROM/OTPROM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 38
O
on-chip memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
opcode map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
option register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
ordering information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
OSC1 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
OSC2 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
oscillator
ceramic resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
crystal resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
external clock signal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
MOTOROLA Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
P
pin assignments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 78
data direction register A (DDRA) . . . . . . . . . . . . . . . . . . . . . . . . . 79
port A data register (PORT A) . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
port A I/O logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
port A pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 81
data direction register B (DDRB) . . . . . . . . . . . . . . . . . . . . . . . . . 82
Freescale Semiconductor, Inc...
R
RAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
registers
I/O register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
reset and interrupt processing flowchart . . . . . . . . . . . . . . . . . . . . . . 59
RESET pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
clock monitor reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65, 67
with STOP instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
216 Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
S
serial communications interface (SCI). . . . . . . . . . . . . . . . . . . . . . . 121
baud rate generator clock prescaling . . . . . . . . . . . . . . . . . . . . . 136
baud rate register (baud) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
baud rate selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
baud rate selection examples . . . . . . . . . . . . . . . . . . . . . . . . . . 138
during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
SCI control register 1 (SCCR1) . . . . . . . . . . . . . . . . . . . . . . . . . 130
SCI control register 2 (SCCR2) . . . . . . . . . . . . . . . . . . . . . . . . . 131
SCI data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
SCI data register (SCDR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
SCI I/O registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
SCI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
SCI operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
SCI receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
SCI status register (SCSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
SCI transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
serial peripheral interface (SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
master/slave connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
multiple-SPI systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
pin functions in master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
pin functions in slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
serial clock polarity and phase . . . . . . . . . . . . . . . . . . . . . . . . . . 146
MOTOROLA Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
T
TCAP pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
TCMP pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
thermal resistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
alternate timer registers (ATRH and ATRL) . . . . . . . . . . . . . . . . . 99
I/O registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
input capture registers (ICRH and ICRL) . . . . . . . . . . . . . . . . . . 100
output compare registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
timer control register (TCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
timer I/O register summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
timer interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
timer operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
timer registers (TRH and TRL). . . . . . . . . . . . . . . . . . . . . . . . . . . 97
timer status register (TSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
218 Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
V
VDD pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
VSS pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
VPP pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
W
wait mode
non-programmable COP watchdog in wait mode . . . . . . . . . . . . 75
programmable COP watchdog in wait mode . . . . . . . . . . . . . . . . 75
Freescale Semiconductor, Inc...
MOTOROLA Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Index
Freescale Semiconductor, Inc...
220 Index
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc... Freescale Semiconductor, Inc.
RoHS-compliant and/or Pb- free versions of Freescale products have the functionality
Home Page:
and electrical characteristics of their non-RoHS-compliant and/or non-Pb- free
www.freescale.com counterparts. For further information, see http://www.freescale.com or contact your
email: Freescale sales representative.
support@freescale.com
USA/Europe or Locations Not Listed: For information on Freescale.s Environmental Products program, go to
Freescale Semiconductor http://www.freescale.com/epp.
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
Freescale Semiconductor, Inc...
(800) 521-6274
480-768-2130
support@freescale.com
Europe, Middle East, and Africa:
Freescale Halbleiter Deutschland GmbH
Technical Information Center
Schatzbogen 7
81829 Muenchen, Germany
+44 1296 380 456 (English)
+46 8 52200080 (English)
+49 89 92103 559 (German)
+33 1 69 35 48 48 (French)
support@freescale.com
Japan:
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku Information in this document is provided solely to enable system and software
Tokyo 153-0064, Japan implementers to use Freescale Semiconductor products. There are no express or
0120 191014 implied copyright licenses granted hereunder to design or fabricate any integrated
+81 2666 8080 circuits or integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to
support.japan@freescale.com any products herein. Freescale Semiconductor makes no warranty, representation or
Asia/Pacific: guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor Hong Kong Ltd. Freescale Semiconductor assume any liability arising out of the application or use of
Technical Information Center any product or circuit, and specifically disclaims any and all liability, including without
2 Dai King Street limitation consequential or incidental damages. Typical parameters which may be
Tai Po Industrial Estate, provided in Freescale Semiconductor data sheets and/or specifications can and do
Tai Po, N.T., Hong Kong vary in different applications and actual performance may vary over time. All operating
parameters, including Typicals must be validated for each customer application by
+800 2666 8080 customers technical experts. Freescale Semiconductor does not convey any license
support.asia@freescale.com under its patent rights nor the rights of others. Freescale Semiconductor products are
For Literature Requests Only: not designed, intended, or authorized for use as components in systems intended for
Freescale Semiconductor surgical implant into the body, or other applications intended to support or sustain life,
Literature Distribution Center or for any other application in which the failure of the Freescale Semiconductor product
P.O. Box 5405 could create a situation where personal injury or death may occur. Should Buyer
Information in this document is provided solely to enable system and software
implementers to use Freescale Semiconductor products. There are no express or
implied copyright licenses granted hereunder to design or fabricate any integrated
circuits or integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to
any products herein. Freescale Semiconductor makes no warranty, representation or
guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor assume any liability arising out of the application or use of
any product or circuit, and specifically disclaims any and all liability, including without
limitation consequential or incidental damages. Typical parameters which may be
provided in Freescale Semiconductor data sheets and/or specifications can and do
vary in different applications and actual performance may vary over time. All operating
parameters, including Typicals must be validated for each customer application by
customers technical experts. Freescale Semiconductor does not convey any license
under its patent rights nor the rights of others. Freescale Semiconductor products are
not designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other application in which the failure of the Freescale Semiconductor product
could create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semiconductor products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor
and its officers, employees, subsidiaries, affiliates, and distributors harmless against all
claims, costs, damages, and expenses, and reasonable attorney fees arising out of,
directly or indirectly, any claim of personal injury or death associated with such
unintended or unauthorized use, even if such claim alleges that Freescale
Semiconductor was negligent regarding the design or manufacture of the part.
Denver, Colorado 80217 purchase or use Freescale Semiconductor products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor
(800) 441-2447 and its officers, employees, subsidiaries, affiliates, and distributors harmless against all
303-675-2140 claims, costs, damages, and expenses, and reasonable attorney fees arising out of,
Fax: 303-675-2150 directly or indirectly, any claim of personal injury or death associated with such
LDCForFreescaleSemiconductor unintended or unauthorized use, even if such claim alleges that Freescale
@hibbertgroup.com Semiconductor was negligent regarding the design or manufacture of the part.
MC68HC705C8A/D