Equivalent Test
TTL Equivalent Test
Open-Drain Equivalent Test
PortAVOHvslOH
PortA
VOL
vs
Port B
VOH
Port B VOL
PortCVOHvslOH
PortCVOLvsIOL·
Port A Vin
EXTALVin
InterruptVinvslin·
RESET
VDDvslDD
PortsAandCLogicDiagram
PortBLogicDiagram
Typical Input Protection
I/OCharacteristicMeasurementCircuit
low-cost single-chip microcomputers was designed for the user who needs
economical microcomputer with the proven capabilities
rapidly expanding family includes a number of memory and package
HMOS
and
tions in both
CMOS.
of
the M6800-based instruction set. This
sizes
with various 1/0 func-
This document describes the eight 8-bit high-density N-channel silicon-gate microcomputers which
comprise the
MC68(7)05R/U series. These devices
MC6805R2 MC6805R3
are
MC68705R3
listed below:
MC68705R5
MC6805U2 MC6805U3 MC68705U3 MC68705U5
an
These eight devices
able
in
40-pin dual-in-line packages.
1.1
DEVICE FEATURES
are
8-bit high-density N-channel silicon-gate microcomputers. They
The following tables summarize the hardware
will
be
between the devices
highlighted throughout this document when applicable.
HARDWARE FEATURES
24 Bidirectional
I/O
Lines
Eight Input-Only Lines X X X
A/
D Converter X X
User ROM (Bytes) 2048
User
EPROM
RAM (Bytes)
Self-Check Mode
Zero/ Crossing
Detect! Interrupt X X X
Timer
with
7-Bit
Prescaler
Programmable
Prescaler
5-Volt Single Supply
Memory Mapped
On-Chip EPROM
The following paragraphs contain brief descriptions
applicable reference
being performed.
2.1
VCC
AND
Power
is
supplied to the microcomputers using these
ground connection.
VSS
has
been
made to other sections that contain more detail about the function
of
the input
two
pins.
and
output signals. Where
VCC
is
power and VSS
is
2.2 INT
This pin provides the capability for asynchronously applying
puter. Refer
mati
on
2.3 EXTAL
These pins provide control input for the on-chip clock oscillator circuit. A crystal, a resistor, or
external signal, depending on user selectable manufacturing
these pins to provide a system clock with various degrees
and
stray capacitance
CLOCK,
2.4 TIMER
This pin
MC68705R3,
voltage level
10
SOFTWARE).
higher voltage
to
SECTION 7 RESET, CLOCK,
regarding the interrupt operation.
AND
XTAL
on
these
two
AND
INTERRUPT STRUCTURE for recommendations about these inputs.
is
used
as
an
external input
MC68705U3,
used
to initiate the bootstrap program for loading the internal
On
level
MC68705R5,
the
MC6805R2,
used
to initiate the self-test program
MC6805U2,
AND
INTERRUPT STRUCTURE for additional infor- ,
pins should
to
control the internal timer/counter circuitry.
and
be
MC68705U5 versions, this pin also detects a higher
MC6805R3,
an
external interrupt to the microcom-
mask
option,
of
stability/cost tradeoffs.
minimized. Refer
and MC6805U3 this pin also detects a
(see
SECTION 6 SELF CHECK).
can
be
connected
to
SECTION 7 RESET,
EPROM
(see
Lead
length
On
SECTION
the
an
to
the
Refer to SECTION 5 TIMER for more detailed information about the timer circuitry.
2.5 RESET
This pin
ing RtSEi low. Refer to SECTION 7 RESET, CLOCK,
tional information.
has
a Schmitt trigger input and
an
on-chip pullup. The microcomputer
AND
INTERRUPT STRUCTURE for addi-
can
2-1
be
reset by pull-
Page 18
2.6
NUM
(NON-USER MODE)
Pin 7
of
the MC6805R2 and MC6805U2
user application and must be connected
2.7
Vpp
This pin is used when programming the EPROM versions (MC68705R3, MC68705U3, MC68705R5,
and MC68705U5l. By
for
programming the EPROMs. In normal operation, this pin is connected
9
TION
2.8
These
ming
MASK
INPUT/OUTPUT
32
lines are arranged into
as
either inputs
applying the programming voltage
OPTIONS
AND
PROGRAMMING
LINES (PAO-PA7,
or
outputs under software control
is
identified
to
PBO-PB7,
four
a-bit ports (A, Sf
VSS.
as
NUM (non-user mode). This pin
to
this pin, one
for
more detailed information.
PCO-PC7,
PDO-PD7)
C,
and D). Ports
of
the data direction registers.
of
the requirements is met
to
A,
is
VCC. Refer
S,
and C are program-
to
not
SEC-
for
For the MC6805U2, MC6805U3, MC68705U3, and MC68705U5
6 may be used
RUPT STRUCTURE and SECTION 8
CONVERTER
For the MC6805R2, MC6805R3, MC68705R3, and MC68705R5
plus
two
PD4/VRU
. analog input is used, then the voltage reference pins (PD5/VRH,
analog mode. Refer
8 INPUT/OUTPUT CIRCUITRY
tion.
for
a second interrupt (fJ\JT2). Refer
INPUT/OUTPUT
for
additional information.
voltage reference inputs when the analog-to-digital converter is used (PD5/VRH,
and
an
il'JT2
input. All
to
SECTION 7 RESET, CLOCK,
port
D lines can be read directly and used
AND
ANALOG-TO-OIGITAL CONVERTER
to
AND
port
SECTION 7 RESET, CLOCK,
CIRCUITRY
port
INTERRUPT STRUCTURE and SECTION
D is
for
digital input only and
AND
ANALOG-TO-DIGITAL
D has up
PD4/VRU
to
as
must
for
AND
INTER-
four analog inputs,
binary inputs.
be
additional informa-
If
any
used in the
bit
2-2
Page 19
SECTION 3
MEMORY CONFIGURATIONS
Each
member
of
memory and 1/0 registers. The memory maps for the eight versions
ed
in
this document are shown
for
each
device
of
the MC68(7)05R/U series
in
Figures
is
detailed
in
1.1
DEVICE FEATURES.
of
microcomputers
3-1
through
3-6~
The amount
is
capable
of
addressing
of
the M6805 Family describ-
of
ROM, EPROM, and RAM
4096
bytes
3.1 MC6805U2 MEMORY
MAP
The memory map for the MC6805U2is shown
and
RESET
vectors. A self-check
7
000
Page Zero
Access
with
Short
Instructions
Interrupt
Vectors
*Caution:
127
128
255
256
1983
1984
3895
3896
4087
~
4088
4089
I-
4090
4091
I-
4092
4093
I-
4094
4095
Data direction registers (DDRs) are write-only; they read
ROM
occupies
1/0 Ports
Timer
RAM
(128 Bytes)
Page-Zero
User ROM
(128 Bytes)
Not
Used
(1728 Bytes)
Main User
ROM
(1912 Bytes)
Self-Check
ROM
(192 Bytes)
- - - - -
-
Timer Interrupt
- - - - - -
External Interrupt
-
-
- -
SWI
-
RESET
--
-
- -
- -
o
in
$000
$07F
$080
$OFF
$100
\
$7BF
$7CO
$F37
$F38
$FF7
$FF8
$FF9
$FFA
$FFB
$FFC
$FFD
$FFE
$FFF
Figure
192
bytes from
3-1.
From
$FF8
$F38
to
7 6 5 4 3 2 1 0
Port A Data Register
0
Port
B Data Register
Port C Data Register
Port D Data Register
PortA
Port B
DDR*
PortC
DDR*
Not
Used
Timer Data Register
Timer Control Register
Miscellaneous Register
Not
Used
Reserved
(48 Bytes)
RAM
(64 Bytes)
Stack
(31
Bytes
Maximum)
t
as
$FF.
10
63
64
127
1
2
3
4
5
6
7
8
9
11
15
16
to
$FF7.
DDR*
$FFF
are the interrupt
The user
$000
$001
$002
$003
$004*
$005*
$006*
$007
$008
$009
$ooA
$ooB
$OOF
$020
$03F
$040
$07F
ROM
is
Figure 3-1. MC6805U2 Memory Map
3-1
Page 20
divided into
bytes
$07F.
two
of
ROM
Only the
portions located from
to
be addressed
31
bytes from
with
$061
$080
to
$OFF
and
$7CO
direct instructions. A RAM
to
$07F
can
be
used for the stack RAM due
to
$F37.
area
The portioning allows
of
64
bytes occupies
to
the limitation imposed by the 5-bit stack pointer. The data direction, peripheral data, timer, and
registers are located from
$000
to
$OOF.
128
$040
to
miscellaneous
3.2 MC6805R2 MEMORY
MAP
The memory map for the MC6805R2
that
two
additional registers, the analog-to-digital control register and the analog-to-digital result
register, have been added
Page
Zero
Access
with
Short
Instructions
Interrupt
Vectors
*Caution:
Data
at
locations
7
000
127
128
255
256
1983
1984
3895
3896
4087
4088
4089
4090
4091
4092
4093
4094
4095
direction registers
(128
(1728
(1912
Timer Interrupt
I-
------
External
I-
-
I-
-
Page
User
(128
Main
Self
(192
-
- - -
110
Not
is
shown in Figure 3-2 and
$OOE
and
$OOF,
o
Ports
Timer
RAM
Bytes)
Zero
ROM
Bytes)
Used
Bytes)
User
ROM
Bytes)
Check
ROM
Bytes)
Interrupt
- -
SWI
RESET
(OORs)
$000
$07F
~-
$OFF
$100
$7BF
$7CO
$F37
$F38
$FF7
$FF8
$FF9
$FFA
$FFB
- -
$FFC
$FFD
- -
$FFE
$FFF
are
write-only; they
\
is
identical
respectively.
765
Port A
0
Port B
1
Port C Data
2
Port
3
4
5
6
7
Timer
8
Timer
9
Miscellaneous
10
11
13
AID
14
AID
15
16
63
64
127
read
as
$FF.
to
4
321
Data
Register
Data
Register
Register
0
Data
Register
PortA DDR*
PortB DDR*
PortC DDR*
Used
Not
Data
Register
Control
Register
Register
Not
Used
(3
Bytes)
Control
Register
Result
Register
Not
Used
(48
Bytes)
RAM
(64
Bytes)
Stack
(31
Bytes
MaXt'um)
the MC6805U2 except
0
$000
$001
$002
$003
$004*
$005*
$006*
$007
$008
$009
$ooA
$ooB
$000
$ooE
$OOF
$010
$03F
$040
$07F
Figure 3-2. MC6805R2 Memory Map
3-2
Page 21
------------
..
-.--
..
----~.-----~~.--
----------
3.3 MC6805U3 MEMORY
The memory map
and RAM
$080
to
$F37.
for
area
over the MC6805U2. The user
The RAM is expanded
MAP
the MC6805U3
is
shown
to
112
in
Figure 3-3. The MC6805U3
ROM
in
the MC6805U3 consists
bytes from
$010
to
tical to the MC6805U2. The 5-bit stack pointer still allows only
area.
- -
o
$000
$07F
$080
$F37
$F38
$FF7
$FF8
$FF9
$FFA
$FFB
$FFC
$FFD
$FFE
$FFF
they
127
read
0
1
2
3
4
5
6
7
8
9
10
11
15
16
7
000
127
128
3895
3896
4087
4088
4089
Interrupt
Vectors
*
4090
4091
4092
4093
4094
4095
Caution: Data direction registers (DDRs) are write-only;
I/O
Timer
RAM
(128 Bytes)
Main User
ROM
(3768 Bytes)
Self Check
ROM
(192 Bytes)
Timer
-------
External Interrupt
-------
- - -
SWI
--
RESET
Ports
Interrupt
has
an
expanded
of
3768 bytes from
$07F. All other registers remain iden31
bytes
of
RAM
to
be
used
as
7
654
Port
Port B Data Register
Port C Data Register
Port D Data Register
Timer
Timer
Miscellaneous Register
(31
as
$FF.
3 2 1 0
A Data Register
PortA
DDR*
Port B
DDR*
Port C
DDR*
Not
Used
Data Register
Control Register
Not
Used
(5
Bytes)
RAM
(112 Bytes)
Stack
Bytes Maximum)
t
$000
$001
$002
$003
$004*
$005*
$006*
$007
$008
$009
$OOA
$008
$OOF
$010
$07F
ROM
stack
Figure 3-3. MC6805U3
3-3
Memory
Map
Page 22
3.4 MC6805R3 MEMORY MAP
The
memory
that two
register,
map
additional
have
been
for
the
registers,
added
MC6805R3
the analog-to-digital
at
locations
is
shown
$OOE
in
and
Figure
control
$OOF,
3-4
and
is
identical
register and
respectively.
to
the
MC6805U3
the
analog-to-digital
except
result
- -
- -
o
$000
$07F
$080
$F37
$F38
$FF7
$FF8
$FF9
$FFA
$FFB
$FFC
$FFD
$FFE
$FFF
7
000
127
128
3895
3896
4087
4088
4089
Interrupt
Vectors 4092
* Caution: Data direction registers (DDRs) are write-only;
4090
4091
4093
4094'
4095
1/0 Ports
Timer
RAM
(128 Bytes)
Main User
(3768 Bytes)
Self Check
(192 Bytes)
Timer
-------
External Interrupt
-
- -
--
-
RESET
ROM
ROM
Interrupt
--
SWI
--
Figure 3-4. MC6805R3 Memory Map
7 6 5 4 3 2 1 0
Port
A Data Register
Port B Data Register
Port C Data Register
Port D Data Register
PortA
Port B DDR*
Port C
Not
Timer Data Register
Control Register
Timer
Miscellaneous Register
Not
AI
D Control Register
AID
Result Register
(112 Bytes)
(31
Bytes Maximum)
$FF.
they
0
1
2
3
4
5
6
7
8
9
10
11
13
14
15
16
127
read as
(3
RAM
Stack
DDR*
DDR*
Used
Used
Bytes)
t
$000
$001
$002
$003
$004*
$005*
$006*
$007
$008
$009
$OOA
$OOB
$ooD
$OOE
$OOF
$010
$07F
3-4
Page 23
3.5 MC68705U3 and MC68705U5 MEMORY
The memory maps
the masked programmed
pose registers, and interrupt and
and MC68705U5 is
for
the MC68705U3 and MC68705U5 are shown in Figure 3-5 and are identical to
equivalent, the MC6805U3,
RESET vectors. The ROM area ($080
an
ultraviolet erasable EPROM.
MAP
with
respect
to
RAM, ROM, 1/0, special pur-
to
$F37)
of
the MC68705U3
A bootstrap ROM is located between
to
program their
At
location
own
EPROMs. The bootstrap
$F38
is
the mask option register
$F39
set up the MC68705U3 and the MC68705U5
clock source, etc.
In addition, the mask option register allows the user
fered by the M C68705U5.
7 o
1/0 Ports Timer
Page Zero I 000
Access
With
Short
Instructions 128
Interrupt
Vectors 4092
* Caution: Data direction registers (DDRs) are write-only; they read
127
255
~------
256
3895
--~----
3896
3897
3967
3968
4087
4088
4089
-------
4090
4091
-------
4093
-------
4094
4095
and
RAM
(128 Bytes)
Page Zero
User EPROM
(128 Bytes)
User
Main
EPROM
(3640 Bytes)
Mask Option
Not
Used
Bootstrap
ROM
(120 Bytes)
Timer Interrupt
External Interrupt
SWI
RESET
>Register
and
$FF7
which allows the MC68705U3 and MC68705U5
is
a mask programmed ROM.
(MaR)
which
is
for
a crystal or
$000
$07F
$080
\OFF
$100
$F37
$F38
$F39
$F7F
$FOO
$FF7
$FF8
$FF9
$FFA
$FFB
$FFC
$FFD
$FFE
$FFF
RC
7 6 5 4
0
1
2
3
4
5
6
7
8
9
10
11
12
15
16
127
as
an
EPROM byte.
It
allows the user
oscillator, set the timer prescaler, the
to
select the secure mode of-
321
Port A Data Register
Port B Data Register
Port C Data Register
Port D Data Register
PortA
DDR*
Port B
DDR*
Port C
DDR*
Not
Used
Timer Data Register
Timer Control Register
Miscellaneous Register
Program Control Register
Not
Used
RAM
(112 Bytes)
Stack
(31
Bytes Maximum)
t
$FF.
0
$000
$001
$002
$003
$004
$005
$006
$007
$008
$009
$OOA
$ooB
$ooC-$OOF
$010
$07F
to
Figure 3-5. MC68705U3 and MC68705U5 Memory Map
3-5
Page 24
3.6
MC68705R3 and MC68705R5 MEMORY
MAP
The memory maps for the MC68705R3 and MC68705R5 are shown in Figure 3-6 and are identical
the
MC68705U3 and MC68705U5 except
register and the analog-to-digital result register have been added
that
two
additional registers, the analog-to-digital control
at
locations
$OOE
and
$OOF,
respectively.
The
MC68705U3/MC68705U5 and MC68705R3/MC68705R5 are intended
to
exactly emulate the
MC6805U3 and MC6805R3 respectively.
to
o
--
--
$000
$07F
$080
\OFF
$100
$F37
$F38
$F39
$F7F
$F80
$FF7
$FF8
$FF9
$FFA
$FFB
$FFC
$FFD
$FFE
$FFF
1/0 Ports
Timer
RAM
(128 Bytes)
Page Zero
User EPROM
(128 Bytes)
~------
User
Main
EPROM
(3640 Bytes)
3895
1--------
3896
Mask Option Register
3897
3967
3968
4087
4088
4089
Interrupt
Vectors
* Caution: Data direction registers (DDRs) are write-only; they read
4090
4091
4092
4093
4094
4095
Not
Used
Bootstrap
ROM
(120 Bytes)
Timer Interrupt
~------
External Interrupt
~-
-
--
SWI
---
~-
Reset
Figure 3-6. MC68705R3 and MC68705R5
7 6 5 4
Port A Data Register
0
Port B Data Register
1
Port C Data Register
2
Port D Data Register
3
PortA
4
Port B
5
PortC
6
7
8
9
10
11
12
13
14
15
16
127
as
Not
Timer Data Register
Timer Control
Miscellaneous Register
Program Control Register
Not
Not
AI
D Control Register
AI
D Register
RAM
(112 Bytes)
Stack
(31
Bytes Maximum)
$FF.
Memory
321
DDR*
DDR*
DDR*
Used
Regi~ter
Used
Used
t
Map
0
$000
$001
$002
$003
$004*
$005*
$006*
$007
$008
$009
$OOA
$OOB
$OOC
$ooD
$OOE
$OOF
$010
$07F
3-6
Page 25
-----~-"--~
-----------------------
3.7 SHARED STACK AREA
The shared stack area (RAM locations $061-$07F)
subroutine call
pushed onto the stack in the order shown
pushes, the
bits
(PCH) are stacked. This ensures that the program counter
the stack since the stack pointer increments when
results
in only the program counter
ing
CPU
data storage or temporary
an
interrupt
to
save the contents
low
order byte (PCL) of the program counter
registers are
or
subroutine call.
I
Push
* For subroutine calls, only
(PCl,
not
pushed. The shared stack
work
locations
7
6 5
1
1
n-4
n-3
n-2
n-l
n
I
1
1
I
PCH
is
used during the processing
of
the central processing unit state. The register contents are
in
Figure
3-7.
Since the stack pointer decrements during
is
stacked first, then the high order four
is
loaded correctly during pulls from
it
pulls data from the stack. A subroutine call
PCH)
contents being pushed onto the stack; the remain-
area
must
be
used
with
to
protect
it
from being overwritten due
3
I
I
1
1
and
I
I 1 I
PCl
4
Condition Code Register
Accumulator
Index Register
PCl*
are stacked.
2
PCH*
o
of
an
care when
to
Pull
:::
[
n+4
n+5
interrupt
it
is
used
stacking from
or
for
Figure 3-7. Interrupt Stacking Order
3.8 CENTRAL PROCESSING UNIT
The central processing unit for the M6805 Family
memory configuration. Consequently,
municating
with
1/0 and memory
it
can
be
treated
via
internal address, data, and control buses.
is
implemented independently from the
as
an
independent central processor com-
110
or
3-7/3-8
Page 26
Page 27
SECTION 4
PROGRAMMABLE
REGISTERS
The M6805 Family
and are explained in the following paragraphs.
CPU
has five registers available
7
I
I
PCH
8 7
1
Figure
54
4 0
'--r-...L....r--'--r....L....,r-'-~
L....------Half
4-1.
Programming
11
I
11
101010101011111
4.1
ACCUMULATOR (A)
The accumulator
calculations or data manipulations.
is
a general purpose 8-bit register
to
the programmer. They
0
A
I Accumulator
0
X
I Index Register
0
PCl
Program Counter
1
0
SP
L----Negative
L-----Interrupt
Stack Pointer
I
Condition Code Register
Carry / Borrow
Zero
Model
used
to hold operands
Carry
Mask
are
and
shown
results
in
Figure
of
arithmetic
4-1
4.2 INDEX REGISTER (X)
The index register
value that may
register may
4.3 PROGRAM COUNTER (PC)
The program counter
be
also
is
an
8-bit register used for the indexed addressing mode.
added
to
an 8-or 16-bit immediate value to create
be
used
as
a temporary storage
is
a 12-bit register that contains the address
4-1
area.
It
contains
an
effective address. The index
of
the next bye to
be
fetched.
an
8-bit
Page 28
4.4
STACK POINTER (SP)
The stack pointer
During
an
$07F.
The stack pointer
data
is
pulled from the stack. The
0000011.
set to
mum) which allows the programmer to
is
a 12-bit register that contains the address of the next free location
MCU reset or the reset stack pointer
is
then decremented
seven
most significant bits of the stack pointer are permanently
Subroutines and interrupts may
use
up to
(RSP)
as
data
be
15
on
instruction, the stack pointer
is
pushed onto the stack and incremented
nested down
levels
to
location
of
subroutine calls (less if interrupts
$061
is
(31
set to location
bytes maxi-
the stack.
as
are
allowed).
4.5 CONDITION CODE REGISTER (CC)
The condition code register
instruction just executed. These bits
as
taken
4.5.1 Half Carry (H)
a result of their state.
Set during ADD and ADC operations to indicate that a carry occurred between bits 3 and
4.5.2 Interrupt (I)
When this bit
is
set, the timer and external interrupts (INT and INT2)
interrupt occurs while this bit
is
cleared.
bit
4.5.3 Negative (N)
is
a 5-bit register
can
Each
bit
is
set, the interrupt
in
which four bits
be
individually tested by a program and specific action
is
explained
in
is
latched and
are
used
to indicate the results
the following paragraphs.
are
masked (disabled), If
is
processed
as
soon
as
the interrupt
4.
of
the
an
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was
in
negative (bit 7
the result
is
a logic one).
4.5.4
Zero (Z)
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was
zero.
4.5.5 Carry/Borrow (C)
When set, this bit indicates that a carry or borrow out of the arithmetic logical unit (ALU) occurred
is
during the last arithmetic operation. This bit
also affected during bit test and branch instructions
plus shifts and rotates.
4-2
Page 29
SECTION 5
TIMER
The following paragraphs describe the timer circuitry for the eight versions
found
in
this document. Note that while each timer consists
of
an
8-bit software programmable
of
the M6805 Family
counter driven by a 7-bit prescaler there are three distinctly different configurations (Figures 5-1,
5-2, and 5-3).
5.1
MC6805R2/MC6805U2 TIMER CIRCUITRY
The timer circuitry for the MC6805R2 and MC6805U2 microcomputers
8-bit counter may
put
(or prescaler output). When the timer reaches zero, the timer interrupt request bit (bit
timer
control register (TCR)
interrupt mask bit (bit
be
loaded under program control and
is
set. The timer interrupt
6)
in
the TCR. The interrupt bit
is
decremented toward zero by the clock in-
can
be
masked (disabled) by setting the timer
(I
bit)
is
shown
in
Figure
5-1.
7)
in
the condition code register also
in
The
the
prevents a timer interrupt from being processed. The MCU responds to this interrupt by saving the
present
and executing the interrupt routine
TURE).
same interrupt vector.
CPU
state on the stack, fetching the timer interrupt vector from locations
(see
The
timer interrupt request
The
SECTION 7
bit
must
interrupt routine
be cleared
must
RESET,
CLOCK, AND INTERRUPT STRUC-
by
software. The
check the request bits
$FF8
and
TI M ER
and I NT2 share the
to
determine the source
$FF9
of
the interrupt.
The
clock input to the timer
on a positive transition
nal phase
two
t/>2
(Internal)
TIMER
Input
Pin
r------1
I I
I I
I I
I I
1...
______
•
I I
Manufacturing
Mask
Options
signal. Three machine cycles
can
be
from
an
external source (decrementing of timer counter occurs
of
the external source) applied to the TIMER input pin, or it
a 7-bit divider which is used to extend the maximum length
of
the
TCR
are
programmed to choose the appropriate prescaler
the counter input. The processor cannot write into or
are
cleared to all zeros by the write operation into
which
allows for truncation-free counting.
be
The timer input can
depending on the
configured for three different operating modes, plus a disable mode,
value written
to
the TCR4 and TCR5 control bits. Refer to 5.2.5 Timer Control
TCR
Register (TCR) for further information.
5.2.1 Timer
If
TCR5 and TCR4
and the external TIMER input
generation,
Input Mode 1
are
both programmed
as
well
as
a reference
to
a zero, the input
is
disabled. The internal clock mode
in
frequency and event measurement. The internal clock
struction cycle clock.
5.2.2 Timer Input Mode 2
With
TCR5= 0 and TCR4=
timer input
put
Signal. This mode can
pulse simply turns on the internal clock for the duration
1,
the internal clock and the TIMER input pin are ANDed
be
used to measure external pulse widths. The external timer in-
Cleared
TCR3
read
Write
by
Software
from the prescaler; however, its contents
when bit 3
to
of
the pulse widths.
Read
Functions
of
the written data equals one,
the timer
can
be
used for periodic interrupt
Interrupt
of
the timer. Bit
output
which
is
from
an
0,
bit
1,
is
used
as
internal clock
is
the in-
to
form the
5.2.3 Timer
If
TCR5= 1 and TCR4= 0, then
Input Mode 3
all
inputs to the timer
5.2.4 Timer Input Mode 4
If
TCR5= 1 and TCR4= 1, the internal clock input
5-3
to
the timer
are
disabled.
is
disabled and the TIMER input pin
Page 32
becomes the input to the timer. The external TIMER pin can, in this mode, be used
nal
events
as
well
as
external frequencies for generating periodic interrupts.
5.2.5
Timer
Control
Register
7
I
TCR
*Write only (read
TCR6\
1
(TCR)
TCR51
as
zero)
TCR41
TCR3* I TCR21
TCR1 I TCRO I $009
to
count exter-
TCR7
TCR6
TCR5
TCR4
TCR3
- Timer interrupt request bit: indicates the timer interrupt when
1-
Set whenever the counter decrements to zero, or under program control.
0-
Cleared
- Timer interrupt
logic one.
Set
1 -
0-
Cleared under program control.
- External or internal bit: selects the input clock source to
or the internal clock (unaffected by
1 - Select external clock source. Set to a logic one
program
0-
Select internal clock source (phase two). Cleared under program control.
- External enable bit: control bit
RESET).
1-
Enable external TIMER pin. Set
0-
Disable external TIMER pin. Cleared under program control.
- Timer prescaler reset bit: writing a one to this bit resets the prescaler to zero. A
this location always indicates a zero (unaffected by
on
external reset, power-on reset, or program control (write).
mask
bit: inhibits the timer interrupt to the processor, when this bit
on
external reset, power-on reset, or program control.
RESET).
control.
used
to enable the external TIMER pin (unaffected by
on
external reset, power-on reset, or program control.
o
1
1
1
TCR4
o
Internal clock to timer
1
o
1
of
AND
Input
to
TIMER pin to timer
internal clock and TIMER pin to timer
timer disabled
TCR5
on
external reset, power-on reset, or
RESET),
it
is
a logic one.
be
either the external TIMER pin
read
is
a
of
TCR2,
TCR1,
and
TCRO
TCR2
0
0
0 1 0
0 1 1
- Prescaler address bits: decoded to select one of eight outputs
prescaler (set to
TCR1
TCRO
0
0
0
1
all
ones by
PRESCALER
Result
+1
+2
+4
+8
5-4
RESET),
TCR2
1
1 0
1
1 1
TCR1
0 0
1
TCRO
1
0
1
Result
+16
+32
+64
+
128
of
the
Page 33
5.3 MC68705R3/MC68705U3
The timer for the MC68705R3 and MC68705U3 microcomputers
for the MC68705R5 and MC68705U5 microcomputers
an
devices contains
one-of-eight selectable outputs. Various timer clock sources may
and counter. The timer selections
mask)
state
(MOR). The
bit
on
tion register
MC68705U5 offer a secure/non-secure mode option which
mask option register (refer
mation regarding the secure/ non-secure mode option).
The 8-bit counter may
counter input frequency
decremented
rupt
the interrupt request to the processor. When the I bit
processor receives the timer interrupt. The MCU responds to this interrupt by saving the present
CPU
executing the interrupt routine. The processor
line; therefore if the interrupt
without generating
clear the timer interrupt request.
8-bit software programmable counter which
to
zero, it sets the
(b6)
can
the stack, fetching the timer interrupt vector from locations
an
interrupt. The
AND
MC68705R5/MC68705U5 TIMER CIRCUITRY
is
shown
in
Figure
5-3
is
shown
in
Figure
5-4.
The timer for all four
is
driven
by
a 7-bit prescaler with
be
selected ahead
are
made via the timer control register
TCR
also contains the interrupt control bits. Note that the MC68705R5 and
is
to
SECTION 9
be
loaded under program control and
(fCIN) input (output
TIR
be
software set
is
MASK
OPTIONS
of
the prescaler selector). Once the 8-bit counter
(timer interrupt request) bit 7
to
inhibit the interrupt request, or software cleared
in
the condition code register
is
masked, the
TIR
bit must
sensitive
TIR
be
to
bit may
cleared by the timer interrupt service routine
AND
is
the level
be
(TCR)
implemented through bit 3
PROGRAMMING for further infor-
decremented toward zero by the
(b7
of TCR)' The TIM (timer inter-
of
the timer interrupt request
cleared by software (e.g., BClR)
and/or
$FF8
of
is
and
and the timer
the prescaler
the mask op-
of
the
has
to
pass
cleared, the
$FF9,
and
to
The timer interrupt and
two
the
The counter continues to count (decrement) by falling through to
can
determine the length
counting process.
The clock input to the timer
positive transition of the external source) applied to the
phase
pin logic
high) state
as
The period
mum allowable frequency by defining
When the phase
pin allowing the user to easily perform pulse width measurements. The source
selected
request bits to determine the source of the interrupt.
be
read
at any time by the processor without disturbing the count. This allows a program to
two
Signal.
is
dependent
on
the pin
follows (assumes 50/50 duty cycle for a given period):
is
not simply
via
the
INT2 share the
of
time since the occurrence
can
The maximum frequency of a signal that
on
the parameter labeled
in
order to "re-arm" the internal logic. Therefore, the period can
tWl
+ tWH. This computation
two
signal
is
used
TCR
or the
MOR
same
be
from
an
tcyc x 2
an
as
the source, it
as
described later.
interrupt vector. The interrupt routine thus must check
$FF
from zero. Thus, the counter
of
a timer interrupt
external source (decrementing the counter occurs
TIMER input pin, or it can
can
be
tWl,
tWH. The pin logic that recognizes the low (or
+
250
ns
= period =
unnecessarily longer period
can
-f
1
req
is
allowable, but it does reduce the maxi-
be
gated
and
recognized by the TIMER or Il\li
(250
nanoseconds twice).
by
an
input applied to the TIMER
does not disturb the
on
be
the internal
be
calculated
of
the clock input
a
is
5-5
Page 34
8
Timer Data Register (TDR)
8-Bit
Counter
Timer
Pin
Internal
l/J2
Clock
41
(fosc+
fplN - Prescaler Input Frequency
fCIN-Counter
NOTE:
Input Frequency
The
TOPT
emulates the mask programmable parts
bit in the mask option register selects whether the timer
eight outputs on the 7-bit binary divider; one output bypasses prescaling. To avoid truncation errors, the
TCR
bit 3 always reads
tions (bit set and clear for
At
reset, the prescaler and counter
bit
(TCR,
b7)
b4,
and
b5
then software
can
be
applied to the clock input that extends the timing interval up
counts before decrementing the counter. This prescaling
prescaler
is
cleared when bit 3
as
a logic zero to ensure proper operation
(b3)
of
the
TCR
TCR
or
MaR
is
written to a logic one; however,
with
read-modify-write instruc-
example).
are
initialized to
is
cleared and the timer interrupt request mask (TCR,
are
initialized by the corresponding mask option register (MaR) bits at reset. They are
selectable after reset (if the TOPT bit
an
all
ones condition; the timer interupt request
b6)
is
set.
TCR
(b6)
in
the MORE
is
equal to zero).
to
a maxi-
option selects
bits
bO,
b1,
b2,
Note that the timer
figurations:
a)
mode to emulate a mask
mode, all
the
b1,
bit
TCR
MaR
controlled mode, for
and
bO
have no effect on a write (always
b3
is
write-only (reads
on a write (reads
5.3.1 Software Controlled Mode
The TOPT (timer option) bit
select the software controlled mode, which
to
block diagrams
software controlled mode via the timer control register (TCR), and
ROM
bits are read/write, except bit
as
as
a logic
one~.
(b6)
give the program direct control
The timer
prescaler input frequency (fPIN)
in
Figures 5-3 and 5-4 reflect
version
all
with
four devices,
the mask option register.
b3
which
is
TCR
bit
b7
read
as
logic ones). For the MC68705R3/ MC68705U3,
logic zero), and for the MC68705R5/MC68705U5, bit
in
the mask option register
is
described first.
of
the prescaler and input select options.
can
be
configured for three different operating modes
plus a disable mode, depending upon the value written to
When the
two) and
generation
When
timer input. This mode
gates in the internal clock for the duration
TIE
and TIN bits
TIMER input pin
as
well
TIE=
1 and TIN =
are
programmed to zero the timer input
is
disabled. The internal clock mode
as
a reference for frequency and event measurement.
0,
the internal clock and the TIMER input pin signals
can
be
used to measure external pulse widths. The external pulse simply
of
the pulse. The accuracy
plus or minus one count.
TIE= 0 and TIN =
When
1,
no prescaler input frequency
disabled.
two
separate timer control con-
b)
MaR
controlled
In
the software controlled
write-only (always reads
and
b6
are read/write
is
EPROM
TCR
control bits
programmed to a logic zero
TCR
bits
is
from the internal clock (phase
can
be
used
of
is
applied to the prescaler and the timer
as
a logic zero).
and
bits
b5, b4,
b3
has
b5,
b4,
b3,
b2, b1,
b4
and
b5
(TIE and TIN).
for periodic interrupt
are
ANDed to form the
the count
in
this mode
In
b2,
no effect
and
bO
is
is
When
TIE
clock
can
and TIN
be
are
both programmed
to
used to count external events
a one, the timer
as
well
as
provide
is
from the external clock. The external
an
external frequency for generating
periodic interrupts.
Bits
bO,
b1,
and
b2
in
the
TCR
are program controlled to choose the appropriate prescaler output.
The
prescaling divides the prescaler input frequency by
1,
2,
4, etc.
in
binary multiplex to
ducing counter input frequency to the counter. The processor cannot write into or
5-8
read
128
pro-
from the
Page 37
prescaler; however, the prescaler
written data
5.3.2
The
MOR
MOR
timer
register
equals one), which allows for truncation-free counting.
MOR
Controlled Mode
controlled mode of the timer
is
programmed to a logic one
clock source. The timer circuits
(TCR)
is
configured differently,
is
set
to
all
ones by a write operation to TCR,
is
selected when the TOPT (timer option) bit
to
emulate the MC6805R2 mask-programmable prescaler and
are
the
same
as
described above, however, the timer control
as
discussed below.
b3
(when bit 3 of the
(b6)
in
the
The logic level for the functions of bits
EPROM
of
programming. They
are
(MOR, $F38l. The value programmed into
sion and the timer clock
read
(when
by software, these five
mable configuration, the TIM
as
software
described above. Bit
MC68705U3 always
selection. Bit
reads
as
(b6)
a logic zero and
bO,
bl,
controlled by corresponding bits within the mask option register
MOR
b4
(TIE)
TCR
bits always
and
TIR
(b7)
b3
of
the
TCR
however, for the MC68705R5/MC68705U5 bit
always
MC6805R2 which
reads
as
a logic one. The
has
only TIM, TIR, and
MOR
controlled mode
PSC
manufacturing mask options.
5.3.3 Timer
The configuration
mask option register
and the other for
TOPT =
are
user programmable via the MOR. A description of
Figures
Control Register (TCR)
of
the
TCR
is
determined by the logic level
(MORl. Two configurations
TOPT =
0,
it provides software control of the
5-3
and 5-4).
b7 b6 b5
TIR
O.
TOPT = 1 configures the
TCR
with
MOR
b4
TIM ! PSC* ! 1 !Register
TCR.
TOPT= 1 (MC6805R2 Emulation)
b3
*For the MC68705R3/MC68705U3 write only,
reads
as
a one and
has
no effect
on
the prescaler.
b2,
and
b5
in
the
TCR
are
all
determined at the time
bits
bO,
bl,
b2,
and
b5
controls the prescaler divi-
is
set to a logic one
read
as
logic ones). As
bits of the
(in the
can
be
b3
is
in
the
of
TCR
MOR
controlled mode) for the
written to a logic one to clear the prescaler;
set to a logic one and when
TCR
and
the
TCR
TCR
When TOPT =
each
b2
bl
reads
as a zero-for
in
the
MOR
in
the software program-
are
controlled by the counter and
is
designed
has
of
bit 6 (timer option, TOPT)
are
shown below, one for TOPT = 1
to emulate the
1,
TCR
to
exactly emulate the
the prescaler options defined
MC6805R2.
the prescaler
bit
is
provided below (also
bO
Timer Control
the MC68705R5/MC68705U5
controlled mode
MC68705R31
read
by software
in
the
When
"mask"
options
see
$009
as
*Write only,
b7,
TIR
Timer Interrupt Request register
1 = Set when the timer data register changes to
0=
TCR
with
MOR
TOPT = 0 (Software Programmable Timer)
b7
"""-T-I
b6
R~-T-I-M"""'T"'-T-I
reads
as
a zero.
b5
b4
N~-TI-E"""'T"'I
-PS-C-*"""I-P-S-2--r--
Used
underflow when it
Cleared
by
external reset or under program control
is
a logic one.
b3
b2
bl
bO
-
"""--PS-0-"IRegister
l
P-S
to
initiate the timer interrupt or signal a timer data
all
zeros.
Timer Control
$009
5-9
Page 38
b6,
TIM Timer Interrupt Mask -
logic one.
Set by
an
1 =
0=
Cleared under program control.
b5,
TIN External or Internal - Selects the input clock source to
8)
or the internal phase two.
Selects the external clock source.
1 =
0=
Selects the internal phase
b4,
TIE
External Enable - Used
(if TIN =
clock
When
Enables
1 =
0=
Disables external TIMER pin.
external reset or under program control.
0)
regardless of the external TIMER pin state (disables gated clock feature).
TOPT =
1,
external TIMER pin.
Used
to
enable the external TIMER (pin
TIE
is
always a logic one.
to inhibit the timer interrupt
two
(fOSC+4) clock source.
to
the processor when
be
either the external TIMER (pin
8)
or
to
enable the internal
it
is
a
TIN
TIE
TIN-TIE
CLOCK
MODES
a a Internal Clock (phase two)
a 1 Gated (AND)
1 a No Clock
1 1 External Clock
b3,
PSC
Prescaler Clear - When TOPT =
BSET
and
BCLR
on
the
TCR
which clears the prescaler. When TOPT =
MC68705R3/MC68705U3; however, for the MC68705R5/MC68705U5 this bit
read
as
a logic one and
b2,
PS2
Prescaler Select - These bits
bl,
PSl scaler division resulting from decoding these bits.
bO,
PSO
PS2
PSl
PSO
a
a a
a
a
1
1
1
1
a
a
1
1
a
1 1 8
a a
a 1
1
a
1 1
of
External and Internal Clocks
a,
this
function correctly. Writing a one into
has
no effect
are
Prescaler
1 (Bypass Prescaler)
2
4
16
32
64
128
on
decoded to select one of eight outputs
Division
is
a write-only bit. It
1,
operation remains the same for the
the prescaler.
reads
as
a logic zero
PSC
generates a pulse
on
the timer pre-
is
always
so
the
When changing the
the
same
write cycle to clear the prescaler. Changing the
prescaler may cause
NOTE
PS2-PSO
an
bits
in
software, the
extraneous toggle of the timer data register.
5-10
PSC
bit should
be
written to a one
PS
bits without clearing the
in
Page 39
SECTION 6
SELF-CHECK
The self-check capability
puters provides
in
Figure
1O-volt level (through a
RESE'F
button, energizes the ROM-based self-check feature. The self-check program exercises the
ROM, TIMER, interrupts,
RAM,
MC6805R3.
Several
tion. They
the timer input
6.1
The RAM self-check
for the MC6805R3/MC6805U3. If any error
the
MC6805R3/U3 test
The RAM test must
cell except for
The A and
6.2 ROM CHECKSUM SUBROUTINE
The
for the MC6805R3/MC6805U3.
of
RAM SELF-CHECK SUBROUTINE
Z bit
ROM
an
6-1
and monitor the output of port C bit 3 for
the self-check subroutines
are
the RAM, ROM,
is
the internal phase
is
set. The walking diagnostic pattern method
$07F
X registers and
self-check
of
the MC6805R2, MC6805U2, MC6805R3,
internal check to determine if the part
10k
resistor)
is
called at location
causes
each
be
called with the stack pointer at
and
$07E
which
all
RAM locations except
is
called at location $F8A for the MC6805R2/MC6805U2 and at location
and
can
and
four-channel
two
byte to
are
on
1/0 ports,
count
assumed
and
MC6805U3 microcom-
is
functional. Connect the MCU
an
oscillation of approximately 7 hertz. A
the timer input, pin
as
well
be
called by a user program with a JSR or
AID
tests. The timer routine may also
clock.
$F6F
for the MC6805R2/MC6805U2 and at location
is
detected, it returns with the Z bit
from 0 up
$07F.
to
contain the return address.
$07F
8,
and pressing then releasing the
as
the
AID
for the MC6805R2 and
cleared;.
is
used
on
the MC6805R2/U2. The
to
0 again with a check after
When run, the test checks every RAM
and
$07E
are
modified.
as
BSR
instruc-
be
called if
otherwise
each
shown
$F84
count.
$F95
The A register should
is
detected,
error
the test
6.3 ANALOG-TO-OIGITAL CONVERTER SELF-CHECK
The analog-to-digital self-check for the MC6805R2
at
bit
passes.
$FAE.
For both devices; it returns with the Z bit cleared if any error was found; otherwise the Z
is
set.
be
cleared before calling the routine
it
retu
rns
with the Z bit cleared; otherwise Z =
RAM location
$040
is
overwritten.
is
called at location $FA4
6-1
in
the MC6805R3/MC6805U3. If any
1,
X = 0 on retu rn, and A
and
for the MC6805R3
is
zero if
Page 40
+5
+
.25V
_
...
10V
--
RESET
1.
1.0--
...
..L
T
.L
-
JLFT
*~
4.00E-2
MHz 7
~
----.l1
~
r
..
...l.. 1.0
JLF
:c
-L~
-
It=::;
-
10
k
AAA
LED
Y;
Y
5100
.....
If
LED
..... ~ ....
~ED""'/;A~l~O
LED
.....
~r'
-.
A A
~1l>sr
......
~122"''''
.........
O.lJLF
1
2
3 INT
4
5
9
10
11
12
...n
15
16
.J..§
19
20
~
-
VSS
RESET
VCC
EXTAL
XTAL
NUM
(N/C)**
TIMER
PCO
PCl
PC2
PC3
PC4
PC5
PC6
PC7
P07
P06/(INT21
P05
P04
PA7
PA6
PA5
PA4
PA3
PA2
PAl
PAO
PB7
PB6
PB5
PB4
PB3
PB2
PBl
PBO
POO
POl
P02
P03
40
39
~
.R.
36
35
34
33
32
31
~
~
28
27
~
~
24
23
22
21
-
* This connection depends on clock oscillator user selectable mask option. Use jumper
* * For the MC6805R2/MC6805U2 pin 7
not
connected. .
is
is
not
for
user application and must be connected
PCO
PCl
1 0
0 0 1 0
1 1
0
1
a a
Anything else bad
PC2
1
0
All Flashinq
Figure
LED
PC3
1
a
0 0
a 0
a a
a a
Part, Bad Port
6-1.
Self-Check
Meanings
Remarks
[l:LED
Bad
I/O
Bad
Timer
Bad
RAM
Bad
ROM
Bad
AID
Bad
Interrupts
Good Device
C,
etc.
ON;
O:LED
or
Request
Connections
6-2
if
the
RC
mask option
to
VSS. For the MC6805R3/MC6805U3 pin 7
OFF]
Flag
is
selected.
Page 41
The A and X register contents
= 8 and
X
port connections.
6.4 TIMER SELF-CHECK SUBROUTINE
The timer self-check
for the MC6805R3/MC6805U3. If any error was found,
the Z bit
In
source and interrupts must
not set
The A and X register contents
how
since the prescaler
routine
prescaler fordivide-by-128 and the timer data register
count down the same
cycles until they both count down to zero. Any mismatch during the count down
error.
AI
D channel 7
is
is
set.
order
to
work correctly
so
the caller must protect from interrupts if necessary.
many times the clock counts in
is
a power of two. If not, the timer probably
also detects a timer which
In
the MC6805R3/U3, the A and X registers
are
lost. The X register must
is
selected. The
called at location
as
a user subroutine, the internal phase
be
disabled. Also,
are
as
the timer data register. The
AI
D test
uses
$FCF
for the MC6805R2/MC6805U2 and at location
on
exit, the clock
lost. The timer self-check routine
128
cycles. The number of counts should
is
not running. In the MC6805R3/U3, this routine sets the
be
set to four before the call.
the internal voltage references and confirms
it
returns with the Z bit cleared; otherwise
two
clock must
is
running and the interrupt mask
in
the MC6805R2/U2 counts
is
not counting correctly. The
is
cleared. The X register
two
are
registers
cleared
are
then compared every
on
exit from the routine.
be
the clocking
be
a power
is
configured to
is
considered
On
return,
$F6D
of
two
128
an
is
6-3/6-4
Page 42
Page 43
SECTION 7
CLOCK,
7.1 RESET
The MCU
RESET,
can
be
reset three ways: by initial powerup, by the external reset input
optional internal low-voltage detect circuit (not available
versions). The
A typical reset Schmitt trigger hysteresis curve
level.
provides
RESET
input consists mainly
an
internal reset voltage if it senses a logical zero
Out
Reset
Reset
AND
INTERRUPT STRUCTURE
of
a Schmitt trigger which senses the
Of
In
11
1.....--+--+--1-+-"...----
0.8
V 2 V 4 V
VIRES-
VIRES+
on
the MC68705U3 or MC68705R3
is
shown
in
Figure
7-1.
The Schmitt trigger
on
the
RESET
pin.
,
(RESET)
mTI
and by
EPROM
line logic
an
Figure 7-1. Typical
7.1.1 Power-On Reset
An internal reset
delay
of
tRHL milliseconds
(POR)
is
generated upon powerup that allows the internal clock generator to stabilize. A
is
power and reset timing diagram
lustrated
switches
Vee
RESET
Pin
Internal
Reset
in
.on
Figure
5V
ov
7-3)
(removes
-------
typically provides sufficient delay. During powerup, the Schmitt trigger
reset)
when
;Reset
Schmitt Trigger Hysteresis
required before allowing the
of
Figure 7-2. Connecting a capacitor to the
RESET
Figure 7-2. Power and Reset Timing
rises
to VIRES +,
RESET
7-1
input to go high. Refer to the
RESET
input
(as
il-
Page 44
1.01'F
Typical
Delay
Capacitor
* Disable LVI
.... -____
POR
-+-4
Pin2
Charging
Current
Source
(Optional)
7.1.2 External Reset Input
The MCU will
machine cycle
an
vide
7.1.3 Low-Voltage Inhibit (LVI)
be
reset
if
a logical zero
(tcycl. Under this type
internal reset voltage.
Figure 7-3.
FfESET
is
applied
of
reset, the Schmitt trigger switches
Configuration
to
the
RESET
input for a period longer than one
off
at
VIRES-
to
pro-
The optional low-voltage detection circuit (not available on the MC68705R3, MC68705R5,
MC68705U3,
certain
one tcyc minimum.
voltage glitches
directly
through a resistor. The
recovery
7.2
INTERNAL CLOCK GENERATOR OPTIONS
The internal clock generator circuit
crystal, a resistor, a jumper wire, or
various stability/ cost tradeoffs. The mask option register (EPROM)
or
resistor operation. The oscillator frequency
and MC68705U5) causes a reset
level (VLVI). The only requirement
In
typical applications, the
of
less
than one tcyc. The
to
the internal reset circuitry. It also forces the
internal reset will
of
the MCU
is
that VCC remains at or below the VLVI threshold for
VCC
output
be
removed once the power supply voltage rises above a
if
the power supply voltage falls below a
bus filter capacitor will eliminate negative-going
from the low-voltage detector
RESET
pin
low
level (VLVR), at which time a normal power-on-reset occurs.
is
designed
an
external signal may
to
require a minimum
be
used to generate a system clock
is
internally divided by four
is
connected
via a strong discharge device
of
external components. A
is
programmed
to
select crystal
to
produce the internal
with
system clocks. For MC6805R2, MC6805U2, MC6805R3, and MC6805U3 a manufacturing mask option
is
used
to
select crystal or resistor operation.
The different connection methods are shown
board layouts
crystal oscillator start-up time
The
RS), oscillator load
sure rapid
are
given in Figure 7-5. A resistor selection graph
is
a function
capacitances,
IC
parameters, ambient temperature, and supply voltage. To en-
oscillator start up, neither the crystal characteristics nor the load capacitances should ex-
ceed recommendations.
in
Figure 7-4. Crystal speCifications and suggested
is
given in Figure 7-6.
of
many variables: crystal parameters (especially
7-2
PC
Page 45
(See Note 2)
~CIOCk
CL
External
Input
6
XTAL
c=l
5
EXTAL
(Crystal Option,
I
6 XTAL
5 EXTAL (Crystal Option,
See
See
MCU
Note
MCU
Note
6
XTAL
5
1)
_'HH
R
(See
Figure 7-5) 5 EXTAL
1)
Connection
EXTAL
Approximately 25% to 50% Accuracy
___
6 ... XTAL
No
MCU
mc
Option,
See
Note
Typical
tcyc=
External Jumper
MCU
(RC
Option,
See
Note
1.25
1)
p's
1)
External Clock
NOTES:
1.
For the MC68705R3, MC68705U3, MC68705R5, and MC68705U5 MOR
tion. When the
When the
2.
The recommended
nal
capacitance
pin should
and approximately
TIMER input pin
TIMER input
CL
of
approximately
be scaled
as
25
is
is
value
the inverse
pF
in the VIHTP range (in the bootstrap
at or below VCC, the clock generator option
with
a 4.0 MHz crystal
25
pF
on the XTAL pin. For crystal frequencies other than 4 MHz, the total capacitance on each
of
on XT AL. The exact value depends
the frequency ratio. For example, with a 2 MHz crystal, use approximately
Figure
7-4.
is
27
pF
maximum, including system distributed capacitance. There
Clock
b7
= 0 for the crystal option and
EPROM
is
determined by bit 7 of the Mask Option Register (CLK)'
on
the Motional-Arm parameters
Generator
Options
When utilizing the on-board oscillator, the MCU should remain
voltage below
are
involved
VIRES
+)
until the oscillator
in
calculating the external reset capacitor required
has
stabilized at its operating frequency. Several factors
Approximately 10% to 25% Accuracy
(Excludes Resistor Tolerance)
programming mode), the crystal option
in
a reset condition (reset pin
to
satisfy this condition: the
oscillator start-up voltage, the oscillator stabilization time, the minimum
charging current specification.
Once
VCC
minimum
on
dent
it
the capacitor value. The charging current
appears almost like a constant current source until the reset voltage
Therefore, the
Assuming the external capacitor
RESET
is
reached, the external
RESET
is
pin will charge at approximately:
(VIRES
+ )eCext= IRESetRHL
is
initially discharged.
capacitor will begin to charge at a rate depen-
supplied from
VCC
through a large resistor,
External Resistor
MOR
of
the crystal used.
VIRES
+,
rises
above
b7
= 1 for the
50
and
RC
is
forced.
is
an
inter-
pF
on EXTAL
the reset
VIRES
op-
so
+.
7-3
Page 46
(a)
C,
(b)
EXTAL . .
5 ~ 6
..
'
S .XTAL
0-R
C
AT - Cut Parallel Resonance Crystal
Co=7
pF
Max
Freq.=4.0
R S =
Piezoelectric ceramic resonators which
have the
used instead
ceramic resonator manufacturer's· suggestions for
Figure
7-5.
and
Suggest~d
MHz @
CL
50
ohms Max.
equivalent specifications may
of
crystal oscillators. Follow
CO,
C"
NOTE:
Keep
Crystal
Motional-Arm
=24
and
RS
crystal leads and circuit connections
PC
Board
pF
values.
Parameters
Layout
be
(e)
as
short
as
possible.
B.O
,...-...--------""---.,...---------,
7.0
~
6.0
g 5.0
Q)
::J
g 4.0
U::
o 3.0
~
.5l
2.0
o
'.0
0
0
10
Figure
7-:-6.
Resistor
20
Typical
(RC
30
40
Resistance
Frequency
Oscillator
7-4
VCC=5.25V
TA=25°C
50
(kOl
Selection
Option)
60
70
for
BO
Page 47
7.3
INTERRUPTS
The microcomputers
put pin, the internal timer interrupt request, the external
can
be
interrupted four different ways: through the external interrupt
port D bit 6 (lNT2) input pin, or the soft-
(ll\ff)
in-
ware interrupt instruction (SWI). When any interrupt occurs: the current instruction (including
SWI)
is
completed, processing
interrupt bit
(I) in the condition code register
from the appropriate interrupt vector address,
CPU
register, setting the I bit,
A flowchart
of
the interrupt sequence
with a return from interrupt (RTI) instruction which allows the
is
suspended, the present
is
set, the address of the interrupt routine
and
the interrupt routine
and
vector fetching require a total of
is
shown
in
Figure
7-7.
CPU
state
is
pushed onto the stack, the
is
is
executed. Stacking the
11
tcyc periods for completion.
The interrupt service routine must
MCU
to resume processing
obtained
end
of
the
1-1
(inCC)
07F-SP
O-DDRs
CLR
iNi Logic
FF-Timer
7F
- Prescaler
7F-TCR
7F-MR
Put
FFE
on
Address Bus
MC68705R3/ MC68705U3
M C68705R5/ MC68705U5
Load
Options From
MaR
($F38)
Logic
Load
PC
From
FFE/FFF
Into
Control
Fetch
Instruction
Execute
Instruction
Clear
INT
Request
Latch
Timer
Stack
PC,X,A,CC
1-1
Load
PC
From:
SWI: FFC/FFD
INT: FFA/FFB
Timer or
INT2: FFS/FF9
Figure
7-7.
Reset
and
Interrupt
7-5
Processing
Flowchart
Page 48
program prior to the interrupt (by unstacking the previous
interrupts do not cause the current instruction execution to
is
until the current instruction execution
complete.
CPU
state). Unlike
be
halted, but
li'ESEf,
are
considered pending
hardware
When the current instruction
if unmasked, proceeds with interrupt processing; otherwise the next instruction
is
complete, the processor checks
all
pending hardware interrupts and
is
ecuted. Note that masked interrupts are latched for later interrupt service.
If both
an
external interrupt and a timer interrupt are pending at the end
the external interrupt
is
serviced first. The SWI
is
executed
as
of
an
instruction execution,
any other instruction.
NOTE
The timer and INT2 interrupts share the same vector address. The interrupt routine must
(TCR
b7
determine the source by examining the interrupt request bits
TCR
b7
and
MR
b7
can
only
be
written to zero by software.
TNT
and
fI\JT2,
The external interrupt,
signal. The INT2 interrupt
input
the miscellaneous register (MRl. The INT2 interrupt
is
always
read
as
a digital input on port
MCU to process
an
interrupt when the condition code I bit
A sinusoidal input signal (fINT maximum)
zero-crossing detector. This
ing/
disengaging
ac
power control devices. Off-chip full wave rectification provides
every zero crossing of the
A software interrupt
I bit
in
the
the condition code register. SWls
(SWI)
allows applications such
ac
signal and thereby provides a 2f clock.
is
an
are synchronized and then latched
has
an
interrupt request bit (bit
is
D.
The
fI\IT2
and timer interrupt request bits, if set, cause the
can
be
used
as
executable instruction which
are
usually
7)
and a
inhibited when the mask bit
is
clear.
to generate
an
servicing time-of-day routines
is
executed regardless
used
as
breakpoints for debugging or
and M R
on
the falling edge of the
mask
bit (bit
external interrupt for
See
Figure 7-8.
system calls.
(a)
Zero-Crossing Interrupt
(b) Digital-Signal Interrupt
Vcc
fetched and
b7).
Both
6)
located
is
set. The INT2
use
and
engag-
an
interrupt
of
the state of
ex-
as
in
a
a~
as
ac
Input
(tINT Max.l ---'\Af'v---..-
Rs1
ac Input
~10
ICurrent
MO
Vacp-p
.....
---I
Figure
7-8.
MCU
Typical
7-6
Interrupt
4.7 K
TTL
Level 3
Digilal--
Input
Circuits
.....
--I
lJ
iNf
MCU
Page 49
SECTION 8
INPUT/OUTPUT CIRCUITRY
ANALOG-TO-DIGITAL CONVERTER
8.1
INPUT/OUTPUT CIRCUITRY
There
are
32
input/
output pins. The INT pin may
additional input pin. All pins
under software
is
accomplished by writing the corresponding bit
ing
logic zero for input.
control of the corresponding data direction register (DDR)' The port
On
input mode. The port output registers
reset
on
ports A,
all
the DDRs
B,
are
are
ware before changing the DDRs from input to output. A
an
output will
to
due
Internal
Connections
read
the contents of the output latch regardless of
output loading. Refer to Figure 8-1.
be
polled with branch instructions
and C
are
in
initialized
not initialized
AND
to
programmable
the port
to
a logic zero state, placing the ports
on
reset and should
read
operation
as
either inputs or outputs
I/O
DDR
to a logic one for output or a
be
initialized by soft-
on
a port programmed
the
logic levels at the output pin,
provide
an
programm-
in
the
as
* DDR
* * Port
Band
See SECTION
is
a write-only register and reads
C are three-state ports. Port A
11
ELECTRICAL CHARACTERISTICS.
Figu
as
all ones.
has
optional internal pullup devices to provide CMOS data drive capability.
re
8-1. Typical Port
8-1
I/O
Data
Direction
Register
Bit
,
,
0
Circu itry
Latched
Output
Data
Bit
0
,
X
Output
State MCU
0
, ,
Hi~Z*
Input
*
To
0
Pin
Page 50
All
inputloutput
patible
as
port
B,
C,
corresponding DDR. When programmed
lines
are
TTL compatible
as
both inputs and outputs. Port A lines
are
outputs (mask option on the MC6805R2, MC6805U2, MC6805R3, and MC6805U3) while
and 0 lines are CMOS compatible
as
inputs. Port 0 lines are input only; thus, there
as
outputs, port b
is
capable of sinking
10
and sourcing 1 milliampere on each pin.
0 provides the reference voltage, INT2, and multiplexed analog inputs for the MC6805R2,
Port
MC6805R3, MC68705R3,
puts. Port
VRH
and
VRl
and
PD5)
and
VRl
are
VRH
0 may always
are connected to the appropriate reference voltages.
internally connected
recommended input voltage range.
and MC68705R5. All
be
used
as
digital inputs and may also
to
the
AID
of
these lines
are
shared with the port 0 digital in-
be
used
TheVRl
resistor. Analog inputs may
as
analog inputs providing
and VRH lines (PD4
be
prescaled to attain the
CMOS com-
is
no
milliamperes
The address maps
register configuration
in
Section 3 give the addresses
is
provided
tions.
The corresponding DDRs for ports A,
$005,
and
are read-modfiy-write
"unaffected"
using a
PA7
PA6
PA5
PA2
PAl
PAO
PB7
PB6
PB5
PB3
PB2
PBl
PBO
single-store instruction.
40
Port A, bit 7
put. Bit 7 driving
driving
output option.
10mA
~.
~10mA
Port B, bit 0
put, driving
$006), A read
bits would
(CMOS Loads)
(1
TTL Load)
one
.--~.....--+
operation on these registers
in
function, they cannot
be
and
bit 4 programmed
CMOS loads and bit 4
TTL load directly using CMOS
and
bit 1 programmed
LEOs
directly.
of
data registers and data direction registers. The
in
Figure 7-6. Figure 8-2 provides some examples
CAUTION
B,
and C are write-only registers (registers at
is
undefined. Since BSET and
be
used
to
set or clear a single
set).
It
is
recommended that
PB7
32
PB6
31
PB5
30
PB4
29
PB3
28
PB2
27
as
out-
PBl
26
PBO
25
16
out-
PC7
PC6
PC5
PC4
PC3
PC2
PCl
PCO
15
14
13
12
11
10
9
V
as
all
DDR
bits
-'Ib
1.0
mA
~""'''''''JV'''''--'
Port
B,
bit 5 programmed
ing Darlington-base directly.
Port
C,
bits
0-3
programmed
CMOS loads, using external
driving
pullup resistors.
of
port connec-
DDR
bit (all
in
a port
be
written
2N6386 (Typical)
as
output, driv-
CMOS Inverter
MCl4049/MCl4069
(Typical)
as
output,
$004,
BClR
Figure 8-2a. Typical Port
Connections-
8-2
Output Modes
Page 51
SN74LS04 (Typical)
TTL driving port A directly.
PA7
PA6
38 PA5
PA4
37
PA3
36
PA2
35
PAl
PAO
SN74LS04
(Typical)
PB7
PB6
or MCl4069 •
CMOS or TTL driving port B directly.
PB5
29
PB4
28
PB3
27
PB2
PBl
PBO
PC7
15
PC6
14
PC5
13
PC4
12
PC3
11
PC2·
PCl
PCO
Port D
used
as
4-channel
as
CMOS digital input.
and MC68705R5
CMOS and TTL driving port C directly.
bit 7 used
MC6805R2, MC6805R3,
MC6805R3,
only.
Figure 8-2b. Typical Port Connections-Input Modes
The latched output data bit
all
of
writes
data register
its data bits
and
avoid undefined outputs; however,
modify-write instructions, since the data
(zero) and corresponds to the
8.2
ANALOG-TO-DIGITAL CONVERTER
(see
Figure
8-1)
must always
even
though the port
read
latched output data when the
be
written. Therefore, any write to a port
DDR
is
set to input. This may
care
must
corresponds to the pin
DDR
be
be
exercised when using
level
if the
is
an
output (onel.
The MC6805R2, MC6805R3, MC68705R3 and MC68705R5 microcomputers have
digital
(AI
D)
converter implemented
shown
in
Figure 8-3. Up
to
four external analog inputs,
through a multiplexer. Four internal analog channels may
(VRH-VRL VRH-VRL/2, VRH-VRL/4, and
on
the chip using a successive approximation technique,
via
port
0,
are
connected
be
selected for calibration purposes
VRU· The accuracy of these internal channels will not
necessarily meet the accuracy specifications of the external channels.
PDO/ANO
PD1/ANl
PD2/AN2
22
21
PD3/AN3
20
19
VRH
PD6/1NT2
18
PD7
AID
used
to initialize the
DDR
an
8-bitanalog-to-
to
VRL
input with
is
an
input
the
read-
as
AID
The multiplexer selection
8-1. This register
is
cleared during any reset condition. Refer
tion.
is
controlled
by
the
AID
control register (ACR) bits
to
Figure 7-6 for the register configura-
8-3
0,
1,
and
2;
see
Table
Page 52
D/A
15
kO
(Typ)
Control
Logic
Count
PDQ/ANO
PD1/ANl
PD2/AN2
PD3/AN3
Whenever the
(ACR bit
7)
is
1-of-8
Select
Multiplexer
AID
Control Register
ACR1
ACR2
0
0
0
0
1
1
1
1
* Internal (Calibration) Levels
ACR
is
written, the conversion
cleared,
and
the selected input
Figure
8-3.
AI
D
Table
8-1.
AI
D
Input
ACRO
0 0
0
1 0 AN2
1 1 AN3
0 0
0 1
1
1 1
Input Selected
1 AN1
0
ANO
VRH*
VRL*
VRH/4*
VRH/2*
in
is
sampled for five machine cycles and held internally.
progress
I.-
.....
Block
--.L_"--'---'-_"-
Diagram
MUX
Selection
AI
D Output (Hex)
Typ
Min
FE
FF FF
00
00
3F
40
7F
80
is
aborted, the conversion complete flag
During these five cycles, the analog input will appear approximately like a
capacitor
(plus approximately
Refer to Figure
8-4.
10
pF
for packaging) charging through a 2.6 kilohm resistor (typical).
8
AID
Result
.....
--'
Register
Max
01
41
81
25
picofarad (maximum)
The converter operates continuously using
sampled analog input. When the conversion
placed
in
the
AID
result register (ARR), the conversion complete flag
sampled again, and a new conversion
TheA/D
port D pins. An input
VRL converts to
is
imum
analog input should
is
ratiometric. Two reference voltages (VRH and VRU
$00.
provided. Similarly,
and
minimum ratings must not
voltage equal
An input voltage greater than
an
input voltage
use
VRH
as
is
started.
to
VRH
converts to
less
than VRL, but greater than VSS converts to
be
exceeded. For ratiometric conversion, the source
the supply voltage and
30
machine cycles to complete a conversion
is
complete, the digitized sample
is
are
$FF
VRH
(full
converts to
be
referenced to VRL. To maintain the full
supplied to the converter via
scale)
and
$FF
and no overflow indication
of
set, the selected input
an
input voltage equal
8-4
of
digital value
$00.
Max-
of
each
the
is
is
to
Page 53
Figure
8-4.
Device
Analog
Input
Effective
Channel
Select
Analog
Input
Inpedance
(During
Sampling
Only)
accuracy on the
than
VSS but
than 4
volts.
The
AI
D
±
Y2
LSB, rather than +
point from
Y2
LSB below VRH, ideally. Refer
1
On
release
be
selected and the conversion complete flag will
Converter
Output
(Hex)
has
$00
of
AID,
VRH
should
be
equal to or
less
than the maximum specification and (VRH-VRU should
a built-in
to
reset, the
$01
Y2
LS
B offset intended to reduce the magnitude
a,
-1
LSB
occurs at
AID
Y2
LSB above VRL. Similarly, the transition from
control register (ACR)
with
no offset. This implies that, ignoring errors, the transition
to
Figures 8-5 and 8-6.
FF
FE
FD
FC
FB
FA
F9
F8
08
07
06
05
04
03
02
01
00
1x
2x
vRL
3x 4x
5x
x=_1_*(VRH-VRL)=1
6x
256
less
than VDD, VRL should
is
cleared therefore after reset, channel
be
clear.
Error Convention
±2
LSBs
250x
251x 252x 253x 254x 255x vRH
LSB
be
equal to or greater
be
equal to or greater
of
the quantizing error to
$FE
to
$FF
occurs
zero
will
Figure
8-5.
Ideal
Converter
8-5
Transfer
Characteristic
Page 54
Digital
Output
Offset
(Positive)
Digital
Output
FF
FF
00
K..
,/
,/
________
(a)
Offset Error
,/,/\
/ Ideal
,/
(b) Full
,/
Scale
,/
,/
,/
,/
Analog Input
Error
...,.
__
~~
Analog Input
Full
Scale
Error
(e)
Non-Linearity
Digital
Output
FF
- - - - - -
00 Analog Input
Non-
Linearity
Figure 8-6. Types
(VRH-1
of
Conversion Errors
8-6
LSB)
Page 55
SECTION 9
MASK
The
information in this section pertains only to the MC68705R3, MC68705U3, MC68705R5, and
MC68705U5 EPROM versions
9.1
MASK OPTIONS
The MC68705R3, MC68705U3, MC68705R5, and MC68705U5 mask option registers are im-
in
plemented
ing (if erased),
When used
junction
b3
is the secure/non-secure mode option
MC68705R3/MC68705U3), and b4 is
the
timer prescaler. Bit
grammed
If
the MOR timer option (TOPT) bit is a zero, the MC6805R3 and MC6805U3 are emulated. Here,
bits
b5,
zation the
EPROM. Like
to
emulate the MC6805R2 and MC6805U2, five
with
the prescaler. Of the remaining, the
b6
determines the timer option selection. The value
to
configure the TCR
b4, b2, b1, and
TCR
bO
is
software controllable.
OPTIONS AND PROGRAMMING
of
the M6805 Family.
all
other EPROM bytes, the MOR contains all zeros prior
of
the eight MOR bits are used
b7
bit
is
used
to
select the type
for
the MC68705R5/MC68705U5 only (b3
not
(a
logic one
set the initial value
used. Bits
for
of
bO,
b1, and
MC6805R2/ MC6805U2 emulation!.
their respective TCR bits during reset.
b2
determine the division
of
the TOPT
to
programm-
in
of
clock oscillator,
is
not
used by
bit
(b6)
After
con-
of
the
is
pro-
initiali-
A description
b7,
ClK
TOPT Timer Option
b6,
of
r--:;.;b
1.....1
_c_lK--1...1
* MC68705R5 and MC68705U5 only.
Clock Oscillator Type
=
RC
1
0=
Crystal
VIHTP on the TIMER (pin
1 =
MC6805R2/MC6805U2type timer/prescaler. All bits, except
control register
option register determine the equivalent
0=
MC6805R3/MC6805U3 type timer/prescaler. All TCR bits are implemented
ware programmable
values
tion).
Programming Latch Enable - When cleared, this bit allows the address and data to
latched into the EPROM. When this bit
1 = (set)
0=
(clear) latch address and data into
PLE
is
set during a reset, but may
b1,
J5GE
b2,
VPON (Vpp
EPROM
Program Enable - When cleared,
only
i.e., setting up the byte
PGE
one.
voltage"
VPON being one "disconnects"
dental clearing
is
be
cleared if PIT
1 = (set) inhibit
0=
(clear) enable
is
set during a reset; however, it
ON)
1 = no
0=
"high
VPON being zero does not indicate that the
programming.
normal operating mode.
to
allow programming the EPROM. The bootstrap program manipulates the
so
that users
b6 b5
read
EPROM
inhibited if VPON
- VPON
is
present at the
"high
voltage" on
voltage" on
of
these bits from affecting the normal operating mode .
need
not
be
concerned
b4
b3
b2
I VPON I
is
be
cleared any time. However, its effect on the
is
a logic one.
f5GE
enables programming
is
cleared.
to
EPROM
EPROM
is
a read-only bit and when at a logic zero it indicates that a
It
is
PGE
be
programmed.
programming
programming (if
Vpp
pin.
Vpp
Vpp
pin
PGE
used
as
a safety interlock for the user
must
has
pin
and
. NOTE
no effect on
PLE
with
the
PCR
in
most applications. A
b1
bO
Programming
PGE I PLE
set, data can
EPROM
be
(read disable)
set when changing the address and data;
PIE
is
from the rest
Vpp
level
be
low)
EPROM
of
is
IControl
Register $008
read
from the EPROM.
of
the EPROM.
circuits if VPON
the chip, preventing acci-
correct for
in
the
PGE
is
a logic
be
can
"high
The programming
VPON
PGE
a a a Programming mode (program
1 a
control register functions
PLE
o
PG
Programming Conditions
E and
PLE
disabled from system
are
shown below.
EPROM
a 1 a Programming disabled (latch address and data
1 1
a a
1 a 1 Invalid state; PGE=O
a
1
a
PG
E and
'PIE
disabled from system
1 Invalid state; PGE=O iff
iff
1
"High
voltage" on
1
PGE
and
PLE
Vpp
disabled from system (operating mode)
PIT
= a
PIT = a
9-3
byte)
in
EPROM)
Page 58
9.3 ERASING THE EPROM
The
EPROM
2537
lamps should
The
one inch from the UV tubes.
is
the entered by programming ones into the desired bit locations.
tects both the
9.4 PROGRAMMING FIRMWARE
The MC68705R3, MC68705U3, MC68705R5, and MC68705U5 have
taining a bootstrap program which
$FF6
to pin 8 (TIMER pin) and the
schematic diagram
the
EPROM.
tents
erasing the entire
9.5 PROGRAMMING STEPS
The MCM2532 UV
that
EPROM
or MC68705U5 and the MCM2532
mounted in sockets.
can
be
erased by exposure
to
high-intensity ultraviolet (UV) light with a wavelength
angstroms. The recommended integrated dose (UV intensity x exposure time)
be
used
without
Be
sure that the
EPROM
EPROM
and
$FF7
is
used to start executing the program. This vector
of
a circuit and a summary
It
is
possible to program the
in
the secure mode. The only way to go from the secure mode to the non-secure mode
shortwave filters and the
Ultraviolet erasure clears all bits
CAUTION
window
is
shielded from light except when erasing. This pro-
and light-sensitive nodes.
can
be
used to program the EPROM. The vector at addresses
RESET
pin
is
allowed to rise above
of
programming steps which
EPROM
via
the bootstrap software and validate its con-
EPROM
of
should
the
EPROM
120
bytes
is
fetched when VIHTP
VIRES
be
to the zero state. Data
of
+.
Figure
can
be
EPROM.
EPROM
is
to
be
transferred to the MC68705R3, MC68705U3, MC68705R5, or MC68705U5. Non-
must first
be
programmed
with
an
exact duplicate
of
addresses are ignored by the bootstrap. Since the MC68705R3, MC68705U3, MC68705R5,
are
to
be
inserted and removed from the circuit, they should
In
Be
sure
S1
addition, the precaution below must
CAUTION
and
S2
are closed and
VCC
and +
26 V are
be
observed (refer to Figure 9-1).
not applied when inserting the
MC68705R3, MC68705U3, MC68705R5, or MC68705U5 and MCM2532 into their respective sockets. This ensures that
RESET
is
held
low
while inserting the devices.
of
Ws/cm
2
is
25
positioned about
mask
ROM
con-
is
applied
9-1
provides a
used
to
program
is
by
the information
be
.
When ready to program the
necessary to provide
S1
(to remove reset). Once the voltages
put
control line
PB3
output (COUNT), The counter selects the MCM2532
equivalent
COUNT
EPROM
clocks the counter to the next
VCC
(PB4)
goes high and then low, then the 12-bit counter (MC14040B)
byte selected by the bootstrap program. Once the
MC68705R3, MC68705U3, MC68705R5, or MC68705U5 it
and
+26
volts, open switch
are
applied and both
EPROM
S2
(to apply Vpp and VIHTP), and then open
location. This continues until the
pletely programmed at which time the programmed indicator
the
loop
is
repeated to verify the programmed data. The verified indicator
ming
is
correct.
9-4
S2
and
EPROM
LED
is
S1
are open, the
is
byte which
EPROM
location
EPROM
lit. The counter
LED
lights if the program-
is
only
CLEAR
outclocked by the
is
to load the
is
loaded,
is
com-
is
cleared and
Page 59
co
U,
RESET
2
-
®.
'CC'"
r
4.7 k
1 V
I~
~'
~
~
11\111711')/\
Summary
~
1.
2.
3.
o 1
-L.-
. T
:::~
0.1
lN4001 1.0 a
~
100
{}
4.7 k J 2N2222
@
~
+12
V
~
~~
TO.Ol
...,,..
of
Programming Steps:
When plugging in the MC68705R3, MC68705U3, MC68705R5, or MC68705U5 or the MCM2532
and that V
CC
To initiate programming, be sure
Before removing the MC68705R3, MC68705U3, MC68705R5, or MC68705U5, first close
26
V then remove the MC68705R3, MC68705U3, MC68705R5, or MC68705U5.
+
*'0
100.1
PFT
~,MH~
~"-
I1
':"
75
:~1
':"
VIHTP
2N2222
~
~
1N4001
~
1N4001
4.7 k
~
CC
and +
26
V are
RESET
,
VSS
L
INT
4
Vce
_ 5
EXTAl
XTAl
pF
7
VPP
8 TIMER
25
PBO
26
Programmed
not
applied.
Sl
PB1
//
~.
~
> 470
is
closed,
L!)
::>
L!)
0
r--
~
u
~
0
L!)'
a::
L!)
0
r--
~
u
~
c.,.;
::>
L!)
0
r--
~
u
~
a::
L!)
'"
0
r--
~
u
~
PA5
PA4
PA2
PAO
PB2
27
....
~
~
S2
PA7
PA6
PA3
PAl
PB4
PB3
II
Verified
470
is
closed and
40
39
38
37
36
35
34
33
Vec
29
28
Vce~
Jl
0.1
I
':"
VCC
and +
18
E/All
~
0
a::
0...
w
:><::
("'oJ
~
("'oJ
C'?
L!)
("'oJ
~
u
~
AlO
A9
A8
A7
A6
A5
A4
A3
A2
Al
AO
G
20
19
22
23
1
2
3 2
4
5
6 6
8 9
---u-u-u-
Vpp
17
07
16
06
15
05
14
04
13
03
11
02
10
Dl
9 7 7
DO
24
Vee
Vss
12
~
1
15
14
12
13
4
3
5
CLEAR
COUNT
-::
VCC=
+5.0
VSS=O.OV
Vpp=21.0
25
V are applied. Then open S2, followed by
V (typical)
V ± 1.0 V (Programming Mode)
be
sure that
S2
and then close
Sl.
012
011
010
09
Qj
§
08
0
u
07
~
N
06
-
III
3
05
~
u
04
~
03
02
01
~--
Sl
and
Disconnect
16
VDO
Vss
~
elK
RST
-
S2
are closed
Sl.
Vce
V
e
lo
10
11
-""
-""
.
".
~
.
"
.i
......-
V~C
and
Figure
9-1.
Programming
Connections
Schematic
Diagram
Page 60
Once the
and close switch
socket.
EPROM
has
been programmed and verified, close switch
S1
(to reset). Disconnect
+26
volts and VCC, then remove the
S2
(to remove
Vpp
and VIHTP)
EPROM
from its
9.6 EMULATION
The MC68705R3 and MC68705R5 emulate the MC6805R2 and MC6805R3 while the MC68705U3
and MC68705U5 emulate the MC685U2 and MC6805U3
MC6805R3,
EPROM
below.
1.
2.
3.
and MC6805U3 mask features are implemented
byte. There are a few minor exceptions to the exactness
The
MC6805R21
mented
must
MC6805R3/MC6805U3. (The MC6805R2/MC6805U2 and MC6805R3/MC6805U3
zeros from this area.)
The reserved
change
reserved
and MC68705U5 use this
The MC6805R2/MC6805U2 and MC6805R3/MC6805U3
RAM"
MC6805R3/MC6805U3 mask
(M
in
be
without
ROM
area.
C68705R31
MC6805U2 and
the MC68705R3/MC68705U3 and MC68705R5/MC68705U5 and these
left unprogrammed to accurately simulate the MC6805R2/MC6805U2 and
ROM
areas
notice. The MC6805R2, MC6805U2, MC6805R3, and MC6805U3
for the self-check feature while the MC68705R3, MC68705U3, MC68705R5,
area
This RAM
M
C68705U3
MC6805R31
have different data stored
for the bootstrap program.
is
not implemented
ROM
version, but
and M
C68705R51
MC6805U3
M
"exactly."
in
in
read
in
is
implemented
C68705U5)
MC6805R2, MC6805U2,
the mask option register (MOR)
of
emulation which are listed
"future
them and this data
the MC6805R2/MC6805U2 and
.
all
ones
ROM"
in
their
in
the
areas
is
48
byte
EPROM
are imple1728
bytes
read
all
subject to
use
the
"future
version
4.
The
Vpp
line (pin
versions
MC6805R3/MC6805U3 mask
5.
The
6.
The MC68705R3/MC68705U3 and MC68705R5/MC68705U5
tion
on the MC6805R2/MC6805U2 and MC6805R3/MC6805U3 mask
pin 7
The operation
same way
is
LVI
feature
in
the MEX6805 Support System.
as
previously noted.
of
all
in
all
devices including interrupts, timer, data ports, and data direction registers (DDRs).
7)
in
the MC68705R3/MC68705U3 and MC68705R5/MC68705U5
tied to
other circuitry
VCC
is
not available
for normal operation.
ROM
versions, pin 7
in
the
has
EPROM
In
been
exactly duplicated or designed to function exactly the
version.
normal operation, all pin functions
9-6
In
the MC6805R2/MC6805U2 and
is
grounded
in
normal operation.
EPROM
versions do not func-
ROM
versions, except for
are
EPROM
the same
as
Page 61
SECTION
10
SOFTWARE
10.1
BIT MANIPULATION
The microcomputers have the ability to set or clear any single RAM or
BCLR)
(see
tion registers) with a single instruction (BSET,
can
be
tested using the
state. The carry bit equals the
working with any bit
handle single
The corresponding data direction registers for ports A,
(locations
BSET
tion regiser bit
tion register bits
and
liD
$004,
BCLR
BRSET
in
bits
as
$005,
are
(all
"unaffected" bits would
in
and
BRCLR
value of the bit references by BRSET or BRCLR. The capability of
RAM, ROM, or
control lines.
and
$006), A read
read-modify-write functions, they cannot
a port
be
written using a single-store instruction.
instructions
liD
allows the user to have individual flags
CAUTION
operation
be
set). It
Caution below). Any bit
and
the program branches
B,
and C are
on
these registers
be
is
recommended that
liD
bit (except the data direc-
in
as
a result of its
in
RAM or to
write-only registers
is
undefined. Since
used
to set a data direc-
all
data direc-
page
zero
The coding examples shown
instruction. Assume that the microcomputer
has
external device
time, least significant bit first out
clocks the external device, picks up the data
accumulates the data bit
Device
a data ready signal, a data output line, and a clock line to clock data one bit at a
READY
Serial
Clock
Data
in
Figure
10-1
illustrate the usefulness of the bit manipulation
of
the device. The microcomputer waits until the data
in
a random-access memory location.
I---
2 p
,
OA
~
T
MCU
-
Figure
10-1.
Bit
is
to
communicate
in
the carry flag, clears the clock line, and finally
Manipulation
10-1
with
SELF
CONT
Examples
an
external serial device. The
BRSET
BSET 1 ,PORTA
BRCLR
BCLR
ROR
2,PORTA,SELF
O,PORTA,CONT
I,PORTA
RAMLOC
and
is
test
ready,
Page 62
10.2 ADDRESSING MODES
The microcomputers have ten addressing modes available for
plained briefly
M6805 HMOSIM146805 CMOS Family Microcomputer/Microprocessor User's Manual.
in
the following paragraphs. For additional details
use
by the programmer. They
and
illustrations, refer to the
are
ex-
The term
address from which the argument for
10.2.1
In
opcode. The immediate addressing mode
program execution
10.2.2 Direct
In
following the opcode byte. Direct addressing allows the user to directly address the lowest
bytes
I/O
10.2.3 Extended
In
bytes following the opcode. Instructions with extended addressing modes
ing arguments anywhere
assembler,
The
10.2.4 Relative
The relative addressing mode
tents of the 8-bit signed byte (the offset)
branch condition
addressing
calculating the correct offset if
and checks
"effective address"
Immediate
the immediate addressing mode, the operand
(e.
the direct addressing mode, the effective address of the argument
in
memory with a single two-byte instruction. This address
registers
the extended addressing mode, the effective address of the argument
assembler automatically selects the shortest form of the instruction.
and
128
the user
is
from
to
see
bytes of
need
is
true. Otherwise, control proceeds to the next instruction. The
-126
if it
(EA)
is
used
in
describing the addressing modes.
an
instruction
is
used
g., a constant
in
memory with a single three-byte instruction. When using the Motorola
·not specify whether
to + 129
is
within the span of the branch.
used
to initialize a loop counter).
ROM.
Direct addressing
is
only
used
in
following the opcode
from the opcode address. The programmer
he
uses
the Motorola assembler, since it calculates the proper offset
is
fetched or stored.
is
contained
to access constants which do not change during
an
instruction
branch instructions.
is
in
the byte immediately following the
is
area
includes
an
effective
use
uses
direct or extended addressing.
In
relative addressing, the con-
is
added to the
EA
is
defined
contained
of both memory
is
are
in
a single byte
all
on-chip
contained
capable of referenc-
PC
if, and only if, the
span
need
not worry about
RAM
and
in
of
as
the
relative
the
256
and
time.
two
10.2.5 Indexed, No Offset
In
the indexed, no offset addressing mode, the effective address of the argument
can
8-bit index register. Thus, this addressing mode
are
only
on
instructions
hold the address of a frequently referenced RAM or
10.2.6 Indexed,
In
the indexed, 8-bit offset addressing mode, the effective address
unsigned 8-bit index register and the unsigned byte
byte long. This mode
8-Bit Offset
access the first
is
often
used
I/O
location.
following the opcode. This addressing mode
to move a pointer through a table or to
256
memory locations. These
is
the sum of the contents of the
10-2
is
contained
in
the
is
Page 63
useful
in
selecting the kth element
typically
may begin anywhere within the first
510
10.2.7 Index, 16-Bit Offset
In
the unsigned 8-bit index register and the
mode
allows tables
shortest form
10.2.8 Bit Set/Clear
I
n the bit set/ clear addressing mode, the bit to
following the opcode specifies the direct addressing
or cleared. Thus, any read/write bit
selectively set or cleared with a single two-byte instruction.
10.2.9 Bit Test and Branch
The bit test and branch addressing mode
ing. The bit which
address
Signed
the specified memory location. This single three-byte instruction allows the program to branch
based on the condition
ching
to
be
in
X with the address
($1
FE
is
the last location at which the instruction may beginl.
the indexed, 16-bit offset addressing mode, the effective address
can
be
used
in
a manner similar to indexed, 8-bit offset except that this three-byte instruction
to
be
anywhere
of
indexed addressing.
The corresponding DDRs for ports A,
$005,
and
$006). A read
are
read-modify-write
"unaffected"
written using a single-store instruction.
of
the byte to
relative 8-bit offset
is
from
the carry bit
bits would
-125
of
the condition code registers.
in
is
to
be
be
tested
in
of
any readable bit
to +
130
in
an
n element table. With this two-byte instruction, k would
of
the beginning
256
addressable locations and could extend
two
in
memory. As
operation on these registers
function, they cannot
be
setl. It
tested and condition (set or
is
in
the third byte
from the opcode address. The state
with
in
the first
CAUTION
B,
is
recommended that
is
a combination
the single byte immediately following the opcode byte. The
is
in
of
the table
unsigned bytes following the opcode. This addressing
direct and extended, the Motorola determines the
be
set or cleared
of
the byte
256
locations
and C
are
write-only registers (registers at
is
undefined since BSET and
be
used to set or clear a single
of
direct addressing
clear)
added to the
the first
See
PC
256
locations
Caution under paragraph 10.2;8.
in
the instruction. As such, tables
as
far
as
location
is
the sum
is
part
of
in
which the specified bit
of
memory, including
all
DDR
bits
is
included
if the specified bit.is set or cleared
of
memory. The span of bran-
of
the tested bit
of
the contents
the opcode, and the byte
is
to
be
I/O,
can
$004,
BCLR
DDR
bit
(all
in
a port must
and
relative address-
in
the opcode, and the
is
also transferred
be
of
set
be
in
10.2.10 Inherent
In
the inherent addressing mode,
tained
in
the opcode. Operations specifying only the index register or accumulator,
trol instruction with no other agruments, are included
long.
10.3 INSTRUCTION SET
The MCU
produce
write, branch, bit manipulation, and
the instructions within a given type are presented
has
a set
of
59
207
usable opcodes. They
basic instructions, which when combined
all
the information necessary to execute the instruction
can
be
divided into five types: register/memory, read-modify-
control. The following paragraphs briefly explain
in
10-3
is
as
well
as
in
this mode. These instructions are one byte
with
the
10
addressing modes
each
type. All
individual tables.
concon-
Page 64
10.3.1 Register/Memory Instructions
Most of these instructions
register. The other operand
unconditional (JMP) and jump to subroutine
10-1.
Table
use
two
operands.
is
obtained from meory using one
One
operand
(JSR) instructions have no register operand. Refer to
is
either the accumulator or the index
of
the addressing modes. The jump
10.3.2 Read-Modify-Write Instructions
These instructions
modified value back to memory or to the register
negative or zero
not perform the write. Refer to Table
read
a memory location or a register, modify or test its contents, and write the
(see
Caution under paragraph 10.2.8). The test for
(TST) instructions is included
in
the read-modify-write instructions, though it does
10-2.
10.3.3 Branch Instructions
The branch instructions cause a branch from the program when a certain condition
10-3.
Table
is
met. Refer to
10.3.4 Bit Manipulation Instructions
These instructions
paragraph
10.2.8.
operations. Refer to Table
are
used
on
any bit
One
group either sets or clears. The other group performs the bit test and branch
in
the first
256
bytes of memory;
see
Caution under
10-4.
10.3.5 Control Instructions
The control instructions control the MCU operations during program execution. Refer to Table
10-5.
10.3.6 Alphabetical Listing
The complete instruction set
10.3.7 Opcode Map Summary
Table
10-7
is
an
opcode made for the instructions
is
given
in
alphabetical order
used
10-4
in
on
the MCU.
Table
10-6.
Page 65
Table
10-1.
Register
Memory
Instructions
~
o
0,
Function
Load A from Memory
Load X from Memory LOX AE
Store A
in
Store X
Add
Add
Subtract Memory
Subtract Memory
AND
OR
Exclusive
Arithmetic Compare A
Arithmetic Compare X
Bit
Jump
Jump
Memory
in
Memory STX
Memory
to
Memory and Carry
with
Memory
Memory
with
with
Test Memory
(Logical Compare) BIT
A
Borrow SBC A2 2 2
Memory CMP
Memory CPX
Unconditional
to
from
to
A
with
A ORA
OR
Memory
with
Subroutine JSR
to
A ADC
A
with
A
Mnemonic
A
Code
LDA
STA
ADD
SUB
AND
EOR
JMP
Immediate
Op
# #
Bytes
A6
--
-
AB 2 2 BB 2
A9 2
AO
A4
AA
AS
A1
A3 2 2
A5 2 2
-
---
Cycles
2 2
2
--
2
2 2
2 2
2 2
2 2
--
2
-
2
2
Direct
Op
Code
Bytes
B6
BE
B7
BF
B9
BO
B2
B4
BA
BS
B1
B3
B5
Be 2 3
BD 2 7
# #
2 4
2 4
2 5
2 5
2
2
2 4
2 4
2 4 CA
2
2 4
2 4
2 4
Cycles
4
4
4
4
Op
Cqde
C6
CE
C7
CF
CB
C9
CO
C2
C4
CS
C1
C3
C5
CC
CD
Addressing
Extended
# #
Bytes
3 5
3 5
3 6
3 6
3
3
3
3
3
3
3 5
3
3 5
3 5
3 4
~
Modes
Indexed Indexed
(No
Offset)
Op
# #
Code
Cycles
-5
5
5
5
5
5 FA 1 4
5
S
-
F6
FE
F7
FF
FB
F9
FO
F2
F4
FS
F1
F3
F5
FC
FD
Bytes
1 4
1 4
1 5
1
1 4
1 4
1 4
1 4
1 4
1 4
1
1
1
1
1
Cycles
5
4
4
4
3
7
(8-Bit
Offset)
Op
# #
Bytes
Code
E6
EE
E7
EF
EB
E9
EO
E2
E4
EA
ES
E1
E3
E5
EC
~D
Cycles
2 5
2 5
2 6
2 6
2 5 DB
2 5 D9
2 5
2 5
2 5 D4
2 5
2 5
2 5
2 5 D3 3 6
2 5
2 4 DC
_
2_
,---S
__
Indexed
(16-Bit
Op
Code
D6
DE
D7
DF
DO
D2
DA
DS
D1
D5
~~--
'-~
Offset)
#
Bytes
3
3 6
3
3
3 6
3
3 6
3 6
3
3 6
3 6
3 6
3
3
#
Cycles
6
7
7
6
6
6
5
'------9_
Page 66
Function'
Increment
Decrement
Clear
Complement
Negate (2'8 Complement)
Rotate Left Thru Carry ROL
Rotate Right Thru Carry
Logical
INT Zero-Crossing Voltage. through a Capacitor
RESET
Hysteresis Voltage (See Figure 7-1)
Out of
Reset
Voltage
Reset
Into
Programming Voltage. (Vpp
Programming
Operating Mode
Input Current
TIMER (Vin = 0.4
INT
EXTAl
RESET
(External Capacitor Changing Current)
*Vpp
NUM and
MC6805U2 ROM-based
* * Due to internal biasing. this input (when
Voltage
EPROM
V)
(Vin=O.4
(Vin=2.4
V to
(Vin = 0.4 V Crystal Option) -
(Vin=0.8
is
Pin 7 on
the MC68705U3 and MC68705U5 and
is
connected to VSS in the Normal Operating Mode. The user must allow
(Vee=
VCC=
not
used) floats
+5.25
Vdc ±O.5 Vdc,
5.25 V T A =O°C·
TA=
-40°C
is
connected
to
approximately 2.0
VSS=O
Symbol Min Typ Max Unit
VIH
VIH
VIL
PINT
Cin
VINT
VIRES
+
VIRES-
Vpp*
lin
IRES
to
VCC
in
the Normal Operating Mode. In the MC6805U2.
V.
Vdc,
TA=Oo
VCC-0.5
4.0
VCC-0.5
2.0
2.0
VSS
VSS
VSS
-
-
-
-
2.0
2.1
0.8
20.0 21.0 22.0 V
4.75
-
-
-
-4.0
for
-
-
**
**
-
-
-
**
-
520
580
25
10
-
-4.0
-2.0
VCC
-
20
-
-
-
this difference when emulating the
to
VCC
VCC
VCC
VCC
VCC
VCC+l.0
0.8
1.5 V
0.8
740
800
-
-
4.0
5.75
20
50
10
-1600
-40
700e
V
V
mW
pF
Vac p-p
V
p.A
Pin 7 is
11.7.3 Switching Characteristics
unless
otherwise noted)
Oscillator Frequency
Normal
Instruction Cycle Time (4/fos
iNT.
INT2. or Timer
RESET
Pulse
Width
RESET
Delay Time (External Cap= 1.0
INT Zero Crossing Detection Input Frequency
Clock Duty Cycle
External
Crystal Oscillator Start-Up
*
See
Figure 7-5 for
tYPical
Characteristic
)
c
Pulse
Width
(EXT
Time*
crystal parameters.
p.F)
AU
(Vee=
+5.25
Vdc, ±O.5
11-11
V,
Symbol
fosc
tcyc
tWL.tWH
tRWL
tRHL
flNT
-
-
VSS=O
Min
0.4 -
0.950
tcyc+
tcyc+
100
0.03
40
-
Vdc,
250
250
TA=Oo
Typ
-
--
-
-
-
50
-
to
700e
Max
4.2
10
-
-
1.0
60 %
100
Unit
MHz
"s
ns
ns
ms
kHz
ms
Page 84
MC68705U3
AND
MC68705U5
11.7.4 Port Electrical Characteristics
unless otherwise noted)
Characteristic
Output Low Voltage,
Output High Voltage, ILoad =
Output High Voltage,
Input High Voltage, ILoad=
Input Low Voltage, ILoad=
Hi-Z State
Hi-Z State Input Current (Vin = 0.4
Output Low Voltage,
Output i.ow Voltage,
Output High Voltage, ILoad=
Darlington
Input High Voltage
Input Low Voltage
Hi·Z State Input Current
Output Low Voltage, ILoad= 1.6 mA
Output High Voltage,
Input High Voltage
Input Low Voltage
Hi·Z State Input Current
Input High Voltage
Input Low Voltage
Input Current
Input Current
Current Drive (Source), VO= 1.5 V
ILoad= 1.6 mA
-100
ILoad=
-10
-300
/LA
-500
/LA
(Vin=2.0
ILoad=3.2
ILoad=
ILoad=
mA
10
mA (Sink)
-200
-100
/LA
/LA
V to
V)
/LA
/LA
(Max)
(Max)
VCC)
(Vee=
Port 0 (Input Only)
+5.25
Vdc ±O.5 Vdc,
Port A
Port B
Port C
Symbol
VOL
VOH
VOH
VIH
VIL
IIH
IlL
VOL
VOL
VOH
10H
VIH
VIL
ITS
VOL
VOH
VIH
VIL
ITSI
VIH
VIL
lin
VSS=O
Min
-
2.4 --
VCC-l.0
2.0
VSS
--
-
--
--
2.4
-1.0
2.0
VSS
-
I
-
2.4
2.0
VSS
-
2.0
VSS
-
Vdc,
TA=Oo
Typ Max Unit
-
-
-
-0.8 V
-
-
-
-
-
<2
-0.4 V
-
-
-0.8
<2
-
-
<1
to
0.4
-
VCC
-300
-500
0.4 V
1.0 V
-
-10
VCC
0.8 V
10
-
VCC
10
VCC
0.8 V
5
700e
V
V
V
V
/LA
/LA
V
mA
V
p.A
V
V
V
/LA
V
/LA
11.8
I/O
CHARACTERISTICS
Figures 11-5 through 11-15 illustrate
Simplified port logic diagrams are shown
Figure 11-18, and
curves and logic diagrams
of
variety
applications where non-TTL loading conditions exist.
an
I/O
characteristic measurement circuit in Figure 11-19. The
are
A minimum specification curve (included
limit
of
performance under the conditions shown. The expected minimum and maximum curves
each figure represent the anticipated performance
operating conditions. A typical curve also
intended
I/O
characteristic data for HMOS M6805 Family devices.
in