MOTOROLA 68HC705H12

General Release Specification
Rev. 1.0
A G R E E M E N T
68HC(7)05H12
R E Q U I R E D
HC05H12GRS/D
Rev. 1.0
N O N - D I S C L O S U R E
November, 1998
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
General Release Specification
Motorola reserves the right to make changes without further notice to
any products herein to improve reliability, function or design. Motorola
does not assume any liability arising out of the application or use of any
product or circuit described herein; neither does it 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., 1997
General Release Specification
2
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
List of Sections
List of Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
CPU and Instruction Set. . . . . . . . . . . . . . . . . . . . . . . . . . 37
Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
A G R E E M E N T
Table of Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Input/Output Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Core Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
16-Bit Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Serial Peripheral Interface (SPI) . . . . . . . . . . . . . . . . . . 115
Serial Communications Interface (SCI). . . . . . . . . . . . 125
Analog to Digital Converter . . . . . . . . . . . . . . . . . . . . . 143
EEPROM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
List of Sections
1
N O N - D I S C L O S U R E
Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
R E Q U I R E D
List of Sections
Pulse Width Modulator (PWM) . . . . . . . . . . . . . . . . . . . 159
EPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . 173
Mechanical Specifications. . . . . . . . . . . . . . . . . . . . . . 183
N O N - D I S C L O S U R E
A G R E E M E N T
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
General Release Specification
2
MC68HC(7)05H12 — Rev. 1.0
List of Sections
MOTOROLA
1.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.3
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4
Mask Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5
Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6
Functional Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.1
VDD and VSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.2
AVDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.3
OSC1, OSC2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.4
RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.5
IRQ/VPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.6
PA0–PA7/Keyboard Interrupt . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.7
PB0–PB7/ECLK, MISO, MOSI, SCK. . . . . . . . . . . . . . . . . . 22
1.6.8
PC0–PC7/TCAP0–3, TCMP0–1, RDI, TDO . . . . . . . . . . . . 22
1.6.9
PD0–PD3/AN0–AN3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.10
VREFH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.11
PE0–PE7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.12
PF0–PF3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.13
PVDD1, PVSS1, PVDD2, PVSS2 . . . . . . . . . . . . . . . . . . . . 23
Section 2. Memory
2.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3
Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.1
System Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4
RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.5
ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Table of Contents
3
R E Q U I R E D
Section 1. General Description
A G R E E M E N T
Table of Contents
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
Table of Contents
2.6
Monitor ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7
User EPROM (for the 705 version only) . . . . . . . . . . . . . . . . . . 35
2.8
EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Section 3. CPU and Instruction Set
3.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A G R E E M E N T
3.3
CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3.1
Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.2
Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.3
Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.4
Program Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.5
Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4
Arithmetic/Logic Unit (ALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5
Instruction Set Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
N O N - D I S C L O S U R E
3.6
Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.6.1
Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.2
Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.3
Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.4
Extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.5
Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.6.6
Indexed, 8-Bit Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.6.7
Indexed,16-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.6.8
Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.7
Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.7.1
Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . 46
3.7.2
Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . 47
3.7.3
Jump/Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.7.4
Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . . . 50
3.7.5
Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.8
Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Section 4. Interrupts
4.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
General Release Specification
4
MC68HC(7)05H12 — Rev. 1.0
Table of Contents
MOTOROLA
4.3
CPU Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.4
Reset Interrupt Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.5
Software Interrupt (SWI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.6
Hardware Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.7
External Interrupt (IRQ/Keyboard) . . . . . . . . . . . . . . . . . . . . . . 63
4.8
8-Bit Timer Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.9
16-Bit Timer1 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.10
16-Bit Timer2 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.11
SCI Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.12
SPI Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.13
WAIT Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Section 5. Resets
5.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.3
External Reset (RESET). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.4
Internal Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.5
Power-On Reset (POR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.6
Computer Operating Properly Reset (COPR). . . . . . . . . . . . . . 70
5.6.1
Resetting the COP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.6.2
COP During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.6.3
COP Watchdog Timer Considerations . . . . . . . . . . . . . . . . 71
5.6.4
COP Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.7
Illegal Address Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.8
Low Voltage Reset (LVR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.8.1
LVR Operation in WAIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Table of Contents
5
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
N O N - D I S C L O S U R E
4.2
R E Q U I R E D
Table of Contents
R E Q U I R E D
Table of Contents
Section 6. Operating Modes
6.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.3
User Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.4
Monitor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
A G R E E M E N T
6.5
Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.5.1
WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.5.2
Data Retention Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.5.3
Slow Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Section 7. Input/Output Ports
7.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
N O N - D I S C L O S U R E
7.3
Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.3.1
Port A Keyboard Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.3.2
Port A Interrupt Edge Register . . . . . . . . . . . . . . . . . . . . . . 81
7.3.3
Port A Interrupt Control Register . . . . . . . . . . . . . . . . . . . . . 81
7.3.4
Port A Interrupt Status Register . . . . . . . . . . . . . . . . . . . . . 82
7.4
Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5
Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.6
Port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.7
Port E and Port F (Power Drivers) . . . . . . . . . . . . . . . . . . . . . . 83
7.7.1
Power Drivers for 360∞Air Core Driven Instruments. . . . . . 85
7.7.2
H-Bridge Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.7.3
Power Driver Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.7.4
Short Circuit Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.7.5
Port E and Port F Mismatch Registers . . . . . . . . . . . . . . . . 89
7.7.6
Driver States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.7.7
Port E and Port F Configurations . . . . . . . . . . . . . . . . . . . . 92
7.7.8
H-Bridge Control with the PWM . . . . . . . . . . . . . . . . . . . . . 94
7.8
Port E and Port F During WAIT Mode . . . . . . . . . . . . . . . . . . . 95
7.9
Input/Output Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
General Release Specification
6
MC68HC(7)05H12 — Rev. 1.0
Table of Contents
MOTOROLA
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.3
Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
8.3.1
Core Timer Status and Control Register (CTSCR) . . . . . . . 99
8.3.2
Computer Operating Properly (COP) Watchdog Reset. . . 101
8.3.3
Core Timer Counter Register (CTCR). . . . . . . . . . . . . . . . 101
8.4
Core Timer During WAIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Section 9. 16-Bit Timers
9.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
9.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
9.3
Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.3.1
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.3.2
Output Compare Registers . . . . . . . . . . . . . . . . . . . . . . . . 106
9.3.3
Output Compare Register 1 . . . . . . . . . . . . . . . . . . . . . . . 106
9.3.4
Output Compare Register 2 . . . . . . . . . . . . . . . . . . . . . . . 107
9.3.5
Input Capture Registers . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.3.6
Input Capture Register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.3.7
Input Capture Register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 109
9.3.8
Timer Control Register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 110
9.3.9
Timer Control Register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.3.10
Timer Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.4
Timer During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Section 10. Serial Peripheral Interface (SPI)
10.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
10.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
10.3 SPI Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.1
Master In Slave Out (MISO) . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.2
Master Out Slave In (MOSI) . . . . . . . . . . . . . . . . . . . . . . . 117
10.3.3
Serial Clock (SCK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
10.4
SPI Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
10.5 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
10.5.1
SPI Control Register (SPCR) . . . . . . . . . . . . . . . . . . . . . . 121
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Table of Contents
7
A G R E E M E N T
8.2
N O N - D I S C L O S U R E
Section 8. Core Timer
R E Q U I R E D
Table of Contents
R E Q U I R E D
Table of Contents
10.5.2
10.5.3
10.6
SPI Status Register (SPSR) . . . . . . . . . . . . . . . . . . . . . . . 123
SPI Data I/O Register (SPDAT) . . . . . . . . . . . . . . . . . . . . 124
SPI During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
A G R E E M E N T
Section 11. Serial Communications Interface (SCI)
11.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.3
Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
11.4 Receiver Wake-up Operation . . . . . . . . . . . . . . . . . . . . . . . . . 130
11.4.1
Idle Line Wake-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
11.4.2
Address Mark Wake-up. . . . . . . . . . . . . . . . . . . . . . . . . . . 131
11.5
Receive Data (RDI). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
11.6
Start Bit Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
11.7
Transmit Data (TDO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
N O N - D I S C L O S U R E
11.8 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
11.8.1
Serial Communications Data Register (SCDAT). . . . . . . . 135
11.8.2
Serial Communications Control Register 1 (SCCR1) . . . . 136
11.8.3
Serial Communications Control Register 2 (SCCR2) . . . . 137
11.8.4
Serial Communications Status Register (SCSR) . . . . . . . 138
11.8.5
Baud Rate Register (BAUD) . . . . . . . . . . . . . . . . . . . . . . . 140
11.9
SCI During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Section 12. Analog to Digital Converter
12.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
12.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
12.3
A/D Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
12.4
A/D Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
12.5
Internal and Master Oscillator. . . . . . . . . . . . . . . . . . . . . . . . . 145
12.6 A/D Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
12.6.1
A/D Status and Control Register (ADSCR) . . . . . . . . . . . . 146
12.6.2
A/D Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
12.7
A/D During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
12.8
Analog Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
General Release Specification
8
MC68HC(7)05H12 — Rev. 1.0
Table of Contents
MOTOROLA
Section 13. EEPROM
13.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
13.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
13.3
EEPROM Control Register (EEPCR) . . . . . . . . . . . . . . . . . . . 154
13.4
EEPROM Options Register (EEOPR) . . . . . . . . . . . . . . . . . . 155
13.5 EEPROM Read, Erase and Programming Procedures . . . . . 156
13.5.1
Read Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
13.5.2
Erase Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
13.5.3
Programming Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Operation in WAIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Section 14. Pulse Width Modulator (PWM)
14.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
14.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
14.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
14.3.1
PWM Channel Microshifting . . . . . . . . . . . . . . . . . . . . . . . 161
14.4 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
14.4.1
PWM Data Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
14.4.2
PWM Control Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
14.4.3
PWM Channel Enable Register. . . . . . . . . . . . . . . . . . . . . 165
14.4.4
PWM Channel Polarity Register . . . . . . . . . . . . . . . . . . . . 165
14.5
PWM During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Table of Contents
9
N O N - D I S C L O S U R E
13.6
A G R E E M E N T
12.9 Conversion Accuracy Definitions . . . . . . . . . . . . . . . . . . . . . . 150
12.9.1
Transfer Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
12.9.2
Monotonicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
12.9.3
Quantization Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.4
Offset Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.5
Gain Scale Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.6
Differential Linearity Error . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.7
Integral Linearity Error. . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.8
Total Unadjusted Error . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
R E Q U I R E D
Table of Contents
R E Q U I R E D
Table of Contents
Section 15. EPROM
15.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.3 EPROM Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.3.1
Bootloader Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
15.4 EPROM Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
15.4.1
EPROM Programming Register (EPROG) . . . . . . . . . . . . 170
A G R E E M E N T
15.5
Mask Option Register (MOR) . . . . . . . . . . . . . . . . . . . . . . . . . 171
N O N - D I S C L O S U R E
Section 16. Electrical Characteristics
16.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
16.2
Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
16.3
Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.4
Power Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.5
DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 176
16.6
Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
16.7
A/D Converter Characteristics . . . . . . . . . . . . . . . . . . . . . . . . 178
16.8
EEPROM Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
16.9
EPROM Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
16.10 Power Driver Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 180
16.11 Power-on Reset/Low Voltage Reset Characteristics . . . . . . . 181
Section 17. Mechanical Specifications
17.1
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
17.2
Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
17.3
Package Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Index
General Release Specification
10
MC68HC(7)05H12 — Rev. 1.0
Table of Contents
MOTOROLA
1-1
1-2
2-1
2-2
2-3
2-4
2-5
2-6
2-7
2-8
3-1
3-2
3-3
3-4
3-5
3-6
4-1
5-1
5-2
5-3
5-4
6-1
7-1
7-2
7-3
7-4
7-5
Title
MC68HC(7)05H12 Block Diagram . . . . . . . . . . . . . . . . . . . . 19
MC68HC(7)05H12 Pin Assignments
(52-pin PLCC package) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
MC68HC(7)05H12 Memory Map . . . . . . . . . . . . . . . . . . . . . 26
I/O Register Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
I/O Registers $0000–$000F . . . . . . . . . . . . . . . . . . . . . . . . . 29
I/O Registers $0010–$001F . . . . . . . . . . . . . . . . . . . . . . . . . 30
I/O Registers $0020–$002F . . . . . . . . . . . . . . . . . . . . . . . . . 31
I/O Registers $0030–$003F . . . . . . . . . . . . . . . . . . . . . . . . . 32
I/O Registers $0040–$004F . . . . . . . . . . . . . . . . . . . . . . . . . 33
System Control Register (SYSCR). . . . . . . . . . . . . . . . . . . . 34
Programming Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Program Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Interrupt Processing Flowchart. . . . . . . . . . . . . . . . . . . . . . . 62
Internal Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
RESET and POR Timing Diagram . . . . . . . . . . . . . . . . . . . . 69
COP Watchdog Timer Location Register (COPR) . . . . . . . . 72
Low Voltage Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
WAIT Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Port A Interrupt Edge Register (PAIED) . . . . . . . . . . . . . . . . 81
Port A Interrupt Control Register (PAICR) . . . . . . . . . . . . . . 81
Port A Interrupt Status Register (PAISR) . . . . . . . . . . . . . . . 82
Port E and Port F (Power Drivers) . . . . . . . . . . . . . . . . . . . . 84
Driving Cross Coupled Coils . . . . . . . . . . . . . . . . . . . . . . . . 85
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
Page
General Release Specification
List of Figures
11
R E Q U I R E D
Figure
A G R E E M E N T
List of Figures
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
List of Figures
7-6
7-7
7-8
7-9
7-10
7-11
7-12
H-Bridge Driver Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Power Driver Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Short Circuit Detection Circuitry . . . . . . . . . . . . . . . . . . . . . . 88
Port E Mismatch Register (PEMISM) . . . . . . . . . . . . . . . . . . 89
Port F Mismatch Register (PFMISM) . . . . . . . . . . . . . . . . . . 90
H-Bridge States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Port E Configuration for two 360° instruments . . . . . . . . . . . 92
7-13
7-14
7-15
7-16
7-17
8-1
8-2
8-3
9-1
9-2
9-3
9-4
9-5
10-1
10-2
10-3
10-4
10-5
10-6
11-1
11-2
11-3
11-4
11-5
11-6
11-7
11-8
11-9
Port F Configuration for four 90° instruments (version 1). . . 93
Port F Configuration for four 90° instruments (version 2). . . 93
H-Bridge Control with PWM . . . . . . . . . . . . . . . . . . . . . . . . . 94
Correspondence between Data and PWM Values. . . . . . . . 95
Port I/O Circuitry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Core Timer Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Core Timer Status and Control Register (CTSCR) . . . . . . . 99
Core Timer Counter Register (CTCR) . . . . . . . . . . . . . . . . 102
Timer Block Diagram (Timer1) . . . . . . . . . . . . . . . . . . . . . . 104
16-Bit Timer Register Addresses (Timer1). . . . . . . . . . . . . 105
Timer Control Register 1 (TCR1) . . . . . . . . . . . . . . . . . . . . 110
Timer Control Register 2 (TCR2) . . . . . . . . . . . . . . . . . . . . 112
Timer Status Register (TSR) . . . . . . . . . . . . . . . . . . . . . . . 113
Data Clock Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . 118
Serial Peripheral Block Diagram . . . . . . . . . . . . . . . . . . . . 119
Serial Peripheral Interface Master-Slave Interconnection . 120
SPI Control Register (SPCR) . . . . . . . . . . . . . . . . . . . . . . . 121
SPI Status Register (SPSR). . . . . . . . . . . . . . . . . . . . . . . . 123
SPI Data I/O Register (SPDAT) . . . . . . . . . . . . . . . . . . . . . 124
Serial Communications Interface Block Diagram . . . . . . . . 128
Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Sampling Technique Used On All Bits . . . . . . . . . . . . . . . . 132
Examples of Start Bit Sampling Techniques . . . . . . . . . . . 133
SCI Artificial Start Following a Framing Error. . . . . . . . . . . 134
SCI Start Bit Following a Break . . . . . . . . . . . . . . . . . . . . . 134
SCI Data Register (SCDAT). . . . . . . . . . . . . . . . . . . . . . . . 135
SCI Control Register 1 (SCCR1) . . . . . . . . . . . . . . . . . . . . 136
SCI Control Register 2 (SCCR2) . . . . . . . . . . . . . . . . . . . . 137
General Release Specification
12
MC68HC(7)05H12 — Rev. 1.0
List of Figures
MOTOROLA
14-5
14-6
15-1
15-2
15-3
17-1
17-2
PWM Channel Enable Register (PWMEN) . . . . . . . . . . . . 165
PWM Channel Polarity Register (PWMPOL) . . . . . . . . . . . 165
MC68HC705H12 Programming Circuit . . . . . . . . . . . . . . . 169
EPROM Programming Register (EPROG). . . . . . . . . . . . . 170
Mask Options Registers (MOR1 and MOR2) . . . . . . . . . . . 171
52-Pin PLCC Pin Assignments. . . . . . . . . . . . . . . . . . . . . . 183
52-Pin PLCC Package Dimensions . . . . . . . . . . . . . . . . . . 184
A G R E E M E N T
SCI Status Register (SCSR) . . . . . . . . . . . . . . . . . . . . . . . 138
SCI Baud Rate Register (BAUD) . . . . . . . . . . . . . . . . . . . . 140
A/D Status and Control Register (ADSCR) . . . . . . . . . . . . 146
A/D Data Register (ADDR). . . . . . . . . . . . . . . . . . . . . . . . . 148
Electrical Model of an A/D Input Pin. . . . . . . . . . . . . . . . . . 149
Transfer Curve of an Ideal 8-Bit A/D Converter . . . . . . . . . 150
EEPROM Control Register (EEPCR) . . . . . . . . . . . . . . . . . 154
EEPROM Options Register (EEOPR) . . . . . . . . . . . . . . . . 155
PWM Block Diagram (one channel) . . . . . . . . . . . . . . . . . . 160
PWM Microshifts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
PWM Data Registers (PWM0–7) . . . . . . . . . . . . . . . . . . . . 163
PWM Control Register (PWMCTL). . . . . . . . . . . . . . . . . . . 164
N O N - D I S C L O S U R E
11-10
11-11
12-1
12-2
12-3
12-4
13-1
13-2
14-1
14-2
14-3
14-4
R E Q U I R E D
List of Figures
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
List of Figures
13
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
List of Figures
General Release Specification
14
MC68HC(7)05H12 — Rev. 1.0
List of Figures
MOTOROLA
3-1
3-2
3-3
3-4
3-5
3-6
3-7
4-1
6-1
7-1
8-1
8-2
10-1
11-1
11-2
12-1
12-2
13-1
14-1
15-1
Title
Register/Memory Instructions. . . . . . . . . . . . . . . . . . . . . . . . . 46
Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . . 47
Jump and Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . 49
Bit Manipulation Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . 50
Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Opcode Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Reset/Interrupt Vector Addresses . . . . . . . . . . . . . . . . . . . . . 61
Operating Mode Entry Conditions . . . . . . . . . . . . . . . . . . . . . 75
I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
RTI Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Minimum COP Reset Times . . . . . . . . . . . . . . . . . . . . . . . . . 101
SPI Clock Rate Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
First Prescaler Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Second Prescaler Stage. . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
A/D Clock Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
A/D Channel Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Erase Mode Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
PWM Clock Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Bootloader Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
Page
General Release Specification
List of Tables
15
R E Q U I R E D
Table
A G R E E M E N T
List of Tables
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
List of Tables
General Release Specification
16
MC68HC(7)05H12 — Rev. 1.0
List of Tables
MOTOROLA
1.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.3
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4
Mask Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5
Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6
Functional Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.1
VDD and VSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.2
AVDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.3
OSC1, OSC2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.4
RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.5
IRQ/VPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.6
PA0–PA7/Keyboard Interrupt . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.7
PB0–PB7/ECLK, MISO, MOSI, SCK. . . . . . . . . . . . . . . . . . 22
1.6.8
PC0–PC7/TCAP0–3, TCMP0–1, RDI, TDO . . . . . . . . . . . . 22
1.6.9
PD0–PD3/AN0–AN3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.10
VREFH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.11
PE0–PE7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.12
PF0–PF3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.13
PVDD1, PVSS1, PVDD2, PVSS2 . . . . . . . . . . . . . . . . . . . . 23
1.2 Introduction
The MC68HC(7)05H12 HCMOS microcomputer is a member of the
M68HC05 family. This 8 bit microcomputer unit (MCU) contains on-chip
oscillator, CPU, RAM, (EP)ROM, monitor ROM, EEPROM, parallel I/O,
one core timer, COP watchdog system, two 16-bit programmable timers,
synchronous and asynchronous serial interface, a 4 channel A/D
converter, and an 8 channel 8-bit PWM with on-chip power driver
circuitry.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
General Description
17
R E Q U I R E D
1.1 Contents
A G R E E M E N T
Section 1. General Description
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
•
HC05 core
•
52 PLCC package
•
12032 bytes of user (EP)ROM + 240 bytes of monitor ROM + 16
bytes user vectors
•
256 bytes of RAM
•
256 bytes of EEPROM
A G R E E M E N T
1.3 Features
•
Multipurpose core timer, real time interrupt (RTI), COP watchdog
timer
•
Two 16-bit timers with two input captures and two output
compares each
•
Serial peripheral interface (SPI)
•
Serial communications interface (SCI)
•
4 channel A/D converter (8-bit resolution)
•
Keyboard interrupt for 8 I/O lines
•
8 channel 8-bit PWM system for control of H-bridge drivers
N O N - D I S C L O S U R E
R E Q U I R E D
General Description
•
12 special power drivers to drive two major gauges and four minor
gauges, with short circuit detection and slew rate limitation for
reduced RFI (EMC)
•
Power saving WAIT mode
•
2 selectable bus frequencies (slow mode)
•
Low voltage reset (LVR) circuitry to hold the CPU in reset
General Release Specification
18
MC68HC(7)05H12 — Rev. 1.0
General Description
MOTOROLA
Monitor ROM — 240 Bytes
PA7
PA6
DDR A
User EEPROM — 256 Bytes
R E Q U I R E D
User (EP)ROM — 12032 Bytes
User Vectors —16 Bytes
PORT A
Key Interrupt
Mask Register
General Description
Features
PA5
PA4
PA3
PA2
PA1
PA0
User RAM — 256 Bytes
Index Register
RESET
RESET
Stack Pointer
0 0 0 0 0 0 0 0 1 1 1
A G R E E M E N T
M68HC05
MCU
PB6/ MOSI
PB5/ MISO
PORT B
Accumulator
IRQ
Data Direction Register B
PB7/ SCK
Arithmetic/Logic
Unit
CPU Control
PB4
PB3
PB2/ECLK
PB1
PB0
Program Counter
OSC1
Divide
by 2 or 8
Internal
Oscillator
OSC2
Core Timer,
COP
PC5/TCMP1
PC4/TCMP0
PC3/TCAP3
PC2/TCAP2
N O N - D I S C L O S U R E
CPU CLOCK
PC6/ RDI
PORT C
Condition Code Register
1 1 1 H I N C Z
Data Direction Register C
PC7/ TDO
0 0
PC1/TCAP1
PC0/TCAP0
16-Bit
Timer2
SCI
SPI
VSS
VDD
AVDD
VREFH
PWM System
package: 52PLCC
PD3–0/
AN3–0
PE7–0
PF3–0
2 x PVDD
2 x PVSS
8-Bit
A/D
Converter
Power
PORT F PORT E
PORT D
16-Bit
Timer1
Figure 1-1. MC68HC(7)05H12 Block Diagram
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
General Description
19
1.4 Mask Options
There are three mask options:
•
COP watchdog timer (enable/disable)
•
Low voltage reset (LVR) (enable/disable)
•
Ports E/F in WAIT mode (enable/disable)
1.5 Pin Assignments
7
VREFH
PB4
PB5/MISO
PB6/MOSI
IRQ/VPP
PB7/SCK
OSC2
OSC1
RESET
PD0/AN0
PD1/AN1
PD2/AN2
PD3/AN3
VSS
Figure 1-2 shows the PLCC pin assignments.
47
1
8
46
AVDD
N O N - D I S C L O S U R E
PB3
PB2/ECLK
VDD
PB1
PC0/TCAP0
PB0
PC1/TCAP1
PA7
PC2/TCAP2
PC3/TCAP3
PA6
14
40
PA5
PC4/TCMP0
PA4
PC5/TCMP1
PA3
PC6/RDI
PA2
PC7/TDO
PA1
PVDD2
PA0
PE0
PE1
PE2
PF0
PE3
PF1
PF2
PF3
PVDD1
PVSS1
34
33
27
PE4
21
PE5
20
PE7
PVSS2
PE6
A G R E E M E N T
R E Q U I R E D
General Description
Figure 1-2. MC68HC(7)05H12 Pin Assignments
(52-pin PLCC package)
General Release Specification
20
MC68HC(7)05H12 — Rev. 1.0
General Description
MOTOROLA
The following paragraphs give a description of the general function of
each pin.
1.6.1 VDD and VSS
Power is supplied to the MCU through VDD and VSS. VDD is the
positive supply, and VSS is ground.
1.6.2 AVDD
AVDD is a separate supply pin providing power to the A/D converter.
1.6.3 OSC1, OSC2
The OSC1 and OSC2 pins are the connections for the on-chip oscillator.
A crystal connected across these pins or an external signal connected
to OSC1 provides the oscillator clock. The frequency, fOSC, of the
oscillator or external clock source is divided by two or eight (slow mode)
to produce the internal operating frequency, fOP.
1.6.4 RESET
This pin can be used as an input to reset the MCU to a known start-up
state by pulling it to the low state. The RESET pin contains an internal
Schmitt trigger to improve its noise immunity as an input. The RESET pin
has an internal pulldown device that pulls the RESET pin low when there
is an internal COP watchdog reset, power-on reset (POR), illegal
address reset, or an internal low voltage reset. Refer to
Section 5 Resets. The RESET pin contains an internal pullup device.
1.6.5 IRQ/VPP
The interrupt triggering sensitivity of this pin can be programmed as
falling edge sensitive or falling edge and low level sensitive.The IRQ pin
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
General Description
21
N O N - D I S C L O S U R E
1.6 Functional Pin Description
A G R E E M E N T
R E Q U I R E D
General Description
Functional Pin Description
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
General Description
contains an internal Schmitt trigger as part of its input to improve noise
immunity. See Section 4 Interrupts for more details on the interrupts.
IRQ/VPP is also the EPROM programming power pin.
1.6.6 PA0–PA7/Keyboard Interrupt
These eight I/O lines comprise port A. The state of any pin is software
programmable and all port A lines are configured as inputs during
power-on or reset. The eight I/O lines are shared with the keyboard
interrupt function. See Section 7 Input/Output Ports for more details
on the I/O ports.
1.6.7 PB0–PB7/ECLK, MISO, MOSI, SCK
These eight I/O lines comprise port B. The state of any pin is software
programmable and all port B lines are configured as inputs during
power-on or reset. See Section 7 Input/Output Ports for more details
on the I/O ports. The port pins PB5–PB7 are shared with the SPI system
(MISO, MOSI, SCK). See Section 10 Serial Peripheral Interface
(SPI) for more details on the operation of the SPI. Pin PB2 is shared with
the internal system clock ECLK. See Section 2.3.1 System Control
Register.
1.6.8 PC0–PC7/TCAP0–3, TCMP0–1, RDI, TDO
These eight I/O lines comprise port C. The state of any pin is software
programmable and all port C lines are configured as inputs during
power-on or reset. See Section 7 Input/Output Ports for more details
on the I/O ports. The port pins PC0–PC5 are shared with the 16-bit timer
(TCAP0–3, TCMP0–1). See Section 9 16-Bit Timers for more details
on the operation of the 16-bit timers. The port pins PC6 and PC7 are
shared with the SCI system (RDI and TDO). Refer to Section 11 Serial
Communications Interface (SCI).
General Release Specification
22
MC68HC(7)05H12 — Rev. 1.0
General Description
MOTOROLA
1.6.9 PD0–PD3/AN0–AN3
These four input only lines comprise port D. See
Section 7 Input/Output Ports for more details on the I/O ports. When
the A/D converter is active, one of the 4 input lines may be selected by
the A/D multiplexer for conversion. See Section 12 Analog to Digital
Converter for more details on the operation of the A/D subsystem.
R E Q U I R E D
General Description
Functional Pin Description
1.6.11 PE0–PE7
These eight output only lines comprise port E. See
Section 7 Input/Output Ports for more details on the I/O ports. The
eight lines are shared with four PWM H-bridge driver pairs. The outputs
are formed by special power drivers. See Section 14 Pulse Width
Modulator (PWM) for more details on the PWM subsystem.
1.6.12 PF0–PF3
These four output only lines comprise port F. See
Section 7 Input/Output Ports for more details on the I/O ports. The
four lines are shared with four PWM channels. The outputs are formed
by special power drivers. See Section 14 Pulse Width Modulator
(PWM) for more details on the PWM subsystem.
1.6.13 PVDD1, PVSS1, PVDD2, PVSS2
Power is supplied to the power drivers through PVDD and PVSS.
PVDD1 and PVSS1 are the supply pins for PE0–3 and PF0–1 and
PVDD2 and PVSS2 are the supply pins for PE4–7 and PF2–3.
The VSS pin and the PVSS1 and PVSS2 pins are connected internally.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
General Description
23
N O N - D I S C L O S U R E
This pin provides the positive reference voltage for the A/D converter.
VSS provides the negative reference voltage for the A/D converter.
A G R E E M E N T
1.6.10 VREFH
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
General Description
General Release Specification
24
MC68HC(7)05H12 — Rev. 1.0
General Description
MOTOROLA
Section 2. Memory
2.1 Contents
2.3
Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.1
System Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4
RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.5
ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.6
Monitor ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7
User EPROM (for the 705 version only) . . . . . . . . . . . . . . . . . . 35
2.8
EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 Introduction
The MC68HC(7)05H12 has a 16K byte memory map consisting of
registers (for I/O, control and status), user RAM, user ROM (or EPROM),
EEPROM, monitor ROM, and reset and interrupt vectors as shown in
Figure 2-1.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Memory
25
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
N O N - D I S C L O S U R E
2.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
Memory
$0000
$004F
$0050
I/O registers
80 bytes
User RAM
256 bytes
A G R E E M E N T
$014F
$0150
$03FF
$0400
$04FF
$0500
$0FFF
$1000
$3EFF
$3F00
$3FEF
$3FF0
$3FFF
Stack RAM
64 bytes
$00C0
$00FF
Unused
688 bytes
User EEPROM
256 bytes
Unused 2816 bytes
User ROM
12032 bytes
Monitor ROM
240 bytes
User vectors
16 bytes
Figure 2-1. MC68HC(7)05H12 Memory Map
N O N - D I S C L O S U R E
2.3 Registers
The I/O and control registers reside in locations $0000–$004F. The
overall organization of these registers is shown in Figure 1-2. The bit
assignments for each register are shown in Figure 2-3, Figure 2-4,
Figure 2-5, Figure 2-6, and Figure 2-7.
General Release Specification
26
MC68HC(7)05H12 — Rev. 1.0
Memory
MOTOROLA
$0000
Port A Data Register
$0001
Port B Data Register
$0002
Port C Data Register
$0003
Port D Data Register
$0004
Port A Data Direction Register
$0005
Port B Data Direction Register
$0006
Port C Data Direction Register
$0007
Port C Control Register
$0008
Core Timer Control/Status (CTCSR)
$0009
Core Timer Counter (CTCR)
$000A
Unused
$000B
Unused
$000C
Unused
$000D
Port A Interrupt Edge
$000E
Port A Interrupt Control
$000F
Port A Interrupt Status
$0010
PWM Data 0
$0011
PWM Data 1
$0012
PWM Data 2
$0013
PWM Data 3
$0014
PWM Data 4
$0015
PWM Data 5
$0016
PWM Data 6
$0017
PWM Data 7
$0018
PWM Control/Sign
$0019
PWM Channel Enable
$001A
PWM Channel Polarity
$001B
Unused
$001C
EEPROM Control
$001D
RESERVED for 705 version
$001E
Unused
$001F
TEST
$0020
Timer1 Capture 1 High
$0021
Timer1 Capture 1 Low
$0022
Timer1 Compare 1 High
$0023
Timer1 Compare 1 Low
$0024
Timer1 Capture 2 High
$0025
Timer1 Capture 2 Low
$0026
Timer1 Compare 2 High
A G R E E M E N T
Register Name
N O N - D I S C L O S U R E
Addr
R E Q U I R E D
Memory
Registers
Figure 2-2. I/O Register Summary
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Memory
27
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Memory
Addr
Register Name
$0027
Timer1 Compare 2 Low
$0028
Timer1 Counter High
$0029
Timer1 Counter Low
$002A
Timer1 Alternate Counter High
$002B
Timer1 Alternate Counter Low
$002C
Timer1 Control 1
$002D
Timer1 Control 2
$002E
Timer1 Status
$002F
Unused
$0030
Timer2 Capture 1 High
$0031
Timer2 Capture 1 Low
$0032
Timer2 Compare 1 High
$0033
Timer2 Compare 1 Low
$0034
Timer2 Capture 2 High
$0035
Timer2 Capture 2 Low
$0036
Timer2 Compare 2 High
$0037
Timer2 Compare 2 Low
$0038
Timer2 Counter High
$0039
Timer2 Counter Low
$003A
Timer2 Alternate Counter High
$003B
Timer2 Alternate Counter Low
$003C
Timer2 Control 1
$003D
Timer2 Control 2
$003E
Timer2 Status
$003F
Unused
$0040
Port E Data Register
$0041
Port E Mismatch Register
$0042
Port F Data Register
$0043
Port F Mismatch Register
$0044
SPI Control
$0045
SPI Status
$0046
SPI Data I/O
$0047
SCI SCDAT
$0048
SCI SCCR1
$0049
SCI SCCR2
$004A
SCI SCSR
$004B
SCI BAUD
$004C
Unused
$004D
System Control Register
$004E
A/D DATA
$004F
A/D STATUS/CTL
Figure 2-2. I/O Register Summary
General Release Specification
28
MC68HC(7)05H12 — Rev. 1.0
Memory
MOTOROLA
$0000
Port A Data
$0001
Port B Data
$0002
Port C Data
$0003
Port D Data
$0004
Port A Data Direction
$0005
Port B Data Direction
$0006
Port C Data Direction
$0007
Port C Control
$0008
CTSCR
$0009
CTCR
$000A
Unimplemented
$000B
Unimplemented
$000C
Unimplemented
$000D
PAIED
$000E
PAICR
$000F
PAISR
R/W
R
W
R
W
R
W
R
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PA7
PA6
PA5
PA4
PA3
PA2
PA1
PA0
PB7
PB6
PB5
PB4
PB3
PB2
PB1
PB0
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
0
0
0
0
PD3
PD2
PD1
PD0
DDRA7
DDRA6
DDRA5
DDRA4
DDRA3
DDRA2
DDRA1
DDRA0
DDRB7
DDRB6
DDRB5
DDRB4
DDRB3
DDRB2
DDRB1
DDRB0
DDRC7
DDRC6
DDRC5
DDRC4
DDRC3
DDRC2
DDRC1
DDRC0
0
0
TCMP1
TCMP0
0
0
0
0
TOF
RTIF
TOFE
RTIE
0
0
RTOF
RTIF
RT1
RT0
W
R
W
R
W
R
W
R
W
R
W
R
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
EDGE7
EDGE6
EDGE5
EDGE4
EDGE3
EDGE2
EDGE1
EDGE0
PAIE7
PAIE6
PAIE5
PAIE4
PAIE3
PAIE2
PAIE1
PAIE0
PAIF7
PAIF6
PAIF5
PAIF4
PAIF3
PAIF2
PAIF1
PAIF0
W
R
W
R
W
R
W
R
W
R
W
R
W
Figure 2-3. I/O Registers $0000–$000F
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
A G R E E M E N T
Register
General Release Specification
Memory
29
N O N - D I S C L O S U R E
Addr
R E Q U I R E D
Memory
Registers
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Memory
Addr
Register
$0010
PWM Data 0
$0011
PWM Data 1
$0012
PWM Data 2
$0013
PWM Data 3
$0014
PWM Data 4
$0015
PWM Data 5
$0016
PWM Data 6
$0017
PWM Data 7
$0018
PWMCTL
$0019
PWMEN
$001A
PWMPOL
$001B
Unimplemented
$001C
EEPCR
$001D
Reserved for 705 version
$001E
Unimplemented
$001F
TEST
R/W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
PWMC3
PWMC2
PWMC1
SIGN3
SIGN2
SIGN1
SIGN0
PWME7
PWME6
PWME5
PWME4
PWME3
PWME2
PWME1
PWME0
PPOL7
PPOL6
PPOL5
PPOL4
PPOL3
PPOL2
PPOL1
PPOL0
0
0
0
EEOSC
ER1
EER0
EELAT
EEPGM
R
0
W
PWMRS
R
W
R
W
R
W
R
W
R
W
R
W
R
0
0
0
0
0
0
0
0
W
††††††
††††††
††††††
††††††
††††††
††††††
††††††
††††††
Figure 2-4. I/O Registers $0010–$001F
General Release Specification
30
MC68HC(7)05H12 — Rev. 1.0
Memory
MOTOROLA
Addr
Register
R/W
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
$0020
Timer 1 Input
Capture1 High
R
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
$0021
Timer 1 Input
Capture1 Low
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
$0022
Timer 1 Output
Compare1 High
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
$0023
Timer 1 Output
Compare1 Low
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
$0024
Timer 1 Input
Capture2 High
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
$0025
Timer 1 Input
Capture2 Low
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
$0026
Timer 1 Output
Compare2 High
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
$0027
Timer 1 Output
Compare2 Low
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
$0028
Timer 1 Counter High
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
$0029
Timer 1 Counter Low
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
$002A
Timer 1 Alternate
Counter High
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
$002B
Timer 1 Alternate
Counter Low
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
$002C
Timer 1 Control 1
ICI1E
ICI2E
OCI1E
TOIE
CO1E
IEDG1
IEDG2
OLVL1
$002D
Timer 1 Control 2
0
0
0
0
$002E
Timer 1 Status
IC1F
IC2F
TCAP2
OC2F
$002F
Unimplemented
W
R
W
R
W
R
W
R
R
A G R E E M E N T
W
W
R
W
R
W
R
W
R
W
R
W
R
R
W
R
OC2IE
W
R
OC1F
0
TOF
CO2E
TCAP1
OLVL2
0
W
R
W
MC68HC(7)05H12 — Rev. 1.0
General Release Specification
Memory
31
N O N - D I S C L O S U R E
W
Figure 2-5. I/O Registers $0020–$002F
MOTOROLA
R E Q U I R E D
Memory
Registers
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Memory
Addr
Register
R/W
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
$0030
Timer 2 Input Capture1
High
R
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 15
bit 14
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
ICI1E
ICI2E
OCI1E
TOIE
CO1E
IEDG1
IEDG2
OLVL1
0
0
OC2IE
0
CO2E
0
0
OLVL2
IC1F
IC2F
OC1F
TOF
TCAP1
TCAP2
OC2F
0
Timer 2 Input Capture1
$0031
Low
$0032
Timer 2 Output
Compare1 High
$0033
Timer 2 Output
Compare1 Low
$0034
Timer 2 Input Capture2
High
Timer 2 Input Capture2
$0035
Low
$0036
Timer 2 Output
Compare2 High
$0037
Timer 2 Output
Compare2 Low
$0038
Timer 2 Counter High
$0039
Timer 2 Counter Low
$003A
Timer 2 Alternate
Counter High
$003B
Timer 2 Alternate
Counter Low
$003C
Timer 2 Control 1
$003D
Timer 2 Control 2
$003E
Timer 2 Status
$003F
Unimplemented
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
R
W
Figure 2-6. I/O Registers $0030–$003F
General Release Specification
32
MC68HC(7)05H12 — Rev. 1.0
Memory
MOTOROLA
$0040
Port E Data
$0041
Port E Mismatch
$0042
Port F Data
$0043
Port F Mismatch
$0044
SPI Control
$0045
SPI Status
$0046
SPI Data
$0047
SCI Data
$0048
SCI Control 1
$0049
SCI Control 2
$004A
SCI Status
$004B
SCI BAUD
$004C
Unimplemented
$004D
System Control
$004E
A/D Data
$004F
A/D Status/Control
R/W
R
W
R
W
R
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PE7
PE6
PE5
PE4
PE3
PE2
PE1
PE0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
0
0
0
0
PF3
PF2
PF1
PF0
0
0
0
0
bit 3
bit 2
bit 1
bit 0
SPIE
SPE
DOD
MSTR
CPOL
CPHA
SPR1
SPR0
SPIF
WCOL
0
0
0
0
0
0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
M
WAKE
0
0
0
W
R
W
R
W
R
A G R E E M E N T
Register
W
R
W
R
W
R
R8
W
R
W
R
0
T8
TIE
TCIE
RIE
ILIE
TE
RE
RWU
SBK
TDRE
TC
RDRF
IDLE
OR
NF
FE
0
SPP
SCP1
SCP0
SCR2
SCR1
SCR0
0
0
0
0
0
bit 7
bit 6
bit 5
ADRC
ADON
W
R
0
W
TCLR
0
RCKB
R
W
R
W
R
SC
IRQ
ECLK
bit 4
bit 3
bit 2
bit 1
bit 0
CH3
CH2
CH1
CH0
W
R
W
COCO
0
Figure 2-7. I/O Registers $0040–$004F
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Memory
33
N O N - D I S C L O S U R E
Addr
R E Q U I R E D
Memory
Registers
2.3.1 System Control Register
The MC68HC(7)05H12 contains a system control register which is
located at $004D. This register is used to control the IRQ interrupt
sensitivity, the bus frequency, and the external availability of the internal
bus clock.
$004D
Bit 7
6
5
Read:
0
0
0
4
3
SC
IRQ
0
0
2
1
0
0
Bit 0
ECLK
Write:
A G R E E M E N T
R E Q U I R E D
Memory
Reset:
0
0
0
0
0
0
Figure 2-8. System Control Register (SYSCR)
SC — System Clock Option
After power on reset the internal bus frequency fOP is = fOSC/2. The
SC bit allows the user to reduce the system speed to fOSC/8.
1 = fOP = fOSC/8 (Slow Mode)
0 = fOP = fOSC/2
IRQ — IRQ Sensitivity
N O N - D I S C L O S U R E
IRQ edge or level sensitive
1 = IRQ input edge and level sensitive
0 = IRQ input edge sensitive
ECLK — Internal System Clock Available
The ECLK bit makes the internal system clock (bus frequency fOP)
available to the user. Refer to Section 7.4 Port B for more details.
1 = The PB2/ECLK pin provides the internal system clock
independently of the value of the port B data direction register
0 = The internal system clock is not available, the PB2/ECLK pin is
an ordinary I/O port line
General Release Specification
34
MC68HC(7)05H12 — Rev. 1.0
Memory
MOTOROLA
The stack is located in the middle of the RAM address space. Data
written to addresses within the stack address range could be overwritten
during stack activity.
2.5 ROM
The 12032 bytes of the user ROM are located from $1000 to $3EFF, plus
16 bytes of user vectors from $3FF0 to $3FFF.
2.6 Monitor ROM
The monitor ROM ranges from $3F00 to $3FEF. The vectors for the
bootloader are located from $3FE0 to $3FEF.
2.7 User EPROM (for the 705 version only)
The 12032 bytes of the user EPROM are located from $1000 to $3EFD,
including two bytes of mask option registers (MOR) at $3EFE and
$3EFF, plus 16 bytes of user vectors from $3FF0 to $3FFF. Refer to
Section 15 EPROM for programming details.
2.8 EEPROM
This device contains 256 bytes of EEPROM. Programming the
EEPROM is performed by the user on a single-byte basis by
manipulating the EEPROM control register, located at address $001C.
Refer to Section 13 EEPROM for programming details.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Memory
35
A G R E E M E N T
The user RAM consists of 256 bytes ranging from $0050 to $014F. The
stack begins at address $00FF. The stack pointer can access 64 bytes
of RAM in the range $00FF to $00C0.
N O N - D I S C L O S U R E
2.4 RAM
R E Q U I R E D
Memory
RAM
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Memory
General Release Specification
36
MC68HC(7)05H12 — Rev. 1.0
Memory
MOTOROLA
Section 3. CPU and Instruction Set
3.1 Contents
3.3
CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3.1
Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.2
Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.3
Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.4
Program Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.5
Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4
Arithmetic/Logic Unit (ALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5
Instruction Set Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.6
Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.6.1
Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.2
Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.3
Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.4
Extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.5
Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.6.6
Indexed, 8-Bit Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.6.7
Indexed,16-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.6.8
Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.7
Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.7.1
Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . 46
3.7.2
Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . 47
3.7.3
Jump/Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.7.4
Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . . . 50
3.7.5
Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.8
Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
37
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
N O N - D I S C L O S U R E
3.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
3.2 Introduction
This chapter describes the CPU registers and the HC05 instruction set.
3.3 CPU Registers
Figure 3-1 shows the five CPU registers. CPU registers are not part of
the memory map.
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
7
0
A
ACCUMULATOR (A)
7
0
X
15
0
15
6
0
0
0
0
0
10
0
0
1
8
7
0
5
1
STACK POINTER (SP)
SP
0
PCH
N O N - D I S C L O S U R E
INDEX REGISTER (X)
PCL
7
1
1
5
4
1
H
PROGRAM COUNTER (PC)
0
I
N
Z
C
CONDITION CODE REGISTER (CCR)
HALF-CARRY FLAG
INTERRUPT MASK
NEGATIVE FLAG
ZERO FLAG
CARRY/BORROW FLAG
Figure 3-1. Programming Model
General Release Specification
38
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
3.3.1 Accumulator
The accumulator is a general-purpose 8-bit register. The CPU uses the
accumulator to hold operands and results of arithmetic and nonarithmetic operations.
Bit 7
6
5
4
Reset:
3
2
1
Bit 0
Unaffected by reset
R E Q U I R E D
CPU and Instruction Set
CPU Registers
In the indexed addressing modes, the CPU uses the byte in the index
register to determine the conditional address of the operand.
Bit 7
6
5
4
Reset:
3
2
1
Bit 0
Unaffected by reset
Figure 3-3. Index Register
The 8-bit index register can also serve as a temporary data storage
location.
3.3.3 Stack Pointer
The stack pointer is a 16-bit register that contains the address of the next
location on the stack. During a reset or after the reset stack pointer
(RSP) instruction, the stack pointer is preset to $00FF. The address in
the stack pointer decrements as data is pushed onto the stack and
increments as data is pulled from the stack.
Bit 15 14
Reset
13
12
11
10
9
8
7
6
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
5
4
3
2
1
Bit 0
1
1
1
1
1
1
Figure 3-4. Stack Pointer
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
39
N O N - D I S C L O S U R E
3.3.2 Index Register
A G R E E M E N T
Figure 3-2. Accumulator
R E Q U I R E D
CPU and Instruction Set
The ten most significant bits of the stack pointer are permanently fixed
at 000000011, 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.
A G R E E M E N T
3.3.4 Program Counter
The program counter is a 16-bit register that contains the address of the
next instruction or operand to be fetched. The two most significant bits
of the program counter are ignored internally.
Normally, the address in the program counter automatically increments
to the next sequential memory location every time an instruction or
operand is fetched. Jump, branch, and interrupt operations load the
program counter with an address other than that of the next sequential
location.
N O N - D I S C L O S U R E
Bit 15 14
Reset
–
–
–
–
13
12
11
10
9
8
7
6
5
4
3
2
1
Bit 0
Loaded with vector from $3FFE AND $3FFF
Figure 3-5. Program Counter
3.3.5 Condition Code Register
The condition code register is an 8-bit register whose three most
significant bits are permanently fixed at 111. The condition code register
contains the interrupt mask and four flags that indicate the results of the
instruction just executed. The following paragraphs describe the
functions of the condition code register.
Reset
Bit 7
6
5
4
3
2
1
Bit 0
1
1
1
H
I
N
C
Z
1
1
1
U
1
U
U
U
Figure 3-6. Condition Code Register
General Release Specification
40
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
Interrupt Mask
Setting the interrupt mask disables interrupts. If an interrupt request
occurs while the interrupt mask is logic zero, the CPU saves the CPU
registers on the stack, sets the interrupt mask, and then fetches the
interrupt vector. If an interrupt request occurs while the interrupt mask is
set, the interrupt request is latched. Normally, the CPU processes the
latched interrupt as soon as the interrupt mask is cleared again.
A return from interrupt (RTI) instruction pulls the CPU registers from the
stack, restoring the interrupt mask to its cleared state. After any reset,
the interrupt mask is set and can be cleared only by a software
instruction.
Negative Flag
The CPU sets the negative flag when an arithmetic operation, logical
operation, or data manipulation produces a negative result.
Zero Flag
The CPU sets the zero flag when an arithmetic operation, logical
operation, or data manipulation produces a result of $00.
Carry/Borrow Flag
The CPU sets the carry/borrow flag when an addition operation
produces a carry out of bit 7 of the accumulator or when a subtraction
operation requires a borrow. Some logical operations and data
manipulation instructions also clear or set the carry/borrow flag.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
41
A G R E E M E N T
The CPU sets the half-carry flag when a carry occurs between bits 3 and
4 of the accumulator during an ADD or ADC operation. The half-carry
flag is required for binary-coded decimal (BCD) arithmetic operations.
N O N - D I S C L O S U R E
Half-Carry Flag
R E Q U I R E D
CPU and Instruction Set
CPU Registers
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
3.4 Arithmetic/Logic Unit (ALU)
The ALU performs the arithmetic and logical operations defined by the
instruction set.
The binary arithmetic circuits decode instructions and set up the ALU for
the selected operation. Most binary arithmetic is based on the addition
algorithm, carrying out subtraction as negative addition. Multiplication is
not performed as a discrete operation but as a chain of addition and shift
operations within the ALU. The multiply instruction (MUL) requires 11
internal clock cycles to complete this chain of operations.
3.5 Instruction Set Overview
The MCU instruction set has 62 instructions and uses eight addressing
modes. The instructions include all those of the M146805 CMOS Family
plus one more: the unsigned multiply (MUL) instruction. The MUL
instruction allows unsigned multiplication of the contents of the
accumulator (A) and the index register (X). The high-order product is
stored in the index register, and the low-order product is stored in the
accumulator.
3.6 Addressing Modes
The CPU uses eight addressing modes for flexibility in accessing data.
The addressing modes provide eight different ways for the CPU to find
the data required to execute an instruction. The eight addressing modes
are:
•
Inherent
•
Immediate
•
Direct
•
Extended
•
Indexed, no offset
•
Indexed, 8-bit offset
General Release Specification
42
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
•
Relative
3.6.1 Inherent
Inherent instructions are those that have no operand, such as return
from interrupt (RTI). Some of the inherent instructions act on data in the
CPU registers, such as set carry flag (SEC) and increment accumulator
(INCA). Inherent instructions require no operand address and are one
byte long.
3.6.2 Immediate
Immediate instructions are those that contain a value to be used in an
operation with the value in the accumulator or index register. Immediate
instructions require no operand address and are two bytes long. The
opcode is the first byte, and the immediate data value is the second byte.
3.6.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.
3.6.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.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
43
A G R E E M E N T
Indexed, 16-bit offset
N O N - D I S C L O S U R E
•
R E Q U I R E D
CPU and Instruction Set
Addressing Modes
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
3.6.5 Indexed, No Offset
Indexed instructions with no offset are 1-byte instructions that can
access data with variable addresses within the first 256 memory
locations. The index register contains the low byte of the effective
address of the operand. The CPU automatically uses $00 as the high
byte, so these instructions can address locations $0000–$00FF.
Indexed, no offset instructions are often used to move a pointer through
a table or to hold the address of a frequently used RAM or I/O location.
3.6.6 Indexed, 8-Bit Offset
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.
3.6.7 Indexed,16-Bit Offset
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.
As with direct and extended addressing, the Motorola assembler
determines the shortest form of indexed addressing.
General Release Specification
44
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
Relative addressing is only for branch instructions. If the branch
condition is true, the CPU finds the effective branch destination by
adding the signed byte following the opcode to the contents of the
program counter. If the branch condition is not true, the CPU goes to the
next instruction. The offset is a signed, two’s complement byte that gives
a branching range of –128 to +127 bytes from the address of the next
location after the branch instruction.
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.
3.7 Instruction Types
•
Register/Memory Instructions
•
Read-Modify-Write Instructions
•
Jump/Branch Instructions
•
Bit Manipulation Instructions
•
Control Instructions
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
N O N - D I S C L O S U R E
The MCU instructions fall into the following five categories:
General Release Specification
CPU and Instruction Set
A G R E E M E N T
3.6.8 Relative
R E Q U I R E D
CPU and Instruction Set
Instruction Types
45
R E Q U I R E D
CPU and Instruction Set
3.7.1 Register/Memory Instructions
These instructions operate on CPU registers and memory locations.
Most of them use two operands. One operand is in either the
accumulator or the index register. The CPU finds the other operand in
memory.
Table 3-1. Register/Memory Instructions
N O N - D I S C L O S U R E
A G R E E M E N T
Instruction
Add Memory Byte and Carry Bit to Accumulator
ADC
Add Memory Byte to Accumulator
ADD
AND Memory Byte with Accumulator
AND
Bit Test Accumulator
BIT
Compare Accumulator
CMP
Compare Index Register with Memory Byte
CPX
EXCLUSIVE OR Accumulator with Memory Byte
EOR
Load Accumulator with Memory Byte
LDA
Load Index Register with Memory Byte
LDX
Multiply
MUL
OR Accumulator with Memory Byte
ORA
Subtract Memory Byte and Carry Bit from Accumulator
SBC
Store Accumulator in Memory
STA
Store Index Register in Memory
STX
Subtract Memory Byte from Accumulator
SUB
General Release Specification
46
Mnemonic
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
3.7.2 Read-Modify-Write Instructions
These instructions read a memory location or a register, modify its
contents, and write the modified value back to the memory location or to
the register.
NOTE:
Do not use read-modify-write operations on write-only registers.
Table 3-2. Read-Modify-Write Instructions
Arithmetic Shift Left (Same as LSL)
ASL
Arithmetic Shift Right
ASR
Bit Clear
BCLR(1)
Bit Set
BSET(1)
Clear Register
CLR
Complement (One’s Complement)
COM
Decrement
DEC
Increment
INC
Logical Shift Left (Same as ASL)
LSL
Logical Shift Right
LSR
Negate (Two’s Complement)
NEG
Rotate Left through Carry Bit
ROL
Rotate Right through Carry Bit
ROR
Test for Negative or Zero
A G R E E M E N T
Mnemonic
N O N - D I S C L O S U R E
Instruction
TST(2)
1. Unlike other read-modify-write instructions, BCLR and
BSET use only direct addressing.
2. TST is an exception to the read-modify-write sequence because it does not write a replacement value.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
R E Q U I R E D
CPU and Instruction Set
Instruction Types
47
3.7.3 Jump/Branch Instructions
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.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
General Release Specification
48
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
R E Q U I R E D
CPU and Instruction Set
Instruction Types
Table 3-3. Jump and Branch Instructions
BCC
Branch if Carry Bit Set
BCS
Branch if Equal
BEQ
Branch if Half-Carry Bit Clear
BHCC
Branch if Half-Carry Bit Set
BHCS
Branch if Higher
BHI
Branch if Higher or Same
BHS
Branch if IRQ Pin High
BIH
Branch if IRQ Pin Low
BIL
Branch if Lower
BLO
Branch if Lower or Same
BLS
Branch if Interrupt Mask Clear
BMC
Branch if Minus
BMI
Branch if Interrupt Mask Set
BMS
Branch if Not Equal
BNE
Branch if Plus
BPL
Branch Always
BRA
Branch Never
Branch if Bit Set
BRCLR
BRN
BRSET
Branch to Subroutine
BSR
Unconditional Jump
JMP
Jump to Subroutine
JSR
MC68HC(7)05H12 — Rev. 1.0
A G R E E M E N T
Branch if Carry Bit Clear
Branch if Bit Clear
MOTOROLA
Mnemonic
N O N - D I S C L O S U R E
Instruction
General Release Specification
CPU and Instruction Set
49
R E Q U I R E D
CPU and Instruction Set
3.7.4 Bit Manipulation Instructions
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.
Table 3-4. Bit Manipulation Instructions
A G R E E M E N T
Instruction
Bit Clear
Mnemonic
BCLR
Branch if Bit Clear
BRCLR
Branch if Bit Set
BRSET
BSET
N O N - D I S C L O S U R E
Bit Set
General Release Specification
50
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
R E Q U I R E D
CPU and Instruction Set
Instruction Types
3.7.5 Control Instructions
These instructions act on CPU registers and control CPU operation
during program execution.
Table 3-5. Control Instructions
Mnemonic
Clear Carry Bit
CLC
Clear Interrupt Mask
CLI
NOP
Reset Stack Pointer
RSP
Return from Interrupt
RTI
Return from Subroutine
RTS
Set Carry Bit
SEC
Set Interrupt Mask
SEI
Software Interrupt
SWI
Transfer Accumulator to Index Register
TAX
Transfer Index Register to Accumulator
TXA
Stop CPU Clock and Enable Interrupts
WAIT
N O N - D I S C L O S U R E
No Operation
A G R E E M E N T
Instruction
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
51
3.8 Instruction Set Summary
ADC #opr
ADC opr
ADC opr
ADC opr,X
ADC opr,X
ADC ,X
ADD #opr
ADD opr
ADD opr
ADD opr,X
ADD opr,X
ADD ,X
AND #opr
AND opr
AND opr
AND opr,X
AND opr,X
AND ,X
ASL opr
ASLA
ASLX
ASL opr,X
ASL ,X
Description
↕◊ — ↕◊ ↕◊ ↕◊
IMM
DIR
EXT
IX2
IX1
IX
A9 ii
2
B9 dd 3
C9 hh ll 4
D9 ee ff 5
E9 ff
4
F9
3
↕◊ — ↕◊ ↕
↕
IMM
DIR
EXT
IX2
IX1
IX
AB ii
2
BB dd 3
CB hh ll 4
DB ee ff 5
EB ff
4
FB
3
— — ↕◊ ↕ —
IMM
DIR
EXT
IX2
IX1
IX
A4 ii
2
B4 dd 3
C4 hh ll 4
D4 ee ff 5
E4 ff
4
F4
3
38
48
58
68
78
dd
— — ↕◊ ↕
DIR
INH
INH
IX1
IX
DIR
INH
INH
IX1
IX
37
47
57
67
77
dd
REL
24
rr
3
11
13
15
17
19
1B
1D
1F
dd
dd
dd
dd
dd
dd
dd
dd
5
5
5
5
5
5
5
5
H I N Z C
A ← (A) + (M) + (C)
Add with Carry
A ← (A) + (M)
Add without Carry
A ← (A) ∧ (M)
Logical AND
Arithmetic Shift Left (Same as LSL)
C
0
b7
ASR opr
ASRA
ASRX
ASR opr,X
ASR ,X
Arithmetic Shift Right
BCC rel
Branch if Carry Bit Clear
↕
b0
C
b7
— — ↕◊ ↕
↕
b0
PC ← (PC) + 2 + rel ? C = 0
Mn ← 0
— — — — —
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
— — — — —
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
ff
ff
Cycles
Operation
Effect on
CCR
Opcode
Source
Form
Operand
Table 3-6. Instruction Set Summary
Address
Mode
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
5
3
3
6
5
5
3
3
6
5
BCLR n opr
Clear Bit n
BCS rel
Branch if Carry Bit Set (Same as BLO)
PC ← (PC) + 2 + rel ? C = 1
— — — — —
REL
25
rr
3
BEQ rel
Branch if Equal
PC ← (PC) + 2 + rel ? Z = 1
— — — — —
REL
27
rr
3
BHCC rel
Branch if Half-Carry Bit Clear
PC ← (PC) + 2 + rel ? H = 0
— — — — —
REL
28
rr
3
BHCS rel
Branch if Half-Carry Bit Set
PC ← (PC) + 2 + rel ? H = 1
— — — — —
REL
29
rr
3
BHI rel
Branch if Higher
BHS rel
Branch if Higher or Same
PC ← (PC) + 2 + rel ? C ∨ Z = 0 — — — — —
PC ← (PC) + 2 + rel ? C = 0
General Release Specification
52
— — — — —
REL
22
rr
3
REL
24
rr
3
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
Operand
Cycles
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
(A) ∧ (M)
— — ↕◊ ↕ —
IMM
DIR
EXT
IX2
IX1
IX
A5 ii
2
B5 dd 3
C5 hh ll 4
D5 ee ff 5
E5 ff
4
F5
3
PC ← (PC) + 2 + rel ? C = 1
— — — — —
REL
25
rr
3
PC ← (PC) + 2 + rel ? C ∨ Z = 1 — — — — —
REL
23
rr
3
Operation
Description
Effect on
CCR
H I N Z C
BIT #opr
BIT opr
BIT opr
BIT opr,X
BIT opr,X
BIT ,X
Bit Test Accumulator with Memory Byte
BLO rel
Branch if Lower (Same as BCS)
BLS rel
Branch if Lower or Same
BMC rel
Branch if Interrupt Mask Clear
PC ← (PC) + 2 + rel ? I = 0
— — — — —
REL
2C
rr
3
BMI rel
Branch if Minus
PC ← (PC) + 2 + rel ? N = 1
— — — — —
REL
2B
rr
3
BMS rel
Branch if Interrupt Mask Set
PC ← (PC) + 2 + rel ? I = 1
— — — — —
REL
2D
rr
3
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
01
03
05
07
09
0B
0D
0F
dd rr
dd rr
dd rr
dd rr
dd rr
dd rr
dd rr
dd rr
5
5
5
5
5
5
5
5
BRCLR n opr rel Branch if Bit n Clear
BRN rel
Branch Never
BRSET n opr rel Branch if Bit n Set
BSET n opr
Set Bit n
PC ← (PC) + 2 + rel ? Mn = 0
PC ← (PC) + 2 + rel ? 1 = 0
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
— — — — ↕◊
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
— — — — —
21
rr
3
PC ← (PC) + 2 + rel ? Mn = 1
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
— — — — ◊↕
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
REL
00
02
04
06
08
0A
0C
0E
dd rr
dd rr
dd rr
dd rr
dd rr
dd rr
dd rr
dd rr
5
5
5
5
5
5
5
5
Mn ← 1
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
— — — — —
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
10
12
14
16
18
1A
1C
1E
dd
dd
dd
dd
dd
dd
dd
dd
5
5
5
5
5
5
5
5
PC ← (PC) + 2; push (PCL)
SP ← (SP) – 1; push (PCH)
SP ← (SP) – 1
PC ← (PC) + rel
— — — — —
REL
AD
rr
6
BSR rel
Branch to Subroutine
CLC
Clear Carry Bit
C←0
— — — — 0
INH
98
2
CLI
Clear Interrupt Mask
I←0
— 0 — — —
INH
9A
2
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
CPU and Instruction Set
53
A G R E E M E N T
Opcode
BIH rel
Source
Form
N O N - D I S C L O S U R E
Address
Mode
Table 3-6. Instruction Set Summary (Continued)
R E Q U I R E D
CPU and Instruction Set
Instruction Set Summary
CLR opr
CLRA
CLRX
CLR opr,X
CLR ,X
CMP #opr
CMP opr
CMP opr
CMP opr,X
CMP opr,X
CMP ,X
COM opr
COMA
COMX
COM opr,X
COM ,X
CPX #opr
CPX opr
CPX opr
CPX opr,X
CPX opr,X
CPX ,X
DEC opr
DECA
DECX
DEC opr,X
DEC ,X
EOR #opr
EOR opr
EOR opr
EOR opr,X
EOR opr,X
EOR ,X
INC opr
INCA
INCX
INC opr,X
INC ,X
JMP opr
JMP opr
JMP opr,X
JMP opr,X
JMP ,X
Description
3F
4F
5F
6F
7F
dd
↕
IMM
DIR
EXT
IX2
IX1
IX
A1 ii
2
B1 dd 3
C1 hh ll 4
D1 ee ff 5
E1 ff
4
F1
3
1
DIR
INH
INH
IX1
IX
33
43
53
63
73
— — ↕◊ ◊↕ ◊↕
IMM
DIR
EXT
IX2
IX1
IX
A3 ii
2
B3 dd 3
C3 hh ll 4
D3 ee ff 5
E3 ff
4
F3
3
— — ↕◊ ↕◊ —
DIR
INH
INH
IX1
IX
3A
4A
5A
6A
7A
— — ↕◊ ↕ —
IMM
DIR
EXT
IX2
IX1
IX
A8 ii
2
B8 dd 3
C8 hh ll 4
D8 ee ff 5
E8 ff
4
F8
3
— — ↕◊ ↕◊ —
DIR
INH
INH
IX1
IX
3C
4C
5C
6C
7C
DIR
EXT
IX2
IX1
IX
BC dd 2
CC hh ll 3
DC ee ff 4
EC ff
3
FC
2
H I N Z C
M ← $00
A ← $00
X ← $00
M ← $00
M ← $00
Clear Byte
Compare Accumulator with Memory Byte
Complement Byte (One’s Complement)
Compare Index Register with Memory Byte
EXCLUSIVE OR Accumulator with Memory Byte
Unconditional Jump
M ← (M) = $FF – (M)
A ← (A) = $FF – (A)
X ← (X) = $FF – (X)
M ← (M) = $FF – (M)
M ← (M) = $FF – (M)
(X) – (M)
M ← (M) – 1
A ← (A) – 1
X ← (X) – 1
M ← (M) – 1
M ← (M) – 1
Decrement Byte
Increment Byte
(A) – (M)
A ← (A) ⊕ (M)
M ← (M) + 1
A ← (A) + 1
X ← (X) + 1
M ← (M) + 1
M ← (M) + 1
PC ← Jump Address
General Release Specification
54
DIR
INH
INH
IX1
IX
Effect on
CCR
— — 0 1 —
— — ↕◊ ↕
— — ↕◊ ↕◊
— — — — —
ff
dd
ff
dd
ff
dd
ff
Cycles
Operation
Operand
Source
Form
Opcode
Table 3-6. Instruction Set Summary (Continued)
Address
Mode
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
5
3
3
6
5
5
3
3
6
5
5
3
3
6
5
5
3
3
6
5
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
LSL opr
LSLA
LSLX
LSL opr,X
LSL ,X
Jump to Subroutine
X ← (M)
Load Index Register with Memory Byte
Logical Shift Left (Same as ASL)
C
0
b7
Logical Shift Right
MUL
Unsigned Multiply
Negate Byte (Two’s Complement)
NOP
No Operation
C
A6 ii
2
B6 dd 3
C6 hh ll 4
D6 ee ff 5
E6 ff
4
F6
3
— — ↕◊ ↕◊ —
IMM
DIR
EXT
IX2
IX1
IX
AE ii
2
BE dd 3
CE hh ll 4
DE ee ff 5
EE ff
4
FE
3
38
48
58
68
78
dd
— — ↕◊ ↕
DIR
INH
INH
IX1
IX
DIR
INH
INH
IX1
IX
34
44
54
64
74
dd
0 — — — 0
INH
42
— — ↕◊ ↕
DIR
INH
INH
IX1
IX
30
40
50
60
70
— — — — —
INH
9D
— — ↕◊ ↕ —
IMM
DIR
EXT
IX2
IX1
IX
AA ii
2
BA dd 3
CA hh ll 4
DA ee ff 5
EA ff
4
FA
3
M ← –(M) = $00 – (M)
A ← –(A) = $00 – (A)
X ← –(X) = $00 – (X)
M ← –(M) = $00 – (M)
M ← –(M) = $00 – (M)
A ← (A) ∨ (M)
Logical OR Accumulator with Memory
— — ↕◊ ↕
DIR
INH
INH
IX1
IX
39
49
59
69
79
Rotate Byte Left through Carry Bit
C
b7
↕
— — 0 ↕
↕
b0
↕
↕
ff
ff
Cycles
— — ↕◊ ↕ —
IMM
DIR
EXT
IX2
IX1
IX
b0
X : A ← (X) × (A)
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
BD dd 5
CD hh ll 6
DD ee ff 7
ED ff
6
FD
5
b0
0
b7
NEG opr
NEGA
NEGX
NEG opr,X
NEG ,X
ROL opr
ROLA
ROLX
ROL opr,X
ROL ,X
A ← (M)
Load Accumulator with Memory Byte
LSR opr
LSRA
LSRX
LSR opr,X
LSR ,X
ORA #opr
ORA opr
ORA opr
ORA opr,X
ORA opr,X
ORA ,X
PC ← (PC) + n (n = 1, 2, or 3)
Push (PCL); SP ← (SP) – 1
Push (PCH); SP ← (SP) – 1
PC ← Effective Address
5
3
3
6
5
5
3
3
6
5
11
dd
ff
5
3
3
6
5
2
dd
ff
5
3
3
6
5
General Release Specification
CPU and Instruction Set
55
A G R E E M E N T
LDX #opr
LDX opr
LDX opr
LDX opr,X
LDX opr,X
LDX ,X
— — — — —
DIR
EXT
IX2
IX1
IX
H I N Z C
N O N - D I S C L O S U R E
LDA #opr
LDA opr
LDA opr
LDA opr,X
LDA opr,X
LDA ,X
Description
Opcode
JSR opr
JSR opr
JSR opr,X
JSR opr,X
JSR ,X
Operation
Effect on
CCR
Address
Mode
Source
Form
Operand
Table 3-6. Instruction Set Summary (Continued)
R E Q U I R E D
CPU and Instruction Set
Instruction Set Summary
N O N - D I S C L O S U R E
Operand
DIR
INH
INH
IX1
IX
36
46
56
66
76
dd
— — — — —
INH
9C
2
Return from Interrupt
SP ← (SP) + 1; Pull (CCR)
SP ← (SP) + 1; Pull (A)
SP ← (SP) + 1; Pull (X)
SP ← (SP) + 1; Pull (PCH)
SP ← (SP) + 1; Pull (PCL)
↕◊ ↕
↕
INH
80
9
Return from Subroutine
SP ← (SP) + 1; Pull (PCH)
SP ← (SP) + 1; Pull (PCL)
— — — — —
INH
81
6
— — ◊↕ ↕
↕
IMM
DIR
EXT
IX2
IX1
IX
A2 ii
2
B2 dd 3
C2 hh ll 4
D2 ee ff 5
E2 ff
4
F2
3
Source
Form
Operation
Effect on
CCR
Description
H I N Z C
ROR opr
RORA
RORX
ROR opr,X
ROR ,X
Rotate Byte Right through Carry Bit
RSP
Reset Stack Pointer
SP ← $00FF
RTI
RTS
C
b7
— — ↕◊ ↕
↕
b0
↕
↕
ff
Cycles
Opcode
Table 3-6. Instruction Set Summary (Continued)
Address
Mode
A G R E E M E N T
R E Q U I R E D
CPU and Instruction Set
5
3
3
6
5
SBC #opr
SBC opr
SBC opr
SBC opr,X
SBC opr,X
SBC ,X
Subtract Memory Byte and Carry Bit from
Accumulator
SEC
Set Carry Bit
C←1
— — — — 1
INH
99
2
SEI
Set Interrupt Mask
I←1
— 1 — — —
INH
9B
2
— — ↕◊ ↕ —
DIR
EXT
IX2
IX1
IX
B7 dd 4
C7 hh ll 5
D7 ee ff 6
E7 ff
5
F7
4
— — ↕◊ ↕ —
DIR
EXT
IX2
IX1
IX
BF dd 4
CF hh ll 5
DF ee ff 6
EF ff
5
FF
4
— — ↕
↕
IMM
DIR
EXT
IX2
IX1
IX
A0 ii
2
B0 dd 3
C0 hh ll 4
D0 ee ff 5
E0 ff
4
F0
3
PC ← (PC) + 1; Push (PCL)
SP ← (SP) – 1; Push (PCH)
SP ← (SP) – 1; Push (X)
SP ← (SP) – 1; Push (A)
— 1 — — —
SP ← (SP) – 1; Push (CCR)
SP ← (SP) – 1; I ← 1
PCH ← Interrupt Vector High Byte
PCL ← Interrupt Vector Low Byte
INH
83
10
INH
97
2
STA opr
STA opr
STA opr,X
STA opr,X
STA ,X
STX opr
STX opr
STX opr,X
STX opr,X
STX ,X
SUB #opr
SUB opr
SUB opr
SUB opr,X
SUB opr,X
SUB ,X
A ← (A) – (M) – (C)
M ← (A)
Store Accumulator in Memory
M ← (X)
Store Index Register In Memory
Subtract Memory Byte from Accumulator
SWI
Software Interrupt
TAX
Transfer Accumulator to Index Register
A ← (A) – (M)
X ← (A)
General Release Specification
56
↕
— — — — —
MC68HC(7)05H12 — Rev. 1.0
CPU and Instruction Set
MOTOROLA
TXA
Transfer Index Register to Accumulator
WAIT
Stop CPU Clock and Enable Interrupts
Accumulator
Carry/borrow flag
Condition code register
Direct address of operand
Direct address of operand and relative offset of branch instruction
Direct addressing mode
High and low bytes of offset in indexed, 16-bit offset addressing
Extended addressing mode
Offset byte in indexed, 8-bit offset addressing
Half-carry flag
High and low bytes of operand address in extended addressing
Interrupt mask
Immediate operand byte
Immediate addressing mode
Inherent addressing mode
Indexed, no offset addressing mode
Indexed, 8-bit offset addressing mode
Indexed, 16-bit offset addressing mode
Memory location
Negative flag
Any bit
(M) – $00
A ← (X)
— — — — —
INH
9F
2
0
— — —
◊
INH
8F
2
— — ↕
—
opr
PC
PCH
PCL
REL
rel
rr
SP
X
Z
#
∧
∨
⊕
()
–( )
←
?
:
↕
—
MC68HC(7)05H12 — Rev. 1.0
↕ —
ff
4
3
3
5
4
Operand (one or two bytes)
Program counter
Program counter high byte
Program counter low byte
Relative addressing mode
Relative program counter offset byte
Relative program counter offset byte
Stack pointer
Index register
Zero flag
Immediate value
Logical AND
Logical OR
Logical EXCLUSIVE OR
Contents of
Negation (two’s complement)
Loaded with
If
Concatenated with
Set or cleared
Not affected
General Release Specification
CPU and Instruction Set
A G R E E M E N T
dd
N O N - D I S C L O S U R E
Test Memory Byte for Negative or Zero
MOTOROLA
3D
4D
5D
6D
7D
H I N Z C
TST opr
TSTA
TSTX
TST opr,X
TST ,X
A
C
CCR
dd
dd rr
DIR
ee ff
EXT
ff
H
hh ll
I
ii
IMM
INH
IX
IX1
IX2
M
N
n
DIR
INH
INH
IX1
IX
Effect on
CCR
Cycles
Description
Operand
Operation
Opcode
Source
Form
Address
Mode
Table 3-6. Instruction Set Summary (Continued)
R E Q U I R E D
CPU and Instruction Set
Instruction Set Summary
57
58
General Release Specification
CPU and Instruction Set
F
E
D
C
B
A
9
8
7
6
5
4
3
2
1
0
MSB
LSB
1
2
Branch
REL
3
DIR
4
5
6
Read-Modify-Write
INH
INH
IX1
7
IX
8
9
Control
INH
INH
A
IMM
B
DIR
C
INH = InherentREL = Relative
IMM = ImmediateIX = Indexed, No Offset
DIR = DirectIX1 = Indexed, 8-Bit Offset
EXT = ExtendedIX2 = Indexed, 16-Bit Offset
LSB of Opcode in Hexadecimal
MSB
0
LSB
MSB of Opcode in Hexadecimal
4
SUB
IX1 1
4
CMP
IX1 1
4
SBC
IX1 1
4
CPX
IX1 1
4
AND
IX1 1
4
BIT
IX1 1
4
LDA
IX1 1
5
STA
IX1 1
4
EOR
IX1 1
4
ADC
IX1 1
4
ORA
IX1 1
4
ADD
IX1 1
3
JMP
IX1 1
6
JSR
IX1 1
4
LDX
IX1 1
5
STX
IX1 1
E
IX1
5 Number of Cycles
BRSET0 Opcode Mnemonic
3
DIR Number of Bytes/Addressing Mode
0
5
SUB
IX2 2
5
CMP
IX2 2
5
SBC
IX2 2
5
CPX
IX2 2
5
AND
IX2 2
5
BIT
IX2 2
5
LDA
IX2 2
6
STA
IX2 2
5
EOR
IX2 2
5
ADC
IX2 2
5
ORA
IX2 2
5
ADD
IX2 2
4
JMP
IX2 2
7
JSR
IX2 2
5
LDX
IX2 2
6
STX
IX2 2
D
Register/Memory
EXT
IX2
STX
LDX
JSR
JMP
ADD
ORA
ADC
EOR
STA
LDA
BIT
AND
CPX
SBC
CMP
SUB
F
IX
IX
IX
4
IX
3
IX
5
IX
2
IX
3
IX
3
IX
3
IX
3
IX
4
IX
3
IX
3
IX
3
IX
3
IX
3
IX
3
3
F
E
D
C
B
A
9
8
7
6
5
4
3
2
1
0
MSB
LSB
R E Q U I R E D
5
5
3
5
3
3
6
5
9
2
3
4
BRSET0
BSET0
BRA
NEG
NEGA
NEGX
NEG
NEG
RTI
SUB
SUB
SUB
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
5
5
3
6
2
3
4
BRCLR0
BCLR0
BRN
RTS
CMP
CMP
CMP
3
DIR 2
DIR 2
REL
1
INH
2
IMM 2
DIR 3
EXT 3
5
5
3
11
2
3
4
BRSET1
BSET1
BHI
MUL
SBC
SBC
SBC
3
DIR 2
DIR 2
REL
1
INH
2
IMM 2
DIR 3
EXT 3
5
5
3
5
3
3
6
5
10
2
3
4
BRCLR1
BCLR1
BLS
COM
COMA
COMX
COM
COM
SWI
CPX
CPX
CPX
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
5
5
3
5
3
3
6
5
2
3
4
BRSET2
BSET2
BCC
LSR
LSRA
LSRX
LSR
LSR
AND
AND
AND
3
DIR 2
DIR 2
REL 2
DIR 1
INH 1
INH 2
IX1 1
IX
2
IMM 2
DIR 3
EXT 3
5
5
3
2
3
4
BRCLR2
BCLR2 BCS/BLO
BIT
BIT
BIT
3
DIR 2
DIR 2
REL
2
IMM 2
DIR 3
EXT 3
5
5
3
5
3
3
6
5
2
3
4
BRSET3
BSET3
BNE
ROR
RORA
RORX
ROR
ROR
LDA
LDA
LDA
3
DIR 2
DIR 2
REL 2
DIR 1
INH 1
INH 2
IX1 1
IX
2
IMM 2
DIR 3
EXT 3
5
5
3
5
3
3
6
5
2
4
5
BRCLR3
BCLR3
BEQ
ASR
ASRA
ASRX
ASR
ASR
TAX
STA
STA
3
DIR 2
DIR 2
REL 2
DIR 1
INH 1
INH 2
IX1 1
IX
1
INH
2
DIR 3
EXT 3
5
5
3
5
3
3
6
5
2
2
3
4
BRSET4
BSET4
BHCC
ASL/LSL ASLA/LSLA ASLX/LSLX ASL/LSL ASL/LSL
CLC
EOR
EOR
EOR
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
5
5
3
5
3
3
6
5
2
2
3
4
BRCLR4
BCLR4
BHCS
ROL
ROLA
ROLX
ROL
ROL
SEC
ADC
ADC
ADC
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
5
5
3
5
3
3
6
5
2
2
3
4
BRSET5
BSET5
BPL
DEC
DECA
DECX
DEC
DEC
CLI
ORA
ORA
ORA
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
5
5
3
2
2
3
4
BRCLR5
BCLR5
BMI
SEI
ADD
ADD
ADD
3
DIR 2
DIR 2
REL
1
INH 2
IMM 2
DIR 3
EXT 3
5
5
3
5
3
3
6
5
2
2
3
BRSET6
BSET6
BMC
INC
INCA
INCX
INC
INC
RSP
JMP
JMP
3
DIR 2
DIR 2
REL 2
DIR 1
INH 1
INH 2
IX1 1
IX
1
INH
2
DIR 3
EXT 3
5
5
3
4
3
3
5
4
2
6
5
6
BRCLR6
BCLR6
BMS
TST
TSTA
TSTX
TST
TST
NOP
BSR
JSR
JSR
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
5
5
3
2
3
4
BRSET7
BSET7
BIL
LDX
LDX
LDX
3
DIR 2
DIR 2
REL
2
IMM 2
DIR 3
EXT 3
5
5
3
5
3
3
6
5
2
2
4
5
BRCLR7
BCLR7
BIH
CLR
CLRA
CLRX
CLR
CLR
WAIT
TXA
STX
STX
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
0
Bit Manipulation
DIR
DIR
A G R E E M E N T
Table 3-7. Opcode Map
N O N - D I S C L O S U R E
CPU and Instruction Set
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
4.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.3
CPU Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.4
Reset Interrupt Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.5
Software Interrupt (SWI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.6
Hardware Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.7
External Interrupt (IRQ/Keyboard) . . . . . . . . . . . . . . . . . . . . . . 63
4.8
8-Bit Timer Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.9
16-Bit Timer1 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.10
16-Bit Timer2 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.11
SCI Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.12
SPI Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.13
WAIT Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Interrupts
59
R E Q U I R E D
4.1 Contents
A G R E E M E N T
Section 4. Interrupts
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
Interrupts
4.2 Introduction
The MCU can be interrupted eight different ways:
1. Nonmaskable Software Interrupt Instruction (SWI)
2. External Asynchronous Interrupt (IRQ)
3. External Keyboard Wakeup on Port A
4. Internal 8 bit Timer Interrupt (CTIMER)
6. Internal 16-bit Timer2 Interrupt (TIMER2)
7. Internal Serial Communications Interface Interrupt (SCI)
8. Internal Serial Peripheral Interface Interrupt (SPI)
4.3 CPU Interrupt Processing
Interrupts cause the processor to save register contents on the stack
and to set the interrupt mask (I-bit) to prevent additional interrupts.
Unlike RESET, hardware interrupts do not cause the current instruction
execution to be halted, but are considered pending until the current
instruction is complete.
N O N - D I S C L O S U R E
A G R E E M E N T
5. Internal 16-bit Timer1 Interrupt (TIMER1)
If interrupts are not masked (I-bit in the CCR is clear) and the
corresponding interrupt enable bit is set, then the processor will proceed
with interrupt processing. Otherwise, the next instruction is fetched and
executed. If an interrupt occurs the processor completes the current
instruction, then stacks the current CPU register states, sets the I-bit to
inhibit further interrupts, and finally checks the pending hardware
interrupts. If more than one interrupt is pending following the stacking
operation, the interrupt with the highest vector location shown in
Table 4-1 will be serviced first. The SWI is executed the same as any
other instruction, regardless of the I-bit state.
When an interrupt is to be processed the CPU fetches the address of the
appropriate interrupt software service routine from the vector table at
locations $3FF0 to $3FFF as defined in Table 4-1.
General Release Specification
60
MC68HC(7)05H12 — Rev. 1.0
Interrupts
MOTOROLA
R E Q U I R E D
Interrupts
CPU Interrupt Processing
Table 4-1. Reset/Interrupt Vector Addresses
Source
Local
Mask
Global
Mask
Priority
(1 = Highest)
Vector
Address
None
None
1
$3FFE–$3FFF
Power-On Logic
Reset
RESET Pin
User Code
None
None
Same Priority
As Instruction
$3FFC–$3FFD
External
Interrupt /
IRQ Pin
None
I Bit
2
$3FFA–$3FFB
KEY wakeup
PTA KEY Pins
PAIE Bits
Core Timer
Interrupts
RTIF Bit
RTIE Bit
TOF Bit
TOFE Bit
I Bit
3
$3FF8–$3FF9
I Bit
4
$3FF6–$3FF7
I Bit
5
$3FF4–$3FF5
I Bit
6
$3FF2–$3FF3
I Bit
7
$3FF0–$3FF1
16-Bit Timer 1
Interrupts
16-Bit Timer 2
Interrupts
ICF Bits
ICIE Bits
OCF Bits
OCIE Bits
TOF Bit
TOIE Bit
ICF Bits
ICIE Bits
OCF Bits
OCIE Bits
TOF Bit
TOIE Bit
SPIF Bit
SPI
Interrupts
MODF Bit
TDRE Bit
TC Bit
SCI
Interrupts
RDRF Bit
OR Bit
IDLE Bit
SPIE
A G R E E M E N T
COP Watchdog
Software
Interrupt
(SWI)
TCIE Bit
RIE Bit
ILIE Bit
The M68HC05 CPU does not support interruptible instructions,
therefore, the maximum latency to the first instruction of the interrupt
service routine must include the longest instruction execution time plus
stacking overhead.
Latency = (Longest instruction execution time + 10) x tCYC secs
An RTI instruction is used to signify when the interrupt software service
routine is completed. The RTI instruction causes the register contents to
be recovered from the stack and normal processing to resume at the
next instruction that was to be executed when the interrupt took place.
Figure 4-1 shows the sequence of events that occur during interrupt
processing.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Interrupts
61
N O N - D I S C L O S U R E
Function
R E Q U I R E D
Interrupts
FROM
RESET
Y
I-BIT
IN CCR
SET?
N
IRQ/KEY
EXTERNAL
INTERRUPT
Y
CLEAR IRQ
REQUEST
LATCH
A G R E E M E N T
N
INTERNAL
8 BIT CORE TIMER
INTERRUPT
Y
N
INTERNAL
16 BIT TIMER1
INTERRUPT
Y
N
INTERNAL
16 BIT TIMER2
INTERRUPT
Y
N
N O N - D I S C L O S U R E
INTERNAL
SPI
INTERRUPT
Y
STACK
PC,X,A,CCR
N
INTERNAL
SCI
INTERRUPT
Y
SET I BIT IN
CC REGISTER
N
LOAD PC FROM
APPROPRIATE
VECTOR
FETCH NEXT INSTRUCTION
SWI
INSTRUCTION
?
Y
N
Y
RTI
INSTRUCTION
?
N
RESTORE REGISTERS
FROM STACK:
CCR,A,X,PC
EXECUTE
INSTRUCTION
Figure 4-1. Interrupt Processing Flowchart
General Release Specification
62
MC68HC(7)05H12 — Rev. 1.0
Interrupts
MOTOROLA
4.5 Software Interrupt (SWI)
The SWI is an executable instruction and a non-maskable interrupt since
it is executed regardless of the state of the I-bit in the CCR. If the I-bit is
zero (interrupts enabled), the SWI instruction executes after interrupts
which were pending before the SWI was fetched, or before interrupts
generated after the SWI was fetched. The interrupt service routine
address is specified by the contents of memory locations $3FFC and
$3FFD.
4.6 Hardware Interrupts
All hardware interrupts except reset are maskable by the I-bit in the
CCR. If the I-bit is set, all hardware interrupts (internal and external) are
disabled. Clearing the I-bit enables the hardware interrupts. There are
two types of hardware interrupts (external, internal) which are explained
in the following sections.
4.7 External Interrupt (IRQ/Keyboard)
If the interrupt mask bit (I bit) of the CCR is set, all maskable interrupts
(internal and external) are disabled. Clearing the I bit enables interrupts.
The interrupt request is latched immediately following the falling edge of
IRQ. It is then synchronized internally and serviced by the interrupt
service routine located at the address specified by the contents of
$3FFA and $3FFB.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Interrupts
63
A G R E E M E N T
The reset function is not in the strictest sense an interrupt; however, it is
acted upon in a similar manner as shown in Figure 4-1. A low level input
on the RESET pin or internally generated RST signal causes the
program to vector to its starting address which is specified by the
contents of memory locations $3FFE and $3FFF. The I-bit in the
condition code register is also set. The MCU is configured to a known
state during this type of reset as described in Section 5 Resets.
N O N - D I S C L O S U R E
4.4 Reset Interrupt Sequence
R E Q U I R E D
Interrupts
Reset Interrupt Sequence
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Interrupts
Either a level-sensitive and edge-sensitive trigger, or an edge-sensitiveonly trigger can be implemented by software.
NOTE:
The internal interrupt latch is cleared in the first part of the interrupt
service routine; therefore, one external interrupt pulse could be latched
and serviced as soon as the I bit is cleared.
The BIH and BIL instructions will only apply to the level on the IRQ pin
itself, and not to the output of the logic OR function with the Port A
keyboard wakeup interrupts. The state of the individual Port A pins can
be checked by reading the appropriate Port A pins as inputs.
4.8 8-Bit Timer Interrupt
This timer can create two types of interrupts. A timer overflow interrupt
will occur whenever the 8-bit timer rolls over from $FF to $00 and the
enable bit TOFE is set. A real time interrupt will occur whenever the
programmed time elapses and the enable bit RTIE is set. This interrupt
will vector to the interrupt service routine located at the address specified
by the contents of memory location $3FF8 and $3FF9.
4.9 16-Bit Timer1 Interrupt
There are five different timer interrupt flags that cause a 16-bit timer1
interrupt whenever they are set and enabled. The interrupt flags are in
the timer1 status register (TSR), and the enable bits are in the timer1
control register1 (TCR1). Any of these interrupts will vector to the same
interrupt service routine, located at the address specified by the contents
of memory location $3FF6 and $3FF7.
4.10 16-Bit Timer2 Interrupt
There are five different timer interrupt flags that cause a 16-bit timer2
interrupt whenever they are set and enabled. The interrupt flags are in
the timer2 status register (TSR), and the enable bits are in the timer2
control register1 (TCR1). Any of these interrupts will vector to the same
General Release Specification
64
MC68HC(7)05H12 — Rev. 1.0
Interrupts
MOTOROLA
There are five different interrupt flags (TDRE, TC, OR, RDRF, IDLE) that
will cause an SCI interrupt whenever they are set and enabled. These
five interrupt flags are found in the five most significant bits of the SCI
status register SCSR. The actual processor interrupt is generated only if
the I-bit in the condition code register is clear and the enable bit in the
serial communications control register 2 (SCCR2) is enabled. The SCI
interrupt causes the program counter to vector to the address pointed to
by memory locations $3FF2–$3FF3 which contain the start address of
the interrupt service routine. Software in the SCI interrupt service routine
must determine the priority and cause of the SCI interrupt by examining
the interrupt flags and the status bits in the serial communications status
register (SCSR).
4.12 SPI Interrupt
There are two different SPI interrupt flags that cause an SPI interrupt
whenever they are set and enabled. The interrupt flags are in the SPI
status register (SPSR), and the enable bits are in the SPI control register
(SPCR). Either of these interrupts will vector to the same interrupt
service routine, located at the address specified by the contents of
memory locations $3FF0 and $3FF1.
4.13 WAIT Mode
All modules that are capable of generating interrupts in WAIT mode will
be allowed to do so if the module is configured properly. The I-bit is
automatically cleared when WAIT mode is entered. Interrupts detected
on port A are recognized in WAIT modes.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Interrupts
65
A G R E E M E N T
4.11 SCI Interrupt
N O N - D I S C L O S U R E
interrupt service routine, located at the address specified by the contents
of memory location $3FF4 and $3FF5.
R E Q U I R E D
Interrupts
SCI Interrupt
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Interrupts
General Release Specification
66
MC68HC(7)05H12 — Rev. 1.0
Interrupts
MOTOROLA
5.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.3
External Reset (RESET). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.4
Internal Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.5
Power-On Reset (POR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.6
Computer Operating Properly Reset (COPR). . . . . . . . . . . . . . 70
5.6.1
Resetting the COP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.6.2
COP During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.6.3
COP Watchdog Timer Considerations . . . . . . . . . . . . . . . . 71
5.6.4
COP Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.7
Illegal Address Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.8
Low Voltage Reset (LVR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.8.1
LVR Operation in WAIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.2 Introduction
The MCU can be reset from five sources: one external input and four
internal restart conditions. The RESET pin is an input with a Schmitt
trigger. All the internal peripheral modules will be reset by the internal
reset signal (RST). Refer to Figure 5-2 for reset timing detail. The
RESET pin contains an internal pullup device.
5.3 External Reset (RESET)
The RESET pin is the only external source of a reset. This pin is
connected to a Schmitt trigger input gate to provide an upper and lower
threshold voltage separated by a minimum amount of hysteresis. This
external reset occurs whenever the RESET pin is pulled below the lower
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Resets
67
R E Q U I R E D
5.1 Contents
A G R E E M E N T
Section 5. Resets
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
threshold and remains in reset until the RESET pin rises above the
upper threshold. This active low input will generate the RST signal and
reset the CPU and peripherals. When the RESET pin goes high, the
MCU will resume operation on the following cycle.
NOTE:
Activation of the RST signal is generally referred to as reset of the
device, unless otherwise specified.
The RESET pin can also act as an open drain output. It will be pulled to
a low state by an internal pulldown that is activated by any reset source.
This RESET pulldown device will be asserted for 3–4 cycles of the
internal clock, fOP, or as long as an internal reset source is asserted.
When the external RESET pin is asserted, the pulldown device will be
turned on for the 3–4 internal clock cycles.
5.4 Internal Resets
The four internally generated resets are the initial power-on reset
function, the COP Watchdog Timer reset, the illegal address detector,
and the low voltage reset. All internal resets will also assert (pull to logic
zero) the external RESET pin for the duration of the reset or 3–4 internal
clock cycles, whichever is longer.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Resets
VDD
INTERNAL
PULLUP
RESET
PIN
INTERNAL
RESET
LOGIC
INTERNAL
RESETS
Figure 5-1. Internal Resets
General Release Specification
68
MC68HC(7)05H12 — Rev. 1.0
Resets
MOTOROLA
MOTOROLA
0v
MC68HC(7)05H12 — Rev. 1.0
Resets
NEW
PCL
3FFF
tcyc
OP
CODE
NEW PC NEW PC
3
tRL
3FFE
3FFE
3FFE
PCH
3FFE
PCL
3FFF
OP
CODE
N O N - D I S C L O S U R E
A G R E E M E N T
Figure 5-2. RESET and POR Timing Diagram
R E Q U I R E D
NEW PC NEW PC
POR THRESHOLD (TYP. 1-2V) 4
NOTES:
1. Internal timing signal and bus information not available externally.
2. OSC1 line is not meant to represent frequency. It is only used to represent time.
3. The next rising edge of the internal processor clock following the rising edge of RESET initiates the reset sequence.
4. VDD must fall to a level lower than VPOR in order to recognized as a power on reset.
If LVR is enabled, VDD must fall below the LVR Power Off Reset Voltage VROFF.
NEW
PCH
INTERNAL
DATA
BUS 1
RESET
3FFE
4064 tcyc
INTERNAL
ADDRESS
BUS 1
INTERNAL
PROCESSOR
CLOCK 1
OSC1 2
V DD
Resets
Internal Resets
General Release Specification
69
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Resets
5.5 Power-On Reset (POR)
The internal POR is generated on power-up to allow the clock oscillator
to stabilize. The POR is strictly for power turn-on conditions and is not
able to detect a drop in the power supply voltage (brown-out). There is
an oscillator stabilization delay of 4064 internal processor bus clock
cycles after the oscillator becomes active.
The POR will generate the RST signal which will reset the CPU. If any
other reset function is active at the end of this 4064 cycle delay, the RST
signal will remain in the reset condition until the other reset condition(s)
end.
POR will activate the RESET pin pulldown device connected to the pin.
VDD must drop below VPOR in order for the internal POR circuit to detect
the next rise of VDD.
5.6 Computer Operating Properly Reset (COPR)
The MCU contains a watchdog timer that automatically times out if not
reset (cleared) within a specific time by a program reset sequence. If the
COP watchdog timer is allowed to time-out, an internal reset is
generated to reset the MCU. Regardless of an internal or external reset,
the MCU comes out of a COP reset according to the pin conditions that
determine mode selection.
The COP reset function is enabled or disabled by the Mask option (COP)
and is verified during production testing.
The COP Watchdog reset will activate the internal pulldown device
connected to the RESET pin.
5.6.1 Resetting the COP
Preventing a COP reset is done by writing a ‘0’ to the COPR bit. This
action will reset the counter and begin the time-out period again. The
COPR bit is bit 0 of address $3FF0. A read of address $3FF0 will return
user data programmed at that location.
General Release Specification
70
MC68HC(7)05H12 — Rev. 1.0
Resets
MOTOROLA
The COP will continue to operate normally during WAIT mode. The
system should be configured to pull the device out of WAIT mode
periodically and reset the COP by writing to the COPR bit to prevent a
COP reset.
5.6.3 COP Watchdog Timer Considerations
The COP Watchdog Timer is active in User Mode if enabled by the Mask
option (COP).
N O N - D I S C L O S U R E
If the COP Watchdog Timer is selected, the COP will reset the MCU
when it times out. Therefore, it is recommended that the COP Watchdog
should be disabled for a system that must have intentional uses of the
WAIT Mode for periods longer than the COP time-out period.
A G R E E M E N T
5.6.2 COP During WAIT Mode
R E Q U I R E D
Resets
Computer Operating Properly Reset (COPR)
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Resets
71
R E Q U I R E D
Resets
5.6.4 COP Register
The COP register is shared with the MSB of a user interrupt vector as
shown in Figure 5-3. Reading this location will return whatever user data
has been programmed at this location. Writing a ‘0’ to the COPR bit in
this location will clear the COP watchdog timer.
N O N - D I S C L O S U R E
A G R E E M E N T
$3FF0
Bit 7
6
5
4
3
2
1
Bit 0
Read:
Write:
COPR
Reset:
Figure 5-3. COP Watchdog Timer Location Register (COPR)
5.7 Illegal Address Reset
An illegal address reset is generated when the CPU attempts to fetch an
instruction from either unimplemented address space ($0150 to $03FF,
$0500 to $0FFF), Monitor ROM ($3F00 to $3FEF) or I/O address space
($0000 to $004F).
The illegal address reset will activate the internal pulldown device
connected to the RESET pin.
NOTE:
No RTS, RTI or JMP,X instruction should be placed at the end of a
memory block (RAM $014F, EEPROM $04FF, User ROM $3EFF) since
this results in an illegal address reset.
5.8 Low Voltage Reset (LVR)
The internal low voltage (LVR) reset is generated when VDD falls below
the LVR threshold VROFF and will be release following a POR delay
starting when VDD rises above VRON. The LVR threshold is tested to be
above the minimum operating voltage of the microcontroller and is
intended to assure that the CPU will be held in reset when the VDD
supply voltage is below reasonable operating limits. A mask option is
General Release Specification
72
MC68HC(7)05H12 — Rev. 1.0
Resets
MOTOROLA
If any other reset function is active at the end of the LVR reset signal, the
RST signal will remain in the reset condition until the other reset
condition(s) end.
VDD
VRON
HYSTERESIS
VROFF
RESET
Figure 5-4. Low Voltage Reset
NOTE:
An external capacity at the RST pin increases the reaction time for the
generation of the internal reset and allows VDD drops. Refer to Figure 5-1.
5.8.1 LVR Operation in WAIT
If enabled, the LVR supply voltage sense option is active during WAIT.
Any reset source can bring the MCU out of WAIT mode.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Resets
73
A G R E E M E N T
The LVR will generate the RST signal which will reset the CPU and other
peripherals. The low voltage reset will activate the internal pulldown
device connected to the RESET pin.
N O N - D I S C L O S U R E
provided to disable the LVR when the device is expected to normally
operate at low voltages. Note that the VDD rise and fall slew rates must
be within the specification for proper LVR operation. If the specification
is not met, the circuit will operate properly following a delay of VDD/Slew
rate.
R E Q U I R E D
Resets
Low Voltage Reset (LVR)
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Resets
General Release Specification
74
MC68HC(7)05H12 — Rev. 1.0
Resets
MOTOROLA
6.1 Contents
6.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.3
User Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.4
Monitor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.5
Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.5.1
WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.5.2
Data Retention Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.5.3
Slow Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.2 Introduction
The normal operating mode of the MC68HC(7)05H12 is user (or single
chip) mode. There is also a monitor (or bootloader) mode, primarily for
programming and evaluation purpose. In addition to these modes, there
are three low power modes which may be entered and exited at will from
user mode: WAIT, Data Retention and Slow Mode. Table 6-1 shows the
conditions required to enter the modes of operation on the rising edge of
RESET, were VTST = 2 x VDD.
Table 6-1. Operating Mode Entry Conditions
IRQ
PB0
Mode
VSS to VDD
VSS to VDD
User
VTST
VDD
Monitor
6.3 User Mode
This is the intended mode of operation for executing user firmware. All
user mode functions are explained in this specification.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Operating Modes
75
A G R E E M E N T
Section 6. Operating Modes
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
Operating Modes
Contents
6.4 Monitor Mode
This mode is used for programming the on-chip EPROM (705 version)
and for the communication with a host computer via a standard RS-232
interface.
6.5 Low Power Modes
The MC68HC(7)05H12 is capable of running in one of several lowpower operational modes. The WAIT instruction provides a mode that
reduces the power required for the MCU by stopping various internal
clocks. The flow of the WAIT mode is shown in Figure 6-1.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Operating Modes
General Release Specification
76
MC68HC(7)05H12 — Rev. 1.0
Operating Modes
MOTOROLA
R E Q U I R E D
Operating Modes
Low Power Modes
WAIT
OSCILLATOR ACTIVE
TIMER CLOCK ACTIVE
PROCESSOR CLOCKS
STOPPED
N
KEYBOARD
INTERRUPT, IRQ
OR CTIMER.
Y
N
16B TIMER,
SPI OR SCI
YINTERRUPT
N
Y
RESTART
PROCESSOR
CLOCK
1. FETCH RESET
VECTOR OR
2. SERVICE
INTERRUPT
A. STACK
B. SET I BIT
C. VECTOR TO
INTERRUPT
ROUTINE
Figure 6-1. WAIT Flowchart
6.5.1 WAIT Mode
The WAIT instruction places the MCU in a low-power consumption
mode. All CPU action is suspended, but the core timer, the 16 bit timers,
the SPI/SCI, the ADC, and the PWM will or can remain active. An
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Operating Modes
77
N O N - D I S C L O S U R E
Y
A G R E E M E N T
RESET OR LVR
R E Q U I R E D
Operating Modes
interrupt, if enabled, from the core timer or any peripheral still active in
WAIT mode will cause the MCU to exit WAIT mode.
During WAIT mode, the I bit in the CCR is cleared to enable interrupts.
All other registers, memory, and input/output lines remain in their
previous state. The core timer may be enabled to allow a periodic exit
from the WAIT mode.
A G R E E M E N T
6.5.2 Data Retention Mode
The contents of RAM and CPU registers are retained at data retention
supply voltage VDR. This is called the data retention mode where the
data is held, but the device is not guaranteed to operate. The RESET pin
must be held low during data-retention mode.
To put the MCU into data retention mode:
•
Drive RESET pin to zero.
•
Lower the VDD voltage. The RESET pin must remain low
continuously during data retention mode.
N O N - D I S C L O S U R E
To take the MCU out of data retention mode:
•
Return VDD to normal operating level.
•
Return the RESET pin to logic one.
6.5.3 Slow Mode
The slow mode function is controlled by the system clock option (SC bit)
in the system control register. It allows the user to interconnect under
software control an extra divide-by-4 between the oscillator and the
internal clock driver. This feature allows all the internal operations to
slow down and thus reduces power consumption. It is particularly useful
when entering Wait mode.
See Section 2.3.1 System Control Register.
General Release Specification
78
MC68HC(7)05H12 — Rev. 1.0
Operating Modes
MOTOROLA
Section 7. Input/Output Ports
7.1 Contents
7.3
Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.3.1
Port A Keyboard Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.3.2
Port A Interrupt Edge Register . . . . . . . . . . . . . . . . . . . . . . 81
7.3.3
Port A Interrupt Control Register . . . . . . . . . . . . . . . . . . . . . 81
7.3.4
Port A Interrupt Status Register . . . . . . . . . . . . . . . . . . . . . 82
7.4
Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5
Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.6
Port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.7
Port E and Port F (Power Drivers) . . . . . . . . . . . . . . . . . . . . . . 83
7.7.1
Power Drivers for 360°Air Core Driven Instruments . . . . . . 85
7.7.2
H-Bridge Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.7.3
Power Driver Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.7.4
Short Circuit Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.7.5
Port E and Port F Mismatch Registers . . . . . . . . . . . . . . . . 89
7.7.6
Driver States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.7.7
Port E and Port F Configurations . . . . . . . . . . . . . . . . . . . . 92
7.7.8
H-Bridge Control with the PWM . . . . . . . . . . . . . . . . . . . . . 94
7.8
Port E and Port F During WAIT Mode . . . . . . . . . . . . . . . . . . . 95
7.9
Input/Output Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7.2 Introduction
In single chip mode there is a total of 40 lines arranged as three 8-bit I/O
ports (ports A, B and C), one 4-bit input only port (port D), 12 output only
lines arranged as one 8-bit (port E) and one 4-bit (port F) port. The I/O
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
79
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
N O N - D I S C L O S U R E
7.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
ports are programmable as either inputs or outputs under software
control of the data direction registers.
NOTE:
To avoid a glitch on the output pins, write data to the I/O port data
register before writing a one to the corresponding data direction register.
7.3 Port A
Port A is an 8-bit bidirectional port. The port A Data register is at $0000
and the port A data direction register (DDR) is at $0004. Reset does not
affect the data registers, but clears the data direction registers, thereby
returning the ports to inputs. Writing a one to a DDR bit sets the
corresponding port bit to output mode.
7.3.1 Port A Keyboard Interrupt
The keyboard interrupt consists of 8 individual edge-sensitive interrupts
with 8 interrupt flags. The keyboard interrupt is generated by a logical
OR function of the 8 interrupt flags. The interrupt inputs are connected
to PA0–7. All interrupts are maskable. If the interrupt mask bit (I bit) in
the condition code register is set, all interrupts are disabled. Each
interrupt can individually be masked by the corresponding PAIE7–0 bits
in the port A interrupt control register. The trigger edges of the interrupt
lines are programmable with the EDG7–0 bits in the port A interrupt edge
register. The PA0–7 input lines have no internal pull-up resistors.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Input/Output Ports
General Release Specification
80
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
7.3.2 Port A Interrupt Edge Register
$000D
Bit 7
6
5
4
3
2
1
Bit 0
EDGE7
EDGE6
EDGE5
EDGE4
EDGE3
EDGE2
EDGE1
EDGE0
0
0
0
0
0
0
0
0
Read:
Write:
Reset:
R E Q U I R E D
Input/Output Ports
Port A
These bits select the corresponding trigger edges of the interrupt lines
PA7–PA0. Note that changing these bits can cause an interrupt, if the
corresponding pin is ‘1’ and the bit changes from ‘0’ to ‘1’ or if the
corresponding pin is ‘0’ and the bit changes from ‘1’ to ‘0’.
1 = Low to high edge sensitive
0 = High to low edge sensitive
7.3.3 Port A Interrupt Control Register
$000E
Bit 7
6
5
4
3
2
1
Bit 0
PAIE7
PAIE6
PAIE5
PAIE4
PAIE3
PAIE2
PAIE1
PAIE0
0
0
0
0
0
0
0
0
Read:
Write:
Reset:
Figure 7-2. Port A Interrupt Control Register (PAICR)
PAIE7–0 — Port A Interrupt Enable
Each of these bits enables the corresponding port A pin as interrupt
line
1 = Corresponding port A interrupt enabled
0 = Corresponding port A interrupt disabled
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
81
N O N - D I S C L O S U R E
EDGE7–0 — Port A Interrupt Edge
A G R E E M E N T
Figure 7-1. Port A Interrupt Edge Register (PAIED)
R E Q U I R E D
Input/Output Ports
7.3.4 Port A Interrupt Status Register
$000F
Bit 7
6
5
4
3
2
1
Bit 0
PAIF7
PAIF6
PAIF5
PAIF4
PAIF3
PAIF2
PAIF1
PAIF0
0
0
0
0
0
0
0
0
Read:
Write:
Reset:
PAIF7–0 — Port A Interrupt Flags
These flags indicate which of the port A interrupt requests is pending.
The 8 interrupt flags can be reset individually if a ‘1’ is written to the
bit position.
1 = Flag set when corresponding transition is sensed (even if
interrupt is disabled), writing ‘1’ clears the flag
0 = No interrupt
7.4 Port B
Port B is an 8-bit bidirectional port. The port B data register is at $0001,
the port B data direction register (DDR) is at $0005. Reset does not
affect the data registers, but clears the data direction registers, thereby
returning the ports to inputs. Writing a one to a DDR bit sets the
corresponding port bit to output mode. The port pins PB5–PB7 are
shared with the SPI system (MISO, MOSI, SCK). If the SPI system is
enabled the pins PB5–PB7 are connected to the SPI system.
N O N - D I S C L O S U R E
A G R E E M E N T
Figure 7-3. Port A Interrupt Status Register (PAISR)
Pin PB2 is shared with the internal system clock ECLK. If the ECLK bit
in the system option register is set the internal system clock is available
through PB2 independently of the value of the port B data direction
register. Refer to Section 2.3.1 System Control Register for more
information. When the ECLK bit is set to ‘1’ the port B data direction
register can still be read or written, but does not impact the ECLK
function at pin PB2. When the ECLK bit is set to ‘1’ the port B data
register bit 2 loses its contents and is not accessible.
General Release Specification
82
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
7.6 Port D
Port D is an 4-bit input only port which shares all of its pins with the A/D
converter (AN0 through AN3). The port D data register is located at
address $0003. When the A/D converter is active, one of these 4 input
lines may be selected by the A/D multiplexer for conversion. A logical
read of a selected input port will always return 0.
7.7 Port E and Port F (Power Drivers)
Port E is an 8-bit output only port. The port E data register is at $0040.
Reset clears the data register. The eight lines are shared with four PWM
H-bridge driver pairs (left and right). The outputs are formed by power
drivers. The port E PWM lines can support two 360° (large angle) aircore
instruments.
Port F is a 4-bit output only port. The port F data register is at $0042.
Reset clears the data register. The four lines are shared with four PWM
channels. The outputs are formed by power drivers. The port F PWM
lines can support four 90° (small angle) aircore instruments.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
83
A G R E E M E N T
Port C is an 8-bit bidirectional port. The port C data register is at $0002,
the port C data direction register (DDR) is at $0006 and the port C control
register is at $0007. Reset does not affect the data registers, but clears
the data direction registers, thereby returning the ports to inputs. Writing
a one to a DDR bit sets the corresponding port bit to output mode. Reset
clears the control register. The port pins PC0–PC5 are shared with the
16-bit timers (TCAP0–3, TCMP0–1). The lines PC0–PC3 must be set to
input by resetting the DDR to enable correct input capture function. If the
TCMP1 or TCMP2 bit in the control register is set the pins PC5, PC4
function as output compare lines from the Timer1 system otherwise they
function as I/O lines. The port pins PC6, PC7 are shared with the SCI
system (RDI, TDO). If the SCI is enabled the pins PC6, PC7 are
connected to the SCI system.
N O N - D I S C L O S U R E
7.5 Port C
R E Q U I R E D
Input/Output Ports
Port C
R E Q U I R E D
Input/Output Ports
The power drivers have a separate voltage supply. PVDD1 and PVSS1 is
the supply for PE0–3 and PF0–1 and PVDD2 and PVSS2 is the supply for
PE4–7 and PF2–3.
The power drivers contain short circuit detection and slew rate limitation
for reduced RFI (EMC).
A G R E E M E N T
PVDD1
LEFT
PE0
RIGHT
PE1
LEFT
PE2
RIGHT
PE3
PWM0
PWM1
PVSS1
PVDD2
LEFT
PE4
RIGHT
PE5
LEFT
PE6
RIGHT
PE7
N O N - D I S C L O S U R E
PWM2
PWM3
PVSS2
PVDD1
PWM4
PF0
PWM5
PF1
PVSS1
PVDD2
PWM6
PF2
PWM7
PF3
PVSS2
Figure 7-4. Port E and Port F (Power Drivers)
General Release Specification
84
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
7.7.1 Power Drivers for 360°Air Core Driven Instruments
PWM2
I2
I2
GPO1
PWM1
PW2
PW1
I1
I1
GPO2
Figure 7-5. Driving Cross Coupled Coils
The vector (I1,I2) of the currents through the coils in the cross coupled
system is determined by the pulse widths (PW1, PW2). It also
determines the elevation angle of the instrument.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
85
N O N - D I S C L O S U R E
A G R E E M E N T
Two PWM H-bridge systems are used to drive a system with cross
coupled coils for a dashboard instrument. A single bridge is controlled by
one PWM channel in combination with a further general purpose output
(GPO) channel. It is capable of driving one of the two coils of an aircore
instrument. The pulse width ratio in one of the two PWM channels
corresponds to the average value of the current through the coil.
R E Q U I R E D
Input/Output Ports
Port E and Port F (Power Drivers)
7.7.2 H-Bridge Driver
Special power drivers in the H-bridge must be used to drive the system
with coils, because high voltages at the driver outputs due to switching
the coils would damage the circuits if the drivers are not protected
against this.
PVDD
A G R E E M E N T
R E Q U I R E D
Input/Output Ports
POUT
L
R
POUT
PWM
GPO
PVSS
N O N - D I S C L O S U R E
Figure 7-6. H-Bridge Driver Circuit
In order to avoid large switching currents through the N- and PMOS
driver transistors both devices will not be active at the same time. On the
other hand the switching delay between NMOS and PMOS transistor
must be short, because the driver has to supply the coil circuit with a
continuous current during the commutation. There would be diode
currents into the bulk due to voltages below PVSS or greater then PVDD
on the driver outputs if the commutation time is not short enough. Low
voltage drops on the driver transistors are also necessary to avoid these
diode currents.
General Release Specification
86
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
R E Q U I R E D
Input/Output Ports
Port E and Port F (Power Drivers)
7.7.3 Power Driver Circuit
PVDD
1
PMOS
2
NMOS
3
VIN
PVSS
Figure 7-7. Power Driver Circuit
A high to low transition at the input VIN causes a low to high transition at
the gate of the PMOS transistor. The NOR-gate 3 blocks the transition
at VIN as long as the inverter 1 in the figure produces a low level. The
result is that the PMOS and the NMOS devices are not active at the
same time. An unsymmetrical sizing of the inverter 1 causes a fast
propagation of the required low level to unblock the NOR-gate. This
results in a short switching delay. The inverter 2 in the figure realizes a
fast low to high transition at the output POUT.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
87
N O N - D I S C L O S U R E
A G R E E M E N T
POUT
7.7.4 Short Circuit Detection
The drivers contain a short circuit detection mechanism. The pin value
of a single power driver output is compared with the set level of the
actual power driver. A difference between both levels indicates a short
circuit case at the actual power driver. The difference is stored as a logic
‘1’ in the corresponding bit of the mismatch registers of port E or port F.
They can be polled by software. In the short circuit case precautions like
shutting down the failed power driver can be taken.
A G R E E M E N T
R E Q U I R E D
Input/Output Ports
PWEN
POWER
DRIVER
PWM
POUT
SOUT
DB
D
Q
DR
DRR
VDD
N O N - D I S C L O S U R E
MRR
Q
D
EXOR
Q
D
C
MR
R
HFF
C
C
MISL
MRW
SYN
Figure 7-8. Short Circuit Detection Circuitry
Figure 7-8 shows the circuitry for a single power driver port bit. Each
output bit of ports E and F can either be controlled directly by the data
register or it is linked to the PWM function. The PWEN signal which
corresponds to the appropriate bit in the PWEN register determines the
functionality which will appear on the output.
General Release Specification
88
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
$0041
Bit 7
6
5
4
3
2
1
Bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
0
0
0
0
0
0
0
0
Read:
Write:
Reset:
Figure 7-9. Port E Mismatch Register (PEMISM)
Bit 7–0 — Port E short circuit indication
The bits 7–0 indicate a short circuit on the port E. Each bit is cleared
by writing a ‘1’ to it.
1 = Short circuit at the corresponding port E pin
0 = No short circuit at the corresponding port E pin
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
89
A G R E E M E N T
7.7.5 Port E and Port F Mismatch Registers
N O N - D I S C L O S U R E
The actual output level POUT of a single power driver is compared with
the set output level SOUT via the EXOR gate in the circuitry. The buffer
C provides ‘low’ if the ‘high’ set output is significantly lower than PVDD
or it provides a ‘high’ if the ‘low’ set output is significantly higher than
PVSS. The comparison result is latched with the appropriate signal SYN
which runs at bus frequency. The timing of the signal SYN depends on
the amount of microshifts for the actual PWM channel. The SYN signal
occurs 1/4 of a bus cycle later than the start of the PWM period. This
ensures the PWM signal being stable on the output POUT. A mismatch
between the levels SOUT and POUT which indicates a short circuit on
the output results in a ‘high’ signal latched by the HFF. This latched
mismatch signal MISL is now stored in the corresponding bit MR of the
mismatch register. The mismatch register of port E or port F can be
polled in a proper time period like an interrupt flag register. A read ‘high’
on the mismatch register bit has to be handled like an interrupt flag. It will
be cleared by writing a logic ‘1’ back to this register.
R E Q U I R E D
Input/Output Ports
Port E and Port F (Power Drivers)
R E Q U I R E D
Input/Output Ports
$0043
Bit 7
6
5
4
Read:
0
0
0
0
3
2
1
Bit 0
bit 3
bit 2
bit 1
bit 0
0
0
0
0
Write:
Reset:
0
0
0
0
Figure 7-10. Port F Mismatch Register (PFMISM)
The bits 3–0 indicate a short circuit on the port F. Each bit is cleared
by writing a ‘1’ to it.
1 = Short circuit at the corresponding port F pin
0 = No short circuit at the corresponding port F pin
7.7.6 Driver States
A single H-bridge realizes a current through the coil in both directions.
Three states are necessary to realize the required H-bridge operations
for the 360° aircore instruments.
N O N - D I S C L O S U R E
A G R E E M E N T
Bit 3–0 — Port F short circuit indication
•
Forward State – M1, M2 off; M0, M3 on
•
Backward State – M0, M3 off; M1, M2 on
•
Off State – M0, M2 off; M1, M3 on
The Mx are the driver transistors which form the H-bridge. The following
circuits show how the bridge can operate in the different states. The
driver transistors are drawn as switches for simplification.
General Release Specification
90
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
OFF STATE
I
M3
L
M1
P
P
P
LEFT
RIGHT
LEFT
R
P
M2
M0
PWM
M3
L
R
M2
M0
GPO
PWM
A G R E E M E N T
M1
GPO
BACKWARD STATE
OFF STATE
I
M3
M1
L
L
R
P
P
RIGHT
LEFT
P
LEFT
PWM
R
P
M2
M0
GPO
M3
M1
M0
GPO
M2
PWM
Figure 7-11. H-Bridge States
In each state the output driver GPO must hold the output Pleft or Pright
(left or right port line) at voltage PVDD–Vdrop while the PWM driver
switches the opposite part of the H-bridge to ground. The PWM driver
switches between forward state and off state or backward state and off
state. The average current I is determined by the pulse width ratio at the
PWM driver.
Current direction is changed by switching between forward and
backward state. The output and the PWM functionality has also been
changed between the two port lines when switching current direction.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
91
N O N - D I S C L O S U R E
FORWARD STATE
R E Q U I R E D
Input/Output Ports
Port E and Port F (Power Drivers)
7.7.7 Port E and Port F Configurations
Figure 7-12 shows a port E configuration which controls two 360°
aircore instruments or stepper motors. One power driver block controls
a single large angle instrument (360°). This configuration ensures a
minimum voltage drop mismatch between the two H-bridges of the
block.
NOTE:
A G R E E M E N T
R E Q U I R E D
Input/Output Ports
One should not control a single instrument with H-bridges from different
power driver blocks. The minimum voltage drop mismatch is only
ensured within a single block.
LEFT
PE0
RIGHT
PE1
LEFT
PE2
RIGHT
PE3
LEFT
PE4
RIGHT
PE5
LEFT
PE6
RIGHT
PE7
PWM0
N O N - D I S C L O S U R E
PWM1
PWM2
PWM3
Figure 7-12. Port E Configuration for two 360° instruments
General Release Specification
92
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
PWM4
PF0
PWM5
PF1
PWM6
PF2
PWM7
PF3
PVSS
Figure 7-13. Port F Configuration for four 90° instruments (version 1)
PVDD
PWM4
PF0
PWM5
PF1
PWM6
PF2
PWM7
PF3
PVSS
Figure 7-14. Port F Configuration for four 90° instruments (version 2)
Figure 7-13 and Figure 7-14 show two port F configuration with four 90°
small angle instruments which are controlled by the PWM. The small
angle instrument does not need a switching between two quadrants. It
can be controlled by a single power driver and its PWM.
NOTE:
If port E (PWM channels 0 to 3) is used to control small angle
instruments, the SIGN bit in the PWM control register may not be
changed during the operation with 90° instruments. This would
exchange the functionality of PWM and GPO (general purpose output)
between the left and the right port bit.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
93
N O N - D I S C L O S U R E
PVDD
A G R E E M E N T
R E Q U I R E D
Input/Output Ports
Port E and Port F (Power Drivers)
7.7.8 H-Bridge Control with the PWM
The current in the PWM can be adjusted in the range of –Imax × 256/256
and + Imax × 255/256. The current is a linear function of the 8+1bit 2’s
complement value in the data register of the PWM channel. The SIGN
bit controls the current direction within the H-bridge. This will be done by
exchanging the PWM and GPO functionality and inverting the PWM
signal in the H-bridge when switching the SIGN-bit.
A G R E E M E N T
R E Q U I R E D
Input/Output Ports
POL = 1
SIGN = 0
SIGN = 1
I
M3
M1
L
L
PWM
R
P
LEFT
M2
M0
M3
M1
R
P
RIGHT
LEFT
N O N - D I S C L O S U R E
I
GPO = HIGH
P
RIGHT
M2
M0
GPO = HIGH
PWM
Figure 7-15. H-Bridge Control with PWM
The following 3 bit PWM example in Figure 7-16 shows the
correspondence between the 2’s complement values in the data register
and the required PWM signal in the H-bridge.
General Release Specification
94
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
7
R E Q U I R E D
Input/Output Ports
Port E and Port F During WAIT Mode
0 111
:
2
0 010
1
0 001
0
0 000
–1
1 111
–2
1 110
1 000
SIGN
Figure 7-16. Correspondence between Data and PWM Values
Figure 7-16 shows that the PWM signal has to be inverted for the
negative values in order to obtain the correct H-bridge signal which is
drawn in Figure 7-16. (Compare the periods for the values –1 and 7).
7.8 Port E and Port F During WAIT Mode
In WAIT mode a mask option defines if port E and port F will be forced
to output ‘low’ or if port E and port F continue normal operation.
7.9 Input/Output Programming
Bidirectional port lines may be programmed as an input or an output
under software control. The direction of the pins is determined by the
state of the corresponding bit in the port data direction register (DDR).
Each port has an associated DDR. Any I/O port pin is configured as an
output if its corresponding DDR bit is set to a logic one. A pin is
configured as an input if its corresponding DDR bit is cleared to a logical
zero.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Input/Output Ports
95
N O N - D I S C L O S U R E
–8
A G R E E M E N T
:
R E Q U I R E D
Input/Output Ports
At power-on or reset, all DDRs are cleared, which configure all port pins
as inputs. The data direction registers are capable of being written to or
read by the processor. During the programmed output state, a read of
the data register actually reads the value of the output data latch and not
the I/O pin.
A G R E E M E N T
Table 7-1. I/O Pin Functions
R/W
DDR
I/O Pin Function
0
0
The I/O pin is in input mode. Data is written into the output data latch.
0
1
Data is written into the output data latch and output to the I/O pin.
1
0
The state of the I/O pin is read.
1
1
The I/O pin is in output mode. The output data latch is read.
R/W is an internal signal.
Data Direction
Register Bit
N O N - D I S C L O S U R E
Internal
HC05
Connections
Latched Output
Data Bit
I/O
Pin
Output
Input
Reg
Bit
Input
I/O
Figure 7-17. Port I/O Circuitry
NOTE:
If the I/O pin is an input and a read-modify (RMW) instruction is
executed, the I/O pin will be read into the HC05 CPU and the computed
result will then be written to the data latch.
General Release Specification
96
MC68HC(7)05H12 — Rev. 1.0
Input/Output Ports
MOTOROLA
General Release Specification — MC68HC(7)05H12
Section 8. Core Timer
8.1 Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.3
Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
8.3.1
Core Timer Status and Control Register (CTSCR) . . . . . . . 99
8.3.2
Computer Operating Properly (COP) Watchdog Reset. . . 101
8.3.3
Core Timer Counter Register (CTCR). . . . . . . . . . . . . . . . 101
8.4
Core Timer During WAIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.2 Introduction
N O N - D I S C L O S U R E
The core timer for this device is a 15-stage multi-functional ripple
counter. The features include timer over flow, power-on reset (POR),
real time interrupt (RTI), and COP watchdog timer.
A G R E E M E N T
8.2
R E Q U I R E D
Core Timer
Contents
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Core Timer
97
R E Q U I R E D
Core Timer
INTERNAL BUS
8
8
8
COP
Clear
$9 CTCR
Timer Counter Register (TCR)
Internal
Processor
Clock
fop
fop /22
TCR
÷4
A G R E E M E N T
fop /210
7-bit counter
POR
TCBP
RTI Select Circuit
Overflow
Detect
Circuit
$08 CTCSR
Timer Control/Status Register
N O N - D I S C L O S U R E
TCSR
TOF
RTIF
TOFE
RTIE RTOF
RRTIF
RT1
RT0
COP Watchdog
Timer (÷8)
Interrupt Circuit
To Interrupt
Logic
To Reset
Logic
Figure 8-1. Core Timer Block Diagram
As seen in Figure 8-1, the Timer is driven by the output of the clock
select circuit followed by a fixed divide by four prescaler. This signal
drives an 8-bit ripple counter. The value of this 8-bit ripple counter can
be read by the CPU at any time by accessing the timer counter register
(TCR) at address $09. A timer overflow function is implemented on the
General Release Specification
98
MC68HC(7)05H12 — Rev. 1.0
Core Timer
MOTOROLA
8.3.1 Core Timer Status and Control Register (CTSCR)
The CTSCR contains the timer interrupt flag, the timer interrupt enable
bits, and the real time interrupt rate select bits. Figure 8-2 shows the
value of each bit in the CTSCR when coming out of reset.
$0008
Bit 7
6
Read:
TOF
RTIF
5
4
TOFE
RTIE
Write:
Reset:
0
0
0
0
3
2
0
0
RTOF
RRTIF
0
0
1
Bit 0
RT!
RT0
1
1
Figure 8-2. Core Timer Status and Control Register (CTSCR)
TOF – Timer Over Flow
TOF is a read-only status bit and is set when the 8-bit ripple counter
rolls over from $FF to $00. A CPU interrupt request will be generated
if TOFE is set. Reset clears TOF.
RTIF – Real Time Interrupt Flag
The real time interrupt circuit consists of a three stage divider and a 1
of 4 selector. The clock frequency that drives the RTI circuit is fop/213
(or fop/8192) with three additional divider stages giving a maximum
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Core Timer
99
A G R E E M E N T
8.3 Registers
N O N - D I S C L O S U R E
last stage of this counter, giving a possible interrupt at the rate of
fop/1024. Two additional stages produce the POR function at fop/4064.
The timer counter bypass circuitry (available only in Test Mode) is at this
point in the timer chain. This circuit is followed by two more stages, with
the resulting clock (fop/16384) driving the real time interrupt circuit. The
RTI circuit consists of three divider stages with a 1 of 4 selector. The
output of the RTI circuit is further divided by eight to drive the mask
optional COP watchdog timer circuit. The RTI rate selector bits, and the
RTI and TOF enable bits and flags are located in the timer control and
status register at location $08.
R E Q U I R E D
Core Timer
Registers
R E Q U I R E D
Core Timer
interrupt period of about 250ms seconds at a crystal frequency of
1 MHz. RTIF is a read-only status bit and is set when the output of the
chosen (1 of 4 selection) stage goes active. A CPU interrupt request
will be generated if RTIE is set. Reset clears RTIF.
TOFE – Timer Over Flow Enable
When this bit is set, a CPU interrupt request is generated when the
TOF bit is set. Reset clears this bit.
A G R E E M E N T
RTIE – Real Time Interrupt Enable
When this bit is set, a CPU interrupt request is generated when the
RTIF bit is set. Reset clears this bit.
RTOF — Reset Timer Overflow Flag
This bit reads always as ‘0’. Writing a ‘1’ to this bit clears the timer
overflow flag (TOF). Writing a zero to this bit has no effect.
RRTIF — Reset Real Time Interrupt Flag
This bit reads always a ‘0’. Writing a ‘1’ to this bit clears the real time
interrupt flag (RTIF). Writing a zero to this bit has no effect.
RT1, RT0 – Real Time Interrupt Rate Select
N O N - D I S C L O S U R E
These two bits select one of four taps from the real time interrupt
circuit. Figure 8-1shows the available interrupt rates with several fop
values. Reset sets these RT0 and RT1, selecting the lowest periodic
rate and therefore the maximum time in which to alter these bits if
necessary. Care should be taken when altering RT0 and RT1 if the
time-out period is imminent or uncertain. If the selected tap is modified
during a cycle in which the counter is switching, an RTIF could be
missed or an additional one could be generated. To avoid problems,
the COP should be cleared before changing RTI taps.
Table 8-1. RTI Rates
RTI Rates at Bus Frequency fOP specified:
RT1:RT0
500 kHz
1.000 MHz
2.000 MHz
2.4576 MHz
RATIO
00
32.768ms
16.384ms
8.192ms
6.667ms
214/fop
General Release Specification
100
MC68HC(7)05H12 — Rev. 1.0
Core Timer
MOTOROLA
R E Q U I R E D
Core Timer
Registers
Table 8-1. RTI Rates
RTI Rates at Bus Frequency fOP specified:
RT1:RT0
500 kHz
1.000 MHz
2.000 MHz
2.4576 MHz
RATIO
01
65.536ms
32.768ms
16.384ms
13.333ms
215/fop
10
131.072ms
65.536ms
32.768ms
26.667ms
216/fop
11
262.144ms
131.072ms
65.536ms
53.333ms
217/fop
The COP watchdog timer function is implemented on this device by
using the output of the RTI circuit and further dividing it by eight. The
minimum COP reset rates are listed in Table 8-2. If the COP circuit times
out, an internal reset is generated and the normal reset vector is fetched.
Preventing a COP time-out is done by writing a ‘0’ to bit 0 of address
$3FF0. When the COP is cleared, only the final divide by eight stage
(output of the RTI) is cleared.
Table 8-2. Minimum COP Reset Times
A G R E E M E N T
8.3.2 Computer Operating Properly (COP) Watchdog Reset
RT1:RT0
500 kHz
1.000 MHz
2.000 MHz
2.4576 MHz
RATIO
00
229.376ms
114.689ms
57.344ms
46.666ms
7*214/fop
01
458.752ms
229.376ms
114.689ms
93.333ms
7*215/fop
10
917.504ms
458.752ms
229.376ms
186.666ms
7*216/fop
11
1835.000ms
917.504ms
458.752ms
373.333ms
7*217/fop
8.3.3 Core Timer Counter Register (CTCR)
The timer counter register is a read-only register which contains the
current value of the 8-bit ripple counter at the beginning of the timer
chain. This counter is clocked at fop divided by 4 and can be used for
various functions including a software input capture. Extended time
periods can be attained using the TOF function to increment a temporary
RAM storage location thereby simulating a 16-bit (or more) counter.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Core Timer
101
N O N - D I S C L O S U R E
Minimum COP Reset Bus Frequency at fOP specified:
$0009
Bit 7
6
5
4
3
2
1
Bit 0
Read:
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
0
0
0
0
0
0
0
0
Write:
Reset:
Figure 8-3. Core Timer Counter Register (CTCR)
The power-on cycle clears the entire counter chain and begins clocking
the counter. After 4064 cycles, the power-on reset circuit is released
which again clears the counter chain and allows the device to come out
of reset. At this point, if RESET is not asserted, the timer will start
counting up from zero and normal device operation will begin. When
RESET is asserted anytime during operation (other than POR), the
counter chain will be cleared.
8.4 Core Timer During WAIT
The CPU clock halts during the WAIT mode, but the core timer remains
active. If the CTIMER interrupts are enabled, then a CTIMER interrupt
will cause the processor to exit the WAIT mode.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Core Timer
General Release Specification
102
MC68HC(7)05H12 — Rev. 1.0
Core Timer
MOTOROLA
Section 9. 16-Bit Timers
9.1 Contents
9.3
Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.3.1
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.3.2
Output Compare Registers . . . . . . . . . . . . . . . . . . . . . . . . 106
9.3.3
Output Compare Register 1 . . . . . . . . . . . . . . . . . . . . . . . 106
9.3.4
Output Compare Register 2 . . . . . . . . . . . . . . . . . . . . . . . 107
9.3.5
Input Capture Registers . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.3.6
Input Capture Register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.3.7
Input Capture Register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 109
9.3.8
Timer Control Register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 110
9.3.9
Timer Control Register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.3.10
Timer Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.4
Timer During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
9.2 Introduction
The MC68HC(7)05H12 has two 16-bit timers (Timer1 and Timer2) each
with two channels. The output compare function in Timer2 has no
external outputs, so it is used for generating precision time intervals and
interrupts only. Write access to the corresponding output level register
bits OLVL3 and OLVL4 has no effect. Apart from this difference in the
external connections, the internal operation of both is identical (each
timer having its own set of registers, see Section 2.3 Registers),
therefore only a complete description of Timer1 is given.
The timer consists of a 16-bit, free running counter driven by a fixed
divide-by-four prescaler. This timer can be used for many purposes,
including input waveform measurements while simultaneously
generating an output waveform. Pulse widths can vary from several
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
General Release Specification
16-Bit Timers
103
N O N - D I S C L O S U R E
9.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
16-Bit Timers
microseconds to many seconds. Refer to Figure 9-1 for a timer block
diagram.
Because the timer has a 16-bit architecture, each specific functional
segment (capability) is represented by two registers. These registers
contain the high and low byte of that functional segment. 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.
A G R E E M E N T
NOTE:
The I bit in the CCR should be set while manipulating both the high and
low byte register of a specific timer function to ensure that an interrupt
does not occur.
Internal Bus
High
Byte
Input
Capture 1
Register
Low
Byte
High
Byte
Low
Byte
$20
$21
Input
Capture 2
Register
Internal
Processor
8-Bit
Clock
Buffer
High
Low
Byte
Byte
/4
16-Bit Free
$28
Running
$29
Counter
$24
$25
Counter
Alternate
Register
N O N - D I S C L O S U R E
Edge
Input
(TCAP2)
High
Byte
Low
Byte
$22
$23
Output
Compare
Register 2
$2A
$2B
Low
Byte
High
Byte
Output
Compare
Register 1
$26
$27
Output
Level
(TCOMP0)
D Q
CLK
Edge
Detect
Circuit
Edge
Detect
Circuit
Overflow
Detect
Circuit
Output
Compare
Circuit 2
Output
Compare
Circuit 1
C
Output
Level
(TCOMP1)
Edge
Input
(TCAP1)
Timer
Status
Reg.
D Q
CLK
ICI1E
C
ICI2E OCI1E TOIE IEDG1 IEDG2 OLVL1 TCR1($2C)
IC1F IC2F OC1F TOF OC2F
RESET
OCI2E OLVL2 TCR2($2D)
Interrupt Circuit
Figure 9-1. Timer Block Diagram (Timer1)
General Release Specification
104
MC68HC(7)05H12 — Rev. 1.0
16-Bit Timers
MOTOROLA
R E Q U I R E D
16-Bit Timers
Registers
Register Name
$0020
Timer1 Capture 1 High
$0021
Timer1 Capture 1 Low
$0022
Timer1 Compare 1 High
$0023
Timer1 Compare 1 Low
$0024
Timer1 Capture 2 High
$0025
Timer1 Capture 2 Low
$0026
Timer1 Compare 2 High
$0027
Timer1 Compare 2 Low
$0028
Timer1 Counter High
$0029
Timer1 Counter Low
$002A
Timer1 Alternate Counter High
$002B
Timer1 Alternate Counter Low
$002C
Timer1 Control 1
$002D
Timer1 Control 2
$002E
Timer1 Status
Figure 9-2. 16-Bit Timer Register Addresses (Timer1)
9.3.1 Counter
The key element in the programmable timer is a 16-bit, free-running
counter or counter register, preceded by a prescaler that divides the
internal processor clock by four. The prescaler gives the timer a
resolution of 2.0 microseconds if the internal bus clock is 2.0 MHz. The
counter is incremented during the low portion of the internal bus clock.
Software can read the counter at any time without affecting its value.
The double-byte, free-running counter can be read from either of two
locations, $28–$29 (counter register) or $2A–$2B (counter alternate
register). A read from only the least significant byte (LSB) of the freerunning counter ($29, $2B) receives the count value at the time of the
read. If a read of the free-running counter or counter alternate register
first addresses the most significant byte ($28, $2A), the LSB ($29, $2B)
is transferred to a buffer. This buffer value remains fixed after the first
MSB read, even if the user reads the MSB several times. This buffer is
accessed when reading the free-running counter or counter alternate
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
16-Bit Timers
105
N O N - D I S C L O S U R E
Addr
A G R E E M E N T
9.3 Registers
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
16-Bit Timers
register LSB ($29 or $2B) and thus completes a read sequence of the
total counter value. In reading either the free-running counter or counter
alternate register, if the MSB is read, the LSB must also be read to
complete the sequence.
The counter alternate register differs from the counter register in one
respect: a read of the counter register MSB can clear the timer overflow
flag (TOF). Therefore, the counter alternate register can be read at any
time without the possibility of missing timer overflow interrupts due to
clearing of the TOF.
9.3.2 Output Compare Registers
There are two output compare registers: output compare register 1 and
output compare register 2. Output compare registers can be used for
several purposes such as controlling an output waveform or indicating
when a period of time has elapsed. All bits are readable and writable and
are not altered by the timer hardware or reset. If the compare function is
not needed, the two bytes of the output compare register can be used as
storage locations.
9.3.3 Output Compare Register 1
The 16-bit output compare register 1 is made up of two 8-bit registers at
locations $22 (MSB) and $23 (LSB). The output compare register
contents are compared with the contents of the free-running counter
once every four internal processor clock cycles. If a match is found, the
output compare flag OC1F (bit 5 of the timer status register ($2E)) is set
and the corresponding output level OLVL1 bit is clocked to TCMP1
output.
The output compare register values and the output level bit should be
changed after each successful comparison to establish a new elapsed
time-out. An interrupt can also accompany a successful output compare
provided the corresponding interrupt enable bit (OCI1E) is set.
After a processor write cycle to the output compare register 1 containing
the MSB ($22), the output compare function is inhibited until the LSB
General Release Specification
106
MC68HC(7)05H12 — Rev. 1.0
16-Bit Timers
MOTOROLA
Because the output compare flag OC1F and the output compare register
1 are undetermined at power-on and are not affected by external reset,
care must be exercised when initializing the output compare function.
The following procedure is recommended
Write the high byte to the compare register 1 to inhibit further compares
until the low byte is written.
Reading the status register arms the OC1F if it is already set.
Write the output compare register 1 low byte to enable the output
compare 1 function with the flag clear.
The purpose of this procedure is to prevent the OC1F bit from being set
between the time it is read and the write to the corresponding output
compare register.
9.3.4 Output Compare Register 2
The 16-bit output compare register 2 is made up of two 8-bit registers at
locations $26 (MSB) and $27 (LSB). The output compare register
contents are compared with the contents of the free-running counter
once every four internal processor clock cycles. If a match is found, the
output compare flag OC2F (bit 1 of the timer status register ($2E)) is set
and the corresponding output level OLVL2 bit is clocked to TCMP2
output.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
16-Bit Timers
107
A G R E E M E N T
The processor can write to either byte of the output compare register 1
without affecting the other byte. The output level (OLVL1) bit is clocked
to the output level register regardless of whether the output compare flag
(OC1F) is set or clear.
N O N - D I S C L O S U R E
($23) is also written. The user must write both bytes (locations) if the
MSB is written first. A write made only to the LSB ($23) will not inhibit the
compare function. The free-running counter is updated every four
internal bus clock cycles. The minimum time required to update the
output compare register is a function of the program rather than the
internal hardware.
R E Q U I R E D
16-Bit Timers
Registers
R E Q U I R E D
16-Bit Timers
The output compare register values and the output level bit should be
changed after each successful comparison to establish a new elapsed
time-out. An interrupt can also accompany a successful output compare
provided the corresponding interrupt enable bit (OCI2E) is set.
N O N - D I S C L O S U R E
A G R E E M E N T
After a processor write cycle to the output compare register 2 containing
the MSB ($26), the output compare function is inhibited until the LSB
($27) is also written. The user must write both bytes (locations) if the
MSB is written first. A write made only to the LSB ($27) will not inhibit the
compare function. The free-running counter is updated every four
internal bus clock cycles. The minimum time required to update the
output compare register is a function of the program rather than the
internal hardware.
The processor can write to either byte of the output compare register 2
without affecting the other byte. The output level (OLVL2) bit is clocked
to the output level register regardless of whether the output compare flag
(OC2F) is set or clear.
Because the output compare flag OC2F and the output compare register
2 are undetermined at power-on, and are not affected by external reset
care must be exercised when initializing the output compare function. A
procedure as recommended for compare register 1 should be followed.
9.3.5 Input Capture Registers
There are two identical input capture registers: input capture register 1
and input capture register 2. The two following sections describe these
two registers.
9.3.6 Input Capture Register 1
Two 8-bit registers, which make up the 16-bit input capture register 1,
are read-only and are used to latch the value of the free-running counter
after the corresponding input capture edge detector senses a defined
transition on the TCAP1 pin. The level transition which triggers the
counter transfer is defined by the corresponding input edge bit (IEDG1).
Reset does not affect the contents of the input capture register.
General Release Specification
108
MC68HC(7)05H12 — Rev. 1.0
16-Bit Timers
MOTOROLA
The result obtained by an input capture will be one more than the value
of the free-running counter on the rising edge of the internal bus clock
preceding the external transition. This delay is required for internal
synchronization. Resolution is one count of the free-running counter,
which is four internal bus clock cycles.
The free-running counter contents are transferred to the input capture
register on each proper signal transition regardless of whether the input
capture flag (IC1F) is set or clear. The input capture register always
contains the free-running counter value that corresponds to the most
recent input capture.
After a read of the input capture register most significant byte ($20), the
counter transfer is inhibited until the least significant byte ($21) is also
read. This characteristic causes the time used in the input capture
software routine and its interaction with the main program to determine
the minimum pulse period.
A read of the input capture register LSB ($21) does not inhibit the freerunning counter transfer since they occur on opposite edges of the
internal bus clock.
9.3.7 Input Capture Register 2
Two 8-bit registers, which make up the 16-bit input capture register 2,
are read-only and are used to latch the value of the free-running counter
after the corresponding input capture edge detector senses a defined
transition on the TCAP2 pin. The level transition which triggers the
counter transfer is defined by the corresponding input edge bit (IEDG2).
Reset does not affect the contents of the input capture register.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
16-Bit Timers
109
A G R E E M E N T
An interrupt can also accompany a capture provided the corresponding
interrupt enable bit, ICI1E is set.
N O N - D I S C L O S U R E
IEDG1 — Capture on Negative/Positive Edge
1 = Capture on positive edge
0 = Capture on negative edge
R E Q U I R E D
16-Bit Timers
Registers
R E Q U I R E D
16-Bit Timers
IEDG2 — Capture on Negative/Positive Edge
1 = Capture on positive edge
0 = Capture on negative edge
An interrupt can also accompany a capture provided the corresponding
interrupt enable bit, ICI2E is set.
N O N - D I S C L O S U R E
A G R E E M E N T
The result obtained by an input capture will be one more than the value
of the free-running counter on the rising edge of the internal bus clock
preceding the external transition. This delay is required for internal
synchronization. Resolution is one count of the free-running counter,
which is four internal bus clock cycles.
The free-running counter contents are transferred to the input capture
register on each proper signal transition regardless of whether the input
capture flag (IC2F) is set or clear. The input capture register always
contains the free-running counter value that corresponds to the most
recent input capture.
After a read of the input capture register most significant byte ($24), the
counter transfer is inhibited until the least significant byte ($25) is also
read. This characteristic causes the time used in the input capture
software routine and its interaction with the main program to determine
the minimum pulse period.
A read of the input capture register LSB ($25) does not inhibit the freerunning counter transfer since they occur on opposite edges of the
internal bus clock.
9.3.8 Timer Control Register 1
$002C
Bit 7
6
5
4
3
2
1
Bit 0
ICI1E
ICI2E
OCI1E
TOIE
CO1E
IEDG1
IEDG2
OLVL1
0
0
0
0
0
U
U
0
Read:
Write:
Reset:
Figure 9-3. Timer Control Register 1 (TCR1)
General Release Specification
110
MC68HC(7)05H12 — Rev. 1.0
16-Bit Timers
MOTOROLA
R E Q U I R E D
16-Bit Timers
Registers
ICI1E — Input Capture 1 Interrupt Enable
1 = Interrupt enabled
0 = Interrupt disabled
ICI2E — Input Capture 2 Interrupt Enable
1 = Interrupt enabled
0 = Interrupt disabled
TOIE — Timer Overflow Interrupt Enable
1 = Interrupt enabled
0 = Interrupt disabled
CO1E — Timer Compare 1 Output Enable
Reset clears this bit.
1 = Output of timer compare 1is enabled
0 = Output of timer compare 1is disabled, i.e. held low
IEDG1 — Input Edge
Value of input edge determines which level transition on TCAP1 pin
will trigger free-running counter transfer to the input capture
register 1.
1 = Positive edge
0 = Negative edge
IEDG2 — Input Edge
Value of input edge determines which level transition on TCAP2 pin
will trigger free-running counter transfer to the input capture
register 2.
1 = Positive edge
0 = Negative edge
OLVL1 — Output Level 1
Value of output level is clocked into output level register by the next
successful output compare 1, and will appear on the TCMP1 pins.
1 = High output
0 = Low output
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
16-Bit Timers
111
N O N - D I S C L O S U R E
A G R E E M E N T
OCI1E — Output Compare 1 Interrupt Enable
1 = Interrupt enabled
0 = Interrupt disabled
R E Q U I R E D
16-Bit Timers
9.3.9 Timer Control Register 2
$002D
Bit 7
6
Read:
0
0
5
4
3
0
OCI2E
2
1
0
0
CO2E
Bit 0
OLVL2
Write:
Reset:
U
U
0
0
U
0
0
U
A G R E E M E N T
Figure 9-4. Timer Control Register 2 (TCR2)
OCI2E — Output Compare 2 Interrupt Enable
1 = Interrupt enabled
0 = Interrupt disabled
CO2E — Timer Compare 2 Output Enable
Reset clears this bit.
1 = Output of timer compare 2 is enabled
0 = Output of timer compare 2 is disabled, i.e. held low
OLVL2 — Output Level 2
N O N - D I S C L O S U R E
Value of output level is clocked into output level register by the next
successful output compare 2, and will appear on the TCMP2 pin.
1 = High output
0 = Low output
Bits 1,2,4,6 & 7 of TRC2 are no used and always read zero.
NOTE:
Only TCMP1 and TCMP2 of Timer 1 are available at port C, Timer 2 has
no TCMP pins.
General Release Specification
112
MC68HC(7)05H12 — Rev. 1.0
16-Bit Timers
MOTOROLA
$002E
Bit 7
6
5
4
3
2
1
Bit 0
Read:
IC1F
IC2F
OC1F
TOF
TCAP1
TCAP2
OC2F
0
U
U
U
U
1
1
U
0
Write:
Reset:
Figure 9-5. Timer Status Register (TSR)
IC1F — Input Capture 1 Flag
1 = Flag set when selected polarity edge is sensed by input capture
1 edge detector
0 = Flag cleared when TSR and input capture 1 register’s low byte
is accessed
IC2F — Input Capture 2 Flag
1 = Flag set when selected polarity edge is sensed by input capture
2 edge detector
0 = Flag cleared when TSR and input capture 2 register’s low byte
is accessed
OC1F — Output Compare 1 Flag
1 = Flag set when output compare register 1 contents match the
free-running counter contents
0 = Flag cleared when TSR and output compare register 1 low byte
are accessed
TOF — Timer Overflow Flag
1 = Flag set when free-running counter transition from $FFFF to
$0000 occurs
0 = Flag cleared when TSR and counter low register are accessed
TCAP1 — Timer Capture 1
This bit reflects the current state of the timer capture 1 input.
TCAP2 — Timer Capture 2
This bit reflects the current state of the timer capture 2 input.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
16-Bit Timers
113
A G R E E M E N T
The timer status register is a read-only register containing timer status
flags.
N O N - D I S C L O S U R E
9.3.10 Timer Status Register
R E Q U I R E D
16-Bit Timers
Registers
R E Q U I R E D
16-Bit Timers
OC2F — Output Compare 2 Flag
1 = Flag set when output compare register 2 contents match the
free-running counter contents
0 = Flag cleared when TSR and output compare register 2 low byte
are accessed
Accessing the timer status registers satisfies the first condition required
to clear status bits. The remaining step is to access the registers
corresponding to the status bit.
N O N - D I S C L O S U R E
A G R E E M E N T
A problem can occur when using the timer overflow function and reading
the free-running counter at random times to measure an elapsed time.
Without incorporating the proper precautions into software, the timer
overflow flag could unintentionally be cleared if:
1. The timer status register is read or written when TOF is set, and
2. The LSB of the free-running counter is read but not for the purpose
of servicing the flag
The counter alternate register contains the same value as the freerunning counter; therefore this alternate register can be read at any time
without affecting the timer overflow flag in the timer status register.
9.4 Timer During WAIT Mode
The CPU clock halts during the WAIT mode but the timer keeps on
running. If a reset is used to exit the WAIT mode the counters are forced
to $FFFC. If interrupts are enabled a timer interrupt will cause the
processor to exit WAIT mode.
General Release Specification
114
MC68HC(7)05H12 — Rev. 1.0
16-Bit Timers
MOTOROLA
Section 10. Serial Peripheral Interface (SPI)
10.1 Contents
10.3 SPI Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.1
Master In Slave Out (MISO) . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.2
Master Out Slave In (MOSI) . . . . . . . . . . . . . . . . . . . . . . . 117
10.3.3
Serial Clock (SCK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
10.4
SPI Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
10.5 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
10.5.1
SPI Control Register (SPCR) . . . . . . . . . . . . . . . . . . . . . . 121
10.5.2
SPI Status Register (SPSR) . . . . . . . . . . . . . . . . . . . . . . . 123
10.5.3
SPI Data I/O Register (SPDAT) . . . . . . . . . . . . . . . . . . . . 124
10.6
SPI During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
10.2 Introduction
The SPI is a synchronous interface which allows several SPI
microcontrollers or SPI-type peripherals to be interconnected. In a serial
peripheral interface, separate wires (signals) are required for data and
clock. In the SPI format, the clock is not included in the data stream and
must be furnished as a separate signal. The MC68HC(7)05H12 SPI
system may be configured either as a master or as a slave.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Peripheral Interface (SPI)
115
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
N O N - D I S C L O S U R E
10.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Serial Peripheral Interface (SPI)
Features include:
•
Full-duplex, 3-wire synchronous transfers
•
Master or slave operation
•
2.50 MHz (maximum) master bit frequency
•
5.0 MHz (maximum) slave bit frequency
•
Four programmable master bit rates
•
Programmable clock polarity and phase
•
End-of-transmission interrupt flag
•
Write collision flag protection
•
Master-master mode fault protection
•
Easy interface to simple expansion parts (PLLs, D/As, latches,
display drivers, etc.)
•
Very low clock rates by reuse of the SCI prescalers.
10.3 SPI Signal Description
Three I/O pins located at port B are associated with the SPI data
transfers. They are the serial clock (SCK), the master in/slave out
(MISO) data line, the master out/slave in (MOSI) data line. When the SPI
system is not utilized (SPE bit cleared in the serial peripheral control
register), the three pins (MISO, MOSI, SCK) are configured as generalpurpose I/O pins. The three SPI signals are discussed in the following
paragraphs for both master mode and slave mode of operation.
NOTE:
The SPI subsystem works as master and does not have a slave select
input line (SS).
10.3.1 Master In Slave Out (MISO)
The MISO line is configured as an input in a master device and as an
output in a slave device. It is one of the two lines that transfer serial data
in one direction, with the most significant bit sent first. The MISO line of
a slave device is placed in the high-impedance state if the slave is not
selected.
General Release Specification
116
MC68HC(7)05H12 — Rev. 1.0
Serial Peripheral Interface (SPI)
MOTOROLA
10.3.3 Serial Clock (SCK)
The serial clock is used to synchronize data movement both in and out
of the device through its MOSI and MISO lines. The master and slave
devices are capable of exchanging a byte of information during a
sequence of eight clock cycles. Since SCK is generated by the master
device, this line becomes an input on a slave device.
As shown in Figure 10-1, four different timing relationships may be
selected by control bits CPOL and CPHA in the serial peripheral control
register (SPCR). Both master and slave devices must operate with the
same timing. The master device always places data on the MOSI line a
half cycle before the clock edge (SCK), in order for the slave device to
latch the data.
Two bits (SPR0 and SPR1) in the SPCR of the master device select the
clock rate. In a slave device, SPR0 and SPR1 have no effect on the
operation of the SPI.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Peripheral Interface (SPI)
117
A G R E E M E N T
The MOSI line is configured as an output in a master device and as an
input in a slave device. It is one of the two lines that transfer serial data
in one direction with the most significant bit sent first.
N O N - D I S C L O S U R E
10.3.2 Master Out Slave In (MOSI)
R E Q U I R E D
Serial Peripheral Interface (SPI)
SPI Signal Description
R E Q U I R E D
Serial Peripheral Interface (SPI)
SCK
(CPOL = 0, CPHA = 0)
SCK
(CPOL = 0, CPHA = 1)
A G R E E M E N T
SCK
(CPOL = 1, CPHA = 0)
SCK
(CPOL = 1, CPHA = 1)
MISO / MOSI
MSB
6
5
4
3
2
1
LSB
INTERNAL STROBE FOR DATA CAPTURE (ALL MODES)
N O N - D I S C L O S U R E
Figure 10-1. Data Clock Timing Diagram
General Release Specification
118
MC68HC(7)05H12 — Rev. 1.0
Serial Peripheral Interface (SPI)
MOTOROLA
R E Q U I R E D
Serial Peripheral Interface (SPI)
SPI Functional Description
10.4 SPI Functional Description
SCI CLOCK
S
M
M
S
DIVIDER
READ DATA BUFF
÷2 ÷4 ÷16 ÷32
CLOCK
SPI CLOCK
(MASTER)
S
CLOCK
LOGIC
M
SPR0
SPR1
SELECT
PB6/
MOSI
A G R E E M E N T
LSB
8-BIT SHIFT REG
PIN CONTROL LOGIC
MSB
PB5/
MISO
PB7/
SCK
MSTR
SPI STATUS REGISTER
SPI INTERRUPT
REQUEST
SPR0
SPR1
CPHA
CPOL
MSTR
SPE
SPIE
SPE
DOD
MODF
WCOL
SPIF
SPI CONTROL
SPI CONTROL REGISTER
INTERNAL
DATA BUS
Figure 10-2. Serial Peripheral Block Diagram
Figure 10-2 shows a block diagram of the serial peripheral interface
circuitry. When a master device transmits data to a slave device via the
MOSI line, the slave device responds by sending data to the master
device via the master’s MISO line. This implies full duplex transmission
with both data out and data in synchronized to the same clock signal.
Thus, the byte transmitted is replaced by the byte received and
eliminates the need for separate transmitter-empty and receiver-full
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Peripheral Interface (SPI)
119
N O N - D I S C L O S U R E
INTERNAL
MCU CLOCK
R E Q U I R E D
Serial Peripheral Interface (SPI)
status bits. A single status bit (SPIF) is used to signify that the I/O
operation has been completed.
The SPI is double buffered on read, but not on write. If a write is
performed during data transfer, the transfer is not interrupted, and the
write will be unsuccessful. This condition will cause the write collision
status bit (WCOL) in the SPSR to be set. After a data byte is shifted, the
SPIF flag in the SPSR is set.
A G R E E M E N T
In master mode, the SCK pin is an output. It idles high or low, depending
on the CPOL bit in the SPCR, until data is written to the shift register.
Then eight clocks are generated to shift the eight bits of data, after which
SCK goes idle again.
In slave mode, the slave start logic receives a clock input at the SCK pin.
Thus, the slave is synchronized to the master. Data from the master is
received serially via the slave MOSI line and is loaded into the 8-bit shift
register. The data is then transferred, in parallel, from the 8-bit shift
register to the read buffer. During a write cycle, data is written into the
shift register, then the slave waits for a clock train from the master to shift
the data out on the slave’s MISO line.
N O N - D I S C L O S U R E
Figure 10-3 illustrates the MOSI, MISO and SCK master-slave
interconnections.
MASTER
SLAVE
8-BIT SHIFT REGISTER
SPI CLOCK
GENERATOR
MISO
MISO
MOSI
MOSI
SCK
SCK
8-BIT SHIFT REGISTER
Figure 10-3. Serial Peripheral Interface Master-Slave Interconnection
General Release Specification
120
MC68HC(7)05H12 — Rev. 1.0
Serial Peripheral Interface (SPI)
MOTOROLA
10.5.1 SPI Control Register (SPCR)
$0044
Bit 7
6
5
4
3
2
1
Bit 0
SPIE
SPE
DOD
MSTR
CPOL
CPHA
SPR1
SPR0
0
0
0
0
0
1
U
U
Read:
Write:
Reset:
Figure 10-4. SPI Control Register (SPCR)
SPIE — SPI Interrupt Enable
When this bit is set to one, a hardware interrupt sequence is
requested each time the SPIF or MODF status flag is set. SPI
interrupts are inhibited if this bit is clear or if the I bit in the CC Register
is set.
1 = SPI interrupts enabled
0 = SPI interrupts disabled
SPE — SPI System Enable
1 = SPI system on
0 = SPI system off
DOD — Direction of Data Flow (in or out of the Serial Shift Register)
1 = data is transferred LSB first
0 = data is transferred MSB first
MSTR — Master/Slave Mode Select
1 = Master mode
0 = Slave mode
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Peripheral Interface (SPI)
121
A G R E E M E N T
There are three registers in the serial peripheral interface which provide
control, status and data storage functions. These registers are called the
serial peripheral control register (SPCR), the serial peripheral status
register (SPSR) and the serial peripheral data I/O register (SPDAT).
N O N - D I S C L O S U R E
10.5 Registers
R E Q U I R E D
Serial Peripheral Interface (SPI)
Registers
R E Q U I R E D
Serial Peripheral Interface (SPI)
CPOL — Clock Polarity
When the clock polarity bit is cleared and data is not being
transferred, a steady state low value is produced at the SCK pin of the
master device. Conversely, if this bit is set, the SCK pin will idle high.
This bit is also used in conjunction with the clock phase control bit to
produce the desired clock-data relationship between master and
slave. See Figure 10-1.
CPHA — Clock Phase
A G R E E M E N T
The clock phase bit, in conjunction with the CPOL bit, controls the
clock-data relationship between master and slave. The CPOL bit can
be thought of simply as inserting an inverter in series with the SCK
line. The CPHA bit selects one of two fundamentally different clocking
protocols. Refer to Figure 10-1.
SPR1, SPR0 — SPI Clock Rate Selects
If the device is a master, the two serial peripheral rate bits select one
of four division ratios of the input-clock to be used as SCK (see
Table 10-1). These bits have no effect in slave mode.
N O N - D I S C L O S U R E
Table 10-1. SPI Clock Rate Selection
SPR1
SPR0
Input clock divided by PRS0
0
0
2
0
1
4
1
0
16
1
1
32
Bit 6 (SPP = SPI Prescaler) of the SCI baud rate register,
Section 11.8.5 Baud Rate Register (BAUD), determines the input
clock of the SPI module.
SPP — SPI Prescaler
1 = SCI receiver clock connected to the SPI clock input
0 = bus clock connected to the SPI clock input
NOTE:
If SPP is set, the SPI clock rate is dependent on the SCI clock rate. The
SPI clock rate is given by E: PRS1: PRS2: PRS0. PRS1 and PRS2 are
General Release Specification
122
MC68HC(7)05H12 — Rev. 1.0
Serial Peripheral Interface (SPI)
MOTOROLA
$0045
Bit 7
6
5
4
3
2
1
Bit 0
Read:
SPIF
WCOL
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Write:
Reset:
Figure 10-5. SPI Status Register (SPSR)
SPIF — SPI Interrupt Request Flag
The serial peripheral data transfer flag bit is set after the eighth SCK
cycle in a data transfer and it is cleared by reading the SPSR register
(with SPIF set) followed by reading from or writing to the SPI Data
Register (SPDAT).
WCOL — Write Collision
The write collision bit is used to indicate that a serial transfer was in
progress when the MCU tried to write new data into the SPDAT data
register. The MCU write is disabled to avoid writing over the data
being transmitted. No interrupt is generated because the error status
flag can be read upon completion of the transfer that was in progress
at the time of the error. This flag is automatically cleared by a read of
the SPSR (with WCOL set) followed by an access (read or write) to
the SPDAT register.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Peripheral Interface (SPI)
123
A G R E E M E N T
10.5.2 SPI Status Register (SPSR)
N O N - D I S C L O S U R E
the SCI prescaler factors given in Table 11-1 and Table 11-2. PRS0 is
the SPI prescaler factor given in Table 10-1.
R E Q U I R E D
Serial Peripheral Interface (SPI)
Registers
R E Q U I R E D
Serial Peripheral Interface (SPI)
10.5.3 SPI Data I/O Register (SPDAT)
$0046
Bit 7
6
5
4
3
2
1
Bit 0
Read:
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
U
U
U
U
U
U
U
U
Write:
Reset:
N O N - D I S C L O S U R E
A G R E E M E N T
Figure 10-6. SPI Data I/O Register (SPDAT)
The serial peripheral data I/O register is used to transmit and receive
data on the serial bus. Only a write to this register will initiate
transmission/reception of another byte, and this will only occur in the
master device. At the completion of transmitting a byte of data, the SPIF
status bit is set in both the master and slave devices.
When the user reads the serial peripheral data I/O register, a buffer is
actually being read. The first SPIF must be cleared by the time a second
transfer of data from the shift register to the read buffer is initiated or an
overrun condition will exist. In cases of overrun, the byte which causes
the overrun is lost.
A write to the serial peripheral data I/O register is not buffered and places
data directly into the shift register for transmission.
10.6 SPI During WAIT Mode
When the MCU enters wait mode, the CPU clock is halted. All CPU
action is suspended; however, the SPI system remains active. In fact an
interrupt from the SPI causes the processor to exit the wait mode.
General Release Specification
124
MC68HC(7)05H12 — Rev. 1.0
Serial Peripheral Interface (SPI)
MOTOROLA
11.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.3
Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
11.4 Receiver Wake-up Operation . . . . . . . . . . . . . . . . . . . . . . . . . 130
11.4.1
Idle Line Wake-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
11.4.2
Address Mark Wake-up. . . . . . . . . . . . . . . . . . . . . . . . . . . 131
11.5
Receive Data (RDI). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
11.6
Start Bit Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
11.7
Transmit Data (TDO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
11.8 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
11.8.1
Serial Communications Data Register (SCDAT). . . . . . . . 135
11.8.2
Serial Communications Control Register 1 (SCCR1) . . . . 136
11.8.3
Serial Communications Control Register 2 (SCCR2) . . . . 137
11.8.4
Serial Communications Status Register (SCSR) . . . . . . . 138
11.8.5
Baud Rate Register (BAUD) . . . . . . . . . . . . . . . . . . . . . . . 140
11.9
SCI During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
11.2 Introduction
The SCI is a full-duplex UART-type asynchronous system, using
standard non return-to-zero (NRZ) format (one start bit, eight or nine
data bits, and a stop bit). An on-chip baud-rate generator derives
standard baud-rate frequencies from the MCU oscillator. Both the
transmitter and the receiver are double buffered; thus, back-to-back
characters can be handled easily, even if the central processing unit
(CPU) is delayed in responding to the completion of an individual
character. The SCI transmitter and receiver are functionally independent
but use the same format and baud rate.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
125
R E Q U I R E D
11.1 Contents
A G R E E M E N T
Section 11. Serial Communications Interface (SCI)
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
Serial Communications Interface (SCI)
A G R E E M E N T
SCI Two-wire System Features:
•
Standard NRZ (mark/space) format.
•
Advanced error detection method includes noise detection for
noise duration of up to 1/16th bit time.
•
Full-duplex operation.
•
Software programmable for one of 32 different baud rates.
•
Software selectable word length (eight or nine bit words).
•
Separate transmitter and receiver enable bits.
•
Capable of being interrupt driven.
•
Four separate enable bits available for interrupt control.
N O N - D I S C L O S U R E
SCI Receiver Features:
•
Receiver wake-up function (idle line or address bit).
•
Idle line detect.
•
Framing error detect.
•
Noise detect.
•
Overrun detect.
•
Receiver data register full flag.
SCI Transmitter Features:
•
Transmit data register empty flag.
•
Transmit complete flag.
•
Send break.
A block diagram of the SCI is shown in Figure 11-1. The user has option
bits in serial communication control register 1 (SCCR1) to select the
‘wake-up’ method (WAKE bit) and data word length (M bit) of the SCI.
Serial communications control register 2 (SCCR2) provides control bits
which individually enable/disable the transmitter or receiver (TE and RE,
respectively), enable system interrupts (TIE, TCIE, RIE, ILIE) and
provide the wake-up enable bit (RWU) and the send break code bit
General Release Specification
126
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
N O N - D I S C L O S U R E
A G R E E M E N T
(SBK). Control bits in the baud rate register (BAUD) allow the user to
select one of 32 different baud rates for the transmitter and receiver.
R E Q U I R E D
Serial Communications Interface (SCI)
Introduction
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
127
R E Q U I R E D
Serial Communications Interface (SCI)
SCI INTERRUPT
$47
INTERNAL BUS
TRANSMIT
RECEIVE DATA $47
REGISTER
DATA REGISTER
SCCR2
$49
A G R E E M E N T
(SEE NOTE)
(SEE NOTE)
TIE
TCIE
TRANSMIT DATA
RIE
RECEIVE DATA
SHIFT REGISTER
ILIE
SHIFT REGISTER
TE
RE
SBK
SCSR FE NF OR DLE RDRF TC TDRE
$4A
RWU
TDO
RDI
2
WAKE-UP
UNIT
N O N - D I S C L O S U R E
SBK
TE
7
TRANSMIT
CONTROL
RECEIVE
CONTROL
FLAG
CONTROL
INTERNAL
PROCESSOR
DATA
RATE GENERATOR
$4B TCLR
$48
R8
SPP
T8
SCP1 SCP0 RCKB SCR2 SCR1 SCR0 BAUD
0
M
WAKE
0
0
0
SCCR1
Figure 11-1. Serial Communications Interface Block Diagram
General Release Specification
128
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
Data transmission is initiated by a write to the serial communications
data register (SCDR). Provided the transmitter is enabled, data stored in
the SCDR is transferred to the transmit data shift register. This transfer
of data sets the transmit data register empty flag (TDRE) in the SCI
status register (SCSR) and may generate an interrupt if the transmit
interrupt is enabled. The transfer of data to the transmit data shift
register is synchronized with the bit rate clock. All data is transmitted
least significant bit first. Upon completion of data transmission, the
transmission complete flag (TC) in the SCSR is set (provided no pending
data, preamble or break is to be sent), and an interrupt may be
generated if the transmit complete interrupt is enabled. If the transmitter
is disabled, and the data, preamble or break (in the transmit data shift
register) has been sent, the TC bit will also be set. This will also generate
an interrupt if the transmission complete interrupt enable bit (TCIE) is
set. If the transmitter is disabled in the middle of a transmission, that
character will be completed before the transmitter gives up control of the
TDO pin.
When SCDR is read, it contains the last data byte received, provided
that the receiver is enabled. The receive data register full flag bit (RDRF)
in the SCSR is set to indicate that a data byte has been transferred from
the input serial shift register to the SCDR, which can cause an interrupt
if the receiver interrupt is enabled. The data transfer from the input serial
shift register to the SCDR is synchronized by the receiver bit rate clock.
The OR (overrun), NF (noise), or FE (framing) error flags in the SCSR
may be set if data reception errors occurred.
An idle line interrupt is generated if the idle line interrupt is enabled and
the IDLE bit (which detects idle line transmission) in SCSR is set. This
allows a receiver that is not in the wake-up mode to detect the end of a
message or the preamble of a new message, or to resynchronize with
the transmitter. A valid character must be received before the idle line
condition or the IDLE bit will not be set and idle line interrupt will not be
generated.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
129
A G R E E M E N T
The Serial Communications Data Register (SCDAT) is controlled by the
internal R/W signal. It is the transmit data register when written and the
receive data register when read.
N O N - D I S C L O S U R E
NOTE:
R E Q U I R E D
Serial Communications Interface (SCI)
Introduction
11.3 Data Format
Receive data or transmit data is the serial data that is transferred to the
internal data bus from the receive data input pin (RDI) or from the
internal bus to the transmit data output pin (TDO). The non-return-tozero (NRZ) data format shown in Figure 11-2 is used and must meet the
following 5 criteria:
1. The idle line is brought to a logic one state prior to
transmission/reception of a character.
A G R E E M E N T
R E Q U I R E D
Serial Communications Interface (SCI)
2. A start bit (logic zero) is used to indicate the start of a frame.
3. The data is transmitted and received least significant bit first.
4. A stop bit (logic one) is used to indicate the end of a frame. A frame
consists of a start bit, a character of eight or nine data bits, and a
stop bit.
5. A break is defined as the transmission or reception of a low (logic
zero) for at least one complete frame time.
CONTROL BIT ‘M’
SELECTS 8 OR 9 BIT DATA
N O N - D I S C L O S U R E
{
0
IDLE LINE
1
2
3
4
5
6
7
8
0
STOP START
START
OPTIONAL
Figure 11-2. Data Format
11.4 Receiver Wake-up Operation
The receiver logic hardware also supports a receiver wake-up function
which is intended for systems having more than one receiver. With this
function a transmitting device directs messages to an individual receiver
or group of receivers by passing addressing information as the initial
byte(s) of each message. The wake-up function allows receivers not
General Release Specification
130
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
11.4.1 Idle Line Wake-up
In idle line wake-up mode, a dormant receiver wakes up as soon as the
RDI line becomes idle. Idle is defined as a continuous logic high level on
the RDI line for ten (or eleven) full bit times. Systems using this type of
wake-up must provide at least one character time of idle between
messages to wake up sleeping receivers, but must not allow any idle
time between characters within a message.
11.4.2 Address Mark Wake-up
In address mark wake-up, the most significant bit (MSB) in a character
is used to indicate that the character is an address (1) or a data (0)
character. Sleeping receivers will wake up whenever an address
character is received. Systems using this method for wake-up would set
the MSB of the first character of each message and leave it clear for all
other characters in the message. Idle periods may be present within
messages and no idle time is required between messages for this wakeup method.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
131
A G R E E M E N T
The receiver is placed in wake-up mode by setting the receiver wake-up
bit (RWU) in the SCCR2 register. While RWU is set, all of the receiver
related status flags (RDRF, IDLE, OR, NF, and FE) are inhibited (cannot
become set). Note that the idle line detect function is inhibited while the
RWU bit is set. Although RWU may be cleared by a software write to
SCCR2, it would be unusual to do so. Normally RWU is set by software
and gets cleared automatically with hardware by one of the two methods
described below.
N O N - D I S C L O S U R E
addressed to remain in a dormant state for the remainder of the
unwanted message. This eliminates any further software overhead to
service the remaining characters of the unwanted message and thus
improves system performance.
R E Q U I R E D
Serial Communications Interface (SCI)
Receiver Wake-up Operation
11.5 Receive Data (RDI)
Receive data is the serial data that is applied through the input line and
the serial communications interface to the internal bus. The receiver
circuitry clocks the input at a rate equal to 16 times the baud rate and this
time is referred to as the RT clock.
Once a valid start bit is detected the start bit, each data bit and the stop
bit are sampled three times at RT intervals 8 RT, 9 RT and 10 RT (1 RT
is the position where the bit is expected to start), as shown in Figure 113. The value of the bit is determined by voting logic which takes the value
of the majority of the samples.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Serial Communications Interface (SCI)
PREVIOUS BIT
PRESENT BIT
RDI
NEXT BIT
SAMPLES
V
V
V
16
1
8
9
10
16
1
R
R
R
R
R
R
R
T
T
T
T
T
T
T
Figure 11-3. Sampling Technique Used On All Bits
11.6 Start Bit Detection
When the RDI input is detected low, it is tested for three more sample
times (referred to as the start edge verification samples in Figure 11-4).
If at least two of these three verification samples detect a logic zero, a
valid start bit has been detected, otherwise the line is assumed to be idle.
A noise flag is set if all three verification samples do not detect a logic
zero. A valid start bit could be assumed with a set noise flag present.
If there has been a framing error without detection of a break (10 zeros
for 8-bit format or 11 zeros for 9-bit format), the circuit continues to
operate as if there actually was a stop bit and the start edge will be
placed artificially. The last bit received in the data shift register is
General Release Specification
132
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
inverted to a logic one, and the three logic one start qualifiers (shown in
Figure 11-4) are forced into the sample shift register during the interval
when detection of a start bit is anticipated (see Figure 11-5); therefore,
the start bit will be accepted no sooner than it is anticipated. If the
receiver detects that a break produced the framing error, the start bit will
not be artificially induced and the receiver must actually detect a logic
one before the start bit can be recognised (see Figure 11-6).
R E Q U I R E D
Serial Communications Interface (SCI)
Start Bit Detection
1
R
T
RT CLOCK EDGES (FOR ALL THREE EXAMPLES)
IDLE
RDI
2
R
T
3
R
T
4
R
T
A G R E E M E N T
16X INTERNAL SAMPLING CLOCK
5
R
T
START
1
1
1
1
1
1
1
1
1
1
0
0
START
QUALIFIERS
0
START
VERIFICATION
IDLE
NOISE
START
1
1
1
1
IDLE
1
1
1
1
1
1
0
0
1
0
0
N O N - D I S C L O S U R E
RDI
NOISE
RDI
START
1
1
1
1
0
1
1
1
1
1
0
Figure 11-4. Examples of Start Bit Sampling Techniques
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
133
R E Q U I R E D
Serial Communications Interface (SCI)
DATA
EXPECTED STOP
ARTIFICIAL EDGE
RECEIVE DATA
IN
START BIT
DATA
DATA SAMPLES
A G R E E M E N T
(A) CASE 1, RECEIVE LINE LOW DURING ARTIFICIAL EDGE
EXPECTED STOP
DATA
START EDGE
RECEIVE DATA
IN
START BIT
DATA
DATA SAMPLES
(B) CASE 2, RECEIVE LINE HIGH DURING EXPECTED START EDGE
N O N - D I S C L O S U R E
Figure 11-5. SCI Artificial Start Following a Framing Error
EXPECTED STOP
DETECTED A
START EDGE
BREAK
START BIT
RECEIVE DATA IN
START
QUALIFIERS
START EDGE
VERIFICATION
SAMPLES
DATA SAMPLES
Figure 11-6. SCI Start Bit Following a Break
General Release Specification
134
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
11.7 Transmit Data (TDO)
Transmit data is the serial data from the internal data bus that is applied
through the serial communications interface to the output line. The
transmitter generates a bit time by using a derivative of the RT clock,
thus producing a transmission rate equal to 1/16th that of the receiver
sample clock.
R E Q U I R E D
Serial Communications Interface (SCI)
Transmit Data (TDO)
11.8.1 Serial Communications Data Register (SCDAT)
$0047
Bit 7
6
5
4
3
2
1
Bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
U
U
U
U
U
U
U
U
Read:
Write:
Reset:
Figure 11-7. SCI Data Register (SCDAT)
The SCI data register (SCDAT) shown in Figure 11-7 is actually two
separate registers. When SCDAT is read, the read-only receive data
register is accessed and when SCDAT is written, the write-only transmit
data register is accessed.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
135
N O N - D I S C L O S U R E
Primarily the SCI system is configured and controlled by five registers
BAUD, SCCR1, SCCR2, SCSR, and SCDAT.
A G R E E M E N T
11.8 Registers
R E Q U I R E D
Serial Communications Interface (SCI)
11.8.2 Serial Communications Control Register 1 (SCCR1)
$0048
Bit 7
Read:
R8
6
5
4
3
M
WAKE
U
U
0
T8
2
1
Bit 0
0
0
0
U
U
U
Write:
Reset:
U
U
U
A G R E E M E N T
Figure 11-8. SCI Control Register 1 (SCCR1)
R8 — Receive Data Bit 8
This bit is the ninth serial data bit received when the SCI system is
configured for nine data bit operation (M = 1). The most significant bit
(bit 8) of the received character is transferred into this bit at the same
time as the remaining eight bits (bits 0 – 7) are transferred from the
serial receive shift register to the SCI receive data register.
T8 — Transmit Data Bit 8
N O N - D I S C L O S U R E
This bit is the ninth data bit to be transmitted when the SCI system is
configured for nine data bit operation (M = 1). When the eight low
order bits (bits 0–7) of a transmit character are transferred from the
SCI data register to the serial transmit shift register, this bit (bit 8) is
transferred to the ninth bit position of the shift register.
M — Mode (Select Character Format)
The M bit controls the character length for both the transmitter and
receiver at the same time. The 9th data bit is most commonly used as
an extra stop bit or in conjunction with the “address mark” wake-up
method. It can also be used as a parity bit.
1 = 1 start bit, 8 data bits + 9th data bit, 1 stop bit
0 = 1 start bit, 8 data bits, 1 stop bit
WAKE — Wake-up Mode Select
1 = Wake-up on address mark
0 = Wake-up on idle line
General Release Specification
136
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
11.8.3 Serial Communications Control Register 2 (SCCR2)
The SCI control register 2 (SCCR2) provides the control bits that
enable/disable individual SCI functions.
$0049
Bit 7
6
5
4
3
2
1
Bit 0
TIE
TCIE
RIE
ILIE
TE
RE
RWU
SBK
0
0
0
0
0
0
0
0
Read:
R E Q U I R E D
Serial Communications Interface (SCI)
Registers
Figure 11-9. SCI Control Register 2 (SCCR2)
TIE — Transmit Interrupt Enable
1 = SCI interrupt if TDRE = 1
0 = TDRE interrupts disabled
TCIE — Transmit Complete Interrupt Enable
1 = SCI interrupt if TC = 1
0 = TC interrupts disabled
RIE — Receiver Interrupt Enable
1 = SCI interrupt if RDRF or OR = 1
0 = RDRF and OR interrupts disabled
ILIE — Idle Line Interrupt Enable
1 = Idle Line Interrupt Enable
0 = IDLE interrupts disabled
TE — Transmitter Enable
When the transmit enable bit is set, the transmit shift register output
is applied to the TDO line. Depending on the state of control bit M
(SCCR1), a preamble of 10 (M = 0) or 11 (M = 1) consecutive ones is
transmitted when software sets the TE bit from a cleared state. After
loading the last byte in the serial communications data register and
receiving the TDRE flag, the user can clear TE. Transmission of the
last byte will then be completed before the transmitter gives up control
of the TDO pin. While the transmitter is active, the Port C bit 7 line is
forced to be an output.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
137
N O N - D I S C L O S U R E
Reset:
A G R E E M E N T
Write:
R E Q U I R E D
Serial Communications Interface (SCI)
RE — Receiver Enable
When the receiver enable bit is set, the receiver is enabled. When RE
is clear, the receiver is disabled and all of the status bits associated
with the receiver (RDRF, IDLE, OR, NF and FE) are inhibited. While
the receiver is enabled, the Port C bit 6 is forced to be an input.
RWU — Receiver Wake-up
N O N - D I S C L O S U R E
A G R E E M E N T
When the receiver wake-up bit is set by the user software, it puts the
receiver to sleep and enables the wake-up function. If the WAKE bit
is cleared, RWU is cleared by the SCI logic after receiving 10 (M = 0)
or 11 (M = 1) consecutive ones. If the WAKE bit is set, RWU is cleared
by the SCI logic after receiving a data word whose MSB is set.
SBK — Send Break
If the send break bit is toggled set and cleared, the transmitter sends
10 (M = 0) or 11 (M = 1) zeros and then reverts to idle sending data.
If SBK remains set, the transmitter will continually send whole blocks
of zeros (sets of 10 or 11) until cleared. At the completion of the break
code, the transmitter sends at least one high bit to guarantee
recognition of a valid start bit. If the transmitter is currently empty and
idle, setting and clearing SBK is likely to queue two character times of
break because the first break transfers almost immediately to the shift
register and the second is then queued into the parallel transmit
buffer.
11.8.4 Serial Communications Status Register (SCSR)
The serial communications status register (SCSR) provides inputs to the
interrupt logic circuits for generation of the SCI system interrupt.
$004A
Bit 7
6
5
4
3
2
1
Bit 0
Read:
TDRE
TC
RDRF
IDLE
OR
NF
FE
0
1
1
0
0
0
0
0
0
Write:
Reset:
Figure 11-10. SCI Status Register (SCSR)
General Release Specification
138
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
TC — Transmit Complete Flag
This bit is set to indicate that the SCI transmitter has no meaningful
information to transmit (no data in shift register, no preamble, no
break). When TC is set the serial line will go idle (continuous MARK).
Reset sets this bit.
RDRF -— Receive Data Register Full Flag
This bit is set when the contents of the receiver serial shift register is
transferred to the receiver data register.
IDLE — Idle Line Detected Flag
This bit is set when a receiver idle line is detected (the receipt of a
minimum of ten/eleven consecutive ‘1’s). This bit will not be set by the
idle line condition when the RWU bit is set. Once cleared, IDLE will
not be set again until after RDRF has been set, (until after the line has
been active and becomes idle again).
OR — Overrun Error Flag
This bit is set when a new byte is ready to be transferred from the
receiver shift register to the receiver data register and the receive data
register is already full (RDRF bit is set). Data transfer is inhibited until
this bit is cleared.
NF — Noise Error Flag
This bit is set if there is noise on a “valid” start bit, any of the data bits,
or on the stop bit. The NF bit is set during the same cycle as the RDRF
bit but does not get set in the case of an overrun (OR).
FE — Framing Error Flag
This bit is set when the word boundaries in the bit stream are not
synchronized with the receiver bit counter (generated by the reception
of a logic zero bit where a stop bit was expected). The FE bit reflects
the status of the byte in the receive data register and the transfer from
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
139
A G R E E M E N T
This bit is set when the byte in the transmit data register is transferred
to the serial shift register. New data will not be transmitted unless the
SCSR register is read before writing to the transmit data register.
Reset sets this bit.
N O N - D I S C L O S U R E
TDRE — Transmit Data Register Empty Flag
R E Q U I R E D
Serial Communications Interface (SCI)
Registers
the receive shift register to the receive data register is inhibited in the
case of overrun. The FE bit is set during the same cycle as the RDRF
bit but does not get set in the case of an overrun (OR). The framing
error flag inhibits further transfer of data into the receive data register
until it is cleared.
11.8.5 Baud Rate Register (BAUD)
The baud rate register (BAUD) is used to set the bit rate for the SCI
system. Normally this register is written once, during initialization, to set
the baud rate for SCI communications. Both the receiver and the
transmitter use the same baud rate which is derived from the MCU bus
rate clock. A two stage divider is used to develop custom baud rates from
normal MCU crystal frequencies so it is not necessary to use special
baud rate crystal frequencies.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Serial Communications Interface (SCI)
$004B
Bit 7
Read:
0
Write:
TCLR
Reset:
1
6
5
4
SPP
SCP1
SCP0
3
2
1
Bit 0
SCR2
SCR1
SCR0
U
U
U
0
RCKB
1
0
0
0
Figure 11-11. SCI Baud Rate Register (BAUD)
TCLR — Clear Baud Rate Counters (for test purposes only)
This bit is disabled and remains low in any mode other than test or
bootstrap mode. Reset clears this bit. While in test or bootstrap mode,
setting this bit causes the baud rate counter chains to be reset. The
logic one state of this bit is transitory and reads always return a logic
zero. This control bit is intended only for factory testing of the MCU.
SPP — SPI Prescaler bit
1 = SCI receiver clock connected to the SPI clock
input.
0 = bus clock connected to the SPI clock input.
The SCI baud rate can be calculated from the internal bus clock and
the two prescaler factors PRS1 and PRS2. The first prescaler factor
PRS1 is selected with SCP0 and SCP1, as shown in Table 11-1. The
General Release Specification
140
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
SCP1, SCP0 — First Serial Prescaler Select bits
Table 11-1. First Prescaler Stage
SCP1
SCP0
PRS1
0
0
1
0
1
3
1
0
4
1
1
13
SCR2, SCR1, SCR0 — SCI Rate Select bits of the second prescaler
stage
These three bits select the baud rates for both the transmitter and the
receiver.
A G R E E M E N T
second prescaler factor PRS2 is selected with SCR0, SCR1 and
SCR2, as shown in Table 11-2. The SCI baud rate B equals the
internal bus clock divided by 16 divided by PRS1 divided by PRS2, [B
= bus clock: 16: PRS1: PRS2].
R E Q U I R E D
Serial Communications Interface (SCI)
Registers
SCR2
SCR1
SCR0
PRS2
0
0
0
1
0
0
1
2
0
1
0
4
0
1
1
8
1
0
0
16
1
0
1
32
1
1
0
64
1
1
1
128
RCKB — SCI Receive Baud Rate Clock Test
This bit is disabled and remains low in any mode other than test or
bootstrap modes. Reset clears this bit. While in test or bootstrap
mode, this bit may be written but not read (reads always return a logic
zero). Setting this bit enables a baud rate counter test mode where
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Serial Communications Interface (SCI)
141
N O N - D I S C L O S U R E
Table 11-2. Second Prescaler Stage
the exclusive-or of the receiver clock (16 times the baud rate) and the
transmit clock (1 times the baud rate) is driven out the PC3/TDO pin.
This control bit is intended only for factory testing of the MCU.
11.9 SCI During WAIT Mode
The SCI system is not affected by the WAIT mode and continues regular
operation. Any valid SCI interrupt will wake the system up.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Serial Communications Interface (SCI)
General Release Specification
142
MC68HC(7)05H12 — Rev. 1.0
Serial Communications Interface (SCI)
MOTOROLA
12.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
12.3
A/D Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
12.4
A/D Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
12.5
Internal and Master Oscillator. . . . . . . . . . . . . . . . . . . . . . . . . 145
12.6 A/D Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
12.6.1
A/D Status and Control Register (ADSCR) . . . . . . . . . . . . 146
12.6.2
A/D Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
12.7
A/D During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
12.8
Analog Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
12.9 Conversion Accuracy Definitions . . . . . . . . . . . . . . . . . . . . . . 150
12.9.1
Transfer Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
12.9.2
Monotonicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
12.9.3
Quantization Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.4
Offset Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.5
Gain Scale Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.6
Differential Linearity Error . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.7
Integral Linearity Error. . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
12.9.8
Total Unadjusted Error . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Analog to Digital Converter
143
R E Q U I R E D
12.1 Contents
A G R E E M E N T
Section 12. Analog to Digital Converter
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
12.2 Introduction
The Analog to Digital converter system consists of a single 8-bit
successive approximation converter and a channel multiplexer. There is
one 8-bit result data register and one 8-bit status/control register.
The reference supply for the converter uses two dedicated pins rather
than being driven by the system power supply lines, because the voltage
drops in the bonding wires of such heavily loaded pins would decrease
the accuracy of the A/D conversion.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Analog to Digital Converter
An internal RC type oscillator is activated by the ADRC bit in the A/D
status/control register. This RC oscillator is used to give sufficiently high
clock rate to the A/D when the bus speed is too low for the A/D to be
accurate.
Additionally, the ADON bit allows the user to disconnect the A/D when
not used, in order to save power. This is particularly useful to reduce
current consumption (by typically 100µA) when going into the WAIT
mode.
The A/D is ratiometric and two dedicated pins supply the reference
voltage (VREFH and VREFL). An input voltage equal to or greater than
VREFH converts to $FF (full scale) with no overflow indication (if
greater). An input voltage equal to VREFL converts to $00. For
ratiometric conversions, the source of each analog input should use
VREFH as the supply voltage and be referenced to VREFL.
12.3 A/D Principle
The A/D reference inputs are applied to a precision internal digital to
analog converter. Control logic drives this D/A and the analog output is
successively compared to the selected analog input which was sampled
at the beginning of the conversion time. The conversion is monotonic
with no missing codes.
The 8-bit conversions are accurate to within ± 1.5 LSB including
quantization.
General Release Specification
144
MC68HC(7)05H12 — Rev. 1.0
Analog to Digital Converter
MOTOROLA
Any write to the A/D status/control register will abort the current
conversion, reset the conversion complete flag and start a new
conversion on the selected channel.
At power-on or external reset, both the ADRC and ADON bits are
cleared. Thus the A/D is disabled.
Each channel of conversion takes 32 clock cycles, which must be at a
frequency equal to or greater than 1 MHz.
A multiplexer allows the single A/D converter to select one of four
external analog signals and three internal reference sources.
12.5 Internal and Master Oscillator
If the MCU bus (E clock) frequency is less than 1.0 MHz, an internal RC
oscillator (nominally 1.5 MHz) must be used for the A/D conversion
clock. This selection is made by setting the ADRC bit in the A/D
status/control register to 1.
When the internal RC oscillator is being used as the conversion clock
three limitations apply:
1. The conversion complete flag (COCO) must be used to determine
when a conversion sequence has been completed, due to the
frequency tolerance of the RC oscillator and its asynchronism with
regard to the MCU bus clock.
2. The conversion process runs at the nominal 1.5 MHz rate, but the
conversion results must be transferred to the MCU result registers
synchronously with the MCU bus clock, so the conversion time is
limited to a maximum of one channel per bus cycle.
3.
If the system clock is running faster than the RC oscillator, the RC
oscillator should be turned off, and the system clock used as the
conversion clock.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Analog to Digital Converter
145
A G R E E M E N T
The A/D is an 8-bit S.A.R. type A/D converter, with continuous
conversion per given channel. The result of a conversion is loaded into
the read-only result data register, and a conversion complete flag COCO
is set in the A/D status/control register.
N O N - D I S C L O S U R E
12.4 A/D Operation
R E Q U I R E D
Analog to Digital Converter
A/D Operation
R E Q U I R E D
Analog to Digital Converter
12.6 A/D Registers
12.6.1 A/D Status and Control Register (ADSCR)
$004F
Bit 7
Read:
COCO
6
5
ADRC
ADON
0
0
4
3
2
1
Bit 0
CH3
CH2
CH1
CH0
0
0
0
0
0
A G R E E M E N T
Write:
Reset:
0
0
Figure 12-1. A/D Status and Control Register (ADSCR)
COCO — Conversions Complete
N O N - D I S C L O S U R E
This read-only status bit is set when a conversion is completed,
indicating that the A/D data register contains valid results. This bit is
cleared whenever the A/D status/control register is written and a new
conversion automatically started, or whenever the A/D register is
read. Once a conversion has been started by writing to the A/D
status/control register, conversions of the selected channel will
continue every 32 cycles until the A/D status/control register is written
to again. In this continuous conversion mode the A/D data register will
be filled with new data, and the COCO bit set, every 32 cycles. Data
from the previous conversion will be overwritten regardless of the
state of the COCO bit prior to writing.
ADRC — RC Oscillator On
When ADRC is set, the A/D section runs on the internal RC oscillator
instead of the CPU clock. The RC oscillator requires a time tRCON to
stabilize, and results can be inaccurate during this time. See
Section 12.5 Internal and Master Oscillator.
ADON — A/D On
When the A/D is turned on (ADON = 1), it requires a time tADON for
the current sources to stabilize, and results can be inaccurate during
this time. This bit turns on the charge pump.
General Release Specification
146
MC68HC(7)05H12 — Rev. 1.0
Analog to Digital Converter
MOTOROLA
ADON
Comments
0
0
RC oscillator off, A/D converter off.
0
1
RC oscillator off, A/D converter on.
1
0
RC oscillator on, A/D converter off. Gives time for the RC osc to
stabilize.
1
1
RC oscillator on, A/D converter on.A/D using RC osc clocks
CH3–0 — Channel Select Bit
CH3, CH2, CH1 and CH0 form a four bit field which is used to select
one of sixteen A/D channels. Channels 4–15 are used for internal
reference points. The following table shows the signals selected by
the channel select field.
Table 12-2. A/D Channel Assignments
NOTE:
CH3
CH2
CH1
CH0
Channel
Signal
0
0
0
0
0
AN0
0
0
0
1
1
AN1
0
0
1
0
2
AN2
0
0
1
1
3
AN3
0
1
0
0
4
VREFL
0
1
0
1
5
VREFL
0
1
0
0
6
VREFL
0
1
1
1
7
VREFL
1
0
0
0
8
VREFH
1
0
0
1
9
(VREFH+VREFL)/2
1
0
1
0
10
VREFL
1
0
1
1
11
VREFL
1
1
X
X
12-15
VREFL
Performing a digital read of the A/D input with levels other than VDD or
VSS on the ADIN pins will result in greater power dissipation during the
read cycle, and may give hazardous results on the ADIN input
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Analog to Digital Converter
147
A G R E E M E N T
ADRC
N O N - D I S C L O S U R E
Table 12-1. A/D Clock Selection
R E Q U I R E D
Analog to Digital Converter
A/D Registers
R E Q U I R E D
Analog to Digital Converter
12.6.2 A/D Data Register
One 8-bit result register is provided. This register is updated each time
COCO is set.
$004E
Bit 7
6
5
4
3
2
1
Bit 0
Read:
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
U
U
U
U
U
U
U
U
Write:
A G R E E M E N T
Reset:
Figure 12-2. A/D Data Register (ADDR)
12.7 A/D During WAIT Mode
The A/D converter continues normal operation during WAIT mode. To
decrease power consumption during WAIT, it is recommended that both
the ADON and ADRC bits in the A/D status/control register be cleared if
the A/D converter is not being used. If the A/D converter is in use and
the system clock rate is above 1.0 MHz, it is recommended that the
ADRC bit be cleared.
N O N - D I S C L O S U R E
NOTE:
As the A/D converter continues to function normally in WAIT mode, the
COCO bit is not cleared.
12.8 Analog Input
The external analog voltage value to be converted by the A/D converter
is sampled on an internal capacitor through a resistive path provided by
input-selection switches and a sampling aperture time switch. Sampling
time is limited to 12 bus clock cycles. After sampling, the analog value is
stored on a capacitor and held until the end of conversion. During this
hold time, the analog input is disconnected from the internal A/D system
and the external voltage source sees a high impedance input.
The equivalent analog input during sampling is a RC low-pass filter with
resistance around 50 KΩ and a capacitance of around 10pF. (It should
be noted that these are typical values measured at room temperature).
General Release Specification
148
MC68HC(7)05H12 — Rev. 1.0
Analog to Digital Converter
MOTOROLA
ANALOG INPUT
INPUT PROTECTION
R E Q U I R E D
Analog to Digital Converter
Analog Input
DIFFUSION
*
< 2pF
+~ 20 V
> 50 KΩ
10 pF
DAC
CAPACITANCE
A G R E E M E N T
VREFL / VSS
* THIS ANALOG SWITCH IS CLOSED ONLY DURING THE 12-CYCLE SAMPLE TIME
N O N - D I S C L O S U R E
Figure 12-3. Electrical Model of an A/D Input Pin
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Analog to Digital Converter
149
12.9 Conversion Accuracy Definitions
This section explains the terminology used to specify the analog
characteristics of the A/D converter.
12.9.1 Transfer Curve
The ideal transfer curve can be thought of as a staircase of uniform step
size with perfect positioning of the endpoints. Figure 12-4 shows the
ideal transfer curve of an 8-bit A/D converter.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Analog to Digital Converter
$FF
CONVERSION RESULT
$FE
$FD
1-BIT ACCURACY
$03
$02
$01
$00
1
2
3
253
254
255
INPUT VOLTAGE (LSB)
1LSB = VREFH / 256
Figure 12-4. Transfer Curve of an Ideal 8-Bit A/D Converter
12.9.2 Monotonicity
The characteristic of the transfer function whereby increasing the input
signal results in the output never decreasing.
General Release Specification
150
MC68HC(7)05H12 — Rev. 1.0
Analog to Digital Converter
MOTOROLA
12.9.4 Offset Error
The offset error is the DC shift of the entire transfer curve of an ideal
converter.
12.9.5 Gain Scale Error
The gain error is an error in the input to output transfer ratio. Gain error
causes an error in the slope of the transfer curve.
12.9.6 Differential Linearity Error
The differential linearity error is the difference between actual analog
voltage change and the ideal (1LSB) voltage change at any code
change.
12.9.7 Integral Linearity Error
The integral linearity error is the departure from the best fitting line
through all A/D code changes. This error is not specified from the ideal
line to make this error independent from offset and gain errors causes
an error in the slope of the transfer curve.
12.9.8 Total Unadjusted Error
The total unadjusted error is the maximum error that occurs without
adjusting offset and gain errors. This error is a combination of offset,
scale and integral linearity errors.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Analog to Digital Converter
151
A G R E E M E N T
Also known as digitization error or uncertainty. It is the inherent error
involved in digitizing an analog signal due to the finite number of steps
at the digital output versus the infinite number of values at the analog
input.
N O N - D I S C L O S U R E
12.9.3 Quantization Error
R E Q U I R E D
Analog to Digital Converter
Conversion Accuracy Definitions
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Analog to Digital Converter
General Release Specification
152
MC68HC(7)05H12 — Rev. 1.0
Analog to Digital Converter
MOTOROLA
13.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
13.3
EEPROM Control Register (EEPCR) . . . . . . . . . . . . . . . . . . . 154
13.4
EEPROM Options Register (EEOPR) . . . . . . . . . . . . . . . . . . 155
13.5 EEPROM Read, Erase and Programming Procedures . . . . . 156
13.5.1
Read Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
13.5.2
Erase Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
13.5.3
Programming Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 157
13.6
Operation in WAIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
13.2 Introduction
The EEPROM on this device is 256 bytes and is located from address
$0400 to $04FF. Programming the EEPROM can be done by the user
on a single-byte basis by manipulating the EEPROM control register
(EEPCR).
An erased byte reads as ‘FF’ and any programmed bit reads as ‘0’.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
EEPROM
153
R E Q U I R E D
13.1 Contents
A G R E E M E N T
Section 13. EEPROM
N O N - D I S C L O S U R E
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
EEPROM
13.3 EEPROM Control Register (EEPCR)
$001C
Bit 7
6
5
Read:
0
0
0
4
3
2
1
Bit 0
EEOSC
EER1
EER0
EELAT
EEPGM
0
0
0
0
0
Write:
Reset:
0
0
0
Figure 13-1. EEPROM Control Register (EEPCR)
A G R E E M E N T
EEOSC — EEPROM RC Oscillator Control
When this bit is set, the EEPROM section uses the internal RC
oscillator instead of the CPU clock. After setting the EEOSC bit, delay
a time tRCON to allow the RC oscillator to stabilize. This bit is readable
and writable and should be set by the user when the internal bus
frequency falls below 1.5 MHz. Reset clears this bit.
EER1, EER0 — Erase Select Bits
EER1 and EER0 form a 2-bit field which is used to select one of three
erase modes: byte, block, or bulk erase. Table 13-1 shows the modes
selected for each bit configuration. These bits are readable and
writable and are cleared by reset.
N O N - D I S C L O S U R E
In byte erase mode, only the selected byte is erased.
In block mode, a 128-byte block of EEPROM is erased. The EEPROM
memory space is divided into two 128-byte blocks ($0400–$047F,
$0480–$04FF), and doing a block erase to any address within a block
will erase the entire block.
In bulk erase mode, the entire 256 byte EEPROM section is erased.
A block protect function is available on block 2 of the EEPROM
memory space. See Section 13.4 EEPROM Options Register
(EEOPR) for more details.
Table 13-1. Erase Mode Select
EER1
EER0
0
0
No Erase
0
1
Byte Erase
1
0
Block Erase (block1 or block2)
1
1
Bulk Erase (block1 & block2)
General Release Specification
154
MODE
MC68HC(7)05H12 — Rev. 1.0
EEPROM
MOTOROLA
EELAT — EEPROM Programming Latch
The EELAT bit is the EEPROM programming latch enable. When
EELAT is at ‘zero’, the EER1, EER0 and EEPGM bits are reset to
zero. When the EELAT bit is clear, data can be read from the
EEPROM, and when set, this bit allows the address and data to be
latched into the EEPROM for further programming or erase operation.
Address and data can only be latched when the EEPGM bit is at
‘zero’. Reset and power-on reset, reset the EELAT bit.
R E Q U I R E D
EEPROM
EEPROM Options Register (EEOPR)
13.4 EEPROM Options Register (EEOPR)
This register contains the secure and protect functions for the EEPROM
and allows the user to select options in a non-volatile manner. The
contents of the EEOPR register are loaded into data latches with each
power-on or external reset. The register is implemented in EEPROM,
therefore reset has no effect on the individual bits.
$0400
Bit 7
6
5
4
3
2
1
Bit 0
Read:
EEPRT
Write:
Reset:
0
0
0
0
0
0
0
0
Figure 13-2. EEPROM Options Register (EEOPR)
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
EEPROM
155
N O N - D I S C L O S U R E
EEPGM must be written to enable (or disable) the EEPGM function.
When set, EEPGM turns on the charge pump and enables the
programming (or erasing) power to the EEPROM array. When clear,
power is switched off. This enables pulsing of the programming
voltage to be controlled internally. This bit can be read at any time, but
can only be set if EELAT=1. If EELAT is not set, then EEPGM cannot
be set. EELAT=0 or reset clears the EEPGM bit.
A G R E E M E N T
EEPGM — EEPROM Programming Power Enable
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
EEPROM
EEPRT — EEPROM Protect Bit
In order to achieve a higher degree of protection, the EEPROM is split
into two 128-byte blocks. Block 1 cannot be protected. Block 2 is
protected by the EEPRT bit of the options register. When this bit is set
from 0 to 1 (erased), the protection remains until the next power-on or
external reset. EEPRT can only be written to ‘0’ when the ELAT bit in
the EEPROM control register is set.
1 = Block 2 of the EEPROM array is not protected; all 256 bytes of
EEPROM can be accessed for any read, erase or
programming operations
0 = Block 2 of the EEPROM array is protected; any attempt to
erase or program a location will be unsuccessful
13.5 EEPROM Read, Erase and Programming Procedures
13.5.1 Read Procedure
To read data form EEPROM, the EELAT bit must be clear. EEPGM,
EER1 and EER0 are all forced to zero. EEPROM is read as if it were a
normal ROM. The charge pump generator is off since EEPGM is zero. If
a read is performed while ELAT is set, data will be read as $FF.
13.5.2 Erase Procedure
There are three types of ERASE operation mode see Table 13-1, byte
erase, block erase or bulk erase.
To erase a byte of EEPROM: set EELAT = 1, ER1 = 0 and ER0 = 1, write
to the address to be erased, and set EEPGM for a time tEBYTE.
To erase a block of EEPROM: set EELAT = 1, ER1 = 1 and ER0 = 0,
write to any address in the block, and set EEPGM for a time tEBLOC.
For a bulk erase: set EELAT = 1, ER1 = 1, and ER0 = 1, write to an
address in the array with A0 or A1 = ‘1’, and set EEPGM for a time
tEBULK.
General Release Specification
156
MC68HC(7)05H12 — Rev. 1.0
EEPROM
MOTOROLA
To program the content of EEPROM, set EELAT bits, write data to the
desired address, and set the EEPGM bit. After the required
programming delay tEEPGM, EELAT must be clear, which also resets
EEPGM. During a programming operation, any access to EEPROM will
return $FF. To program a second byte, EELAT must be cleared before
it is set, or the programming will have no effect.
NOTE:
Each byte must be erased before reprogramming. Do not use overprogramming (write more ‘zeros’).
13.6 Operation in WAIT
N O N - D I S C L O S U R E
The user may want to ensure that the RC oscillator is disabled before
entering WAIT mode to help conserve power.
A G R E E M E N T
13.5.3 Programming Procedure
R E Q U I R E D
EEPROM
Operation in WAIT
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
EEPROM
157
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
EEPROM
General Release Specification
158
MC68HC(7)05H12 — Rev. 1.0
EEPROM
MOTOROLA
Section 14. Pulse Width Modulator (PWM)
14.1 Contents
14.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
14.3.1
PWM Channel Microshifting . . . . . . . . . . . . . . . . . . . . . . . 161
14.4 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
14.4.1
PWM Data Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
14.4.2
PWM Control Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
14.4.3
PWM Channel Enable Register. . . . . . . . . . . . . . . . . . . . . 165
14.4.4
PWM Channel Polarity Register . . . . . . . . . . . . . . . . . . . . 165
14.5
PWM During WAIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
14.2 Introduction
The pulse width modulator (PWM) system has eight 8-bit channels.
Preceding the 8-bit (÷256) PWM counter is a programmable
prescaler.The PWM frequency is selected by choosing the desired
divide option from the programmable prescaler.
The four PWM channels 0 to 3 provide four full H-bridge drivers capable
of driving air core instruments or stepper motor instruments. Each of the
H-bridges will be implemented as a combination of one PWM power
driver and another general purpose output (GPO) port power driver. A
single PWM channel provides a pulse width ratio for the corresponding
PWM driver part of a single H-bridge. Thus the current through the
bridge can be controlled by the pulse width ratio.
The four PWM channels 4 to 7 with their power drivers can support four
90° (small angle) aircore instruments.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Pulse Width Modulator (PWM)
159
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
N O N - D I S C L O S U R E
14.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
R E Q U I R E D
Pulse Width Modulator (PWM)
fOP
HC05 DATA BUS
PRESCALER
÷ 0.5,1,2,4,64
8-BIT COMPARATOR
RQ M
S
U
Q X
RIGHT LEFT
GPO
Q M
U
Q X
GPO
PWME
SIGN
PWM DATA
BUFFER
PPOL
PWMC2
PWMC0
PWMC1
PWM DATA
REGISTER
A G R E E M E N T
N O N - D I S C L O S U R E
8-BIT COUNTER
(÷256)
PWM CONTROL, CHANNEL ENABLE AND CHANNEL POLARITY REGISTERS
Figure 14-1. PWM Block Diagram (one channel)
14.3 Functional Description
The PWM is capable of generating signals from 0% to 100% duty cycle.
A $00 in the PWM data register yields an ‘low’ output (0%), but a $FF
yields a duty of 255/256. To achieve the 100% duty (‘high’ output), the
polarity control bit is set to zero while the data register has $00 in it.
Figure 14-1 shows the block diagram of a PWM timer channel 0 to 3.
The 8-bit counter runs at the rate of the selected clock source provided
by the programmable prescaler. The counter is compared to the data
register. When the counter matches the data register a flip-flop changes
state causing the PWM output to also change state. When the PWM
counter rolls over it resets the flip-flop and the output changes back.
Notice that there is a select bit called PPOL which allows each channel
to independently create a signal which is a low-to-high or high-to-low
transition.
General Release Specification
160
MC68HC(7)05H12 — Rev. 1.0
Pulse Width Modulator (PWM)
MOTOROLA
14.3.1 PWM Channel Microshifting
Switching more than one PWM channel simultaneously would cause
large currents in the corresponding power drivers of the H-bridges.
Clocking of different channels must be delayed such that only one
channel switches at a time. Therefore microshifts are introduced to
achieve a switching delay between different channels.
A G R E E M E N T
The SIGN bit in the PWM control register selects whether the left or the
right port line (left or right path of an H-bridge) is enabled for the PWM
signal. The opposite port line drives the general purpose output value.
The SIGN bit performs also the inversion of the PWM signal. This is done
because the duty values are assumed to be 2’s complement values in
the range from –256 to +255. A change from duty value $01FF to value
$0000 (–1 to 0) causes a change of the current direction within the
corresponding H-bridge. This is done by changing the polarity of the
PWM signal and exchanging PWM and output port signals within the Hbridge.
R E Q U I R E D
Pulse Width Modulator (PWM)
Functional Description
N O N - D I S C L O S U R E
BUS CLOCK
CHANNEL 0
1/4TBUS
CHANNEL 1
2/4TBUS
CHANNEL 2
7/4TBUS
CHANNEL 7
Figure 14-2. PWM Microshifts
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Pulse Width Modulator (PWM)
161
The start of the PWM period is shifted by a quarter of the period time of
the bus clock tBUS for the channels 0 to 7. See Figure 14-2. Inevitable
large currents due to switching of the power drivers are distributed over
a number of time slots. They do not load power supply at the same time.
14.4 Registers
Associated with the PWM system, there are eight PWM data registers,
a control/sign register, a channel enable register and a channel polarity
register. The registers can be written to and read at any time.
A G R E E M E N T
R E Q U I R E D
Pulse Width Modulator (PWM)
For updating the PWM values, the following sequence must be followed:
1. Write the corresponding SIGN bit in the PWM control register
2. Write data to the corresponding data register
N O N - D I S C L O S U R E
Not until after the data register is written are the SIGN bits transferred
from a buffer to the SIGN register. Data written to a data register is held
in a buffer and transferred to the PWM data register at the end of a PWM
cycle. Reads of a data register will always result in the read of the PWM
data buffer and not the PWM data register.
General Release Specification
162
MC68HC(7)05H12 — Rev. 1.0
Pulse Width Modulator (PWM)
MOTOROLA
PWM0
Read:
$0010
Write:
PWM1
Read:
$0011
Write:
PWM2
Read:
$0012
Write:
PWM3
Read:
$0013
Write:
PWM4
Read:
$0014
Write:
PWM5
Read:
$0015
Write:
PWM6
Read:
$0016
Write:
PWM7
Read:
$0017
Write:
Reset:
Bit 7
6
5
4
3
2
1
Bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
1
1
1
1
1
1
1
1
Figure 14-3. PWM Data Registers (PWM0–7)
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Pulse Width Modulator (PWM)
163
A G R E E M E N T
The PWM system has eight 8-bit data registers which hold the duty cycle
for each PWM output. The data bits in these registers are set by reset.
N O N - D I S C L O S U R E
14.4.1 PWM Data Registers
R E Q U I R E D
Pulse Width Modulator (PWM)
Registers
14.4.2 PWM Control Register
$0018
Bit 7
Read:
0
Write:
PWMRST
Reset:
0
6
5
4
3
2
1
Bit 0
PWMC3
PWMC2
PWMC1
SIGN3
SIGN2
SIGN1
SIGN0
1
1
1
0
0
0
0
Figure 14-4. PWM Control Register (PWMCTL)
PWMRST — PWM Reset
A G R E E M E N T
R E Q U I R E D
Pulse Width Modulator (PWM)
Writing ‘1’ to the PWMRST bit resets the PWM counter. The
PWMRST bit reads always as ‘0’.
PWMC3–1 — PWM Clock Rate
These bits select the input clock rate and determines the period as
shown in Figure 14-1. The PWM prescaler clock input is fOP, which is
the bus frequency.
N O N - D I S C L O S U R E
Table 14-1. PWM Clock Rate
PWMC3
PWMC2
PWMC1
PWM Clock
PWM OUT
0
0
0
2 x fOP
fOP / 128
0
0
1
fOP
fOP / 256
0
1
0
fOP / 2
fOP / 512
0
1
1
fOP / 4
fOP / 1024
1
0
0
fOP / 64
fOP / 16384
1
0
1
1
1
0
1
1
1
PWM Shut off
- to save power if the PWM is
not used
SIGN3–0 — Sign of the PWM Channel 0–3
The SIGN bit selects whether the left or the right output is the PWM
signal. The opposite output is the general purpose port. The SIGN bit
performs also the inversion of the PWM signal. See Figure 7-4 for the
assignment of the PWM channels to the power driver lines.
1 = Right PWM output
0 = Left PWM output
General Release Specification
164
MC68HC(7)05H12 — Rev. 1.0
Pulse Width Modulator (PWM)
MOTOROLA
Bit 7
6
5
4
3
2
1
Bit 0
PWME7
PWME6
PWME5
PWME4
PWME3
PWME2
PWME1
PWME0
0
0
0
0
0
0
0
0
Read:
Write:
Reset:
Figure 14-5. PWM Channel Enable Register (PWMEN)
PWME7–0 — PWM Channel Enable
These bits enable/disable the corresponding PWM channels. If a bit
is disabled, the corresponding pin functions as a general purpose
output (GPO). Refer to Section 7.7 Port E and Port F (Power
Drivers).
1 = The PWM channel is enabled.
0 = The PWM channel is disabled and the corresponding lines are
general purpose outputs (GPO)
14.4.4 PWM Channel Polarity Register
$001A
Bit 7
6
5
4
3
2
1
Bit 0
PPOL7
PPOL6
PPOL5
PPOL4
PPOL3
PPOL2
PPOL1
PPOL0
0
0
0
0
0
0
0
0
Read:
Write:
Reset:
Figure 14-6. PWM Channel Polarity Register (PWMPOL)
PPOL7–0 — PWM Polarity
These bits initialize the corresponding PWM outputs.
1 = PWM channel is high at the beginning of the period, then
toggles to low when the data count is reached.
0 = PWM channel is low at the beginning of the period, then toggles
to high when the data count is reached.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Pulse Width Modulator (PWM)
165
A G R E E M E N T
$0019
N O N - D I S C L O S U R E
14.4.3 PWM Channel Enable Register
R E Q U I R E D
Pulse Width Modulator (PWM)
Registers
14.5 PWM During WAIT Mode
The PWM continues normal operation during WAIT mode. To decrease
power consumption during WAIT, the PWM should be shut off prior to
entering WAIT mode by setting the corresponding bits in the PWM
control register. Refer to Section 7.8 Port E and Port F During WAIT
Mode for information about the corresponding ports.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Pulse Width Modulator (PWM)
General Release Specification
166
MC68HC(7)05H12 — Rev. 1.0
Pulse Width Modulator (PWM)
MOTOROLA
Section 15. EPROM
15.1 Contents
15.3 EPROM Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.3.1
Bootloader Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
15.4 EPROM Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
15.4.1
EPROM Programming Register (EPROG) . . . . . . . . . . . . 170
15.5
Mask Option Register (MOR) . . . . . . . . . . . . . . . . . . . . . . . . . 171
15.2 Introduction
The HC705H12 contains 12K EPROM instead of ROM and the mask
options are controlled by a programmable nonvolatile mask option
register (MOR). The MOR is an EPROM register which must be
programmed appropriately prior to operation of the micro-controller.
15.3 EPROM Bootloader
Bootloader programming mode is entered upon the rising edge of
RESET if the IRQ/VPP pin is at VTST and the PB0 pin is at logic one (refer
to Table 6-1). The bootloader code resides in the ROM from $3F00 to
$3FEF. This program handles copying of user code from an external
EPROM into the on-chip EPROM.
The user code must be a one-to-one correspondence with the internal
EPROM addresses (including the MOR).
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
EPROM
167
A G R E E M E N T
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
N O N - D I S C L O S U R E
15.2
R E Q U I R E D
General Release Specification — MC68HC(7)05H12
15.3.1 Bootloader Functions
Two pins are used to select various bootloader functions. These pins are
PB2 and PB3. Two other pins, PB7 and PB6 are used to drive the PROG
LED and the VERF LED respectively. The programming modes are
shown in Table 15-1.
Table 15-1. Bootloader Functions
A G R E E M E N T
R E Q U I R E D
EPROM
PB2
PB3
MODE
0
0
Program/Verify EPROM
0
1
Verify only
1
0
Jump to RAM
1
1
Load RAM and Execute
The bootloader uses an external 14 bit counter to address the memory
device containing the code to be copied. This counter requires a clock
(provided at PB5) and a reset signal (provided at PB4).
NOTE:
The EPROM must be erased before performing a program cycle.
N O N - D I S C L O S U R E
For the communication with a host computer via a standard RS-232
interface PB1 is used as transmitter (TX) and PB0 is used as receiver
(RX).
General Release Specification
168
MC68HC(7)05H12 — Rev. 1.0
EPROM
MOTOROLA
R E Q U I R E D
EPROM
EPROM Bootloader
L1 – VERIFY
L2 – PROGRAM
+5V
+5V
L1
+5V
L2
PB5
CLOCK
PB4
RESET
+5V
RESET
VDD
S3
+5V +5V
VCC
AVDD
TCAP0
CLK
PGM
Q0
A1
Q1
A2
Q2
A3
Q3
A4
Q4
A5
Q5
A6
Q6
A7
Q7
A8
Q8
A9
Q9
A10
Q10
A11
Q11
CE
A12
Q12
OE
A13
Q13
PB3
PA0
D0
PA1
D1
PA2
D2
PA3
D3
PA4
D4
PA5
D5
PA6
D6
PA7
D7
IRQ/VPP
VSS
VSS
VDD
MC74HC393
A0
S1
VPP
OSC1
RST
VPP
S2
27128 (16K EPROM)
TCAP2
+5V
PB2
MC68HC705H12
TCAP1
TCAP2
10K
10K
VREFH
A G R E E M E N T
PB7
N O N - D I S C L O S U R E
PB6
10K
470
470
10K
+5V
VSS
OSC2
1MHz
20 pF
20 pF
Figure 15-1. MC68HC705H12 Programming Circuit
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
EPROM
169
R E Q U I R E D
EPROM
15.4 EPROM Programming
The EPROM array is programmed through manipulation of the
programming register located at $001D. It may be programmed in user,
bootstrap or test mode. In addition to the main EPROM array, the mask
option register must also be programmed appropriately by the
programming software.
A G R E E M E N T
15.4.1 EPROM Programming Register (EPROG)
$001D
Bit 7
6
5
4
3
2
1
Bit 0
Read:
ELAT
EPGM
Write:
Reset:
0
0
0
0
0
0
0
0
Figure 15-2. EPROM Programming Register (EPROG)
ELAT — EPROM Latch Control
N O N - D I S C L O S U R E
This read/write bit controls the latching of the address and data buses
when programming the EPROM.
1 = Address and data buses are latched when the following
instruction is a write to one of the EPROM locations. Normal
reading is disabled if ELAT =1
0 = EPROM address and data buses are configured for normal
reading
EPGM — EPROM Program Control
This read/write bit controls whether the programming voltage is
applied to the EPROM array. For programming, this bit can only be
set if the LATCH bit has been previously set. Both EPGM and ELAT
cannot be set in the single write.
1 = Programming voltage applied to EPROM array
0 = Programming voltage not applied to EPROM array
General Release Specification
170
MC68HC(7)05H12 — Rev. 1.0
EPROM
MOTOROLA
The sequence for programming the EPROM is as follows:
1. Set the ELAT bit.
2. Write the data to be programmed to the EPROM (or MOR byte)
location to be programmed.
3. Set the EPGM bit.
4. Wait a time tEPGM
5. Clear the ELAT and EPGM bits.
R E Q U I R E D
EPROM
Mask Option Register (MOR)
The mask option register (MOR) is used to select all mask options
available on the MC68HC705H12. When in the erased state, the
EPROM cells read as a logic zero which therefore represents the value
transferred from the MOR at reset if it is left unprogrammed. The
unimplemented bits of this register are read as ‘0’.
There are two mask option registers (MOR1, MOR2) implemented.
MOR2 is used only.
Bit 7
MOR1
Read:
$3EFE
Write:
MOR2
Read:
$3EFF
Write:
6
5
4
3
2
1
PWDRW
Reset:
0
Bit 0
COPE
0
0
0
0
0
0
0
Figure 15-3. Mask Options Registers (MOR1 and MOR2)
PWDRW — Ports E/F in WAIT mode
1 = Ports E/F continue in WAIT (enabled)
0 = Ports E/F are forced ‘low’ in WAIT (disabled)
COPE — COP Timer Enable
1 = COP timer enabled.
0 = COP timer disabled.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
EPROM
171
N O N - D I S C L O S U R E
15.5 Mask Option Register (MOR)
A G R E E M E N T
6. Repeat for each byte.
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
EPROM
General Release Specification
172
MC68HC(7)05H12 — Rev. 1.0
EPROM
MOTOROLA
16.1 Contents
16.2
Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
16.3
Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.4
Power Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.5
DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 176
16.6
Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
16.7
A/D Converter Characteristics . . . . . . . . . . . . . . . . . . . . . . . . 178
16.8
EEPROM Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
16.9
EPROM Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
16.10 Power Driver Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 180
N O N - D I S C L O S U R E
16.11 Power-on Reset/Low Voltage Reset Characteristics . . . . . . . 181
R E Q U I R E D
Section 16. Electrical Characteristics
A G R E E M E N T
General Release Specification — MC68HC(7)05H12
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Electrical Characteristics
173
16.2 Maximum Ratings
(Voltage referenced to VSS)
Rating
Symbol
Value
Unit
VDD
–0.3 to +7.0
V
PVDD1,2
–0.3 to +10.0
V
VIN
VIN
VSS – 0.3 to VDD + 0.3
VSS – 0.3 to 2 × VDD + 0.3
V
V
IOmax
300
mA
Short Circuit Time for Power Drivers (PE7–0, PF3–0)
(note 1)
tSC
20
ms
Operating Temperature Range
TA
–40 to +85
°C
TSTG
–65 to +150
°C
10,000
cycles
10
years
Supply Voltage
Supply Voltage for Power Drivers
Input Voltage
Normal Operation
Monitor Mode (IRQ Pin Only)
A G R E E M E N T
R E Q U I R E D
Electrical Characteristics
Current Drain Per Pin
Storage Temperature Range
Write/Erase Cycles EEPROM
Data Retention EEPROM
1.
Only one output shorted for a time.
N O N - D I S C L O S U R E
Stresses above those listed as ‘maximum ratings’ may cause permanent
damage to the device. This is a stress rating only and functional
operation of the device at these conditions is not implied. Exposure to
maximum rating conditions for extended periods may affect device
reliability.
This device contains circuitry to protect the inputs against damage due
to high static voltages or electric fields; however, it is advised that normal
precautions be taken to avoid application of any voltage higher than
maximum-rated voltages to this high-impedance circuit. For proper
operation, it is recommended that VIN and VOUT be constrained to the
range VSS ≤ (VIN or VOUT) ≤ VDD. Unused inputs are connected to the
appropriate voltage level, either VSS or VDD.
Positive current flow is defined as conventional current flow into the
device. Negative current flow is defined as current flow out of the device.
General Release Specification
174
MC68HC(7)05H12 — Rev. 1.0
Electrical Characteristics
MOTOROLA
Characteristic
Thermal Resistance
PLCC(52 pin)
Symbol
Value
Unit
ΘJA
50
°C/W
16.4 Power Considerations
The average chip junction temperature, TJ, in degrees Celsius can be
obtained from the following equation:
T J = T A + ( P D • θ JA )
[1]
where:
TA = Ambient temperature (°C)
θJA = Package thermal resistance, junction-to-ambient (°C/W)
PD = PINT + PI/O (W)
PINT = Internal chip power = IDD • VDD (W)
PI/O = Power dissipation on input and output pins (user determined)
An approximate relationship between PD and TJ (if PI/O is neglected) is:
K
P D = ----------------------T J + 273
[2]
Solving equations [1] and [2] for K gives:
K = P D • ( T A + 273 ) + θ JA • P D2
[3]
where K is a constant for a particular part. K can be determined by
measuring PD (at equilibrium) for a known TA. Using this value of K, the
values of PD and TJ can be obtained for any value of TA by solving the
above equations. The package thermal characteristics are shown in
Section 16.3 Thermal Characteristics.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Electrical Characteristics
175
N O N - D I S C L O S U R E
16.3 Thermal Characteristics
A G R E E M E N T
R E Q U I R E D
Electrical Characteristics
Thermal Characteristics
16.5 DC Electrical Characteristics
(VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C, unless otherwise noted)
Symbol
Min
Typ 1
Max
Unit
VOH
VOL
VDD – 0.1
—
—
—
—
0.1
V
Output High Voltage
ILOAD = –0.8 mA
PA7–0, PB7–0, PC7–0
ILOAD = –80 µA
OSC2
VOH
VDD – 0.8
—
—
V
VDD – 0.8
—
—
V
Output Low Voltage
ILOAD = 1.6 mA
PA7–0, PB7–0, PC7–0, RESET
ILOAD = 80 µA
OSC2
VOL
—
—
0.4
V
—
—
0.4
V
Output Source Current (see maximum ratings)
VO = 4.5 V (VDD = 5V)
VO = 4.0 V (VDD = 5V)
PA7–0, PB7–0, PC7–0
IOH
–1.0
–3.0
—
—
–14.5
–26.0
mA
mA
Output Sink Current (see maximum ratings)
VO = 0.5 V (VDD = 5V)
VO = 1.0 V (VDD = 5V)
PA7–0, PB7–0, PC7–0
IOL
5.0
10.0
—
—
15.0
27.0
mA
mA
Input High Voltage
PA7–0, PB7–0, PC7–0, PD3–0, IRQ,
RESET, OSC1
VIH
0.7 × VDD
—
VDD
V
Input Low Voltage
PA7–0, PB7–0, PC7–0, PD3–0, IRQ,
RESET, OSC1
VIL
VSS
—
0.2 × VDD
V
Supply current (note 2)
Run (fOP = 2.1 MHz)
Run (fOP = 525 kHz, Slow Mode)
IDD
IDD
—
—
7
—
10
7
mA
mA
Wait (fOP = 2.1 MHz)
Wait (fOP = 525 kHz, Slow Mode)
IDD
IDD
—
—
3
1
6
4
mA
mA
IO Ports Hi-Z Leakage Current
PA7–0, PB7–0, PC7–0
IIL
—
—
±1
µA
Input Current
PD3–0, IRQ, OSC1, VREFH
IIN
—
—
±1
µA
Characteristic
Output Voltage
ILOAD = –10 µA
ILOAD = +10 µA
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Electrical Characteristics
General Release Specification
176
MC68HC(7)05H12 — Rev. 1.0
Electrical Characteristics
MOTOROLA
Typ 1
Max
Unit
Schmitt Trigger Inputs – Hysteresis
PA7–0, PB7–5, PC6, PC3–0, IRQ, RESET
VHYRS
0.3
—
1.5
V
Internal Pullup Resistor
RESET
RRSTPU
8
11
14
KΩ
—
±10
±10
±10
±1
±10
±10
mA
Injection Current (note 3)
PA7–0
PB7–2
PC7–0
PD3–0
PE7–0
PF3–0
IINJ
—
Data Retention Supply Voltage (note 5)
VDR
2
Oscillator transconductance (IOSC2/VOSC1)
gm
1.1
1.
2.
3.
4.
5.
—
—
mA/V
Typical values reflect average measurements at midpoint of voltage range at
25 °C.
Test Conditions: All I/O Ports are configured as output with no DC load. External
Clock Input OSC1 is driven by square wave external clock.
A simple protection can be built with a series resistor: R > VMAX /IINJ The sum of
currents during multiple injection should be limited below the maximum values
for a single pin: R > (VMAX /IINJ)•(number of pins). The A/D conversion accuracy
can degrade to ±7LSB on a channel adjacent to the one subjected to current
injection. Not production tested.
The Enabling of the LVR by mask option will cause a permanent current trough
the LVR circuitry.
The MCU retains RAM contents and CPU register contents.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
V
General Release Specification
Electrical Characteristics
177
A G R E E M E N T
Min
N O N - D I S C L O S U R E
Symbol
Characteristic
R E Q U I R E D
Electrical Characteristics
DC Electrical Characteristics
A G R E E M E N T
R E Q U I R E D
Electrical Characteristics
16.6 Control Timing
(VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C, unless otherwise noted)
Characteristic
Symbol
Min
Max
Unit
Oscillator Frequency
Crystal / Ceramic Resonator
External Clock Source
fOSC
—
dc
4.2
4.2
MHz
MHz
Internal Operating Frequency (fOSC / 2)
Crystal / Ceramic Resonator
External Clock
fOP
—
dc
2.1
2.1
MHz
MHz
Cycle Time (1 / fOP)
tCYC
476
—
ns
RESET Pulse Width
tRL
1.5
—
tCYC
IRQ Interrupt Pulse Width Low (Edge-Triggered)
tILIH
120
—
ns
IRQ Interrupt Pulse Period
tILIL
—(1)
—
tCYC
tOH,tOL
100
—
ns
OSC1 Pulse Width
1. 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.7 A/D Converter Characteristics
N O N - D I S C L O S U R E
(VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C, unless otherwise noted)
Characteristic
Parameter
Min
Max
Unit
8
—
Bit
Resolution
Number of bits resolved by the A/D
Monotonicity
Conversion result never decreases with an
increase in input voltage and has no missing
codes
Quantization Error
Uncertainly due to converter resolution
—
±1/2
LSB
Offset Error
DC shift of the entire transfer curve of an ideal
converter (1)
—
±1/2
LSB
Gain Error
Difference between the actual and expected
gain (end point to end point) (1)
—
±1/2
LSB
Differential Linearity Error
Difference between the actual analog voltage
change and the ideal voltage change (1)
—
±1/2
LSB
Integral Linearity Error
Max deviation from the best straight line
through the A/D transfer characteristics (1)
—
±1/2
LSB
General Release Specification
178
GUARANTEED
MC68HC(7)05H12 — Rev. 1.0
Electrical Characteristics
MOTOROLA
Characteristic
Parameter
Min
Max
Unit
—
±1.5
LSB
Difference between the actual input voltage
and the full-scale equivalent of the binary
code output for all errors (1)
Conversion Range
Analog input voltage range
VSS
VREFH
V
VREFH
Analog reference voltage (2)
VSS
VDD + 0.1
V
Conversion Time
Total time to perform a single analog to digital
conversion
—
32
cycles
Zero Input Reading
Conversion result when VIN = VSS
00
—
Hex
Full Scale Reading (3)
Conversion result when VIN = VREFH
—
FF
Hex
5
µs
100
µs
RC oscillator stabilization
time tRCON
ADC stabilization time tADON
A G R E E M E N T
Absolute Accuracy /
Total Unadjusted Error
R E Q U I R E D
Electrical Characteristics
EEPROM Characteristics
1. AVDD = VREFH = VDD and VREFL = 0 V
2. For 8-bit resolution Vref ≥ 3.5V is necessary
3. When VIN > VREFH Conversion result will be ‘FF’ (for the max input voltage VIN see maximum ratings)
16.8 EEPROM Characteristics
Characteristic
Symbol
Min
Max
Unit
EEPROM Byte Programming Time
tEEPGM
10
10
ms
EEPROM Byte Erase Time
tEBYTE
10
10
ms
EEPROM Block Erase Time
tEBLOC
10
50
ms
EEPROM Bulk Erase Time
tEBULK
20
50
ms
RC oscillator stabilization time
tRCON
—
5
µs
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
N O N - D I S C L O S U R E
(VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C, unless otherwise noted)
General Release Specification
Electrical Characteristics
179
R E Q U I R E D
Electrical Characteristics
16.9 EPROM Characteristics
(VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C, unless otherwise noted)
Characteristic
EPROM Programming Voltage Rate1
EPROM Programming Time
Min
Max
Unit
VPP
VSS–0.3
17.5
V
tEPGM
4
-
ms
10
years
EPROM Data Retention
1.
Typical value = 12 – 15 V.
16.10 Power Driver Characteristics
(All voltages are referenced to VSS, VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C,
inductive load at the Power Drivers Outputs (PE7–0,PF3–0): L=100 mH, R=260Ω)
Characteristic
Symbol
Min
Typ
Max
Unit
Operating Supply Voltage for Power Drivers(1)
PVDD
VDD
—
9.5
V
Output High Voltage
IOH = –35 mA
PE7–0, PF3–0
VOH
PVDD – 0.5
—
PVDD + 0.5
V
Output Low Voltage
IOL = +35 mA
PE7–0, PF3–0
VOL
0
—
0.5
V
Output Rise Time (2)
10% to 90% of VOH, PVDD = 8V, T = +25°C
PE7–0, PF3–0
tr
21
—
—
ns
Output Fall Time (note 2)
90% to 10% of VOH, PVDD = 8V, T = +25°C
PE7–0, PF3–0
tf
19
—
—
ns
N O N - D I S C L O S U R E
A G R E E M E N T
Symbol
1. The value for the supply voltage for the power driver is under normal operating conditions as well as under short
circuit conditions.
2. The power driver outputs are slew rate limited. The value show the minimal time for an inductive load (L=100 mH,
R=260Ω) which is connected to PVDD.
General Release Specification
180
MC68HC(7)05H12 — Rev. 1.0
Electrical Characteristics
MOTOROLA
R E Q U I R E D
Electrical Characteristics
Power-on Reset/Low Voltage Reset Characteristics
16.11 Power-on Reset/Low Voltage Reset Characteristics
Symbol
Min
Typ (1)
Max
Unit
VRON
VROFF
VHYST
3.4
3.3
0.1
3.85
3.75
—
4.3
4.2
—
V
V
V
Vmin
1.0
—
—
V
Supply Voltage Rise and Fall Time
—
—
—
1000
ms
Low Voltage Reset Internal Delay Time
—
—
5
—
ms
Characteristic
Low Voltage Reset (LVR) – Threshold
Voltage
VRON – (VDD Increasing)
VROFF – (VDD Decreasing)
Hysteresis
Minimum Reset Voltage
A G R E E M E N T
(VDD = 5.0Vdc±10%, VSS = 0Vdc, TA = –40°C to +85°C, unless otherwise noted)
N O N - D I S C L O S U R E
1. Typical values reflect average measurements at midpoint of voltage range at 25 °C.
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
General Release Specification
Electrical Characteristics
181
N O N - D I S C L O S U R E
A G R E E M E N T
R E Q U I R E D
Electrical Characteristics
General Release Specification
182
MC68HC(7)05H12 — Rev. 1.0
Electrical Characteristics
MOTOROLA
17.1 Contents
17.2
Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
17.3
Package Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
7
47
1
8
46
AVDD
PB3
PB2/ECLK
VDD
PB1
PC0/TCAP0
PB0
PC1/TCAP1
PA7
PC2/TCAP2
PC3/TCAP3
PA6
14
40
PC4/TCMP0
PA5
PA4
PC5/TCMP1
PA3
PC6/RDI
PA2
PC7/TDO
PA1
PVDD2
PA0
PE0
PE1
PE2
PF0
PE3
PF1
PF2
PF3
PE4
PVDD1
PVSS1
34
33
27
PE5
21
PE6
20
PE7
PVSS2
N O N - D I S C L O S U R E
VREFH
PB4
PB5/MISO
PB6/MOSI
IRQ/VPP
PB7/SCK
OSC2
OSC1
RESET
PD0/AN0
PD1/AN1
PD2/AN2
PD3/AN3
VSS
17.2 Pin Assignments
Figure 17-1. 52-Pin PLCC Pin Assignments
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
R E Q U I R E D
Section 17. Mechanical Specifications
A G R E E M E N T
General Release Specification — MC68HC(7)05H12
General Release Specification
Mechanical Specifications
183
17.3 Package Dimensions
0.18 M T N S –P S
L
–L–
B
S –M S
–N–
A G R E E M E N T
R E Q U I R E D
Mechanical Specifications
Y BRK
–M–
Case No. 778-02
52 Lead PLCC
G1
W
pin 52
Z1
pin 1
–P–
X
V
A
R
Z
U
0.18 M T N S –P S
L
0.18 M T L S –M S
N S –P S
0.18 M T L S –M S
N S –P S
S –M S
C
0.10
N O N - D I S C L O S U R E
G
G1
0.25 S T L S –M S
Dim.
A
B
C
E
F
G
H
J
K
R
Min.
Max.
19.94
20.19
19.94
20.19
4.20
4.57
2.29
2.79
0.33
0.48
1.27 BSC
0.66
0.81
0.51
—
0.64
—
19.05
19.20
J E
–T– SEATING PLANE
N S –P S
Notes
1. Datums –L–, –M–, –N– and –P– are determined where top of lead
shoulder exits plastic body at mould parting line.
2. Dimension G1, true position to be measured at datum –T– (seating
plane).
3. Dimensions R and U do not include mould protrusion. Allowable
mould protrusion is 0.25mm per side.
4. Dimensions and tolerancing per ANSI Y 14.5M, 1982.
5. All dimensions in mm.
Dim.
U
V
W
X
Y
Z
G1
K1
Z1
Min.
19.05
1.07
1.07
1.07
—
2°
18.04
1.02
2°
Max.
19.20
1.21
1.21
1.42
0.50
10 °
18.54
—
10 °
Figure 17-2. 52-Pin PLCC Package Dimensions
General Release Specification
184
MC68HC(7)05H12 — Rev. 1.0
Mechanical Specifications
MOTOROLA
General Release Specification — MC68HC(7)05H12
Index
B
16-bit timer
block diagram 104
interrupts 64
register addresses 105
52-pin PLCC case outline 184
52-pin PLCC package 20, 183
8-bit timer
see core timer
bit manipulation instructions 50
block diagrams
16-bit timer 104
core timer 98
MC68HC(7)05H12 19
PWM 160
SCI 128
SPI 119
bootloader 167
A
A/D
channel assignments 147
clock selection 147
conversion accuracy 150
data register (ADDR) 148
electrical characteristics 178
errors 151
status and control register (ADSCR) 146, 147
accumulator 39
address mark wake-up 131
addressing modes 42
ADON bit in ADSCR 146
ADRC bit in ADSCR 146
ALU — arithmetic/logic unit 42
AN0–AN3 23
analog input 148
analog to digital converter
see A/D
AVDD 21
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
C
carry/borrow flag 41
C-bit in CCR 41
CH3_0 bits in ADSCR 147
channel microshifting 161
CO2E bit in TCR2 112
COCO bit in ADSCR 146
COIE bit in TCR1 111
condition code register (CCR) 40
control instructions 51
control timing 178
COP
register (COPR) 72
reset 70, 101
COPE bit in MOR 171
COPR bit in COPR 72
core timer
block diagram 98
counter register (CTCR) 101
interrupts 64
Index
General Release Specification
185
Index
status and control register (CTSCR) 99
counter 105
CPHA bit in SPCR 122
CPOL bit in SPCR 122
cross coupled coils 85
D
data retention mode 78
DC electrical characteristics 176
differential linearity error 151
direct addressing mode 43
DOD bit in SPCR 121
E
ECLK bit in SYSCR 34
ECLK pin 22
EDGE7–0 bits in PAIED 81
EELAT bit in EEPCR 155
EEOSC bit in EEPCR 154
EEPGM bit in EEPCR 155
EEPROM 35
control register (EEPCR) 154, 155
electrical characteristics 179
erase 156
options register (EEOPR) 155, 156
programming 157
read 156
EEPRT bit in EEOPR 156
EER1, EER0 bits in EEPCR 154
ELAT bit in EPROG 170
EPGM bit in EPROG 170
EPROM 35
bootloader 167
electrical characteristics 180
programming 170
programming register (EPROG) 170
erase mode select 154
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
extended addressing mode 43
external interrupt 63
F
FE bit in SCSR 139
features 18
flowcharts
interrupt 62
WAIT 77
G
gain scale error 151
H
half-carry flag 41
hardware interrupts 63–65
H-bit in CCR 41
H-bridge
driver 86
states 90
with the PWM 94
I
I/O programming 95
IC1F bit in TSR 113
IC2F bit in TSR 113
ICI1E bit in TCR1 111
ICI2E bit in TCR1 111
IDLE bit in SCSR 139
idle line wake-up 131
IEDG1 bit in TCR1 111
IEDG2 bit in TCR1 111
ILIE bit in SCCR2 137
illegal address reset 72
immediate addressing mode 43
index register 39
indexed addressing mode 44
Index
General Release Specification
186
Index
inherent addressing mode 43
input capture
register 1 108
register 2 109
instruction types 45
integral linearity error 151
interrupts
16-bit timers 64
core timer 64
flowchart 62
hardware 63
IRQ 63
keyboard 63
SCI 65
SPI 65
SWI 63
IRQ bit in SYSCR 34
IRQ pin 21
J
jump/branch instructions 48
junction temperature, chip 175
maximum ratings 174
memory map 26
MISO 22, 116
modes of operation
data retention 78
entry conditions 75
low power (WAIT) 65, 76–78
monitor 76
slow 78
user 75
monitor mode 76
monitor ROM 35
monotonicity 150
MOR 171
MOSI 22, 117
MSTR bit in SPCR 121
N
N-bit in CCR 41
negative flag 41
NF bit in SCSR 139
O
K
keyboard interrupt 22, 63, 80
L
low power modes 65, 76
low voltage reset (LVR) 72
electrical characteristics 181
M
M bit in SCCR1 136
mask options 20
register (MOR) 171
master mode 120
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
OC1F bit in TSR 113
OC2F bit in TSR 114
OCI1E bit in TCR1 111
OCI2E bit in TCR2 112
offset error 151
OLVL1 bit in TCR1 111
OLVL2 bit in TCR2 112
opcode map 58
operating modes
see modes of operation
OR bit in SCSR 139
OSC1, OSC2 21
oscillator pins 21
output compare 106
Index
General Release Specification
187
Index
register 1 106
register 2 107
P
PA0–PA7 22
PAIE7–0 bits in PAICR 81
PAIF7–0 bits in PAISR 82
PB0–PB7 22
PC0–PC7 22
PD0–PD3 23
PE0–PE7 23
PF0–PF3 23
pins
AN0–AN3 23
assignments 20
AVDD 21
ECLK 22
IRQ 21
keyboard interrupt 22
MISO 22
MOSI 22
OSC1, OSC2 21
port A (PA0–PA7) 22
port B (PB0–PB7) 22
port C (PC0–PC7) 22
port D (PD0–PD3) 23
port E (PE0–PE7) 23
port F (PF0–PF3) 23
PVDD1, PVSS1, PVDD2, PVSS2 23
RDI 22
RESET 21
SCK 22
TCAP0–3 22
TCMP0–1 22
TDO 22
VDD, VSS 21
VPP 21
VREFH 23
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
port A
interrupt control register (PAICR) 81
interrupt edge register (PAIED) 81
interrupt status register (PAISR) 82
keyboard interrupt 80
port B 82
port C 83
port D 83
port E and port F
configurations 92
mismatch registers (PEMISM and PFMISM)
89, 90
power drivers 83
power considerations 175
power driver
circuit 87
electrical characteristics 180
pins 23, 83
power supply pins 21
power-on reset (POR) 70
electrical characteristics 181
PPOL7–0 bits in PWMPOL 165
program counter 40
programming circuit 169
programming model 38
pulse width modulator
see PWM
PVDD1, PVSS1, PVDD2, PVSS2 23
PWDRW bit in MOR 171
PWM
block diagram 160
channel enable register (PWMEN) 165
channel microshifting 161
channel polarity register (PWMPOL) 165
control register (PWMCTL) 164
data registers (PWM0–7) 163
PWMC3–1 bits in PWMCTL 164
PWME7–0 bits in PWMEN 165
Index
General Release Specification
188
Index
PWMRST bit in PWMCTL 164
Q
quantization error 151
R
R8 bit in SCCRI 136
RAM 35
RCKB bit in BAUD 141
RDI 22
RDRF bit in SCSR 139
RE bit in SCCR2 138
read-modify-write instructions 47
receive data (RDI) 132
receiver 130
register/memory instructions 46
registers
ADDR 148
ADSCR 146
BAUD 140
complete listing 29–33
COPR 72
CTCR 102
CTSCR 99
EEOPR 155
EEPCR 154
EPROG 170
MOR 171
PAICR 81
PAIED 81
PAISR 82
PEMISM 89
PFMISM 90
PWM07 163
PWMCTL 164
PWMEN 165
PWMPOL 165
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
SCCR1 136
SCCR2 137
SCDAT 135
SCSR 138
SPCR 121
SPDAT 124
SPSR 123
summary 27
SYSCR 34
TCR1 110
TCR2 112
TSR 113
relative addressing mode 45
RESET 21, 67
resets
computer operating properly (COPR) 70
external 67
illegal address 72
internal 68
LVR 72
POR 70
RESET 67
RIE bit in SCCR2 137
ROM 35
RRTIF bit in CTSCR 100
RT1, RT0 bits in CTSCR 100
RTI rates 100
RTIE bit in CTSCR 100
RTIF bit in CTSCR 99
RTOF bit in CTSCR 100
RWU bit in SCCR2 138
S
SBK bit in SCCR2 138
SC bit in SYSCR 34
SCI
baud rate register (BAUD) 140, 141
block diagram 128
Index
General Release Specification
189
Index
control register 1 (SCCR1) 136
control register 2 (SCCR2) 137, 138
data format 130
data register (SCDAT) 135
interrupt 65
receiver wake-up 130
status register (SCSR) 138, 139
SCK 22, 117
SCP1, SCPO bits in BAUD 141
SCR2, SCR1, SCRO bits in BAUD 141
serial communcations interface
see SCI
serial peripheral interface
see SPI
short circuit detection 88
SIGN3–0 bits in PWMCTL 164
slave mode 120
slow mode 78
software interrupt (SWI) 63
SPE bit in SPCR 121
SPI
block diagram 119
control register (SPCR) 121, 122
data I/O register (SPDAT) 124
interrupt 65
master and slave 120
MISO 116
MOSI 117
serial clock (SCK) 117
status register (SPSR) 123
SPIE bit in SPCR 121
SPIF bit in SPSR 123
SPP bit in BAUD 140
SPR1, SPR0 bits in SPCR 122
stack pointer 39
start bit 132
system control register (SYSCR) 34
ECLK — internal system clock available 34
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
IRQ — IRQ sensitivity 34
SC — system clock option 34
T
T8 bit in SCCR1 136
TC bit in SCSR 139
TCAP0–3 22
TCAP1 bit in TSR 113
TCAP2 bit in TSR 113
TCIE bit in SCCR2 137
TCLR bit in BAUD 140
TCMP0–1 22
TDO 22
TDRE bit in SCSR 139
TE bit in SCCR2 137
thermal characteristics 175
TIE bit in SCCR2 137
timer control register 1 (TCR1) 110
CO1E — timer compare 1 output enable 111
ICI1E — input capture 1 interrupt enable 111
ICI2E — input capture 2 interrupt enable 111
IEDG1 — input edge 111
IEDG2 — input edge 111
OCI1E — output compare 1 interrupt enable
111
OLVL1 — output level 1 111
TOIE — timer overflow interrupt enable 111
timer control register 2 (TCR2) 112
CO2E — timer compare 2 output enable 112
OCI2E — output compare 2 interrupt enable
112
OLVL2 — output level 2 112
timer status register (TSR) 113
IC1F — input capture 1 flag 113
IC1F — output compare 1 flag 113
IC2F — input capture 2 flag 113
IC2F — output compare 2 flag 114
TCAP1 — timer capture 1 113
Index
General Release Specification
190
Index
TCAP2 — timer capture 2 113
TOF — timer overflow flag 113
timing diagrams
data clock 118
RESET and POR 69
TOF bit in CTSCR 99
TOF bit in TSR 113
TOFE bit in CTSCR 100
TOIE bit in TCR1 111
total unadjusted error 151
transfer curve 150
transmit data (TDO) 135
U
user mode 75
V
VDD, VSS 21
vector addresses 61
VPP 21
VREFH 23
W
WAIT mode 65, 77
WAKE bit in SCCR1 136
wake-up 130
address mark 131
idle line 131
watchdog
see COP
WCOL bit in SPSR 123
Z
Z-bit in CCR 41
zero flag 41
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
Index
General Release Specification
191
Index
MC68HC(7)05H12 — Rev. 1.0
MOTOROLA
Index
General Release Specification
192
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 and
are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
How to reach us:
USA/EUROPE/Locations Not Listed: Motorola Literature Distribution; P.O. Box 5405; Denver, Colorado 80217.1-800-441-2447 or
303-675-2140
Mfax™: [email protected] – TOUCHTONE 602-244-6609
INTERNET: http://www.mot.com/SPS/
JAPAN: Nippon Motorola Ltd.; Tatsumi-SPD-JLDC, 6F Seibu-Butsuryu-Center, 3-14-2 Tatsumi Koto-Ku, Tokyo 135, Japan.
81-3-3521-8315
ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; 8B Tai Ping Industrial Park, 51 Ting Kok Road, Tai Po, N.T., Hong Kong. 852-26629298
Mfax is a trademark of Motorola, Inc.
© Motorola, Inc., 1997
HC05H12GRS/D