311 21159 0 KMC705JJ7CDW
311 21159 0 KMC705JJ7CDW
311 21159 0 KMC705JJ7CDW
HC05M68HC
MC68HC705JJ7/D
REV 4
68HC05M6
MC68HC705JJ7
MC68HC705JP7
MC68HC705SJ7
MC68HC705SP7
MC68HRC705JJ7
MC68HRC705JP7
Advance Information
HCMOS
Microcontroller Unit
blank
MC68HC705JJ7 MC68HRC705SJ7
MC68HC705SJ7 MC68HC705JP7
MC68HRC705JJ7 MC68HC705SP7
Advance Information
Motorola reserves the right to make changes without further notice to any products
herein. Motorola makes no warranty, representation or guarantee regarding the
suitability of its products for any particular purpose, nor does Motorola 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 Motorola 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 customer's technical experts. Motorola does not convey
any license under its patent rights nor the rights of others. Motorola 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 Motorola product could create a
situation where personal injury or death may occur. Should Buyer purchase or use
Motorola products for any such unintended or unauthorized application, Buyer shall
indemnify and hold Motorola 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 Motorola was negligent regarding the design or manufacture of the part.
Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
MOTOROLA 3
Advance Information
Revision History
Revision Page
Date Description
Level Number(s)
General reformat to bring document up to current publication
All
standards
References to MC68HRC705SJ7 and MC68HRC705SP7 removed
All
throughout
Figure 7-9. PB4/AN4/TCMP/CMP1 Pin I/O Circuit — Change label
94
of register $1FF0 from mask option register to COP register
Table 7-2. Port B Pin Functions — PB0–PB4 — Change heading
96
under Comparator 1 from OPT in MOR to OPT in COPR
12.4 PEPROM Programming — Contact information updated 179
August, 2001 4 Figure 13-3. EPROM Security in COP and Security Register
188
(COPR) — Figure title change
13.4 EPROM Programming — Contact information updated and
189
corrected reference to COP register from COP to COPR
15.15 SIOP Timing (VDD = 5.0 Vdc) — Value change for clock
225
(SCK) low time
15.16 SIOP Timing (VDD = 3.0 Vdc) — Value change for clock
226
(SCK) low time
213, 214,
Section 15. Electrical Specifications — Added Figure 15-1
219, 223,
through Figure 15-10 and Figure 15-12
and 227
4 MOTOROLA
Advance Information — MC68HC705JJ7/MC68HC705JP7
List of Sections
Section 2. Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Section 4. Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Section 5. Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Table of Contents
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Section 2. Memory
2.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Section 4. Interrupts
4.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Section 5. Resets
5.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.3.2 Data Direction Register A. . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.3.3 Pulldown Register A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.3.4 Port A External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.3.5 Port A Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.4 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.4.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.4.2 Data Direction Register B. . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.4.3 Pulldown Register B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.4.4 Port B Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.4.5 PB0, PBI, PB2, and PB3 Logic. . . . . . . . . . . . . . . . . . . . . . .93
7.4.6 PB4/AN4/TCMP/CMP1 Logic. . . . . . . . . . . . . . . . . . . . . . . . 94
7.4.7 PB5/SDO Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
7.4.8 PB6/SDI Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
7.4.9 PB7/SCK Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
List of Figures
List of Tables
10-1 Core Timer Interrupt Rates and COP Timeout Selection . . . . 155
10-2 COP Watchdog Recommendations . . . . . . . . . . . . . . . . . . . . 157
1.1 Contents
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.2 Introduction
The Motorola MC68HC705JJ7 and MC68HC705JP7 are erasable
programmable read-only memory (EPROM) versions of the
MC68HC05JJ/JP Family of microcontrollers (MCU).
1.3 Features
Features of the two parts include:
• Low-cost, M68HC05 core MCU in 20-pin package
(MC68HC705JJ7) or 28-pin package (MC68HC705JP7)
• 6160 bytes of user EPROM, including 16 bytes of user vectors
• 224 bytes of low-power user random-access memory (RAM)
• 64 bits of personality EPROM (serial access)
• 16-bit programmable timer with input capture and output compare
• 15-stage core timer, including 8-bit free-running counter
and 4-stage selectable real-time interrupt generator
• Simple serial input/output port (SIOP) with interrupt capability
• Two voltage comparators, one of which can be combined with the
16-bit programmable timer to create a 4-channel, single-slope
analog-to-digital (A/D) converter
• Output of voltage comparator can drive port pin PB4 directly under
software control
• 14 input/output (I/O) lines (MC68HC705JJ7) or 22 I/O lines
(MC68HC705JP7), including high-source/sink current capability
on 6 I/O pins (MC68HC705JJ7) or 14 I/O pins (MC68HC705JP7)
• Programmable 8-bit mask option register (MOR) to select mask
options found in read-only memory (ROM) based versions
• MOR selectable software programmable pulldowns on all I/O pins
and keyboard scan interrupt on four I/O pins
• Software mask and request bit for IRQ interrupt with MOR
selectable sensitivity on IRQ interrupt (edge- and level-sensitive or
edge-only)
• On-chip oscillator with device option of crystal/ceramic resonator
or resistor-capacitor (RC) operation and MOR selectable shunt
resistor, 2 MΩ by design
NOTE: A line over a signal name indicates an active low signal. For example,
RESET is active high and RESET is active low.
OSC1 EXTERNAL +
TRANSFER
CONTROL
OSC2 OSCILLATOR COMP1
– VDD
INTERNAL
+
OSCILLATOR CURRENT
COMP2
– SOURCE
÷2
16-BIT TIMER
(1) INPUT CAPTURE TCAP
VDD INT TCMP COMPARATOR
LVR (1) OUTPUT COMPARE
CONTROL & TEMPERATURE
ICF
MULTIPLEXER DIODE
15-STAGE OCF
CORE TIMER
TOF
SYSTEM
VSS
WATCHDOG &
VSS ILLEGAL ADDR
PB0/AN0
DETECT
PORT B
INT
RESET PB3/AN3/TCAP
68HC05 CPU PB4/AN4/TCMP/CMP1*
IRQ/VPP
PB5/SDO
ACCUM
CPU REGISTERS PB6/SDI
INDEX REG PB7/SCK
0 0 0 0 0 0 0 0 1 1 STK PTR
INT
SIMPLE SERIAL
PROGRAM COUNTER INTERFACE
(SIOP)
COND CODE REG 1 1 1H I NZC
PORT A DATA DIR. REG.
PA5*
PA4*
PORT A
PA3*†
PC6*
PERSONALITY EPROM — 64 BITS PC5*
PORT C
PORT C
PC4* ONLY ON
PC3* 28-PIN
VERSIONS
* High sink current capability PC2*
* High source current capability PC1*
† IRQ interrupt capability
PC0*
MC68HC705JJ7
PB1/AN1 1 20 PB0/AN0
PB2/AN2 2 19 VDD
PB3/AN3/TCAP 3 18 VSS
*PB4/AN4/TCMP/CMP1 4 17 OSC1
PB5/SDO 5 16 OSC2
PB6/SDI 6 15 RESET
PB7/SCK 7 14 IRQ/VPP
*PA5 8 13 PA0*†
* PA4 9 12 PA1*†
†* PA3 10 11 PA2*†
MC68HC705JP7
PB1/AN1 1 28 PB0/AN0
PB2/AN2 2 27 VDD
PB3/AN3/TCAP 3 26 VSS
*PB4/AN4/TCMP/CMP1 4 25 OSC1
PB5/SDO 5 24 OSC2
* PC4 6 23 PC3*
*PC5 7 22 PC2*
* PC6 8 21 PC1*
*PC7 9 20 PC0*
PB6/SDI 10 19 RESET
PB7/SCK 11 18 IRQ/VPP
*PA5 12 17 PA0*†
* PA4 13 16 PA1*†
†* PA3 14 15 PA2*†
Very fast signal transitions occur on the MCU pins. The short rise and fall
times place very high short-duration current demands on the power
supply. To prevent noise problems, special care should be taken to
provide good power supply bypassing at the MCU by using bypass
capacitors with good high-frequency characteristics that are positioned
as close to the MCU as possible.
2 MΩ
UNCONNECTED
EXTERNAL CLOCK
The circuit in Figure 1-3 (a) shows a typical oscillator circuit for an
AT-cut, parallel resonant crystal. The crystal manufacturer’s
recommendations should be followed, as the crystal parameters
determine the external component values required to provide maximum
stability and reliable startup. The load capacitance values used in the
oscillator circuit design should include all stray capacitances. The crystal
and components should be mounted as close as possible to the pins for
startup stabilization and to minimize output distortion. An internal startup
resistor of approximately 2 MΩ can be provided between OSC1 and
OSC2 for the crystal type oscillator by use of the OSCRES bit in the
MOR.
1.7.3 RC Oscillator
NOTE: Do not use the internal startup resistor between OSC1 and OSC2 for the
RC-type oscillator.
NOTE: Do not use the internal startup resistor between OSC1 and OSC2 for the
external clock.
The voltage on this pin may affect operation if the voltage on the
IRQ/VPP pin is above VDD when the device is released from a reset
condition. The IRQ/VPP pin should only be taken above VDD to program
an EPROM memory location or personality EPROM bit. For more
information, refer to 15.14 PEPROM and EPROM Programming
Characteristics.
NOTE: Each of the PA0–PA3 I/O pins may be connected as an OR function with
the IRQ interrupt function by the PIRQ bit in the MOR. This capability
allows keyboard scan applications where the transitions or levels on the
I/O pins will behave the same as the IRQ/VPP pin, except that active
transitions and levels are inverted. The edge or level sensitivity selected
by the LEVEL bit in the MOR for the IRQ/VPP pin also applies to the I/O
pins that are ORed to create the IRQ signal. For more information, refer
to 4.6 External Interrupts.
1.10 PA0–PA5
These six I/O lines comprise port A, a general-purpose bidirectional I/O
port. This port also has four pins which have keyboard interrupt
capability. All six of these pins have high current source and sink
capability.
1.11 PB0–PB7
These eight I/O lines comprise port B, a general-purpose bidirectional
I/O port. This port is also shared with the 16-bit programmable timer
input capture and output compare functions, with the two voltage
comparators in the analog subsystem, and with the simple serial
interface (SIOP).
The outputs of voltage comparator 1 can directly drive the PB4 pin; and
the PB4 pin has high current source and sink capability.
Section 2. Memory
2.1 Contents
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 Introduction
This section describes the organization of the memory on the
MC68HC705JJ7/MC68HC705JP7.
MOTOROLA Memory 35
Memory
$1EFF
36 Memory MOTOROLA
Memory
Input/Output Registers
MOTOROLA Memory 37
Memory
38 Memory MOTOROLA
Memory
Input/Output Registers
MOTOROLA Memory 39
Memory
40 Memory MOTOROLA
Memory
Input/Output Registers
Read:
$1FF0 COP and Security Register OPT
(COPR) Write: EPMSEC COPC
See pages 43, 137, 156, and 188.
Reset: Unaffected by reset
= Unimplemented R = Reserved U = Unaffected
1. Features related to port C are only available on the 28-pin MC68HC705JP7 devices.
MOTOROLA Memory 41
Memory
42 Memory MOTOROLA
Memory
Erasable Programmable Read-Only Memory (EPROM)
Address: $1FF0
Read:
OPT
Write: EPMSEC COPC
= Unimplemented
MOTOROLA Memory 43
Memory
44 Memory MOTOROLA
Advance Information — MC68HC705JJ7/MC68HC705JP7
3.1 Contents
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.2 Introduction
This section describes the central processor unit (CPU) registers.
Figure 3-1 shows the five CPU registers. CPU registers are not part of
the memory map.
7 0
A ACCUMULATOR (A)
7 0
X INDEX REGISTER (X)
15 6 5 0
0 0 0 0 0 0 0 0 1 1 SP STACK POINTER (SP)
15 10 8 7 0
1 1 1 PCH PCL PROGRAM COUNTER (PC)
7 5 4 0
1 1 1 H I N Z C CONDITION CODE REGISTER (CCR)
HALF-CARRY FLAG
INTERRUPT MASK
NEGATIVE FLAG
ZERO FLAG
CARRY/BORROW FLAG
3.3 Accumulator
The accumulator is a general-purpose 8-bit register as shown in
Figure 3-2. The CPU uses the accumulator to hold operands and results
of arithmetic and non-arithmetic operations.
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Write:
The 8-bit index register can also serve as a temporary data storage
location.
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Write:
Bit Bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Read:
0 0 0 0 0 0 0 0 1 1
Write:
Reset: 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
The 10 most significant bits of the stack pointer are permanently fixed at
0000000011, so the stack pointer produces addresses from $00C0 to
$00FF. If subroutines and interrupts use more than 64 stack 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 Bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Read:
1 1 1
Write:
Bit 7 6 5 4 3 2 1 Bit 0
Read:
1 1 1 H I N C Z
Write:
Reset: 1 1 1 U 1 U U U
U = Unaffected
Section 4. Interrupts
4.1 Contents
4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3 Interrupt Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.4 Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.5 Software Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.6 External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
4.6.1 IRQ/VPP Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.6.2 PA0–PA3 Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.6.3 IRQ Status and Control Register (ISCR) . . . . . . . . . . . . . . . 58
4.7 Core Timer Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.7.1 Core Timer Overflow Interrupt . . . . . . . . . . . . . . . . . . . . . . . 60
4.7.2 Real-Time Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.8 Programmable Timer Interrupts . . . . . . . . . . . . . . . . . . . . . . . . 61
4.8.1 Input Capture Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.8.2 Output Compare Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.8.3 Timer Overflow Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.9 Serial Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.10 Analog Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.10.1 Comparator Input Match Interrupt . . . . . . . . . . . . . . . . . . . .63
4.10.2 Input Capture Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.2 Introduction
An interrupt temporarily stops normal program execution to process a
particular event. An interrupt does not stop the execution of the
instruction in progress, but takes effect when the current instruction
completes its execution. Interrupt processing automatically saves the
MOTOROLA Interrupts 51
Interrupts
central processor unit (CPU) registers on the stack and loads the
program counter with a user-defined vector address.
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
actually interrupt a lower priority interrupt service routine unless the
lower priority interrupt service routine clears the I bit.
52 Interrupts MOTOROLA
Interrupts
Interrupt Processing
$00BE
$00BF
$00C0 Bottom of Stack
$00C1
$00C2 Unstacking
Order
⇓
n Condition Code Register 5 1
n+1 Accumulator 4 2
n+2 Index Register 3 3
n+3 Program Counter (High Byte) 2 4
n+4 Program Counter (Low Byte) 1 5
⇑
Stacking
$00FD Order
$00FE
$00FF Top of Stack (RAM)
MOTOROLA Interrupts 53
Interrupts
FROM
RESET
NO
EXTERNAL YES
CLEAR IRQ LATCH
INTERRUPT?
NO
NO
TIMER YES
INTERRUPT?
NO
SERIAL YES
INTERRUPT?
NO
ANALOG YES
INTERRUPT?
FETCH NEXT
INSTRUCTION
SWI YES
INSTRUCTION?
NO
RTI YES
INSTRUCTION? UNSTACK CCR, A, X, PCH, PCL
NO
EXECUTE INSTRUCTION
54 Interrupts MOTOROLA
Interrupts
Software Interrupt
Setting the I bit in the condition code register or clearing the IRQE bit in
the interrupt status and control register disables these external
interrupts.
NOTE: If the IRQ/VPP pin is not in use, it should be connected to the VDD pin.
MOTOROLA Interrupts 55
Interrupts
VPP TO
USER EPROM
AND PEPROM
PA3
VDD
PA2 IRQ
LATCH
EXTERNAL
R INTERRUPT
REQUEST
PA1
PA0
RST
IRQ VECTOR FETCH
LEVEL
IRQR
PIRQ
IRQE
IRQF
MASK OPTION REGISTER ($1FF1) IRQ STATUS/CONTROL REGISTER ($000D)
With the edge- and level-sensitive trigger MOR option, a falling edge or
a low level on the IRQ/VPP pin latches an external interrupt request. The
edge- and level-sensitive trigger MOR option allows connection to the
IRQ/VPP pin of multiple wired-OR interrupt sources. As long as any
source is holding the IRQ low, an external interrupt request is present,
and the CPU continues to execute the interrupt service routine.
56 Interrupts MOTOROLA
Interrupts
External Interrupts
NOTE: The response of the IRQ/VPP pin can be affected if the external interrupt
capability of the PA0 through PA3 pins is enabled. If the port A pins are
enabled as external interrupts, then any high level on a PA0–PA3 pin will
cause the IRQ changes and state to be ignored until all of the PA0–PA3
pins have returned to a low level.
Programming the PIRQ bit in the MOR to a logic 1 enables the PA0–PA3
pins (PA0:3) to serve as additional external interrupt sources. A rising
edge on a PA0:3 pin latches an external interrupt request. After
completing the current instruction, the CPU tests the IRQ latch. If the
IRQ latch is set, the CPU then tests the I bit in the condition code register
and the IRQE bit in the ISCR. If the I bit is clear and the IRQE bit is set,
the CPU then begins the 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, the CPU can
recognize the new interrupt request.
With the edge- and level-sensitive trigger MOR option, a rising edge or
a high level on a PA0:3 pin latches an external interrupt request. The
edge- and level-sensitive trigger MOR option allows connection to a
PA0:3 pin of multiple wired-OR interrupt sources. As long as any source
is holding the pin high, an external interrupt request is present, and the
CPU continues to execute the interrupt service routine.
NOTE: If the port A pins are enabled as external interrupts, then a high level on
any PA0:3 pin will drive the state of the IRQ function such that the
MOTOROLA Interrupts 57
Interrupts
IRQ/VPP pin and other PA0:3 pins are to be ignored until ALL of the
PA0:3 pins have returned to a low level. Similarly, if the IRQ/VPP pin is
at a low level, the PA0:3 pins will be ignored until the IRQ/VPP pin returns
to a high state.
The IRQ status and control register (ISCR), shown in Figure 4-4,
contains an external interrupt mask (IRQE), an external interrupt flag
(IRQF), and a flag reset bit (IRQR). Unused bits will read as logic 0s. The
ISCR also contains two control bits for the oscillators, external pin
oscillator, and internal low-power oscillator. Reset sets the IRQE and
OM2 bits and clears all the other bits.
Address: $000D
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0 IRQF 0 0 0
IRQE OM2 OM1
Write: R IRQR
Reset: 1 1 0 0 0 0 U 0
58 Interrupts MOTOROLA
Interrupts
External Interrupts
MOTOROLA Interrupts 59
Interrupts
Setting the I bit in the condition code register disables core timer
interrupts. The controls and flags for these interrupts are in the core timer
status and control register (CTSCR) located at $0008.
An overflow interrupt request occurs if the core timer overflow flag (TOF)
becomes set while the core timer overflow interrupt enable bit (TOFE) is
also set. The TOF flag bit can be reset by writing a logic 1 to the CTOFR
bit in the CTSCR or by a reset of the device.
60 Interrupts MOTOROLA
Interrupts
Programmable Timer Interrupts
Setting the I bit in the condition code register disables timer interrupts.
The controls for these interrupts are in the timer control register (TCR)
located at $0012 and in the status bits in the timer status register (TSR)
located at $0013.
An input capture interrupt occurs if the input capture flag (ICF) becomes
set while the input capture interrupt enable bit (ICIE) is also set. The ICF
flag bit is in the TSR, and the ICIE enable bit is located in the TCR. The
ICF flag bit is cleared by a read of the TSR with the ICF flag bit set, and
then followed by a read of the LSB of the input capture register (ICRL)
or by reset. The ICIE enable bit is unaffected by reset.
MOTOROLA Interrupts 61
Interrupts
The TOF flag bit is cleared by a read of the TSR with the TOF flag bit set,
and then followed by an access to the LSB of the timer registers (TMRL)
or by reset. The TOIE enable bit is unaffected by reset.
Setting the I bit in the condition code register disables serial interrupts.
The controls for these interrupts are in the serial control register (SCR)
located at $000A and in the status bits in the serial status register (SSR)
located at $000B.
62 Interrupts MOTOROLA
Interrupts
Analog Interrupts
Setting the I bit in the condition code register disables analog subsystem
interrupts. The controls for these interrupts are in the analog subsystem
control register (ACR) located at $001D, and the status bits are in the
analog subsystem status register (ASR) located at $001E.
NOTE: For the analog subsystem to generate an interrupt using the input
capture function of the programmable timer, the ICEN enable bit in the
ACR, and the ICIE and IEDG bits in the TCR must all be set.
MOTOROLA Interrupts 63
Interrupts
64 Interrupts MOTOROLA
Advance Information — MC68HC705JJ7/MC68HC705JP7
Section 5. Resets
5.1 Contents
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
MOTOROLA Resets 65
Resets
5.2 Introduction
This section describes the five reset sources and how they initialize the
microcontroller unit (MCU). A reset immediately stops the operation of
the instruction being executed, initializes certain control bits, and loads
the program counter with a user-defined reset vector address. These
conditions produce a reset:
• Initial power-up of device (power-on reset)
• A logic 0 applied to the RESET pin (external reset)
• Timeout of the computer operating properly (COP) watchdog
(COP reset)
• Low voltage applied to the device (LVR reset)
• Fetch of an opcode from an address not in the memory map
(illegal address reset)
Figure 5-1 shows a block diagram of the reset sources and their
interaction.
COP WATCHDOG
LOW-VOLTAGE RESET
INTERNAL
ADDRESS BUS
S TO CPU
RESET D RST
AND
RESET SUBSYSTEMS
LATCH
R
3-CYCLE
CLOCKED
1-SHOT INTERNAL
CLOCK
66 Resets MOTOROLA
Resets
Power-On Reset
The RESET pin can also be pulled to a low state by an internal pulldown
device that is activated by three internal reset sources. This reset
pulldown device will only be asserted for three to four cycles of the
internal bus or as long as the internal reset source is asserted.
NOTE: Do not connect the RESET pin directly to VDD, as this may overload
some power supply designs if the internal pulldown on the RESET pin
should activate. If an external reset function is not required, the RESET
pin should be left unconnected.
MOTOROLA Resets 67
Resets
Only the COP watchdog timer reset, low-voltage reset, and illegal
address detector will also assert the pulldown device on the RESET pin
for the duration of the reset function or for three to four internal bus
cycles, whichever is longer.
The POR will generate the RST signal which will reset the CPU. If any
other reset function is active at the end of the 16- or 4064-cycle delay,
the RST signal will remain in the reset condition until the other reset
condition(s) end.
POR will not activate the pulldown device on the RESET pin. VDD must
drop below VPOR for the internal POR circuit to detect the next rise of
VDD.
68 Resets MOTOROLA
Resets
Internal Resets
Address: $1FF0
Bit 7 6 5 4 3 2 1 Bit 0
Read:
EPMSEC OPT
Write: COPC
Reset: U U U U U U U U
= Unimplemented U = Unaffected
NOTE: See 8.8.1 Voltage Comparator 1 and 8.11 Sample and Hold for further
descriptions of the OPT bit.
The COP watchdog reset will assert the pulldown device to pull the
RESET pin low for three to four cycles of the internal bus.
MOTOROLA Resets 69
Resets
The LVR activates the RST reset signal to reset the device when the
voltage on the VDD pin falls below the LVR trip voltage. The LVR will
assert the pulldown device to pull the RESET pin low for three to four
cycles of the internal bus.
NOTE: The LVR is intended for applications where the VDD supply voltage
normally operates above 4.5 volts.
5.6.1 CPU
70 Resets MOTOROLA
Resets
Reset States
1. Features related to port C are only available on the 28-pin MC68HC705JP7 devices
MOTOROLA Resets 71
Resets
A reset, therefore, disables the SIOP and leaves the shared port B pins
as general I/O. Any pending interrupt flag is cleared and the SIOP
interrupt is disabled. Also the baud rate defaults to the slowest rate.
72 Resets MOTOROLA
Resets
Reset States
A reset presets the oscillator select bits (OM1 and OM2) in the interrupt
status and control register (ISCR) such that the device runs from the
internal oscillator (OM1 = 0, OM2 = 1) which has these effects on the
oscillators:
• The internal low-power oscillator is enabled and selected.
• The external oscillator is disabled.
• The CPU bus clock is driven from the internal low-power oscillator.
MOTOROLA Resets 73
Resets
74 Resets MOTOROLA
Advance Information — MC68HC705JJ7/MC68HC705JP7
6.1 Contents
6.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.2 Introduction
This section describes the operation of the device with respect to the
oscillator source and the low-power modes:
• Stop mode
• Wait mode
• Halt mode
• Data-retention mode
Address: $000D
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0 IRQF 0 0 0
IRQE OM2 OM1
Write: R IRQR
Reset: 1 1 0 0 0 0 0 0
= Unimplemented R = Reserved
NOTE: When switching from LPO to EPO, the user must be careful to ensure
that the EPO has been enabled and powered up long enough to stabilize
before shifting clock sources.
Figure 6-2 shows the sequence of events in stop, wait, and halt modes.
YES
SWAIT BIT CLEAR I BIT IN CCR. CLEAR I BIT IN CCR.
IN MOR SET? SET IRQE BIT IN ISCR. SET IRQE BIT IN ISCR.
TURN OFF CPU CLOCK. TURN OFF CPU CLOCK.
NO KEEP OTHER MODULE KEEP OTHER MODULE
CLOCKS ACTIVE. CLOCKS ACTIVE.
CLEAR I BIT IN CCR.
SET IRQE BIT IN ISCR.
CLEAR CTOF, RTIF, CTOFE, AND RTIE BITS IN TSCR.
CLEAR ICF, OCF, AND TOF BITS IN TSR.
CLEAR ICIE, OCIE, AND TOIE BITS IN TCR. YES YES
DISABLE EXTERNAL PIN OSCILLATOR. EXTERNAL EXTERNAL
TURN OFF INTERNAL LOW-POWER OSCILLATOR. RESET? RESET?
NO NO
NO NO NO
YES END OF NO NO
STABILIZATION
DELAY?
YES ANALOG YES ANALOG
NO INTERRUPT? INTERRUPT?
NO NO
NO NO
The STOP instruction puts the MCU in a mode with the lowest power
consumption and affects the MCU as follows:
• Turns off the central processor unit (CPU) clock and all internal
clocks by stopping both the external pin oscillator and the internal
low-power oscillator. The selection of the oscillator by the OM1
and OM2 bits in the ISCR is not affected. The stopped clocks turn
off the COP watchdog, the core timer, the programmable timer,
the analog subsystem, and the SIOP.
• Removes any pending core timer interrupts by clearing the core
timer interrupt flags (CTOF and RTIF) in the core timer status and
control register (CTSCR)
• Disables any further core timer interrupts by clearing the core
timer interrupt enable bits (CTOFE and RTIE) in the CTSCR
• Removes any pending programmable timer interrupts by clearing
the timer interrupt flags (ICF, OCF, and TOF) in the timer status
register (TSR)
• Disables any further programmable timer interrupts by clearing the
timer interrupt enable bits (ICIE, OCIE, and TOIE) in the timer
control register (TCR)
• Enables external interrupts via the IRQ/VPP pin by setting the
IRQE bit in the IRQ status and control register (ISCR). External
interrupts are also enabled via the PA0 through PA3 pins, if the
port A interrupts are enabled by the PIRQ bit in the mask option
register (MOR).
• Enables interrupts in general by clearing the I bit in the condition
code register
The STOP instruction does not affect any other bits, registers, or I/O
lines.
NOTE: Execution of the STOP instruction without setting the SWAIT bit in the
MOR will cause the oscillators to stop, and, therefore, disable the COP
watchdog timer. If the COP watchdog timer is to be used, stop mode
should be changed to halt mode as described in 6.4.3 Halt Mode.
The WAIT instruction puts the MCU in a low-power wait mode which
consumes more power than the stop mode and affects the MCU as
follows:
• Enables interrupts by clearing the I bit in the condition code
register
• Enables external interrupts by setting the IRQE bit in the IRQ
status and control register
• Stops the CPU clock which drives the address and data buses, but
allows the selected oscillator to continue to clock the core timer,
programmable timer, analog subsystem, and SIOP
The WAIT instruction does not affect any other bits, registers, or I/O
lines.
These conditions restart the CPU bus clock and bring the MCU out of
wait mode:
• An external interrupt signal on the IRQ/VPP pin — A high-to-low
transition on the IRQ/VPP pin loads the program counter with the
contents of locations $1FFA and $1FFB.
• An external interrupt signal on a port A external interrupt pin — If
selected by PIRQ bit in the MOR, a low-to-high transition on a
PA3–PA0 pin loads the program counter with the contents of
locations $1FFA and $1FFB.
• A core timer interrupt — A core timer overflow or a real-time
interrupt loads the program counter with the contents of locations
$1FF8 and $1FF9.
• A programmable timer interrupt — A programmable timer interrupt
driven by an input capture, output compare, or timer overflow
loads the program counter with the contents of locations $1FF6
and $1FF7.
• An SIOP interrupt — An SIOP interrupt driven by the completion
of transmitted or received 8-bit data loads the program counter
with the contents of locations $1FF4 and $1FF5.
• An analog subsystem interrupt — An analog subsystem interrupt
driven by a voltage comparison loads the program counter with
the contents of locations $1FF2 and $1FF3.
• A COP watchdog reset — A timeout of the COP watchdog resets
the MCU and loads the program counter with the contents of
locations $1FFE and $1FFF. Software can enable real-time
interrupts so that the MCU can periodically exit the wait mode to
reset the COP watchdog.
• An external reset — A logic 0 on the RESET pin resets the MCU
and loads the program counter with the contents of locations
$1FFE and $1FFF.
When the MCU exits the wait mode, there is no delay before code
executes like occurs when exiting the stop or halt modes.
The STOP instruction puts the MCU in halt mode if selected by the
SWAIT bit in the MOR. Halt mode is identical to wait mode, except that
a variable recovery delay occurs when the MCU exits halt mode. A
recovery time of from 1 to 16 or from 1 to 4064 internal bus cycles can
be selected by the DELAY bit in the MOR.
If the SWAIT bit is set in the MOR to put the MCU in halt mode, the COP
watchdog cannot be turned off inadvertently by a STOP instruction.
7.1 Contents
7.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.3.2 Data Direction Register A. . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.3.3 Pulldown Register A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.3.4 Port A External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.3.5 Port A Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.4 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.4.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.4.2 Data Direction Register B. . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.4.3 Pulldown Register B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.4.4 Port B Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.4.5 PB0, PBI, PB2, and PB3 Logic. . . . . . . . . . . . . . . . . . . . . . .93
7.4.6 PB4/AN4/TCMP/CMP1 Logic. . . . . . . . . . . . . . . . . . . . . . . . 94
7.4.7 PB5/SDO Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
7.4.8 PB6/SDI Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
7.4.9 PB7/SCK Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.2 Introduction
The MC68HC705JJ7 has 14 bidirectional input/output (I/O) pins which
form two parallel I/O ports, A and B. The MC68HC705JP7 has
22 bidirectional I/O pins which form three parallel I/O ports, A, B and C.
Each I/O pin is programmable as an input or an output. The contents of
the data direction registers determine the data direction of each of the
I/O pins. All I/O pins have software programmable pulldown devices
which can be enabled or disabled globally by the SWPDI bit in the mask
option register (MOR).
7.3 Port A
Port A is a 6-bit, general-purpose, bidirectional I/O port with these
features:
• Individual programmable pulldown devices
• High current sinking capability on all port A pins, with a maximum
total for port A
• High current sourcing capability on all port A pins, with a maximum
total for port A
• External interrupt capability (pins PA3–PA0)
The port A data register (PORTA) contains a bit for each of the 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 the port A data register returns
the logic state of the pin. The upper two bits of the port A data register
will always read as logic 0s.
Address: $0000
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0 0
PA5 PA4 PA3 PA2 PA1 PA0
Write:
= Unimplemented
Address: $0004
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0 0
DDRA5 DDRA4 DDRA3 DDRA2 DDRA1 DDRA0
Write:
Reset: 0 0 0 0 0 0 0 0
= Unimplemented
These read/write bits control port A data direction. Reset clears the
DDRA5–DDRA0 bits.
1 = Corresponding port A pin configured as output and pulldown
device disabled
0 = Corresponding port A pin configured as input
Address: $0010
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Reset: 0 0 0 0 0 0 0 0
= Unimplemented
The PIRQ bit in the MOR enables the PA3–PA0 pins to serve as external
interrupt pins in addition to the IRQ/VPP pin. The active interrupt state for
the PA3–PA0 pins is a logic 1 or a rising edge. A state of the PIRQ bit in
the MOR determines whether external interrupt inputs are
edge-sensitive only or both edge- and level-sensitive. Port A interrupts
are also interactive with each other and the IRQ/VPP pin as described in
4.6 External Interrupts.
NOTE: When testing for external interrupts, the BIH and BIL instructions test the
voltage on the IRQ/VPP pin, not the state of the internal IRQ signal.
Therefore, BIH and BIL cannot test the port A external interrupt pins.
The data latch can always be written, regardless of the state of its DDR
bits. Table 7-1 summarizes the operations of the port A pins.
WRITE $0010
PULLDOWN PULLDOWN
REGISTER A DEVICE
BIT PDIAx
SWPDI
R
RESET
7.4 Port B
Port B is an 8-bit, general-purpose, bidirectional I/O port with these
features:
• Programmable pulldown devices
• PB0–PB4 are shared with the analog subsystem.
• PB3 and PB4 are shared with the 16-bit programmable timer.
• PB4 can be driven directly by the output of comparator 1.
• PB5–PB7 are shared with the simple serial interface (SIOP).
• High current sinking capability on the PB4 pin
• High current sourcing capability on the PB4 pin
The port B data register (PORTB) contains a bit for each of the port B
pins. When a port B pin is programmed to be an output, the state of its
data register bit determines the state of the output pin. When a port B pin
is programmed to be an input, reading the port B data register returns
the logic state of the pin. Reset has no effect on port B data.
Address: $0001
Bit 7 6 5 4 3 2 1 Bit 0
Read:
PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
Write:
Reset: Unaffected by reset
Alternate: SCK SDI SDO AN4 AN3 AN2 AN1 AN0
Alternate: SCK SDI SDO TCMP TCAP AN2 AN1 AN0
Alternate: SCK SDI SDO CMP1 TCAP AN2 AN1 AN0
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
Address: $0011
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Reset: 0 0 0 0 0 0 0 0
= Unimplemented
All port B pins have the general I/O port logic similar to port A; but they
also share this function with inputs or outputs from other modules, which
are also attached to the pin itself or override the general I/O function.
PB0, PB1, PB2, and PB3 simply share their inputs with another module.
PB4, PB5, PB6, and PB7 will have their operation altered by outputs or
controls from other modules.
The typical I/O logic shown in Figure 7-8 is used for PB0, PB1, PB2, and
PB3 pins of port B. When these port B pins are programmed as an
output, reading the port bit actually reads the value of the data latch and
not the voltage on the pin itself. When these port B pins are 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.
The operations of the PB0–PB3 pins are summarized in Table 7-2.
BIT PBx
READ $0001
WRITE $0011
PULLDOWN
REGISTER B PULLDOWN
BIT PDIBx DEVICE
SWPDI
R
RESET
The PB0–PB3 pins share their inputs with another module. When using
the other attached module, these conditions must be observed:
1. If the DDRB configures the pin as an output, then the port data
register can provide an output which may conflict with any external
input source to the other module. The pulldown device will be
disabled in this case.
2. If the DDRB configures the pin as an input, then reading the port
data register will return the state of the input in terms of the digital
threshold for that pin (analog inputs will default to logic states).
3. If DDRB configures the pin as an input and the pulldown device is
activated for a pin, it will also load the input to the other module.
4. If interaction between the port logic and the other module is not
desired, the pin should be configured as an input by clearing the
appropriate DDRB bit. The input pulldown device is disabled by
clearing the appropriate PDRB bit (or by disabling programmable
pulldowns with the SWPDI bit in the MOR).
READ $0001
RESET
MASK OPTION REG. ($1FF1)
OPT
The PB5/SDO pin can be used as a simple I/O port pin or be controlled
by the SIOP serial interface as shown in Figure 7-10. The operations of
the PB5 pin are summarized in Table 7-3.
WRITE $0005
DATA DIRECTION
REGISTER B
BIT DDRB5
R
INTERNAL DATA BUS
READ $0001
WRITE $0011
PULLDOWN PULLDOWN
REGISTER B DEVICE
R BIT PDIB5
SWPDI
RESET
The PB6/SDI pin can be used as a simple I/O port pin or be controlled
by the SIOP serial interface as shown in Figure 7-11. The operations of
PB6/SDI pin are summarized in Table 7-3.
WRITE $0005
DATA DIRECTION
REGISTER B
BIT DDRB6
R
INTERNAL DATA BUS
READ $0001
WRITE $0011
PULLDOWN PULLDOWN
REGISTER B DEVICE
R BIT PDIB6
SWPDI
RESET
1. If the SIOP function is required, then the SPE bit in the SCR must
be set. This causes the PB6/SDI pin buffer to be disabled to allow
the PB6/SDI pin to act as an input that feeds the serial data input
(SDI) of the SIOP. The pulldown device is disabled in this case.
2. If the SIOP function is in control of the PB6/SDI pin, the DDRB6
and PB6 data register bits are still accessible to the CPU and can
be altered or read without affecting the SIOP functionality.
However, if the DDRB6 bit is cleared, reading the PB6 data
register will return the current state of the PB6/SDI pin.
The PB7/SCK pin can be used as a simple I/O port pin or be controlled
by the SIOP serial interface as shown in Figure 7-12. The operations of
the PB7/SCK pin are summarized in Table 7-3.
WRITE $0005
DATA DIRECTION
REGISTER B
INTERNAL DATA BUS
BIT DDRB7
R
READ $0001
WRITE $0011
PULLDOWN PULLDOWN
REGISTER B DEVICE
R BIT PDIB7
SWPDI
RESET
1. If the SIOP function is required, then the SPE bit in the SCR must
be set. This causes the PB7/SCK pin buffer to be controlled by the
MSTR control bit in the SCR. The pulldown device is disabled in
these cases.
a. If the MSTR bit is set, then the PB7/SCK pin buffer will be
enabled and driven by the serial data clock (SCK) from the
SIOP.
b. If the MSTR bit is clear, then the PB7/SCK pin buffer will be
disabled, allowing the PB7/SCK pin to drive the serial data
clock (SCK) into the SIOP.
2. If the SIOP function is in control of the PB7/SCK pin, the DDRB7
and PB7 data register bits are still accessible to the CPU and can
be altered or read without affecting the SIOP functionality.
However, if the DDRB7 bit is cleared, reading the PB7 data
register will return the current state of the PB7/SCK pin.
3. If the SIOP function is terminated by clearing the SPE bit in the
SCR, then the last conditions stored in the DDRB7, PDIB7, and
PB7 register bits will then control the PB7/SCK pin.
4. If the PB7/SCK pin is to be a digital input, then both the SPE bit in
the SCR and the DDRB7 bit must be cleared. Depending on the
external application, the pulldown device may also be disabled by
setting the PDIB7 pulldown inhibit bit.
5. If the PB7/SCK pin is to be a digital output, then the SPE bit in the
SCR must be cleared and the DDRB7 bit must be set. The
pulldown device will be disabled when the pin is set as an output.
The port C data register (PORTC) contains a bit for each of the 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 the output pin. When a port C pin
is programmed to be an input, reading the port C data register returns
the logic state of the pin.
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
Read:
DDRC7 DDRC6 DDRC5 DDRC4 DDRC3 DDRC2 DDRC1 DDRC0
Write:
Reset: 0 0 0 0 0 0 0 0
READ $0006
WRITE $0006
DATA DIRECTION
REGISTER C
BIT DDRCx
R
INTERNAL DATA BUS
SWPDI
R
RESET
8.1 Contents
8.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
8.2 Introduction
The analog subsystem of the MC68HC705JJ7/MC68HC705JP7 is
based on two on-chip voltage comparators and a selectable current
charge/discharge function as shown in Figure 8-1.
16-BIT PROG.
TIMER
PB3/AN3/TCAP
OCF
2 TO 1
TOF
VDD TCAP
ICF
MUX
PORTB ICHG
LOGIC CHG
CHARGE
PB0 CURRENT ATD1
AN0 CONTROL
LOGIC ATD2
CONTROL REGISTER
IDISCHG ISEN
VDD
CP2EN
ANALOG
(ACR)
CP2EN ICEN
+
COMP2
–
INTERNAL
TEMPERATURE
DIODE INV CP1EN
CPIE
$001D
VDD ANALOG
INTERRUPT
INPUT SELECT AND
SAMPLE CONTROL
COMPARATOR
80 kΩ CPF2
VREF
CPF1
STATUS REGISTER
ANALOG
80 kΩ
(ASR)
PORTB SAMPLE CMP1
LOGIC CAP
VOFF
PB1
AN1
–+
MUX1 100 MV
PORTB $001E
LOGIC OFFSET
PORTB MUX2
+ HOLD
LOGIC COMP1
PB3 – DHOLD
CHANNEL SELECT BUS
AN3 INV
TCAP
MUX REGISTER
(AMUX)
LOGIC MUX4
PB4
AN4 MUX3
TCMP
MUX2
MUX4 PORT B
OLVL MUX1
VAOFF CONTROL COE1
LOGIC OPT (COPR) $0003
VSS –+ MUX4 DENOTES
MUX3
VSS MUX2 INTERNAL
MUX1 ANALOG VSS
AVSS = VSS = VAOFF
The end of the A/D conversion time can be captured by these means:
Address: $0003
Bit 7 6 5 4 3 2 1 Bit 0
Read:
HOLD DHOLD INV VREF MUX4 MUX3 MUX2 MUX1
Write:
Reset: 1 0 0 0 0 0 0 0
HOLD, DHOLD
These read/write bits control the source connection to the negative
input of voltage comparator 2 shown in Figure 8-3. This allows the
voltage on the internal temperature sensing diode, the channel
selection bus, or the divide-by-two channel selection bus to charge
the internal sample capacitor and to also be presented to comparator
2. The decoding of these sources is given in Table 8-1.
During the hold case when both the HOLD and DHOLD bits are clear,
the VOFF bit in the analog status register (ASR) can offset the VSS
reference on the sample capacitor by approximately 100 mV. This
offset source is bypassed whenever the sample capacitor is being
charged with either the HOLD or DHOLD bit set. The VOFF bit must
be enabled by the OPT bit in the COPR at location $1FF0.
VDD
PB0 +
COMP2
INTERNAL –
TEMPERATURE
DIODE
CHANNEL
SELECTION
BUS
80 kΩ
SAMPLE
80 kΩ CAP
VOFF
OPT (MOR)
HOLD
VSS
OFFSET +
– DHOLD
During a reset, the HOLD bit is set and the DHOLD bit is cleared,
which connects the internal sample capacitor to the channel selection
bus. And since a reset also clears the MUX[1:4] bits, then the channel
selection bus will be connected to VSS and the internal sample
capacitor will be discharged to VSS following the reset.
NOTE: When sampling a voltage for later conversion, the HOLD and DHOLD
bits should be cleared before making any changes in the MUX channel
selection. If the MUX channel and the HOLD/DHOLD are changed on
the same write cycle to the AMUX register, the sampled voltage may be
altered during the channel switching.
INV
This is a read/write bit that controls the relative polarity of the inherent
input offset voltage of the voltage comparators. This bit allows voltage
comparisons to be made with both polarities and then averaged
together by taking the sum of the two readings and then dividing by 2
(logical shift right).
The polarity of the input offset is reversed by interchanging the
internal voltage comparator inputs while also inverting the comparator
output. This interchange does not alter the action of the voltage
comparator output with respect to its port pins. That is, the output will
only go high if the voltage on the positive input (PB2 pin for
comparator 1 and PB0 pin for comparator 2) is above the voltage on
the respective negative input (PB3 pin for comparator 1 and PB1 pin
for comparator 2). This is shown schematically in Figure 8-4. This bit
is cleared by a reset of the device.
1 = The voltage comparators are internally inverted.
0 = The voltage comparators are not internally inverted.
NOTE: The effect of changing the state of the INV bit is to only change the
polarity of the input offset voltage. It does not change the output phase
of the CPF1 or CPF2 flags with respect to the external port pins.
RISE RISE
WHEN WHEN
V+ V+ > V– V+ V+ > V–
VIO + VIO +
COMP COMP
– –
V– V–
INV = 0 INV = 1
NOTE: Either comparator may generate an output flag when the inputs are
exchanged due to a change in the state of the INV bit. It is therefore
recommended that the INV bit not be changed while waiting for a
comparator flag. Further, any changes to the state of the INV bit should
be followed by writing a logic 1 to both the CPFR1 and CPFR2 bits to
clear any extraneous CPF1 or CPF2 flags that may have occurred.
VREF
This read/write bit connects the channel select bus to VDD for making
a reference voltage measurement. It cannot be selected if any of the
other input sources to the channel select bus are selected as shown
in Table 8-2. This bit is cleared by a reset of the device.
1 = Channel select bus connected to VDD if all MUX1:4 are cleared.
0 = Channel select bus cannot be connected to VDD.
MUX1:4
These are read/write bits that connect the analog subsystem pins to
the channel select bus and voltage comparator 2 for purposes of
making a voltage measurement. They can be selected individually or
combined with any of the other input sources to the channel select
bus as shown in Table 8-2.
NOTE: The VAOFF voltage source shown in Figure 8-1 depicts a small offset
voltage generated by the total chip current passing through the package
bond wires and lead frame that are attached to the single VSS pin. This
offset raises the internal VSS reference (AVSS) in the analog subsystem
with respect to the external VSS pin. Turning on the VSS MUX to the
channel select bus connects it to this internal AVSS reference line.
When making A/D conversions, this AVSS offset gets placed on the
external ramping capacitor since the discharge device on the PB0/AN0
pin discharges the external capacitor to the internal AVSS line. Under
these circumstances, the positive input (+) to comparator 2 will always
be higher than the negative input (–) until the negative input reaches the
AVSS offset voltage plus any offset in comparator 2.
Therefore, input voltages cannot be resolved if they are less than the
sum of the AVSS offset and the comparator offset, because they will
always yield a low output from the comparator.
X(1) 1 1 1 1 Hi Z On On On On Hi Z
1. Don/t care
The control bits in the ACR are shown in Figure 8-5. All the bits in this
register are cleared by a reset of the device.
Address: $001D
Bit 7 6 5 4 3 2 1 Bit 0
Read:
CHG ATD2 ATD1 ICEN CPIE CP2EN CP1EN ISEN
Write:
Reset: 0 0 0 0 0 0 0 0
CHG
The CHG enable bit allows direct control of the charge current source
and the discharge device and also reflects the state of the discharge
device. This bit is cleared by a reset of the device.
1 = If the ISEN bit is also set, the charge current source is sourcing
current out of the PB0/AN0 pin. Writing a logic 1 enables the
charging current out of the PB0/AN0 pin.
0 = The discharge device is sinking current into the PB0/AN0 pin.
Writing a logic 0 disables the charging current and enables the
discharging current into the PB0/AN0 pin, if the ISEN bit is also
set.
ATD1–ATD2
The ATD1–ATD2 enable bits select one of the four operating modes
used for making A/D conversions via the single-slope method.These
four modes are given in Table 8-3. These bits have no effect if the
ISEN enable bit is cleared. These bits are cleared by a reset of the
device and thereby return the analog subsystem to the manual A/D
conversion method.
Current
source and Current control disabled,
Disabled 0 X X X
discharge no source or sink current
disabled
ICEN
This is a read/write bit that enables a voltage comparison to trigger the
input capture register of the programmable timer when the CPF2 flag
bit is set. Therefore, an A/D conversion could be started by receiving
an OCF or TOF from the programmable timer and then terminated
when the voltage on the external ramping capacitor reaches the level
of the unknown voltage. The time of termination will be stored in the
16-bit buffer located at $0014 and $0015. This bit is automatically set
whenever mode 2 or 3 is selected by setting the ATD2 control bit. This
bit is cleared by a reset of the device.
1 = Connects the CPF2 flag bit to the timer input capture register
0 = Connects the PB3/AN3 pin to the timer input capture register
NOTE: For the input capture to occur when the output of comparator 2 goes
high, the IEDG bit in the TCR must also be set.
When the ICEN bit is set, the input capture function of the programmable
timer is not connected to the PB3/AN3/TCAP pin but is driven by the
CPF2 output flag from comparator 2. To return to capturing times from
external events, the ICEN bit must first be cleared before the timed event
occurs.
CPIE
This is a read/write bit that enables an analog interrupt when either of
the CPF1 or CPF2 flag bits is set to a logic 1. This bit is cleared by a
reset of the device.
1 = Enables analog interrupts when comparator flag bits are set
0 = Disables analog interrupts when comparator flag bits are set
NOTE: If both the ICEN and CPIE bits are set, they will both generate an
interrupt by different paths. One will be the programmable timer interrupt
due to the input capture and the other will be the analog interrupt due to
the output of comparator 2 going high. In this case, the input capture
interrupt will be entered first due to its higher priority. The analog
interrupt will then need to be serviced even if the comparator 2 output
has been reset or the input capture flag (ICF) has been cleared.
CP2EN
The CP2EN enable bit controls power to voltage comparator 2 in the
analog subsystem. Powering down a comparator will drop the supply
current. This bit is cleared by a reset of the device.
1 = Writing a logic 1 powers up voltage comparator 2.
0 = Writing a logic 0 powers down voltage comparator 2.
NOTE: Voltage comparators power up slower than digital logic and their outputs
may go through indeterminate states which might set their respective
flags (CPF1, CPF2). It is therefore recommended to power up the
charge current source first (ISEN), then to power up any comparators,
and finally clear the flag bits by writing a logic 1 to the respective CPFR1
or CPFR2 bits in the ACR.
CP1EN
The CP1EN enable bit will power down the voltage comparator 1 in
the analog subsystem. Powering down a comparator will drop the
supply current. This bit is cleared by a reset of the device.
1 = Writing a logic 1 powers up voltage comparator 1
0 = Writing a logic 0 powers down voltage comparator 1
ISEN
The ISEN enable bit will power down the charge current source and
disable the discharge device in the analog subsystem. Powering
down the current source will drop the supply current by about 200 µA.
This bit is cleared by a reset of the device.
1 = Writing a logic 1 powers up the ramping current source and
enables the discharge device on the PB0/AN0 pin.
0 = Writing a logic 0 powers down the ramping current source and
disables the discharge device on the PB0/AN0 pin.
NOTE: The analog subsystem has support circuitry which draws current. This
current will be powered down if both comparators and the charge current
source are powered down (ISEN, CP1EN, and CP2EN all cleared).
Powering up either comparator or the charge current source will activate
the support circuitry.
Address: $001E
Bit 7 6 5 4 3 2 1 Bit 0
Read: CPF2 CPF1 0 0 CMP2 CMP1
COE1 VOFF
Write: CPFR2 CPFR1 R
Reset: 0 0 0 0 0 0 0 0
= Unimplemented R = Reserved
CPF2
This read-only flag bit is edge sensitive to the rising output of
comparator 2. It is set when the voltage on the PB0/AN0 pin rises
above the voltage on a sample capacitor which creates a positive
edge on the output of comparator 2, regardless of the state of the INV
bit in the AMUX register. This bit is reset by writing a logic 1 to the
CPFR2 reset bit in the ASR. This bit is cleared by a reset of the
device.
1 = A positive transition on the output of comparator 2 has occurred
since the last time the CPF2 flag has been cleared.
0 = A positive transition on the output of comparator 2 has not
occurred since the last time the CPF2 flag has been cleared.
CPF1
This read-only flag bit is edge sensitive to the rising output of
comparator 1. It is set when the voltage on the PB2/AN2 pin rises
above the voltage on the PN3/AN3/TCAP pin which creates a positive
edge on the output of comparator 1, regardless of the state of the INV
bit in the AMUX register. This bit is reset by writing a logic 1 to the
CPFR1 reset bit in the ASR. This bit is cleared by a reset of the
device.
1 = A positive transition on the output of comparator 1 has occurred
since the last time the CPF1 flag has been cleared.
0 = A positive transition on the output of comparator 1 has not
occurred since the last time the CPF1 flag has been cleared.
CPFR2
Writing a logic 1 to this write-only flag clears the CPF2 flag in the ASR.
Writing a logic 0 to this bit has no effect. Reading the CPFR2 bit will
return a logic 0. By default, this bit looks cleared following a reset of
the device.
1 = Clears the CPF2 flag bit
0 = No effect
CPFR1
Writing a logic 1 to this write-only flag clears the CPF1 flag in the ASR.
Writing a logic 0 to this bit has no effect. Reading the CPFR1 bit will
return a logic 0. By default, this bit looks cleared after a reset of the
device.
1 = Clears the CPF1 flag bit
0 = No effect
NOTE: The CPFR1 and CPFR2 bits should be written with logic 1s following a
power-up of either comparator. This will clear out any latched CPF1 or
CPF2 flag bits which might have been set during the slower power-up
sequence of the analog circuitry.
If both inputs to a comparator are above the maximum common-mode
input voltage (VDD –1.5 V), the output of the comparator is indeterminate
and may set the comparator flag. Applying a reset to the device may only
temporarily clear this flag as long as both inputs of a comparator remain
above the maximum common-mode input voltages.
VOFF
This read-write bit controls the addition of an offset voltage to the
bottom of the sample capacitor. It is not active unless the OPT bit in
the COPR at location $1FF0 is set. Any reads of the VOFF bit location
return a logic 0 if the OPT bit is clear. During the time that the sample
capacitor is connected to an input (either HOLD or DHOLD set), the
bottom of the sample capacitor is connected to VSS. The VOFF bit is
cleared by a reset of the device. For more information, see 8.11
Sample and Hold.
1 = Enables approximately 100 mV offset to be added to the
sample voltage when both the HOLD and DHOLD control bits
are cleared
0 = Connects the bottom of the sample capacitor to VSS
COE1
This read-write bit controls the output of comparator 1 to the PB4 pin.
It is not active unless the OPT bit in the COPR at location $1FF0 is
set. Any reads of the COE1 bit location return a logic 0 if the OPT bit
is clear. The COE1 bit is cleared by a reset of the device.
1 = Enables the output of comparator 1 to be ORed with the PB4
data bit and OLVL bit, if the DDRB4 bit is also set
0 = Disables the output of comparator 1 from affecting the PB4 pin
CMP2
This read-only bit shows the state of comparator 2 during the time that
the bit is read. This bit is therefore the current state of the comparator
without any latched history. The CMP2 bit will be high if the voltage
on the PB0/AN0 pin is greater than the voltage on the PB1/AN1 pin,
regardless of the state of the INV bit in the AMUX register. Since a
reset disables comparator 2, this bit returns a logic 0 following a reset
of the device.
1 = The voltage on the positive input on comparator 2 is higher than
the voltage on the negative input of comparator 2.
0 = The voltage on the positive input on comparator 2 is lower than
the voltage on the negative input of comparator 2.
CMP1
This read-only bit shows the state of comparator 1 during the time that
the bit is read. This bit is therefore the current state of the comparator
without any latched history. The CMP1 bit will be high if the voltage
on the PB2/AN2 pin is greater than the voltage on the PB3/AN3/TCAP
pin, regardless of the state of the INV bit in the AMUX register. Since
a reset disables comparator 1, this bit returns a logic 0 following a
reset of the device.
1 = The voltage on the positive input on comparator 1 is higher than
the voltage on the negative input of comparator 1.
0 = The voltage on the positive input on comparator 1 is lower than
the voltage on the negative input of comparator 1.
C x VX
Charge Time =
I
VOLTAGE ON
CAPACITOR
CONNECTED
TO (+) INPUT
CHARGE TIME
TO MATCH UNKNOWN
DISCHARGE TIME
TO RESET CAPACITOR
MAXIMUM CHARGE TIME
TO VDD –1.5 Vdc
+5V
PB4/AN4 VDD
UNKNOWN PB3/AN3
OR REFERENCE PB2/AN2 MC68HC705JJ7
SIGNALS MC68HC705JP7
PB1/AN1
PB0/AN0 VSS
RAMP
CAP
The top three bits of the ACR control the charging and discharging
current into or out of the PB0/AN0 pin. These three bits will have no
effect on the PB0/AN0 pin if the ISEN enable bit is cleared. Any clearing
of the ISEN bit will immediately disable both the charge current source
and the discharge device. Since all these bits and the ISEN bit are
Since the MCU can measure time in a variety of ways, the resolution of
the conversion will depend on the length of the time keeping function and
its prescaling to the oscillator frequency (fOSC). Therefore, the charge
time also equals:
tCHG = P x N / fOSC
Where:
P = Prescaler value (÷ 2, ÷ 4, ÷ 8, etc.)
N = Number of counts during charge time
fOSC = Oscillator clock frequency (Hz)
NOTE: Noise on the system ground or the external ramping capacitor can cause
the comparator to trip prematurely. Therefore, in any given application it
is best to use the fastest possible ramp rate (shortest charge time).
The previous two equations for the charge time, tCHG, can be combined
to form the following expression for the full scale count (NFS) of the
measured time versus the full scale unknown voltage (VFS):
Since a given timing method has a fixed charge current and prescaler,
then the variation in the resultant count for a given unknown voltage is
mainly dependent on the operating frequency and the capacitance value
used. The desired external capacitance for a given voltage range, fOSC,
conversion method, and resolution is defined as:
NOTE: The value of any capacitor connected directly to the PB0/AN0 pin should
be limited to less than 2 microfarads. Larger capacitances will create
high discharge currents which may damage the device or create signal
noise.
The full scale voltage range for a given capacitance, fOSC, conversion
method, and resolution is defined as:
Table 8-4 gives the range of values of each parameter in the A/D timing
conversion and Table 8-5 gives some A/D conversion examples for
several bit resolutions.
The mode selection bits in the ACR allow four methods of single-slope
A/D conversion. Each of these methods is shown in Figure 8-8 through
Figure 8-11 using the signal names and parameters given in Table 8-4.
• Manual start and stop (mode 0) Figure 8-8
• Manual start and automatic discharge (mode 1) Figure 8-9
• Automatic start and stop from TOF to ICF (mode 2) Figure 8-10
• Automatic start and stop from OCF to ICF (mode 3) Figure 8-11
tDIS
CHG
COMP2
TOF
OCF
ICF
0 2 3 4 5 1
1 VCAP falls to VSS. Wait out minimum tDIS time. VMAX, IDIS, CEXT
tDIS
tDIS tDIS
(MIN) (MIN)
VCAP VMAX
tCHG
tCHG x ICHG
VX VX =
CEXT
CHG
COMP2
TOF
OCF
ICF
0 1 2 3 1 2
1 VCAP falls to VSS. Wait out minimum tDIS time. VMAX, IDIS, CEXT
tDIS
tDIS tDIS
(MIN) (MIN)
VCAP VMAX
tCHG
tCHG x ICHG
VX VX =
CEXT
CHG
COMP2
(TCAP)
TOF
OCF
ICF
0 1 2 3 1 2
tDIS
tDIS tDIS
(MIN) (MIN)
VCAP VMAX
tCHG
tCHG x ICHG
VX VX =
CEXT
CHG
COMP2
(TCAP)
TOF
OCF
ICF
0 1 2 3 1 2
The minimum count should be the desired resolution, and the counting
mechanism must be capable of counting to the maximum. The final
scaling of the count will be by a math routine which calculates:
Once the maximum timeout detection has been made, the state of the
comparator outputs can be tested to determine the situation. However,
such tests should be carefully designed when using modes 1, 2, or 3 as
these modes cause the immediate automatic discharge of the external
ramping capacitor before any software check can be made of the output
state of comparator 2.
NOTE: All A/D conversion methods should include a test for a maximum
elapsed time to detect error cases where the inputs may be outside of
the design specification.
will depend on the variety of sources, but will generally be better than for
absolute readings. Many of these error sources can be taken into
account using the features of the analog subsystem and appropriate
software as described in Table 8-7. As with absolute measurements,
most of the errors can be reduced by frequent comparisons to the
reference voltage, use of the inverted comparator inputs, and averaging
of multiple samples.
The output of comparator 1 can be connected to the port logic driving the
PB4/AN4/TCMP/CMP1 pin such that the output of the comparator is
ORed with the PB4 data bit and the OLVL bit from the 16-bit timer. This
capability requires that the OPT bit is set in the COPR at location $1FF0
as in Figure 8-12, and the COE1 bit is set in the ASR at location $001E.
Address: $1FF0
Bit 7 6 5 4 3 2 1 Bit 0
Read:
EPMSEC OPT
Write: COPC
Reset: U U U U U U U U
= Unimplemented U = Unaffected
NOTE: The sample capacitor can be affected by excessive noise created with
respect to the device’s VSS pin such that it may appear to leak down or
charge up depending on the voltage level stored on the sample
capacitor. It is recommended to avoid switching large currents through
the port pins while a voltage is to remain stored on the sample capacitor.
by a single VSS return pin. This offset also provides a means to measure
the internal VSS level regardless of the comparator offset to determine
NOFF as described in 8.7 Voltage Measurement Methods. In either
case the OPT bit must be set in the COPR located at $1FF0 as in
Figure 8-12 and the VOFF bit must be set in the ASR. It is not necessary
to switch the VOFF bit during conversions, since the offset is controlled
by the HOLD and DHOLD bits when the VOFF is active. Refer to
8.3 Analog Multiplex Register for more details on the design and
decoding of the sample and hold circuit.
If any port B pins are to be used for analog voltage measurements, they
should be left as inputs. In this case, not only can the voltage on the pin
be measured, but the logic state of the port B pins can be read from
location $0002.
error due to the analog source output impedance. Since this may not
always be true, it is therefore best to disable port B pulldowns on those
pins used for analog input sources.
9.1 Contents
9.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
9.2 Introduction
The simple synchronous serial I/O port (SIOP) subsystem is designed to
provide efficient serial communications with peripheral devices or other
MCUs. SIOP is implemented as a 3-wire master/slave system with serial
clock (SCK), serial data input (SDI), and serial data output (SDO). A
block diagram of the SIOP is shown in Figure 9-1.
The SIOP subsystem shares its input/output pins with port B. When the
SIOP is enabled (SPE bit set in the SCR), the port B data direction and
data registers are bypassed by the SIOP. The port B data direction and
data registers will remain accessible and can be altered by the
application software, but these actions will not affect the SIOP
transmitted or received data.
PORTB LOGIC
OSCILLATOR
CLOCK ÷2
CLOCK CLOCK
SPR0 DIVIDER CONTROL
AND PB7
SPR1 SELECT SCK
CONTROL REGISTER
CPHA
PORTB LOGIC
MSTR
(SCR)
SIOP
SPE
LSBF
SPIR PB6
SDI
SPIE
PORTB LOGIC
$000A DIN DOUT
CLK
LATCH
SIOP
INTERNAL M68HC05 BUS
DCOL
D0
D1
D2
D3
D4
D5
D6
D7
(SSR)
SIOP
FORMAT CONTROL
(LSB OR MSB FIRST)
SDR0
SDR1
SDR2
SDR3
SDR4
SDR5
SDR6
SDR7
$000B
SIOP
DATA REGISTER
(SDR)
$000C
The state of the SCK output remains a fixed logic level during idle
periods between data transfers. The edges of SCK indicate the
beginning of each output data transfer and latch any incoming data
received. The first bit of transmitted data is output from the SDO pin on
the first falling edge of SCK. The first bit of received data is accepted at
the SDI pin on the first rising edge of SCK after the first falling edge. The
transfer is terminated upon the eighth rising edge of SCK.
The idle state of the SCK is determined by the state of the CPHA bit in
the SCR. When the CPHA is clear, SCK will remain idle at a logic 1 as
shown in Figure 9-2. When the CPHA is set, SCK will remain idle at a
logic 0 as shown in Figure 9-3. In both cases, the SDO changes data on
the falling edge of the SCK, and the SDI latches data in on the rising
edge of SCK.
SCK (IDLE = 1)
(CPHA = 0)
100 ns 100 ns
SDI
BIT 1 BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 BIT 7 BIT 8
SCK (IDLE = 0)
(CPHA = 1)
100 ns 100 ns
SDI
BIT 1 BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 BIT 7 BIT 8
The only difference in the master and slave modes of operation is the
sourcing of the SCK. In master mode, SCK is driven from an internal
source within the MCU. In slave mode, SCK is driven from a source
external to the MCU. The SCK frequency is based on one of four
divisions of the oscillator clock that is selected by the SPR0 and SPR1
bits in the SCR.
The first data bit will be shifted out to the SDO pin on the first falling edge
of the SCK. The remaining data bits will be shifted out to the SDI pin on
subsequent falling edges of SCK. The SDO pin will present valid data at
least 100 nanoseconds before the rising edge of the SCK and remain
valid for 100 nanoseconds after the rising edge of SCK. See Figure 9-3.
Address: $000A
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0
SPIE SPE LSBF MSTR CPHA SPR1 SPR0
Write: SPIR
Reset: 0 0 0 0 0 0 0 0
NOTE: If the SPIE bit is cleared just after the serial interrupt sequence has
started (for instance, the CPU status is being stacked), then the CPU will
be unable to determine the source of the interrupt and will vector to the
reset vector as a default.
Address: $000B
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 0 0 0 0 0 0 0 0
= Unimplemented
done after another transfer has started, the DCOL bit will be set again.
Reset clears the DCOL bit.
1 = Illegal access of the SDR occurred
0 = No illegal access of the SDR detected
The SIOP data register (SDR) is located at address $000C and serves
as both the transmit and receive data register. Writing to this register will
initiate a message transmission if the node is in master mode. The SIOP
subsystem is not double buffered and any write to this register will
destroy the previous contents. The SDR can be read at any time.
However, if a transfer is in progress the results may be ambiguous.
Writing to the SDR while a transfer is in progress can cause invalid data
to be transmitted and/or received. Figure 9-6 shows the position of each
bit in the register. This register is not affected by reset.
Address: $000C
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Bit 7 6 5 4 3 2 1 Bit 0
Write:
10.1 Contents
10.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
10.2 Introduction
This section describes the operation of the core timer and the computer
operating properly (COP) watchdog as shown by the block diagram in
Figure 10-1.
RESET
INTERNAL
CLOCK
$0009
OVERFLOW
CORE TIMER COUNTER REGISTER ÷4 ÷2 OSC1
BITS 0–7 OF 15-STAGE
RIPPLE COUNTER
INTERNAL CLOCK ÷ 1024
CORE TIMER
INTERRUPT
INTERNAL DATA BUS
REQUEST
CTOFR
CTOFE
RTIFR
CTOF
RTIE
RTIF
$0008
CORE TIMER STATUS/CONTROL REGISTER RESET
RT1
RT0
POWER-ON
RESET
COP
÷2 ÷2 ÷2 ÷2 WATCHDOG
RESET
RESET
Address: $0008
Bit 7 6 5 4 3 2 1 Bit 0
Read: CTOF RTIF 0 0
CTOFE RTIE RT1 RT0
Write: CTOFR RTIFR
Reset: 0 0 0 0 0 0 1 1
= Unimplemented
NOTE: Changing RT1 and RT0 when a COP timeout is imminent or uncertain
may cause a real-time interrupt request to be missed or an additional
real-time interrupt request to be generated. Clear the COP timer just
before changing RT1 and RT0.
Table 10-1. Core Timer Interrupt Rates and COP Timeout Selection
Timer Overflow Real-Time
Interrupt Period COP Timeout Period
Interrupt Period
RTI COP = 7-to-8 RTI Periods
TOF = 1/(fOSC ÷ 211) (RTI)
Rate (Milliseconds)
(Microseconds) (Milliseconds)
RT1 RT0 = fOSC
@ fOSC (MHz) divided @ fOSC (MHz) @ fOSC (MHz)
by:
4.2 2.0 1.0 4.2 2.0 1.0 4.2 MHz 2.0 MHz 1.0 MHz
MHz MHz MHz MHz MHz MHz Min Max Min Max Min Max
0 0 215 7.80 16.4 32.8 54.6 62.4 115 131 229 262
0 1 216 15.6 32.8 65.5 109 125 229 262 459 524
488 1024 2048
1 0 217 31.2 65.5 131 218 250 459 524 918 1049
1 1 218 62.4 131 262 437 499 918 1049 1835 2097
Address: $0009
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 0 0 0 0 0 0 0 0
= Unimplemented
Power-on clears the entire counter chain and begins clocking the
counter. After the startup delay (16 or 4064 internal bus cycles
depending on the DELAY bit in the mask option register (MOR)), the
power-on reset circuit is released, clearing the counter again and
allowing the MCU to come out of reset.
Each count of the timer counter register takes eight oscillator cycles or
four cycles of the internal bus. A timer overflow function at the eighth
counter stage allows a timer interrupt every 2048 oscillator clock cycles
or every 1024 internal bus cycles.
Address: $1FF0
Bit 7 6 5 4 3 2 1 Bit 0
Read:
OPT
Write: EPMSEC COPC
Reset: Unaffected by reset
= Unimplemented
NOTE: If the voltage on the IRQ/VPP pin exceeds 1.5 × VDD, the COP watchdog
turns off and remains off until the IRQ/VPP pin voltage falls below
1.5 × VDD.
1. The SWAIT bit in the MOR converts STOP instructions to HALT instructions.
2. Reset the COP watchdog immediately before executing the WAIT/HALT instruction.
3. Don’t care
11.1 Contents
11.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
11.2 Introduction
The MC68HC705JJ7/MC68HC705JP7 MCU contains a 16-bit
programmable timer with an input capture function and an output
compare function as shown by the block diagram in Figure 11-1.
The input/output (I/O) registers for the input capture and output compare
functions are pairs of 8-bit registers, because of the 16-bit timer
architecture used. Each register pair contains the high and low bytes of
that function. Generally, accessing the low byte of a specific timer
function allows full control of that function; however, an access of the
high byte inhibits that specific timer function until the low byte is also
accessed.
The interrupt capability, the input capture edge, and the output compare
state are controlled by the timer control register (TCR) located at $0012,
and the status of the interrupt flags can be read from the timer status
register (TSR) located at $0013.
PB3
AN3 INPUT EDGE
TCAP SELECT SELECT ICRH ($0014) ICRL ($0015)
MUX & DETECT
LOGIC
ICF
CPF2 TMRH ($0018) TMRL ($0019) ACRH ($001A) ACRL ($001B)
IEDG
FLAG
BIT
FROM
ANALOG
SUBSYSTEM
OLVL
OCF
ANALOG
COMP 1
TIMER
INTERRUPT
REQUEST
RESET
OCIE
IEDG
OLVL
TOIE
OCF
TOF
ICIE
ICF
LATCH READ
TMRL ($0019) TMRL
TOF
TIMER CONTROL REG. TIMER STATUS REG.
$0012 $0013
INTERNAL
DATA
BUS
The timer registers (TMRH and TMRL) shown in Figure 11-3 are
read-only locations which contain the current high and low bytes of the
16-bit free-running counter. Writing to the timer registers has no effect.
Reset of the device presets the timer counter to $FFFC.
The TMRL latch is a transparent read of the LSB until a read of the
TMRH takes place. A read of the TMRH latches the LSB into the TMRL
location until the TMRL is again read. The latched value remains fixed
even if multiple reads of the TMRH take place before the next read of the
TMRL. Therefore, when reading the MSB of the timer at TMRH, the LSB
of the timer at TMRL must also be read to complete the read sequence.
Address: $0018
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 1 1 1 1 1 1 1 1
Address: $0018
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 1 1 1 1 1 1 0 0
= Unimplemented
When the free-running counter rolls over from $FFFF to $0000, the timer
overflow flag bit (TOF) is set in the TSR. When the TOF is set, it can
generate an interrupt if the timer overflow interrupt enable bit (TOIE) is
also set in the TCR. The TOF flag bit can only be reset by reading the
TMRL after reading the TSR.
Other than clearing any possible TOF flags, reading the TMRH and
TMRL in any order or any number of times does not have any effect on
the 16-bit free-running counter.
NOTE: To prevent interrupts from occurring between readings of the TMRH and
TMRL, set the I bit in the condition code register (CCR) before reading
TMRH and clear the I bit after reading TMRL.
flag bit and timer interrupts. The alternate counter registers include a
transparent buffer latch on the LSB of the 16-bit timer counter.
INTERNAL
DATA
BUS
LATCH READ
ACRL ($001B) ACRL
READ READ
ACRH ACRH ($001A) TMR LSB
The ACRL latch is a transparent read of the LSB until a read of the
ACRH takes place. A read of the ACRH latches the LSB into the ACRL
location until the ACRL is again read. The latched value remains fixed
even if multiple reads of the ACRH take place before the next read of the
ACRL. Therefore, when reading the MSB of the timer at ACRH, the LSB
of the timer at ACRL must also be read to complete the read sequence.
Reading the ACRH and ACRL in any order or any number of times does
not have any effect on the 16-bit free-running counter or the TOF flag bit.
NOTE: To prevent interrupts from occurring between readings of the ACRH and
ACRL, set the I bit in the condition code register (CCR) before reading
ACRH and clear the I bit after reading ACRL.
Address: $001A
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 1 1 1 1 1 1 1 1
Address: $001B
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Reset: 1 1 1 1 1 1 0 0
= Unimplemented
NOTE: Both the ICEN bit in the ACR and the IEDG bit in the TCR must be set
when using voltage comparator 2 to trigger the input capture function.
INTERNAL
DATA
READ BUS
ICRH
PB3 EDGE
AN3 INPUT ICRH ($0014) ICRL ($0015) READ
TCAP SELECT SELECT LATCH ICRL
MUX & DETECT
LOGIC
INTERNAL
CPF2 16-BIT COUNTER ÷4 CLOCK
$FFFC
FLAG (OSC ÷ 2)
IEDG
BIT INPUT CAPTURE (ICF)
FROM TIMER
ANALOG INTERRUPT
SUBSYSTEM REQUEST
ICEN
IEDG
ICIE
ICF
CONTROL
BIT
RESET TIMER CONTROL REG. TIMER STATUS REG.
$0012 $0013
INTERNAL
DATA
BUS
The input capture registers are made up of two 8-bit read-only registers
(ICRH and ICRL) as shown in Figure 11-7. The input capture edge
detector contains a Schmitt trigger to improve noise immunity. The edge
that triggers the counter transfer is defined by the input edge bit (IEDG)
in the TCR. Reset does not affect the contents of the input capture
registers.
Address: $0014
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Address: $0015
Bit 7 6 5 4 3 2 1 Bit 0
Write:
= Unimplemented
The result obtained by an input capture will be one count higher than the
value of the free-running timer counter preceding the external transition.
This delay is required for internal synchronization. Resolution is affected
by the prescaler, allowing the free-running timer counter to increment
once every four internal clock cycles (eight oscillator clock cycles).
Reading the ICRH inhibits future captures until the ICRL is also read.
Reading the ICRL after reading the timer status register (TSR) clears the
ICF flag bit. There is no conflict between reading the ICRL and transfers
from the free-running timer counters. The input capture registers always
contain the free-running timer counter value which corresponds to the
most recent input capture.
NOTE: To prevent interrupts from occurring between readings of the ICRH and
ICRL, set the I bit in the condition code register (CCR) before reading
ICRH and clear the I bit after reading ICRL.
Software can use the output compare register to measure time periods,
to generate timing delays, or to generate a pulse of specific duration
or a pulse train of specific frequency and duty cycle on the
PB4/AN4/TCMP pin.
EDGE PB4
16-BIT COMPARATOR SELECT AN4
DETECT TCMP
LOGIC
OLVL
$FFFC INTERNAL
16-BIT COUNTER ÷4 CLOCK
(OSC ÷ 2)
OUTPUT COMPARE
(OCF) TIMER
INTERRUPT
REQUEST
OCIE
OLVL
OCF
RESET TIMER CONTROL REG. TIMER STATUS REG.
$0012 $0013
INTERNAL
DATA
BUS
Address: $0016
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Bit 15 14 13 12 11 10 9 Bit 8
Write:
Address: $0017
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Bit 7 6 5 4 3 2 1 Bit 0
Write:
Writing to the OCRH before writing to the OCRL inhibits timer compares
until the OCRL is written. Reading or writing to the OCRL after reading
the TCR will clear the output compare flag bit (OCF). The output
compare OLVL state will be clocked to its output latch regardless of the
state of the OCF.
To prevent OCF from being set between the time it is read and the time
the output compare registers are updated, use this procedure:
Reset clears all the bits in the TCR with the exception of the IEDG bit
which is unaffected.
Address: $0012
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0 0 0
ICIE OCIE TOIE IEDG OLVL
Write:
Reset: 0 0 0 0 0 0 U 0
= Unimplemented U = Unaffected
NOTE: The IEDG bit must be set when either mode 2 or 3 of the analog
subsystem is being used for A/D conversions. Otherwise, the input
capture will not occur on the rising edge of the comparator 2 flag.
Writing to any of the bits in the TSR has no effect. Reset does not
change the state of any of the flag bits in the TSR.
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
If a valid input capture edge occurs during stop mode, the input capture
detect circuitry will be armed. This action does not set any flags or wake
up the MCU, but when the MCU does wake up there will be an active
input capture flag (and data) from the first valid edge. If the stop mode is
exited by an external reset, no input capture flag or data will be present
even if a valid input capture edge was detected during stop mode.
12.1 Contents
12.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
12.2 Introduction
This section describes how to program the 64-bit personality erasable
programmable read-only memory (PEPROM). Figure 12-1 shows the
structure of the PEPROM subsystem.
0
PEPGM
PEPRZF
PEDATA
SINGLE
SENSE
AMPLIFIER VPP
ROW 0
ROW 1
ROW 2
ROW 3
ROW 4
ROW 5
ROW 6
ROW 7
COL 0
COL 1
COL 2
COL 3
COL 4
COL 5
COL 6
COL 7
ROW ZERO
DECODER
PEB5
PEB4
PEB3
PEB2
PEB1
PEB0
0
The PEPROM bit select register (PEBSR) selects one of 64 bits in the
PEPROM array. Reset clears all the bits in the PEPROM bit select
register.
Address: $000E
Bit 7 6 5 4 3 2 1 Bit 0
Read:
PEB7 PEB6 PEB5 PEB4 PEB3 PEB2 PEB1 PEB0
Write:
Reset: 0 0 0 0 0 0 0 0
Address: $000F
Bit 7 6 5 4 3 2 1 Bit 0
Reset: U 0 0 0 0 0 0 1
NOTE: While the PEPGM bit is set and the VPP voltage level is applied to the
IRQ/VPP pin, do not access bits that are to be left unprogrammed
(erased).
To program the PEPROM bits properly, the VDD voltage must be greater
than 4.5 Vdc.
The PEPROM can also be programmed by user software with the VPP
voltage level applied to the IRQ/VPP pin. This sequence shows how to
program each PEPROM bit:
NOTE: A PEPROM byte that has been read can be transferred to the personality
EPROM bit select register (PEBSR) as a temporary storage location
such that subsequent reads of the PEBSR quickly yield that PEPROM
byte.
13.1 Contents
13.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
13.2 Introduction
This section describes how to program the 6160-byte erasable
programmable read-only memory/one-time programmable read-only
memory (EPROM/OTPROM), the mask option register (MOR), and the
EPROM security bit (EPMSEC).
Address: $001C
Bit 7 6 5 4 3 2 1 Bit 0
Read: 0 0 0 0 0
ELAT MPGM EPGM
Write: R R R R
Reset: 0 0 0 0 0 0 0 0
Whenever the ELAT bit is cleared, the EPGM bit is also cleared. Both the
EPGM and the ELAT bit cannot be set using the same write instruction.
Any attempt to set both the ELAT and EPGM bit on the same write
instruction cycle will result in the ELAT bit being set and the EPGM bit
being cleared. To program a byte of EPROM, manipulate the EPROG
register as follows:
Address: $1FF1
Bit 7 6 5 4 3 2 1 Bit 0
Read:
SWPDI DELAY OSCRES SWAIT LVREN PIRQ LEVEL COPEN
Write:
Erased: 0 0 0 0 0 0 0 0
CAUTION: The 16-cycle delay option will work properly in devices with the internal
low-power oscillator or with a steady external clock source. Check
crystal/ceramic resonator specifications carefully before using the
16-cycle delay option with a crystal or ceramic resonator.
NOTE: The optional oscillator resistor is NOT recommended for devices that
use an external RC oscillator. For such devices, this bit should be left
erased as a 0.
Address: $1FF0
Bit 7 6 5 4 3 2 1 Bit 0
Read:
OPT
Write: EPMSEC COPC
Erased: 0 — — — — — — —
= Unimplemented
Once the MOR bits have been programmed, some of the options may
experience glitches in operation after removal of the programming
voltage. It is recommended that the part be reset before trying to verify
the contents of the user EPROM or the MOR itself.
NOTE: The contents of the EPROM or the MOR cannot be accessed if the
EPMSEC bit in the COPR register has been set.
Once the EPMSEC bit has been programmed to a logic 1, access to the
contents of the EPROM and MOR in the expanded non-user modes will
be denied. It is therefore recommended that the user EPROM and MOR
in the part first be programmed and fully verified before setting the
EPMSEC bit.
NOTE: Unlike many commercial EPROMs, an erased EPROM byte in the MCU
will read as $00. All unused locations should be programmed as 0s.
14.1 Contents
14.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
14.2 Introduction
The microcontroller unit (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
• Inherent
• Immediate
• Direct
• Extended
• Indexed, no offset
• Indexed, 8-bit offset
• Indexed, 16-bit offset
• Relative
14.3.1 Inherent
14.3.2 Immediate
14.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.
14.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.
14.3.8 Relative
When using the Motorola assembler, the programmer does not need to
calculate the offset, because the assembler determines the proper offset
and verifies that it is within the span of the branch.
• Register/memory instructions
• Read-modify-write instructions
• Jump/branch instructions
• Bit manipulation instructions
• Control instructions
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
instructions use a combination of direct addressing and relative
addressing. The direct address of the byte to be tested is in the byte
following the opcode. The third byte is the signed offset byte. The CPU
finds the effective branch destination by adding the third byte to the
program counter if the specified bit tests true. The bit to be tested and its
condition (set or clear) is part of the opcode. The span of branching is
from –128 to +127 from the address of the next location after the branch
instruction. The CPU also transfers the tested bit to the carry/borrow bit
of the condition code register.
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
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
ADC #opr IMM A9 ii 2
ADC opr DIR B9 dd 3
ADC opr EXT C9 hh ll 4
Add with Carry A ←(A) + (M) + (C) —
ADC opr,X IX2 D9 ee ff 5
ADC opr,X IX1 E9 ff 4
ADC ,X IX F9 3
ADD #opr IMM AB ii 2
ADD opr DIR BB dd 3
ADD opr EXT CB hh ll 4
Add without Carry A ←(A) + (M) —
ADD opr,X IX2 DB ee ff 5
ADD opr,X IX1 EB ff 4
ADD ,X IX FB 3
AND #opr IMM A4 ii 2
AND opr DIR B4 dd 3
AND opr EXT C4 hh ll 4
Logical AND A ←(A) ∧ (M) — — —
AND opr,X IX2 D4 ee ff 5
AND opr,X IX1 E4 ff 4
AND ,X IX F4 3
ASL opr DIR 38 dd 5
ASLA INH 48 3
Arithmetic Shift Left
ASLX C 0 — — INH 58 3
(Same as LSL)
ASL opr,X b7 b0 IX1 68 ff 6
ASL ,X IX 78 5
ASR opr DIR 37 dd 5
ASRA INH 47 3
ASRX Arithmetic Shift Right C
— — INH 57 3
b7 b0
ASR opr,X IX1 67 ff 6
ASR ,X IX 77 5
Branch if Carry Bit
BCC rel PC ←(PC) + 2 + rel ? C = 0 — — — — — REL 24 rr 3
Clear
DIR (b0) 11 dd 5
DIR (b1) 13 dd 5
DIR (b2) 15 dd 5
DIR (b3) 17 dd 5
BCLR n opr Clear Bit n Mn ←0 — — — — —
DIR (b4) 19 dd 5
DIR (b5) 1B dd 5
DIR (b6) 1D dd 5
DIR (b7) 1F dd 5
Branch if Carry Bit Set
BCS rel PC ←(PC) + 2 + rel ? C = 1 — — — — — REL 25 rr 3
(Same as BLO)
BEQ rel Branch if Equal PC ←(PC) + 2 + rel ? Z = 1 — — — — — REL 27 rr 3
Operand
Address
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
Branch if Half-Carry
BHCC rel PC ←(PC) + 2 + rel ? H = 0 — — — — — REL 28 rr 3
Bit Clear
Branch if Half-Carry
BHCS rel PC ←(PC) + 2 + rel ? H = 1 — — — — — REL 29 rr 3
Bit Set
BHI rel Branch if Higher PC ←(PC) + 2 + rel ? C ∨ Z = 0 — — — — — REL 22 rr 3
Branch if Higher or
BHS rel PC ←(PC) + 2 + rel ? C = 0 — — — — — REL 24 rr 3
Same
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 Test
BIT opr EXT C5 hh ll 4
Accumulator with (A) ∧ (M) — — —
BIT opr,X IX2 D5 ee ff 5
Memory Byte
BIT opr,X IX1 E5 ff 4
BIT ,X IX F5 p 3
Branch if Lower
BLO rel PC ←(PC) + 2 + rel ? C = 1 — — — — — REL 25 rr 3
(Same as BCS)
Branch if Lower or
BLS rel PC ←(PC) + 2 + rel ? C ∨ Z = 1 — — — — — REL 23 rr 3
Same
Branch if Interrupt
BMC rel PC ←(PC) + 2 + rel ? I = 0 — — — — — REL 2C rr 3
Mask Clear
BMI rel Branch if Minus PC ←(PC) + 2 + rel ? N = 1 — — — — — REL 2B rr 3
Branch if Interrupt
BMS rel PC ←(PC) + 2 + rel ? I = 1 — — — — — REL 2D rr 3
Mask Set
BNE rel Branch if Not Equal PC ←(PC) + 2 + rel ? Z = 0 — — — — — REL 26 rr 3
BPL rel Branch if Plus PC ←(PC) + 2 + rel ? N = 0 — — — — — REL 2A rr 3
BRA rel Branch Always PC ←(PC) + 2 + rel ? 1 = 1 — — — — — REL 20 rr 3
DIR (b0) 01 dd rr 5
DIR (b1) 03 dd rr 5
DIR (b2) 05 dd rr 5
DIR (b3) 07 dd rr 5
BRCLR n opr rel Branch if bit n clear PC ←(PC) + 2 + rel ? Mn = 0 — — — —
DIR (b4) 09 dd rr 5
DIR (b5) 0B dd rr 5
DIR (b6) 0D dd rr 5
DIR (b7) 0F dd rr 5
Operand
Address
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
DIR (b0) 00 dd rr 5
DIR (b1) 02 dd rr 5
DIR (b2) 04 dd rr 5
DIR (b3) 06 dd rr 5
BRSET n opr rel Branch if Bit n Set PC ←(PC) + 2 + rel ? Mn = 1 — — — —
DIR (b4) 08 dd rr 5
DIR (b5) 0A dd rr 5
DIR (b6) 0C dd rr 5
DIR (b7) 0E dd rr 5
BRN rel Branch Never PC ←(PC) + 2 + rel ? 1 = 0 — — — — — REL 21 rr 3
DIR (b0) 10 dd 5
DIR (b1) 12 dd 5
DIR (b2) 14 dd 5
DIR (b3) 16 dd 5
BSET n opr Set Bit n Mn ←1 — — — — —
DIR (b4) 18 dd 5
DIR (b5) 1A dd 5
DIR (b6) 1C dd 5
DIR (b7) 1E dd 5
PC ←(PC) + 2; push (PCL)
Branch to SP ←(SP) – 1; push (PCH)
BSR rel — — — — — REL AD rr 6
Subroutine SP ←(SP) – 1
PC ←(PC) + rel
CLC Clear Carry Bit C ←0 — — — — 0 INH 98 2
CLI Clear Interrupt Mask I ←0 — 0 — — — INH 9A 2
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
CMP #opr IMM A1 ii 2
CMP opr DIR B1 dd 3
Compare
CMP opr EXT C1 hh ll 4
Accumulator with (A) – (M) — —
CMP opr,X IX2 D1 ee ff 5
Memory Byte
CMP opr,X IX1 E1 ff 4
CMP ,X IX F1 3
COM opr M ←(M) = $FF – (M) DIR 33 dd 5
COMA A ←(A) = $FF – (M) INH 43 3
Complement Byte
COMX X ←(X) = $FF – (M) — — 1 INH 53 3
(One’s Complement)
COM opr,X M ←(M) = $FF – (M) IX1 63 ff 6
COM ,X M ←(M) = $FF – (M) IX 73 5
Operand
Address
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
CPX #opr IMM A3 ii 2
CPX opr DIR B3 dd 3
Compare Index
CPX opr EXT C3 hh ll 4
Register with (X) – (M) — — 1
CPX opr,X IX2 D3 ee ff 5
Memory Byte
CPX opr,X IX1 E3 ff 4
CPX ,X IX F3 3
DEC opr M ←(M) – 1 DIR 3A dd 5
DECA A ←(A) – 1 INH 4A 3
DECX Decrement Byte X ←(X) – 1 — — — INH 5A 3
DEC opr,X M ←(M) – 1 IX1 6A ff 6
DEC ,X M ←(M) – 1 IX 7A 5
EOR #opr IMM A8 ii 2
EOR opr DIR B8 dd 3
EXCLUSIVE OR
EOR opr EXT C8 hh ll 4
Accumulator with A ←(A) ⊕ (M) — — —
EOR opr,X IX2 D8 ee ff 5
Memory Byte
EOR opr,X IX1 E8 ff 4
EOR ,X IX F8 3
INC opr M ←(M) + 1 DIR 3C dd 5
INCA A ←(A) + 1 INH 4C 3
INCX Increment Byte X ←(X) + 1 — — — INH 5C 3
INC opr,X M ←(M) + 1 IX1 6C ff 6
INC ,X M ←(M) + 1 IX 7C 5
Operand
Address
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
LDX #opr IMM AE ii 2
LDX opr DIR BE dd 3
LDX opr Load Index Register EXT CE hh ll 4
X ←(M) — — —
LDX opr,X with Memory Byte IX2 DE ee ff 5
LDX opr,X IX1 EE ff 4
LDX ,X IX FE 3
Operand
Address
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
SP ←(SP) + 1; Pull (CCR)
SP ←(SP) + 1; Pull (A)
RTI Return from Interrupt SP ←(SP) + 1; Pull (X) ↕ INH 80 6
SP ←(SP) + 1; Pull (PCH)
SP ←(SP) + 1; Pull (PCL)
Return from SP ←(SP) + 1; Pull (PCH)
RTS INH
Subroutine SP ←(SP) + 1; Pull (PCL)
SBC #opr IMM A2 ii 2
SBC opr DIR B2 dd 3
Subtract Memory Byte
SBC opr EXT C2 hh ll 4
and Carry Bit from A ←(A) – (M) – (C) — —
SBC opr,X IX2 D2 ee ff 5
Accumulator
SBC opr,X IX1 E2 ff 4
SBC ,X IX F2 3
SEC Set Carry Bit C ←1 — — — — 1 INH 99 2
SEI Set Interrupt Mask I ←1 — 1 — — — INH 9B 2
STA opr DIR B7 dd 4
STA opr EXT C7 hh ll 5
Store Accumulator in
STA opr,X M ←(A) — — — IX2 D7 ee ff 6
Memory
STA opr,X IX1 E7 ff 5
STA ,X IX F7 4
Stop Oscillator and
STOP — 0 — — — INH 8E 2
Enable IRQ Pin
STX opr DIR BF dd 4
STX opr EXT CF hh ll 5
Store Index
STX opr,X M ←(X) — — — IX2 DF ee ff 6
Register In Memory
STX opr,X IX1 EF ff 5
STX ,X IX FF 4
SUB #opr IMM A0 ii 2
SUB opr DIR B0 dd 3
Subtract Memory Byte
SUB opr EXT C0 hh ll 4
from A ←(A) – (M) — —
SUB opr,X IX2 D0 ee ff 5
Accumulator
SUB opr,X IX1 E0 ff 4
SUB ,X IX F0 3
PC ←(PC) + 1; Push (PCL)
SP ←(SP) – 1; Push (PCH)
SP ←(SP) – 1; Push (X)
SP ←(SP) – 1; Push (A)
SWI Software Interrupt — 1 — — — INH 83 10
SP ←(SP) – 1; Push (CCR)
SP ←(SP) – 1; I ←1
PCH ←Interrupt Vector High Byte
PCL ←Interrupt Vector Low Byte
Operand
Address
Opcode
Effect
Cycles
Mode
Source on CCR
Form Operation Description
H I N Z C
Transfer
TAX Accumulator to Index X ←(A) — — — — — INH 97 2
Register
TST opr DIR 3D dd 4
TSTA INH 4D 3
Test Memory Byte for
TSTX (M) – $00 — — — — — INH 5D 3
Negative or Zero
TST opr,X IX1 6D ff 5
TST ,X IX 7D 4
Transfer Index
TXA Register to A ←(X) — — — — — INH 9F 2
Accumulator
Stop CPU Clock and
WAIT Enable — — — — INH 8F 2
Interrupts
A Accumulator opr Operand (one or two bytes)
C Carry/borrow flag PC Program counter
CCR Condition code register PCH Program counter high byte
dd Direct address of operand PCL Program counter low byte
dd rr Direct address of operand and relative offset of branch instruction REL Relative addressing mode
DIR Direct addressing mode rel Relative program counter offset byte
ee ff High and low bytes of offset in indexed, 16-bit offset addressing rr Relative program counter offset byte
EXT Extended addressing mode SP Stack pointer
ff Offset byte in indexed, 8-bit offset addressing X Index register
H Half-carry flag Z Zero flag
hh ll High and low bytes of operand address in extended addressing # Immediate value
I Interrupt mask ∧ Logical AND
ii Immediate operand byte ∨ Logical OR
IMM Immediate addressing mode ⊕ Logical EXCLUSIVE OR
INH Inherent addressing mode () Contents of
IX Indexed, no offset addressing mode –( ) Negation (two’s complement)
IX1 Indexed, 8-bit offset addressing mode ← Loaded with
IX2 Indexed, 16-bit offset addressing mode ? If
M Memory location : Concatenated with
N Negative flag Set or cleared
n Any bit — Not affected
Advance Information
Table 14-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
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
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
Instruction Set
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
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
MC68HC705JJ7 • MC68HC705JP7 — REV 4
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
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
C BRSET6 BSET6 BMC INC INCA INCX INC INC RSP JMP JMP JMP JMP JMP C
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 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
15.1 Contents
15.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
15.2 Introduction
This section contains the 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 below. Keep VIn and VOut within the range
VSS ≤(VIn or VOut) ≤VDD. Connect unused inputs to the appropriate
voltage level, either VSS or VDD.
Bootloader/self-check mode
VIn VSS –0.3 to 17 V
(IRQ/VPP pin only)
Thermal resistance
Plastic DIP θ JA 60 ° C/W
SOIC
1. VDD = 4.5 to 5.5 Vdc, VSS = 0 V, TL ≤TA ≤TH, unless otherwise noted. All values shown reflect average measurements.
2. Typical values at midpoint of voltage range, 25° C only
3. Run (Operating) IDD, Wait IDD: Measured using external square wave clock source to OSC1 pin or internal oscillator, all
inputs 0.2 Vdc from either supply rail (VDD or VSS); no dc loads, less than 50 pF on all outputs, CL = 20 pF on OSC2.
4. Wait IDD is affected linearly by the OSC2 capacitance.
5. Stop IDD: All ports configured as inputs, VIL = 0.2 Vdc, VIH = VDD –0.2 Vdc, OSC1 = VDD.
1. VDD = 2.7 to 3.3 Vdc, VSS = 0 V, TL ≤TA ≤TH, unless otherwise noted. All values shown reflect average measurements.
2. Typical values at midpoint of voltage range, 25° C only.
3. Run (Operating) IDD, Wait IDD: Measured using external square wave clock source to OSC1 pin or internal oscillator, all
inputs 0.2 Vdc from either supply rail (VDD or VSS); no dc loads, less than 50 pF on all outputs, CL = 20 pF on OSC2.
4. Wait IDD is affected linearly by the OSC2 capacitance.
5. Stop IDD: All ports configured as inputs, VIL = 0.2 Vdc, VIH = VDD –0.2 Vdc, OSC1 = VDD.
3.50E–03
3.00E–03
2.00E–03 5.5 V
4.5 V
1.50E–03 3.3 V
2.7 V
1.00E–03
5.00E–04
0.00E+00
0 0.5 1 1.5 2 2.5
FREQUENCY IN MHz
1.60E–03
1.40E–03
SUPPLY CURRENT IN AMPS
1.20E–03
1.00E–03
5.5 V
8.00E–04 4.5 V
6.00E–04 3.3 V
2.7 V
4.00E–04
2.00E–04
0.00E+00
0 0.5 1 1.5 2 2.5
FREQUENCY IN MHz
3.50E–03
3.00E–03
1.00E–03
5.00E–04
2.5 3 3.5 4 4.5 5 5.5 6
SUPPLY VOLTAGE IN VOLTS
1.80E–03
1.60E–03
SUPPLY CURRENT IN AMPS
1.40E–03
1.20E–03
–40° C
1.00E–03 25° C
85° C
8.00E–04
6.00E–04
4.00E–04
2.00E–04
2.5 3 3.5 4 4.5 5 5.5 6
SUPPLY VOLTAGE IN VOLTS
4.50E–06
SUPPLY CURRENT IN AMPS
4.00E–06
3.50E–06
3.00E–06 –40° C
2.50E–06 25° C
2.00E–06 85° C
1.50E–06
1.00E–06
5.00E–07
0.00E+00
2.5 3 3.5 4 4.5 5 5.5 6
SUPPLY VOLTAGE IN VOLTS
Figure 15-5. Typical Stop IDD with Analog and LVR Disabled
Output voltage
ILoad = 10.0 µA VOL — — 0.1 V
ILoad = –10.0 µA VOH VDD –0.1 — —
Input current
IIn –1 — 1 µA
OSC1, IRQ/VPP
Input current
RESET (pullup, source) IIn 10 — — µA
RESET (pulldown, sink) –6 — — mA
Output voltage
ILoad = 10.0 µA VOL — — 0.1 V
ILoad = –10.0 µA VOH VDD –0.1 — —
Input current
IIn –1 — 1 µA
OSC1, IRQ/VPP
Input current
RESET (pullup, source) IIn 5 — — µA
RESET (pulldown, sink) –3 — — mA
Voltage comparators
Input offset voltage VIO — 15 mV
Common-mode range VCMR — VDD –1.5 V
Comparator 1 input impedance ZIn 800 — kΩ
Comparator 2 input impedance
Direct input to comparator 2 (HOLD = 1, DHOLD = 0) ZIn 800 — kΩ
Divider input to comparator 2 (HOLD = 0, DHOLD = 1) ZIn 80 — kΩ
Voltage comparators
Input offset voltage VIO — 15 mV
Common-mode range VCMR — VDD –1.5 V
Comparator 1 input impedance ZIn 800 — kΩ
Comparator 2 input impedance
Direct input to comparator 2 (HOLD = 1, DHOLD = 0) ZIn 800 — kΩ
ZIn 80 — kΩ
Divider input to comparator 2 (HOLD = 0, DHOLD = 1)
820
800
780
760
740
720
T DIODE IN mV
700
680
660
640
620
600
580
560
–45 –35 –25 –15 –5 5 15 25 35 45 55 65 75 85 95
TEMPERATURE IN ° C
16-bit timer
Resolution tRESL 4.0 — tcyc
Input capture (TCAP) pulse width tTH, tTL 284 — ns
Interrupt pulse width low (edge-triggered) tILIH 284 — ns
1. VDD = 4.5 to 5.5 Vdc, VSS = 0 V, TL ≤TA ≤TH, unless otherwise noted
2. The 500-kHz nominal mask option is available through special order only. Contact your local Motorola sales representative
for detailed ordering information. Not offered with the RC oscillator.
3. The minimum period, tILIL, should not be less than the number of cycle times it takes to execute the interrupt service routine
plus 21 tcyc.
16-bit timer
Resolution tRESL 4.0 — tcyc
Input capture (TCAP) pulse width tTH, tTL 284 — ns
Interrupt pulse width low (edge-triggered) tILIH 284 — ns
510000
500000
490000
FREQUENCY IN Hz
480000
470000
460000
450000
440000
430000
420000
–45 –35 –25 –15 –5 5 15 25 35 45 55 65 75 85 95
TEMPERATURE IN ° C
114000
113500
113000
FREQUENCY IN Hz
112500
112000
111500
111000
110500
110000
109500
–45 –35 –25 –15 –5 5 15 25 35 45 55 65 75 85 95
TEMPERATURE IN ° C
2.5
1.5
VDD = 5.5 V
VDD = 4.5 V
1
0.5
0
12.1 24.9 49.9
EXTERNAL RESISTOR VALUE (kΩ)
2
INTERNAL BUS FREQUENCY (MHz)
1.5
VDD = 3.3 V
VDD = 2.7 V
0.5
0
12.1 24.9 49.9
Frequency of operation
Master fSIOP(M) 0.25 x fOP 0.25 x fOP 0.25 x fOP kHz
Slave fSIOP(S) dc — 1050
Cycle time
Master tSCK(M) 4.0 x tcyc 4.0 x tcyc 4.0 x tcyc µs
Slave tSCK(M) — — 3.8
tSCK
tSCKL
SCK
tV tHO
tS
tH
Frequency of operation
Master fSIOP(M) 0.25 x fOP 0.25 x fOP 0.25 x fOP
kHz
Slave fSIOP(S) dc — 525
Cycle time
Master tSCK(M) 4.0 x tcyc 4.0 x tcyc 4.0 x tcyc
µs
Slave tSCK(M) — — 1.9
Low-voltage reset
Rising recovery voltage VLVRR 2.4 3.4 4.4 V
Falling reset voltage VLVRF 2.3 3.3 4.3 V
LVR hysteresis VLVRH 30 70 — mV
RESET pulse width (when bus clock active) tRL 1.5 — — tCYC
4.5
RESET VOLTAGE IN VOLTS
3.5
2.5
–45 –35 –25 –15 –5 5 15 25 35 45 55 65 75 85 95
TEMPERATURE IN ° C
OSC11
t
RL
RESET
4064 or 16 tcyc(2)
INTERNAL
CLOCK(3)
INTERNAL
ADDRESS 1FFE 1FFF NEW PCH NEW PCL
BUS(3)
INTERNAL
DATA NEW NEW Op
PCH PCL code
BUS(3)
Notes:
1. Represents the internal gating of the OSC1 pin
2. Normal delay of 4064 tcyc or short delay option of 16 tcyc
3. Internal timing signal and data information not available externally
INTERNAL
RESET1
RESET
PIN
tRPD 4064 or 16 tcyc(2)
INTERNAL
CLOCK(3)
INTERNAL
ADDRESS 1FFE 1FFF NEW PCH NEW PCL
BUS(3)
INTERNAL
DATA NEW NEW
PCH PCL
BUS(3)
Notes:
1.Represents the internal reset from low-voltage reset, illegal opcode fetch or COP watchdog timeout
2.Only if reset occurs during normal delay of 4064 tCYC or short delay option of 16 tCYC for initial power-up
or stop recovery.
3.Internal timing signal and data information not available externally
VDD VLVRR
VLVRF
LOW
VOLTAGE
RESET
RESET
PIN1 (2)
tRPD 4064 or 16 t
cyc
INTERNAL
CLOCK3
INTERNAL
ADDRESS 1FFE 1FFF NEW PCH NEW PCL
BUS(3)
INTERNAL
DATA NEW NEW
PCH PCL
BUS(3)
Notes:
1. RESET pin pulled down by internal device
2 Only if LVR occurs during normal delay of 4064 tcyc or short delay option of 16 tcyc for initial power-up
or stop recovery.
3 Internal timing signal and data information not available externally
16.1 Contents
16.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
16.2 Introduction
The MC68HC705JJ7 is available in:
• 20-pin plastic dual in-line package (PDIP)
• 20-pin small outline integrated circuit (SOIC) package
• 20-pin windowed ceramic package
The following figures show the latest packages at the time of this
publication. To make sure that you have the latest case outline
specifications, contact one of the following:
• Local Motorola Sales Office
• World Wide Web at:
http://www.motorola.com/mcu/
-A-
NOTES:
1. DIMENSIONING AND TOLERANCING PER ANSI
20 11 Y14.5M, 1982.
2. CONTROLLING DIMENSION: INCH.
B 3. DIMENSION L TO CENTER OF LEAD WHEN
1 10 FORMED PARALLEL.
4. DIMENSION B DOES NOT INCLUDE MOLD
C L FLASH.
INCHES MILLIMETERS
DIM MIN MAX MIN MAX
A 1.010 1.070 25.66 27.17
B 0.240 0.260 6.10 6.60
-T- C 0.150 0.180 3.81 4.57
K 0.015 0.022 0.39 0.55
SEATING D
PLANE M E 0.050 BSC 1.27 BSC
F 0.050 0.070 1.27 1.77
E N G 0.100 BSC 2.54 BSC
J 0.008 0.015 0.21 0.38
G F J 20 PL 0.110 0.140 2.80 3.55
K
L 0.300 BSC 7.62 BSC
D 20 PL 0.25 (0.010) M T B M
M 0° 15° 0° 15°
0.25 (0.010) M T A M N 0.020 0.040 0.51 1.01
-A-
NOTES:
1. DIMENSIONING AND TOLERANCING PER
20 11 ANSI Y14.5M, 1982.
2. CONTROLLING DIMENSION: MILLIMETER.
3. DIMENSIONS A AND B DO NOT INCLUDE
-B- P 10 PL MOLD PROTRUSION.
0.010 (0.25) M B M 4. MAXIMUM MOLD PROTRUSION 0.150
(0.006) PER SIDE.
5. DIMENSION D DOES NOT INCLUDE
1 10 DAMBAR PROTRUSION. ALLOWABLE
DAMBAR PROTRUSION SHALL BE 0.13
(0.005) TOTAL IN EXCESS OF D DIMENSION
D 20 PL AT MAXIMUM MATERIAL CONDITION.
J
0.010 (0.25) M T A S B S MILLIMETERS INCHES
DIM MIN MAX MIN MAX
A 12.65 12.95 0.499 0.510
B 7.40 7.60 0.292 0.299
F C 2.35 2.65 0.093 0.104
D 0.35 0.49 0.014 0.019
R X 45° F 0.50 0.90 0.020 0.035
G 1.27 BSC 0.050 BSC
J 0.25 0.32 0.010 0.012
K 0.10 0.25 0.004 0.009
C M 0° 7° 0° 7°
P 10.05 10.55 0.395 0.415
-T- R 0.25 0.75 0.010 0.029
SEATING M
G 18 PL K PLANE
NOTES:
1. POSITIONAL TOLERANCE OF LEADS (D),
SHALL BE WITHIN 0.25mm (0.010) AT
MAXIMUM MATERIAL CONDITION, IN
RELATION TO SEATING PLANE AND
EACH OTHER.
28 15 2. DIMENSION L TO CENTER OF LEADS
WHEN FORMED PARALLEL.
3. DIMENSION B DOES NOT INCLUDE
B MOLD FLASH.
MILLIMETERS INCHES
1 14 DIM MIN MAX MIN MAX
A 36.45 37.21 1.435 1.465
A L B 13.72 14.22 0.540 0.560
C C 3.94 5.08 0.155 0.200
D 0.36 0.56 0.014 0.022
N F 1.02 1.52 0.040 0.060
G 2.54 BSC 0.100 BSC
H 1.65 2.16 0.065 0.085
J 0.20 0.38 0.008 0.015
H G J K 2.92 3.43 0.115 0.135
K M
F D L 15.24 BSC 0.600 BSC
SEATING M 0° 15° 0° 15°
PLANE
N 0.51 1.02 0.020 0.040
-A-
28 15 NOTES:
1. DIMENSIONING AND TOLERANCING PER
14X P ANSI Y14.5M, 1982.
-B- 0.010 (0.25) M B M 2. CONTROLLING DIMENSION: MILLIMETER.
3. DIMENSION A AND B DO NOT INCLUDE MOLD
PROTRUSION.
1 14 4. MAXIMUM MOLD PROTRUSION 0.15
(0.006) PER SIDE.
5. DIMENSION D DOES NOT INCLUDE
DAMBAR PROTRUSION. ALLOWABLE
28X D DAMBAR PROTRUSION SHALL BE 0.13
M (0.005) TOTAL IN EXCESS OF D
0.010 (0.25) M T A S B S
DIMENSION AT MAXIMUM MATERIAL
R X 45° CONDITION.
MILLIMETERS INCHES
-T- C DIM MIN MAX MIN MAX
A 17.80 18.05 0.701 0.711
-T- B 7.40 7.60 0.292 0.299
26X G SEATING C 2.35 2.65 0.093 0.104
PLANE
D 0.35 0.49 0.014 0.019
K
F F 0.41 0.90 0.016 0.035
G 1.27 BSC 0.050 BSC
J 0.23 0.32 0.009 0.013
J K 0.13 0.29 0.005 0.011
M 0° 8° 0° 8°
P 10.05 10.55 0.395 0.415
R 0.25 0.75 0.010 0.029
NOTES:
1. LEADS WITHIN 0.010 DIAMETER, TRUE
20 11 POSITION AT SEATING PLANE, AT MAXIMUM
MATERIAL CONDITION.
2. DIMENSION L TO CENTER OF LEADS WHEN
1 10
FORMED PARALLEL.
3. DIMENSIONS A AND B INCLUDE MENISCUS.
B
INCHES
A DIM MIN MAX
A 0.940 0.990
B 0.260 0.295
C L C 0.150 0.200
F D 0.015 0.022
F 0.055 0.065
G 0.100 BSC
H 0.020 0.050
N J 0.008 0.012
J K 0.125 0.160
H K L 0.300 BSC
D G M M 0_ 15_
N 0.010 0.040
SEATING
PLANE
NOTES:
28 15 1. DIMENSIONING AND TOLERANCING PER ANSI
Y14.5M, 1982.
B 2. CONTROLLING DIMENSION: INCH.
3. DIMENSION A AND B INCLUDE MENISCUS.
4. DIMENSION L TO CENTER OF LEADS WHEN
1 14 FORMED PARALLEL.
M INCHES MILLIMETERS
–A– DIM MIN MAX MIN MAX
L A 1.435 1.490 36.45 37.84
B 0.500 0.605 12.70 15.36
C 0.160 0.240 4.06 6.09
N D 0.015 0.022 0.38 0.55
F 0.050 0.065 1.27 1.65
–T– C G 0.100 BSC 2.54 BSC
J
SEATING K J 0.008 0.012 0.20 0.30
PLANE K 0.125 0.160 3.17 4.06
L 0.600 BSC 15.24 BSC
G M 0_ 15 _ 0_ 15 _
F N 0.020 0.050 0.51 1.27
D 28 PL
0.25 (0.010) M T A M
17.1 Contents
17.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
17.2 Introduction
This section contains instructions for ordering the various erasable
programmable read-only memory (EPROM) versions of the
MC68HC05JJ/JP Family of microcontrollers.
EPO Operating
Package Oscill. LPO Freq.
Temperature Order Number
Type (kHz)
Type(1) Range
EPO Operating
Package Oscill. LPO Freq.
Temperature Order Number
Type (kHz)
Type(1) Range
JAPAN:
Motorola Japan Ltd.
SPS, Technical Information Center
3-20-1, Minami-Azabu, Minato-ku
Tokyo 106-8573 Japan
81-3-3440-3569
ASIA/PACIFIC:
Motorola Semiconductors H.K. Ltd.
Silicon Harbour Centre
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
852-26668334
HOME PAGE:
http://www.motorola.com/semiconductors/
Q4/00
MC68HC705JJ7/D REV 1
REV 4