MC68S711PH8CPV3 [MOTOROLA]

Microcontroller, 8-Bit, OTPROM, 6800 CPU, 3MHz, CMOS, PQFP112, TQFP-112;
MC68S711PH8CPV3
型号: MC68S711PH8CPV3
厂家: MOTOROLA    MOTOROLA
描述:

Microcontroller, 8-Bit, OTPROM, 6800 CPU, 3MHz, CMOS, PQFP112, TQFP-112

可编程只读存储器 时钟 微控制器 外围集成电路
文件: 总264页 (文件大小:1243K)
中文:  中文翻译
下载:  下载PDF数据表文档文件
MC68HC11PH8/D  
HC11  
MC68HC11PH8  
MC68HC711PH8  
TECHNICAL  
DATA  
!MOTOROLA  
INTRODUCTION  
PIN DESCRIPTIONS  
1
2
OPERATING MODES AND ON-CHIP MEMORY  
PARALLEL INPUT/OUTPUT  
3
4
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA INTERCONNECT BUS (MI BUS)  
SERIAL PERIPHERAL INTERFACE  
TIMING SYSTEM  
5
6
7
8
ANALOG-TO-DIGITAL CONVERTER  
RESETS AND INTERRUPTS  
9
10  
11  
A
B
C
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MECHANICAL DATA AND ORDERING INFORMATION  
DEVELOPMENT SUPPORT  
TPG  
INTRODUCTION  
1
2
PIN DESCRIPTIONS  
OPERATING MODES AND ON-CHIP MEMORY  
PARALLEL INPUT/OUTPUT  
3
4
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA INTERCONNECT BUS (MI BUS)  
SERIAL PERIPHERAL INTERFACE  
TIMING SYSTEM  
5
6
7
8
ANALOG-TO-DIGITAL CONVERTER  
RESETS AND INTERRUPTS  
9
10  
11  
A
B
C
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MECHANICAL DATA AND ORDERING INFORMATION  
DEVELOPMENT SUPPORT  
TPG  
1
2
MC68HC11PH8  
MC68HC711PH8  
3
High-density Complementary  
Metal Oxide Semiconductor  
(HCMOS) Microcomputer Unit  
4
5
6
7
All Trade Marks recognized. This document contains information on new products. Specifications and information herein are  
subject to change without notice.  
8
All products are sold on Motorola’s Terms & Conditions of Supply. In ordering a product covered by this document the  
Customer agrees to be bound by those Terms & Conditions and nothing contained in this document constitutes or forms part  
of a contract (with the exception of the contents of this Notice). A copy of Motorola’s Terms & Conditions of Supply is available  
on request.  
9
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 can and do vary in different applications. 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.  
10  
11  
12  
13  
14  
15  
The Customer should ensure that it has the most up to date version of the document by contacting its local Motorola office.  
This document supersedes any earlier documentation relating to the products referred to herein. The information contained  
in this document is current at the date of publication. It may subsequently be updated, revised or withdrawn.  
© MOTOROLA LTD., 1997  
TPG  
1
2
3
Conventions  
Abbreviations  
4
Definitions of any abbreviations used can be found in the Glossary.  
5
Text in italics  
This document contains information referring to the MC68HC11PH8 and the  
MC68HC711PH8. All references to the MC68HC11PH8 apply equally to the  
MC68HC711PH8, unless otherwise noted. References specific to the  
MC68HC711PH8 are italicised in the text.  
6
7
Register tables  
Because the bits in any one register are not necessarily linked by a common  
function, the description of a register may appear in several sections referring to  
different aspects of device operation. A full description of a bit is given only in a  
section in which it has relevance. Elsewhere, it appears shaded in the register  
diagram and is only briefly described.  
8
9
State on reset  
x
u
state of bit on reset depends on factors such as operating mode  
state of bit on reset is undefined  
10  
11  
12  
13  
14  
15  
TPG  
CUSTOMER FEEDBACK QUESTIONNAIRE (MC68HC11PH8/D Rev 1)  
Motorola wishes to continue to improve the quality of its documentation. We would welcome your feedback on the publication you  
have just received. Having used the document, please complete this card (or a photocopy of it, if you prefer).  
1. How would you rate the quality of the document? Check one box in each category.  
Excellent  
Poor  
Excellent  
Poor  
Organization  
Readability  
Understandability  
Accuracy  
Tables  
Table of contents  
Index  
Page size/binding  
Overall impression  
Illustrations  
Comments:  
2. What is your intended use for this document? If more than one option applies, please rank them (1, 2, 3).  
Selection of device for new application  
System design  
Other  
Please specify:  
Training purposes  
3. How well does this manual enable you to perform the task(s) outlined in question 2?  
Completely  
Not at all  
Comments:  
e
v
4. How easy is it to find the information you are looking for?  
Easy Difficult  
Comments:  
5. Is the level of technical detail in the following sections sufficient to allow you to understand how the device functions?  
Too little detail Too much detail  
SECTION 1  
SECTION 2  
SECTION 3  
SECTION 4  
SECTION 5  
SECTION 6  
SECTION 7  
SECTION 8  
SECTION 9  
INTRODUCTION  
–Cuaghslintremo  
PIN DESCRIPTIONS  
OPERATING MODES AND ON-CHIP MEMORY  
PARALLEL INPUT/OUTPUT  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA INTERCONNECT BUS (MI BUS)  
SERIAL PERIPHERAL INTERFACE  
TIMING SYSTEM  
ANALOG-TO-DIGITAL CONVERTER  
SECTION 10 RESETS AND INTERRUPTS  
SECTION 11 CPU CORE AND INSTRUCTION SET  
APPENDIX A ELECTRICAL SPECIFICATIONS (STANDARD)  
APPENDIX B MECHANICAL DATA AND ORDERING INFORMATION  
APPENDIX C DEVELOPMENT SUPPORT  
Comments:  
6. Have you found any errors? If so, please comment:  
7. From your point of view, is anything missing from the document? If so, please say what:  
TPG  
8. How could we improve this document?  
9. How would you rate Motorola’s documentation?  
Excellent  
Poor  
– In general  
– Against other semiconductor suppliers  
10. Which semiconductor manufacturer provides the best technical documentation?  
11. Which company (in any field) provides the best technical documentation?  
12. How many years have you worked with microprocessors?  
Less than 1 year  
1–3 years  
3–5 years  
More than 5 years  
– Second fold back along this line –  
NE PAS AFFRANCHIR  
NO STAMP REQUIRED  
By air mail  
Par avion  
IBRS NUMBER PHQ-B/207/G  
CCRI NUMERO PHQ-B/207/G  
–Firsft  
–Cugahslitnremo  
lodbac  
REPONSE PAYEE  
kagothsline–  
GRANDE-BRETAGNE  
Motorola Ltd.,  
Colvilles Road,  
Kelvin Industrial Estate,  
EAST KILBRIDE,  
G75 8BR.  
v
e
GREAT BRITAIN.  
!
F.A.O. Technical Publications Manager  
(re: MC68HC11PH8/D Rev 1)  
MOTOROLA LTD.  
Semiconductor Products Sector  
– Third fold back along this line –  
13. Currently there is some discussion in the semiconductor industry regarding a move towards providing data sheets in electronic  
form. If you have any opinion on this subject, please comment.  
14. We would be grateful if you would supply the following information (at your discretion), or attach your card.  
Name:  
Phone No:  
FAX No:  
Position:  
Department:  
Company:  
Address:  
Thank you for helping us improve our documentation,  
Graham Livey, Technical Publications Manager, Motorola Ltd., Scotland.  
TPG  
– Last tuck this edge into opposite flap –  
TABLE OF CONTENTS  
Paragraph  
Number  
Page  
Number  
Title  
1
INTRODUCTION  
1.1  
1.2  
Features.................................................................................................................1-1  
Mask options .........................................................................................................1-2  
2
PIN DESCRIPTIONS  
2.1  
2.2  
2.3  
2.4  
VDD and VSS........................................................................................................2-2  
RESET...................................................................................................................2-3  
Crystal driver and external clock input (XTAL, EXTAL)..........................................2-3  
E clock output (E) ..................................................................................................2-5  
Phase-locked loop (XFC, VDDSYN, 4XOUT)........................................................2-6  
PLL operation...................................................................................................2-7  
Synchronization of PLL with subsystems.........................................................2-8  
Changing the PLL frequency ...........................................................................2-8  
PLL registers....................................................................................................2-8  
PLLCR — PLL control register...................................................................2-9  
SYNR — Synthesizer program register......................................................2-11  
Interrupt request (IRQ) ..........................................................................................2-12  
Nonmaskable interrupt (XIRQ/VPPE)....................................................................2-12  
MODA and MODB (MODA/LIR and MODB/VSTBY).............................................2-13  
VRH and VRL ........................................................................................................2-13  
2.5  
2.5.1  
2.5.2  
2.5.3  
2.5.4  
2.5.4.1  
2.5.4.2  
2.6  
2.7  
2.8  
2.9  
2.10 PG7/R/W ...............................................................................................................2-13  
2.11 Port signals............................................................................................................2-14  
2.11.1  
2.11.2  
2.11.3  
2.11.4  
2.11.5  
2.11.6  
2.11.7  
2.11.8  
Port A...............................................................................................................2-14  
Port B...............................................................................................................2-14  
Port C...............................................................................................................2-16  
Port D...............................................................................................................2-16  
Port E...............................................................................................................2-17  
Port F ...............................................................................................................2-17  
Port G...............................................................................................................2-17  
Port H...............................................................................................................2-18  
2.12 LCD module...........................................................................................................2-18  
2.12.1  
LCDR — LCD control and data register...........................................................2-18  
TPG  
MC68HC11PH8  
TABLE OF CONTENTS  
MOTOROLA  
i
Paragraph  
Number  
Page  
Number  
Title  
3
OPERATING MODES AND ON-CHIP MEMORY  
3.1  
3.1.1  
3.1.2  
3.1.3  
3.1.4  
3.2  
3.2.1  
3.2.1.1  
3.2.1.2  
3.2.1.3  
3.2.2  
3.3  
3.3.1  
Operating modes...................................................................................................3-1  
Single chip operating mode .............................................................................3-1  
Expanded operating mode...............................................................................3-1  
Special test -mode...........................................................................................3-2  
Special bootstrap mode...................................................................................3-2  
On-chip memory....................................................................................................3-3  
Mapping allocations.........................................................................................3-4  
RAM ...........................................................................................................3-4  
ROM and EPROM......................................................................................3-5  
Bootloader ROM ........................................................................................3-5  
Registers..........................................................................................................3-5  
System initialization...............................................................................................3-10  
Mode selection.................................................................................................3-10  
HPRIO — Highest priority I-bit interrupt & misc. register ...........................3-11  
Initialization......................................................................................................3-12  
CONFIG — System configuration register.................................................3-12  
INIT — RAM and I/O mapping register ......................................................3-14  
INIT2 — EEPROM mapping and MI BUS delay register............................3-16  
OPTION — System configuration options register 1..................................3-17  
OPT2 — System configuration options register 2......................................3-18  
BPROT — Block protect register................................................................3-21  
TMSK2 — Timer interrupt mask register 2.................................................3-22  
EPROM, EEPROM and CONFIG register.............................................................3-23  
EPROM............................................................................................................3-23  
EPROG — EPROM programming control register.....................................3-23  
EPROM programming................................................................................3-24  
EEPROM .........................................................................................................3-25  
PPROG — EEPROM programming control register ..................................3-25  
EEPROM bulk erase ..................................................................................3-27  
EEPROM row erase...................................................................................3-28  
EEPROM byte erase..................................................................................3-28  
CONFIG register programming........................................................................3-29  
RAM and EEPROM security............................................................................3-30  
3.3.1.1  
3.3.2  
3.3.2.1  
3.3.2.2  
3.3.2.3  
3.3.2.4  
3.3.2.5  
3.3.2.6  
3.3.2.7  
3.4  
3.4.1  
3.4.1.1  
3.4.1.2  
3.4.2  
3.4.2.1  
3.4.2.2  
3.4.2.3  
3.4.2.4  
3.4.3  
3.4.4  
4
PARALLEL INPUT/OUTPUT  
4.1  
4.1.1  
4.1.2  
Port A.....................................................................................................................4-2  
PORTA — Port A data register ........................................................................4-2  
DDRA — Data direction register for port A .....................................................4-2  
TPG  
MOTOROLA  
ii  
TABLE OF CONTENTS  
MC68HC11PH8  
Paragraph  
Number  
Page  
Number  
Title  
4.2  
Port B.....................................................................................................................4-3  
PORTB — Port B data register ........................................................................4-3  
DDRB — Data direction register for port B ......................................................4-3  
Port C.....................................................................................................................4-4  
PORTC — Port C data register........................................................................4-4  
DDRC — Data direction register for port C......................................................4-4  
Port D.....................................................................................................................4-5  
PORTD — Port D data register........................................................................4-5  
DDRD — Data direction register for port D......................................................4-5  
Port E.....................................................................................................................4-6  
PORTE — Port E data register ........................................................................4-6  
Port F.....................................................................................................................4-7  
PORTF — Port F data register.........................................................................4-7  
DDRF — Data direction register for port F.......................................................4-7  
Port G ....................................................................................................................4-8  
PORTG — Port G data register .......................................................................4-8  
DDRG — Data direction register for port G .....................................................4-8  
Port H.....................................................................................................................4-9  
PORTH — Port H data register........................................................................4-9  
DDRH — Data direction register for port H......................................................4-9  
Wired-OR interrupt...........................................................................................4-10  
WOIEH — WOI enable (WOIEH) ...............................................................4-10  
Internal pull-up resistors ........................................................................................4-11  
PPAR — Port pull-up assignment register .......................................................4-11  
4.2.1  
4.2.2  
4.3  
4.3.1  
4.3.2  
4.4  
4.4.1  
4.4.2  
4.5  
4.5.1  
4.6  
4.6.1  
4.6.2  
4.7  
4.7.1  
4.7.2  
4.8  
4.8.1  
4.8.2  
4.8.3  
4.8.3.1  
4.9  
4.9.1  
4.10 System configuration .............................................................................................4-11  
4.10.1  
4.10.2  
OPT2 — System configuration options register 2............................................4-12  
CONFIG — System configuration register.......................................................4-13  
5
SERIAL COMMUNICATIONS INTERFACE  
5.1  
5.2  
5.3  
5.4  
5.4.1  
5.4.2  
5.5  
Data format............................................................................................................5-2  
Transmit operation .................................................................................................5-2  
Receive operation..................................................................................................5-2  
Wake-up feature ....................................................................................................5-4  
Idle-line wake-up..............................................................................................5-4  
Address-mark wake-up ....................................................................................5-4  
SCI error detection ................................................................................................5-5  
SCI registers..........................................................................................................5-5  
SCBDH, SCBDL — SCI baud rate control registers........................................5-6  
SCCR1 — SCI control register 1 .....................................................................5-7  
SCCR2 — SCI control register 2 .....................................................................5-9  
SCSR1 — SCI status register 1.......................................................................5-10  
SCSR2 — SCI status register 2.......................................................................5-12  
SCDRH, SCDRL — SCI data high/low registers .............................................5-12  
5.6  
5.6.1  
5.6.2  
5.6.3  
5.6.4  
5.6.5  
5.6.6  
TPG  
MC68HC11PH8  
TABLE OF CONTENTS  
MOTOROLA  
iii  
Paragraph  
Number  
Page  
Number  
Title  
5.7  
5.7.1  
5.8  
5.8.1  
5.8.2  
5.8.3  
5.8.4  
5.8.5  
5.8.6  
Status flags and interrupts.....................................................................................5-13  
Receiver flags ..................................................................................................5-13  
SCI2 ......................................................................................................................5-15  
S2BDH, S2BDL — SCI2 baud rate control registers.......................................5-15  
S2CR1 — SCI2 control register 1....................................................................5-16  
S2CR2 — SCI2 control register 2....................................................................5-16  
S2SR1 — SCI2 status register 1 .....................................................................5-16  
S2SR2 — SCI2 status register 2 .....................................................................5-17  
S2DRH, S2DRL — SCI2 data high/low registers ............................................5-17  
6
MOTOROLA INTERCONNECT BUS (MI BUS)  
6.1  
Push-pull sequence...............................................................................................6-2  
The push field ..................................................................................................6-2  
The pull field ....................................................................................................6-3  
Biphase coding......................................................................................................6-3  
Message validation................................................................................................6-4  
Controller detected errors................................................................................6-4  
MCU detected errors .......................................................................................6-4  
Interfacing to MI BUS ............................................................................................6-6  
MI BUS clock rate..................................................................................................6-7  
SCI2/MI BUS registers ..........................................................................................6-7  
INIT2 — EEPROM mapping and MI BUS delay register .................................6-8  
S2BDH, S2BDL — MI BUS clock rate control registers...................................6-9  
S2CR1 — MI BUS control register 1 ...............................................................6-9  
S2CR2 — MI BUS control register 2 ...............................................................6-10  
S2SR1 — MI BUS status register 1.................................................................6-11  
S2SR2 — MI BUS2 status register 2...............................................................6-12  
S2DRL — MI BUS2 data register ....................................................................6-12  
6.1.1  
6.1.2  
6.2  
6.3  
6.3.1  
6.3.2  
6.4  
6.5  
6.6  
6.6.1  
6.6.2  
6.6.3  
6.6.4  
6.6.5  
6.6.6  
6.6.7  
7
SERIAL PERIPHERAL INTERFACE  
7.1  
7.2  
7.2.1  
7.3  
7.3.1  
7.3.2  
7.3.3  
7.3.4  
7.4  
Functional description ...........................................................................................7-1  
SPI transfer formats...............................................................................................7-2  
Clock phase and polarity controls....................................................................7-3  
SPI signals ............................................................................................................7-3  
Master in slave out...........................................................................................7-4  
Master out slave in...........................................................................................7-4  
Serial clock ......................................................................................................7-4  
Slave select......................................................................................................7-4  
SPI system errors..................................................................................................7-5  
TPG  
MOTOROLA  
iv  
TABLE OF CONTENTS  
MC68HC11PH8  
Paragraph  
Number  
Page  
Number  
Title  
7.5  
SPI registers..........................................................................................................7-5  
SPCR — SPI control register...........................................................................7-6  
SPSR — SPI status register ............................................................................7-7  
SPDR — SPI data register...............................................................................7-8  
OPT2 — System configuration options register 2............................................7-9  
SPI2.......................................................................................................................7-10  
SP2CR — SPI2 control register.......................................................................7-11  
SP2SR — SPI2 status register ........................................................................7-11  
SP2DR — SPI2 data register...........................................................................7-11  
SP2OPT — SPI2 control options register........................................................7-11  
7.5.1  
7.5.2  
7.5.3  
7.5.4  
7.6  
7.6.1  
7.6.2  
7.6.3  
7.6.4  
8
TIMING SYSTEM  
8.1  
8.1.1  
8.1.1.1  
8.1.2  
8.1.3  
16-bit timer.............................................................................................................8-1  
Timer enable control ........................................................................................8-3  
PLLCR — PLL control register...................................................................8-3  
Timer structure.................................................................................................8-4  
Input capture....................................................................................................8-8  
TCTL2 — Timer control register 2..............................................................8-9  
TIC1–TIC3 — Timer input capture registers...............................................8-10  
TI4/O5 — Timer input capture 4/output compare 5 register.......................8-10  
Output compare ...............................................................................................8-11  
TOC1–TOC4 — Timer output compare registers.......................................8-12  
CFORC — Timer compare force register...................................................8-12  
OC1M — Output compare 1 mask register................................................8-13  
OC1D — Output compare 1 data register..................................................8-13  
TCNT — Timer counter register .................................................................8-14  
TCTL1 — Timer control register 1..............................................................8-14  
TMSK1 — Timer interrupt mask register 1.................................................8-15  
TFLG1 — Timer interrupt flag register 1 ....................................................8-16  
TMSK2 — Timer interrupt mask register 2.................................................8-17  
8.1.3.1  
8.1.3.2  
8.1.3.3  
8.1.4  
8.1.4.1  
8.1.4.2  
8.1.4.3  
8.1.4.4  
8.1.4.5  
8.1.4.6  
8.1.4.7  
8.1.4.8  
8.1.4.9  
8.1.4.10  
8.1.5  
8.1.5.1  
8.1.5.2  
8.1.5.3  
8.1.6  
TFLG2 — Timer interrupt flag register 2 ....................................................8-18  
Real-time interrupt ...........................................................................................8-19  
TMSK2 — Timer interrupt mask register 2.................................................8-20  
TFLG2 — Timer interrupt flag register 2 ....................................................8-21  
PACTL — Pulse accumulator control register ............................................8-22  
Computer operating properly watchdog function .............................................8-23  
LCD module.....................................................................................................8-23  
Pulse accumulator ...........................................................................................8-23  
PACTL — Pulse accumulator control register ............................................8-25  
PACNT — Pulse accumulator count register..............................................8-26  
Pulse accumulator status and interrupt bits ...............................................8-26  
TMSK2 — Timer interrupt mask 2 register.................................................8-26  
TFLG2 — Timer interrupt flag 2 register ....................................................8-26  
8.1.7  
8.1.8  
8.1.8.1  
8.1.8.2  
8.1.8.3  
8.1.8.4  
8.1.8.5  
TPG  
MC68HC11PH8  
TABLE OF CONTENTS  
MOTOROLA  
v
Paragraph  
Number  
Page  
Number  
Title  
8.2  
8.2.1  
8.2.2  
8.2.2.1  
8.2.2.2  
8.2.3  
8.2.4  
8.2.5  
8.2.6  
8.2.7  
8.2.8  
8.2.9  
8.3  
8.3.1  
8.3.2  
Pulse-width modulation (PWM) timer ....................................................................8-27  
PWM timer block diagram................................................................................8-28  
PWCLK — PWM clock prescaler and 16-bit select register ............................8-28  
16-bit PWM function...................................................................................8-28  
Clock prescaler selection ...........................................................................8-30  
PWPOL — PWM timer polarity & clock source select register........................8-31  
PWSCAL — PWM timer prescaler register .....................................................8-31  
PWEN — PWM timer enable register..............................................................8-32  
PWCNT1–4 — PWM timer counter registers 1 to 4 ........................................8-33  
PWPER1–4 — PWM timer period registers 1 to 4 ..........................................8-33  
PWDTY1–4 — PWM timer duty cycle registers 1 to 4.....................................8-34  
Boundary cases...............................................................................................8-34  
8-bit modulus timers..............................................................................................8-35  
Modulus timer operation ..................................................................................8-35  
Clock rate selection..........................................................................................8-37  
T8ADR — 8-bit modulus timer A data register...........................................8-38  
T8ACR — 8-bit modulus timer A control register.......................................8-38  
T8BDR — 8-bit modulus timer B data register...........................................8-39  
T8BCR — 8-bit modulus timer B control register.......................................8-39  
T8CDR — 8-bit modulus timer C data register ..........................................8-40  
T8CCR — 8-bit modulus timer C control register.......................................8-40  
8.3.2.1  
8.3.2.2  
8.3.2.3  
8.3.2.4  
8.3.2.5  
8.3.2.6  
9
ANALOG-TO-DIGITAL CONVERTER  
9.1  
Overview................................................................................................................9-1  
Multiplexer........................................................................................................9-2  
Analog converter..............................................................................................9-3  
Digital control...................................................................................................9-3  
Result registers................................................................................................9-4  
A/D converter clocks........................................................................................9-4  
Conversion sequence ......................................................................................9-4  
Conversion process .........................................................................................9-5  
A/D converter power-up and clock select..............................................................9-5  
OPTION — System configuration options register 1 .......................................9-5  
Channel assignments............................................................................................9-7  
Single-channel operation.................................................................................9-7  
Multiple-channel operation...............................................................................9-8  
Control, status and results registers......................................................................9-8  
ADCTL — A/D control and status register.......................................................9-8  
ADR1–ADR4 — A/D converter results registers..............................................9-10  
Operation in STOP and WAIT modes....................................................................9-10  
9.1.1  
9.1.2  
9.1.3  
9.1.4  
9.1.5  
9.1.6  
9.1.7  
9.2  
9.2.1  
9.3  
9.3.1  
9.3.2  
9.4  
9.4.1  
9.4.2  
9.5  
TPG  
MOTOROLA  
vi  
TABLE OF CONTENTS  
MC68HC11PH8  
Paragraph  
Number  
Page  
Number  
Title  
10  
RESETS AND INTERRUPTS  
10.1 Resets .................................................................................................................10-1  
10.1.1  
10.1.2  
10.1.3  
10.1.3.1  
10.1.4  
10.1.5  
10.1.6  
Power-on reset...............................................................................................10-1  
External reset (RESET) .................................................................................10-2  
COP reset ......................................................................................................10-2  
COPRST — Arm/reset COP timer circuitry register.................................10-3  
Clock monitor reset ........................................................................................10-4  
OPTION — System configuration options register 1 .....................................10-4  
CONFIG — Configuration control register ....................................................10-6  
10.2 Effects of reset.....................................................................................................10-7  
10.2.1  
10.2.2  
10.2.3  
10.2.4  
10.2.5  
10.2.6  
10.2.7  
10.2.8  
10.2.9  
Central processing unit ..................................................................................10-8  
Memory map..................................................................................................10-8  
Parallel I/O .....................................................................................................10-8  
Timer..............................................................................................................10-8  
Real-time interrupt (RTI) ................................................................................10-9  
Pulse accumulator .........................................................................................10-9  
Computer operating properly (COP)..............................................................10-9  
8-bit modulus timer system............................................................................10-9  
Serial communications interface (SCI)...........................................................10-9  
10.2.10 Serial peripheral interface (SPI).....................................................................10-10  
10.2.11 Analog-to-digital converter.............................................................................10-10  
10.2.12 LCD module...................................................................................................10-10  
10.2.13 System...........................................................................................................10-10  
10.3 Reset and interrupt priority ..................................................................................10-11  
10.3.1  
HPRIO — Highest priority I-bit interrupt and misc. register ...........................10-12  
10.4 Interrupts .............................................................................................................10-15  
10.4.1  
10.4.2  
10.4.3  
10.4.4  
10.4.5  
10.4.6  
Interrupt recognition and register stacking.....................................................10-15  
Nonmaskable interrupt request (XIRQ)..........................................................10-16  
Illegal opcode trap..........................................................................................10-16  
Software interrupt...........................................................................................10-16  
Maskable interrupts........................................................................................10-17  
Reset and interrupt processing......................................................................10-17  
10.5 Low power operation ...........................................................................................10-17  
10.5.1  
10.5.2  
WAIT ..............................................................................................................10-17  
STOP .............................................................................................................10-18  
11  
CPU CORE AND INSTRUCTION SET  
11.1 Registers .............................................................................................................11-1  
11.1.1  
11.1.2  
11.1.3  
Accumulators A, B and D...............................................................................11-2  
Index register X (IX) .......................................................................................11-2  
Index register Y (IY) .......................................................................................11-2  
TPG  
MC68HC11PH8  
TABLE OF CONTENTS  
MOTOROLA  
vii  
Paragraph  
Number  
Page  
Number  
Title  
11.1.4  
11.1.5  
11.1.6  
Stack pointer (SP)..........................................................................................11-2  
Program counter (PC)....................................................................................11-4  
Condition code register (CCR).......................................................................11-4  
Carry/borrow (C) ......................................................................................11-5  
Overflow (V) .............................................................................................11-5  
Zero (Z) ....................................................................................................11-5  
Negative (N).............................................................................................11-5  
Interrupt mask (I)......................................................................................11-5  
Half carry (H)............................................................................................11-6  
X interrupt mask (X) .................................................................................11-6  
Stop disable (S)........................................................................................11-6  
11.1.6.1  
11.1.6.2  
11.1.6.3  
11.1.6.4  
11.1.6.5  
11.1.6.6  
11.1.6.7  
11.1.6.8  
11.2 Data types ...........................................................................................................11-6  
11.3 Opcodes and operands .......................................................................................11-7  
11.4 Addressing modes...............................................................................................11-7  
11.4.1  
11.4.2  
11.4.3  
11.4.4  
11.4.5  
11.4.6  
Immediate (IMM)............................................................................................11-7  
Direct (DIR)....................................................................................................11-7  
Extended (EXT) .............................................................................................11-8  
Indexed (IND, X; IND, Y).................................................................................11-8  
Inherent (INH)................................................................................................11-8  
Relative (REL)................................................................................................11-8  
11.5 Instruction set......................................................................................................11-8  
A
ELECTRICAL SPECIFICATIONS (STANDARD)  
A.1  
A.2  
A.3  
A.4  
A.4.1  
A.5  
A.5.1  
A.5.2  
A.5.3  
A.5.4  
A.5.5  
A.5.6  
A.5.7  
Maximum ratings .................................................................................................. A-1  
Thermal characteristics and power considerations .............................................. A-2  
Test methods ........................................................................................................ A-3  
DC electrical characteristics................................................................................. A-4  
DC electrical characteristics — modes of operation....................................... A-5  
Control timing ....................................................................................................... A-6  
Peripheral port timing...................................................................................... A-9  
PLL control timing........................................................................................... A-10  
Analog-to-digital converter characteristics...................................................... A-11  
Serial peripheral interface timing .................................................................... A-12  
Non-multiplexed expansion bus timing ........................................................... A-15  
EEPROM characteristics ................................................................................ A-16  
EPROM characteristics .................................................................................. A-16  
TPG  
MOTOROLA  
viii  
TABLE OF CONTENTS  
MC68HC11PH8  
Paragraph  
Number  
Page  
Number  
Title  
B
MECHANICAL DATA AND ORDERING INFORMATION  
B.1  
B.2  
B.3  
Pin assignments ................................................................................................... B-1  
Package dimensions............................................................................................. B-3  
Ordering Information............................................................................................. B-6  
C
DEVELOPMENT SUPPORT  
C.1  
C.2  
C.3  
EVS — Evaluation system....................................................................................C-1  
MMDS11 — Motorola modular development system ...........................................C-2  
SPGMR11 — Serial programmer system.............................................................C-2  
GLOSSARY  
INDEX  
TPG  
MC68HC11PH8  
TABLE OF CONTENTS  
MOTOROLA  
ix  
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
x
TABLE OF CONTENTS  
MC68HC11PH8  
LIST OF FIGURES  
Figure  
Number  
Page  
Number  
Title  
1-1  
2-1  
2-2  
2-3  
2-4  
2-5  
2-6  
2-7  
3-1  
3-2  
3-3  
5-1  
5-2  
5-3  
6-1  
6-2  
6-3  
6-4  
7-1  
7-2  
8-1  
8-2  
8-3  
8-4  
8-5  
8-6  
8-7  
9-1  
9-2  
9-3  
10-1  
10-2  
10-3  
MC68HC11PH8/MC68HC711PH8 block diagram..................................................1-3  
84-pin PLCC/CERQUAD pinout .............................................................................2-1  
112-pin TQFP pinout ..............................................................................................2-2  
External reset circuitry............................................................................................2-3  
Oscillator connections (VDDSYN = 0, PLL disabled) .............................................2-4  
Oscillator connections (VDDSYN = 1, PLL enabled)..............................................2-5  
PLL circuit...............................................................................................................2-6  
RAM stand-by connections.....................................................................................2-13  
MC68HC11PH8/MC68HC711PH8 memory map...................................................3-3  
Example of expanded mode FREEZ actions..........................................................3-13  
RAM and register overlap.......................................................................................3-15  
SCI baud rate generator circuit diagram.................................................................5-1  
SCI1 block diagram ................................................................................................5-3  
Interrupt source resolution within SCI.....................................................................5-14  
MI BUS timing.........................................................................................................6-2  
Biphase coding and error detection........................................................................6-3  
MI BUS block diagram............................................................................................6-5  
A typical interface between the MC68HC11PH8 and the MI BUS..........................6-6  
SPI block diagram...................................................................................................7-2  
SPI transfer format..................................................................................................7-3  
Timer clock divider chains (PLL enabled — VDDSYN high) ..................................8-5  
Timer clock divider chains (PLL disabled — VDDSYN low) ...................................8-6  
Capture/compare block diagram.............................................................................8-7  
Pulse accumulator block diagram...........................................................................8-24  
PWM timer block diagram.......................................................................................8-29  
PWM duty cycle......................................................................................................8-34  
8-bit modulus timer system.....................................................................................8-36  
A/D converter block diagram ..................................................................................9-2  
Electrical model of an A/D input pin (in sample mode)...........................................9-3  
A/D conversion sequence.......................................................................................9-4  
Processing flow out of reset (1 of 2).....................................................................10-19  
Processing flow out of reset (2 of 2).....................................................................10-20  
Interrupt priority resolution (1 of 3) .......................................................................10-21  
TPG  
MC68HC11PH8  
LIST OF FIGURES  
MOTOROLA  
xi  
Figure  
Number  
Page  
Number  
Title  
10-4  
10-5  
10-6  
10-7  
11-1  
11-2  
A-1  
A-2  
A-3  
A-4  
A-5  
A-6  
A-7  
A-8  
A-9  
A-10  
A-11  
A-12  
A-13  
B-1  
Interrupt priority resolution (2 of 3).......................................................................10-22  
Interrupt priority resolution (3 of 3).......................................................................10-23  
Interrupt source resolution within the SCI subsystem ..........................................10-24  
Interrupt source resolution within the 8-bit modulus timer subsystem..................10-25  
Programming model.............................................................................................11-1  
Stacking operations..............................................................................................11-3  
Test methods..........................................................................................................A-3  
Timer inputs............................................................................................................A-6  
Reset timing ...........................................................................................................A-7  
Interrupt timing .......................................................................................................A-7  
STOP recovery timing ............................................................................................A-8  
WAIT recovery timing .............................................................................................A-8  
Port read timing diagram........................................................................................A-9  
Port write timing diagram........................................................................................A-9  
SPI master timing (CPHA = 0) ...............................................................................A-13  
SPI master timing (CPHA = 1) ...............................................................................A-13  
SPI slave timing (CPHA = 0) ..................................................................................A-14  
SPI slave timing (CPHA = 1) ..................................................................................A-14  
Expansion bus timing .............................................................................................A-16  
84-pin PLCC/CERQUAD pinout .............................................................................B-1  
112-pin TQFP pinout ..............................................................................................B-2  
84-pin PLCC mechanical dimensions ....................................................................B-3  
84-pin CERQUAD mechanical dimensions ............................................................B-4  
112-pin TQFP mechanical dimensions...................................................................B-5  
B-2  
B-3  
B-4  
B-5  
TPG  
MOTOROLA  
xii  
LIST OF FIGURES  
MC68HC11PH8  
LIST OF TABLES  
Table  
Number  
Page  
Number  
Title  
2-1  
2-2  
3-1  
3-2  
3-3  
3-4  
3-5  
3-6  
3-7  
3-8  
4-1  
5-1  
7-1  
8-1  
8-2  
8-3  
PLL mask options...................................................................................................2-7  
Port signal functions ...............................................................................................2-15  
Example bootloader baud rates..............................................................................3-3  
Register and control bit assignments .....................................................................3-6  
Registers with limited write access.........................................................................3-10  
Hardware mode select summary............................................................................3-11  
RAM and register remapping..................................................................................3-15  
EEPROM remapping..............................................................................................3-16  
EEPROM block protect...........................................................................................3-21  
Erase mode selection.............................................................................................3-26  
Port configuration ...................................................................................................4-1  
Example SCI baud rate control values ...................................................................5-7  
SPI clock rates........................................................................................................7-7  
Timer resolution and capacity.................................................................................8-2  
RTI periodic rates (PLL disabled) ...........................................................................8-19  
RTI periodic rates (PLL enabled)............................................................................8-19  
Pulse accumulator timing .......................................................................................8-23  
Clock A and clock B prescalers ..............................................................................8-30  
Modulus timers clock sources ................................................................................8-37  
A/D converter channel assignments.......................................................................9-7  
COP timer rate select (PLL disabled)...................................................................10-3  
COP timer rate select (PLL enabled)....................................................................10-3  
Reset cause, reset vector and operating mode....................................................10-7  
Highest priority interrupt selection........................................................................10-13  
Interrupt and reset vector assignments ................................................................10-14  
Stacking order on entry to interrupts ....................................................................10-15  
Reset vector comparison......................................................................................11-4  
Instruction set .......................................................................................................11-9  
Ordering information.............................................................................................. B-6  
M68HC11 development tools ................................................................................ C-1  
8-4  
8-5  
8-6  
9-1  
10-1  
10-2  
10-3  
10-4  
10-5  
10-6  
11-1  
11-2  
B-1  
C-1  
TPG  
MC68HC11PH8  
LIST OF TABLES  
MOTOROLA  
xiii  
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
xiv  
LIST OF TABLES  
MC68HC11PH8  
1
1
INTRODUCTION  
The MC68HC11PH8 8-bit microcontroller is a member of the M68HC11 family of HCMOS  
microcontrollers. In addition to 48K bytes of ROM, the MC68HC11PH8 contains 2K bytes of RAM  
and 768 bytes of EEPROM. Making use of an 84-pin PLCC, or 112-pin TQFP package, a  
non-multiplexed expanded bus is a feature of this device.The timer system has been expanded to  
include three input captures, four output compares and a software selectable input capture or  
output compare. There are three 8-bit modulus timers, one of which may be used as a prescaler  
for the other two. The inclusion of a PLL circuit allows power consumption and performance to be  
adjusted to suit operational requirements. Other major features of this device are: 8-channel, 8-bit  
A/D converter, four PWM timer channels, wired-OR capability for keyboard interrupt, four LCD  
segment drivers and two SPI and two enhanced SCI subsystems. The MC68HC11PH8 is  
especially suitable for mobile communications and automotive applications.  
The MC68HC711PH8 is an EPROM version of the MC68HC11PH8, with the user ROM replaced  
by a similar amount of EPROM. All references to the MC68HC11PH8 apply equally to the  
MC68HC711PH8, unless otherwise noted. References specific to the MC68HC711PH8 are  
italicised in the text.  
1.1  
Features  
Low power, high performance M68HC11 CPU core  
48K bytes of user ROM (MC68HC11PH8); 48K bytes of user EPROM (MC68HC711PH8)  
2K bytes of RAM  
768 bytes of byte-erasable user EEPROM, with on-chip charge pump  
Up to 54 general purpose I/O lines, plus up to 8 input-only lines  
Non-multiplexed address and data buses, permitting direct access to the full 64K address map  
16-bit timer with 3/4 input captures and 4/5 output compares; pulse accumulator and COP  
watchdog timer  
Three 8-bit modulus timers, for generating periodic interrupts  
TPG  
MC68HC11PH8  
INTRODUCTION  
MOTOROLA  
1-1  
1
Power saving PLL circuit  
Wired-OR interrupt capability for keyboard support, allowing wake-up from STOP and WAIT  
modes  
Two 8- or 9-bit SCI subsystems, one with MI BUS capability; both NRZ type for RS232  
compatibility  
Two SPI subsystems, with software selectable MSB/LSB first option  
8-channel, 8-bit analog-to-digital (A/D) converter  
Four 8-bit PWM timer channels (may be concatenated to form one or two 16-bit channels)  
4-segment LCD driver  
Available in 84-pin PLCC or 112-pin TQFP packages (MC68HC11PH8); also 84-pin  
CERQUAD package (MC68HC711PH8)  
1.2  
Mask options  
There are five mask options available on the MC68HC11PH8. These options are programmed  
during manufacture and must be specified on the order form.  
Security option (available/unavailable); see Section 3.4.4  
PLL oscillator frequency (32kHz/614kHz); see Section 2.5  
Oscillator buffer type (inverter/Schmitt trigger); see Section 2.3  
POR/exit from STOP start-up time (4064/128 bus cycles); see Section 3.3.2.4  
ROMON bit software switchable in user expanded mode (enable/disable); see Section 3.3.2.1  
Note:  
These options are not available on the MC68HC711PH8; on this device, the security  
option is always available, the PLL oscillator is optimized for operation at 32 kHz, the  
oscillator buffer is an inverter, the POR/exit from STOP start-up time is 4064 bus cycles  
and the ROMON bit is software switchable in user expanded mode.  
The Motorola Interconnect Bus (MI BUS) is a serial communications protocol which supports  
distributed real-time control efficiently and with a high degree of noise immunity. It allows data  
to be transferred between the MCU and the slave device using only one wire, making this type  
of communication suitable for medium speed networks requiring very low cost multiplex  
wiring.  
TPG  
MOTOROLA  
1-2  
INTRODUCTION  
MC68HC11PH8  
1
OC1/PAI  
OC1/OC2  
OC1/OC3  
OC1/OC4  
PA7  
PA6  
PA5  
PA4  
PA3  
PA2  
PA1  
PA0  
Pulse accumulator  
Timer  
IC4/OC1/OC5  
IC1  
Periodic interrupt  
IC2  
IC3  
COP watchdog  
ROM or EPROM  
49152 x 8  
(including 64 bytes for vectors)  
SS1  
SCK1  
MOSI1  
MISO1  
PD5  
PD4  
PD3  
PD2  
SPI1  
TXD1  
RXD1  
PD1  
PD0  
SCI1+  
VRH  
VRL  
PE7  
PE6  
PE5  
PE4  
PE3  
PE2  
PE1  
PE0  
768 bytes EEPROM  
2048 bytes RAM  
AD7  
AD6  
AD5  
AD4  
AD3  
AD2  
AD1  
AD0  
8-channel  
A/D  
converter  
VPPE/XIRQ  
IRQ  
RESET  
LIR/MODA  
VSTBY/MODB  
PG7  
PG6  
PG5  
PG4  
PG3  
PG2  
PG1  
PG0  
R/W  
Interrupts  
&
SS2  
SCK2  
MOSI2  
MISO2  
TXD2  
mode  
select  
SPI2  
M68HC11  
CPU  
XTAL  
EXTAL  
E
SCI2+ (with MI BUS)  
RXD2  
Oscillator  
PH7  
PH6  
PH5  
PH4  
PH3  
PH2  
PH1  
PH0  
XFC  
VDDSYN  
4XOUT  
(see note)  
3 x Modulus timers  
PLL  
PW4  
LCDBP  
LCD  
5
PW3  
PW2  
PW1  
drivers  
5
VDD  
VSS  
PWM  
Non-multiplexed address and data buses  
Port B  
Port F  
Port C  
Note: The 4XOUT pin  
is available only on the  
112-pin TQFP package.  
Figure 1-1 MC68HC11PH8/MC68HC711PH8 block diagram  
TPG  
MC68HC11PH8  
INTRODUCTION  
MOTOROLA  
1-3  
1
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
1-4  
INTRODUCTION  
MC68HC11PH8  
2
2
PIN DESCRIPTIONS  
The MC68HC11PH8 is available in an 84-pin plastic-leaded chip carrier (PLCC) and in an 112-pin thin  
quad flat pack (TQFP); in addition to those two packages, the MC68HC711PH8 is also available in an  
84-pin windowed cerquad package, to allow the EPROM to be erased.Most pins on this MCU serve  
two or more functions, as described in the following paragraphs. Refer to Figure 2-1 and to Figure 2-2  
which show the pin assignments for the 84 and 112-pin packages respectively.  
PW1/PH0 12  
PW2/PH1 13  
PW3/PH2 14  
PW4/PH3 15  
PH4 16  
74 PD2/MISO  
73 PD1/TXD1  
72 PD0/RXD1  
71 MODA/LIR  
70 RESET  
69 XFC  
PH5 17  
PH6 18  
PH7 19  
68 VDDSYN  
67 EXTAL  
MODB/VSTBY 20  
VPPE/XIRQ 21  
VDD 22  
66 XTAL  
65  
E
64 VDDR  
63 VSSR  
VDDL 23  
VSSL 24  
62 PC7/D7  
61 PC6/D6  
60 PC5/D5  
59 PC4/D4  
58 PC3/D3  
57 PC2/D2  
56 PC1/D1  
55 PC0/D0  
54 IRQ  
VSS 25  
R/W/PG7 26  
LCDBP/PG6 27  
SS2/PG5 28  
SCK2/PG4 29  
MOSI2/PG3 30  
MISO2/PG2 31  
TXD2/PG1 32  
Figure 2-1 84-pin PLCC/CERQUAD pinout  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-1  
 
2
NC  
NC  
PW1/PH0  
PW2/PH1  
PW3/PH2  
PW4/PH3  
PH4  
1
2
3
4
5
6
7
8
9
84 NC  
83 PD2/MISO  
82 PD1/TXD  
81 PD0RXD  
80 MODA/LIR  
79 RESET  
78 XFC  
PH5  
PH6  
PH7 10  
NC 11  
77 VDDSYN  
76 NC  
75 NC  
74 NC  
MODB/VSTBY 12  
VPPE/XIRQ 13  
NC 14  
73 EXTAL  
72 XTAL  
71  
E
VDDL 15  
70 4XOUT  
69 VDDR  
68 VSSR  
67 PC7/D7  
66 PC6/D6  
65 PC5/D5  
64 PC4/D4  
63 PC3/D3  
62 PC2/D2  
61 PC1/D1  
60 PC0/D0  
59 IRQ  
VSSL 16  
NC 17  
NC 18  
R/W/PG7 19  
LCDBP/PG6 20  
SS2/PG5 21  
SCK2/PG4 22  
MOSI2/PG3 23  
MISO2/PG2 24  
TXD2/PG1 25  
NC 26  
NC 27  
NC 28  
58 NC  
57 NC  
Figure 2-2 112-pin TQFP pinout  
2.1  
VDD and VSS  
Power is supplied to the microcontroller via these pins. VDD is the positive supply and VSS is  
ground. The MCU operates from a single 5V (nominal) power supply.  
It is in the nature of CMOS designs that very fast signal transitions occur on the MCU pins.These short  
rise and fall times place very high short-duration current demands on the power supply. To prevent  
noise problems, special care must be taken to provide good power supply bypassing at the MCU.  
Bypass capacitors should have good high-frequency characteristics and be as close to the MCU as  
possible. Bypassing requirements vary, depending on how heavily the MCU pins are loaded.  
The MC68HC11PH8 MCU has five VDD pins and five VSS pins. One pair of these pins is reserved for  
supplying power to the analog-to-digital converter (VDD AD, VSS AD); two pairs are used for the  
internal logic (VDD, VSS); the remaining two pairs supply power for the port logic on either half of the  
chip (VDDL, VSSL and VDDR, VSSR). This arrangement minimizes the injection of noise into the  
digital circuitry on the chip.  
TPG  
MOTOROLA  
2-2  
PIN DESCRIPTIONS  
MC68HC11PH8  
2.2  
RESET  
2
An active low bidirectional control signal, RESET, acts as an input to initialize the MCU to a known  
start-up state. It also acts as an open-drain output to indicate that an internal failure has been  
detected in either the clock monitor or the COP watchdog circuit.The CPU distinguishes between  
internal and external reset conditions by sensing whether the reset pin rises to a logic one in less  
than four E clock cycles after an internal reset has been released. It is therefore not advisable to  
connect an external resistor-capacitor (RC) power-up delay circuit to the reset pin of M68HC11  
devices because the circuit charge time constant can cause the device to misinterpret the type of  
reset that occurred. Refer to Section 10 for further information.  
Figure 2-3 illustrates a typical reset circuit that includes an external switch together with a low  
voltage inhibit circuit, to prevent power transitions, or RAM or EEPROM corruption.  
VDD  
VDD  
2
4.7 kΩ  
IN  
1
To M68HC11  
RESET  
RESET  
MC34064  
GND  
3
VDD  
Manual  
reset  
4.7 kΩ  
2
4.7 kΩ  
1µF  
IN  
1
RESET  
MC34164  
GND  
3
Figure 2-3 External reset circuitry  
2.3  
Crystal driver and external clock input (XTAL, EXTAL)  
These two pins provide the interface for either a crystal or a CMOS compatible clock to control the  
internal clock generator circuitry. If the PLL circuit is not being used to provide the E clock, the  
frequency applied to these pins must be four times higher than the desired E clock rate. Figure 2-4  
shows oscillator connections that should be used when the PLL is disabled, and Figure 2-5 shows the  
connections that should be used when the PLL is enabled.  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-3  
 
The XTAL pin is normally left unconnected when an external CMOS compatible clock input is  
connected to the EXTAL pin. However, a 10 kto 100 kload resistor connected from XTAL to  
ground can be used to reduce RFI noise emission. The XTAL output is normally intended to drive  
only a crystal.The XTAL output can be buffered with a high-impedance buffer, or it can be used to  
drive the EXTAL input of another M68HC11 family device (unless the PLL circuit is in use, in which  
case the 4XOUT output must be used to clock a second device; see Section 2.5).  
2
On the MC68HC11PH8, the type of internal crystal oscillator buffer is determined by a mask  
option; it can be either an inverter or a Schmitt trigger. Use of the Schmitt trigger type reduces  
problems caused by noise, in particular with slow clocks. At crystal power-up, the Schmitt trigger  
will only generate internal clocks when the crystal amplitude is sufficient. However, this type of  
buffer requires a larger XTAL amplitude and is not recommended for use with high frequency  
crystals, especially if a second MCU is to be driven. This option is not available on the  
MC68HC711PH8, on which the crystal oscillator buffer is an inverter.  
In all cases, use caution when designing circuitry associated with the oscillator pins.  
25 pF  
EXTAL  
4¥E  
crystal  
(a) Common crystal  
connections  
M68HC11  
10 MΩ  
XTAL  
25 pF  
EXTAL  
External oscillator  
(b) External oscillator  
connections  
M68HC11  
NC  
XTAL  
25 pF  
220Ω  
EXTAL  
EXTAL  
XTAL  
4¥E  
crystal  
M68HC11  
10 MΩ  
M68HC11  
NC  
XTAL  
25 pF  
(c) One crystal driving two MCUs  
Note: capacitor values include all stray capacitance.  
Figure 2-4 Oscillator connections (VDDSYN = 0, PLL disabled)  
TPG  
MOTOROLA  
2-4  
PIN DESCRIPTIONS  
MC68HC11PH8  
18 pF  
EXTAL  
XTAL  
2
(a) Common crystal connections  
(32 to 38.4 kHz crystal)  
M68HC11  
22 MΩ  
crystal  
20 pF  
25 pF  
390 kΩ  
EXTAL  
XTAL  
(a) Common crystal connections  
(500 to 2000 kHz crystal)  
M68HC11  
10 MΩ  
crystal  
25 pF  
EXTAL  
XTAL  
External oscillator  
(b) External oscillator  
connections  
M68HC11  
NC  
Note: capacitor values include all stray capacitance.  
Note: all values of capacitance and resistance shown are approximate; exact values must be calculated knowing the crystal parameters  
and the expected voltage and temperature ranges.  
Figure 2-5 Oscillator connections (VDDSYN = 1, PLL enabled)  
2.4  
E clock output (E)  
E is the output connection for the internally generated E clock. The signal from E is used as a  
timing reference. The frequency of the E clock output is one quarter that of the input frequency at  
the XTAL and EXTAL pins (except when the PLL is used as the clock source).When E clock output  
is low, an internal process is taking place; when it is high, data is being accessed. All clocks,  
including the E clock, are halted when the MCU is in STOP mode. The E clock output can be  
turned off to reduce the effects of RFI (see Section 3.3.2.5).  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-5  
2.5  
Phase-locked loop (XFC, VDDSYN, 4XOUT)  
2
The XFC and VDDSYN pins are the inputs for the on-chip PLL (phase-locked loop) circuitry. On reset,  
all system clocks are derived from the internal EXTAL signal (EXTALi). If enabled (VDDSYN high), the  
PLL uses the EXTALi frequency as a reference to generate a clock frequency that can be varied under  
software control. The user may choose to use the PLL output instead of EXTALi as the source clock  
for the system.  
The PLL consists of a variable bandwidth loop filter, a voltage controlled oscillator (VCO), a  
feedback frequency divider and a digital phase detector. PLL functions are controlled by the  
PLLCR and SYNR registers. A block diagram of the PLL circuit is shown in Figure 2-6; refer also  
to Figure 8-1.  
VDDSYN  
0.1 µF  
XTAL EXTAL STOP  
&
CXFC  
XFC  
Loop Þlter  
0.01 µF  
BCS  
VDDSYN  
fREF  
PCOMP  
VCOOUT  
Phase  
detect  
4XCLK  
VCO  
Bus clock  
select  
To clock  
generation  
circuitry  
fFB  
ST4XCK  
Module clock  
select  
Frequency divider  
For SCI  
and timer  
EXTALi  
MCS  
SYNR  
4XOUT clock  
select  
EXTALi  
4XOUT  
Key:  
External connection  
EXT4X  
Figure 2-6 PLL circuit  
If enabled by the CLK4X bit in the CONFIG register, either the 4XCLK signal or the EXTALi signal  
can be output on the 4XOUT pin, depending on the state of the EXT4X bit in the OPT2 register.  
Refer to Figure 2-6, and to Section 3 for a description of the CLK4X and EXT4X bits. The signal  
output on the 4XOUT pin could be used to clock another MCU.  
Note:  
The 4XOUT pin is not available on 84-pin packaged devices.  
TPG  
MOTOROLA  
2-6  
PIN DESCRIPTIONS  
MC68HC11PH8  
 
 
2.5.1  
PLL operation  
2
The voltage controlled oscillator (VCO) generates the PLL output frequency VCOOUT.This signal  
is fed back through a frequency divider, which divides the signal frequency by a factor determined  
by the contents of the SYNR register, to produce the feedback signal f .This signal is input to the  
FB  
phase detector along with the reference signal, f . The phase detector generates a control  
REF  
signal (PCOMP) which is a function of the phase difference between f and f . PCOMP is then  
FB  
REF  
integrated, and the resultant dc voltage (visible on XFC) is applied to the VCO, modifying the  
output signal VCOOUT to lock it in phase with f  
.
REF  
Note:  
Because the operation of the PLL depends on repeated adjustments to the voltage  
input to the VCO, a time t is required for the stabilization of the output frequency.  
PLLS  
The state of two bits in the PLLCR register, MCS and BCS, determine whether VCOOUT or  
EXTALi is used for the system clocks.  
A mask option on the MC68HC11PH8 allows the PLL circuit to be optimized for operation in either  
of two frequency ranges, as shown in Table 2-1 (this option is not available on the  
MC68HC711PH8; on this device the PLL is optimized for operation at 32kHz). Input frequencies  
other than those included in Table 2-1 can be used, but, for operation above the maximum  
frequency specified, VDDSYN should be grounded to disable the PLL and enable the high  
frequency oscillator circuit; in this state the oscillator is designed for 16MHz operation and XFC  
may be left unconnected. Refer also to Figure 2-5.  
Table 2-1 PLL mask options  
Characteristic  
Typical input frequency  
Maximum input frequency  
Mask option 1 Mask option 2  
32 kHz  
50 kHz  
614 kHz  
2 MHz  
VDDSYN is the power supply pin for the PLL and should be suitably bypassed. Connecting it high  
enables the internal low frequency oscillator circuitry designed for the PLL.The external capacitor  
on XFC (C  
) should be located as close to the chip as possible to minimize noise. In general,  
XFC  
a larger capacitor will improve the PLLs frequency stability, at the expense of increasing the time  
required for it to settle (t ) at the desired frequency. A capacitor value of 47nF is usually  
PLLS  
adequate for either 32kHz or 614kHz applications. Refer to Section A.5.2 for PLL control timing  
information.  
The PLL filter has two bandwidths that can be manually selected under control of the BWC bit in  
PLLCR. Whenever the PLL is first enabled, the wide bandwidth mode should be used, to enable  
the PLL frequency to ramp up quickly. After a time t  
has elapsed, the filter can be switched to  
PLLS  
the narrow bandwidth mode, to make the final frequency more stable.  
Warning: Bit 5 of the PLLCR (AUTO) must be cleared before an attempt is made to use BWC;  
manual bandwidth control should always be used.  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-7  
 
2.5.2  
Synchronization of PLL with subsystems  
2
If the MCS bit in PLLCR is set, then the SCI and timer clocks run off the PLL output (4XCLK) as  
does the CPU. If MCS is cleared, then the timer and SCI subsystems operate off the EXTALi  
frequency, but are accessed by the CPU relative to the internal PH2 signal. In this case, although  
EXTALi is used as the reference for the PLL, the PH2 clock and the module clocks for the timer  
and the SCI are not synchronized. In order to ensure synchronized data, special circuitry has been  
incorporated into both subsystems.  
2.5.3  
Changing the PLL frequency  
The PLL output frequency can be changed by altering the contents of the SYNR register (see  
Section 2.5.4.2).To prevent possible bursts of high frequency operation during the reconfiguration  
of the PLL, the following sequence should be performed:  
1) Switch to the low frequency bus rate (BCS = 0).  
2) Disable the PLL (PLLON = 0).  
3) Change the value in SYNR.  
4) Enable the PLL (PLLON = 1).  
5) Wait a time t  
for the PLL frequency to stabilize.  
PLLS  
6) Switch to the high frequency bus rate (BCS = 1).  
2.5.4  
PLL registers  
Two registers are used to control the operation of the MC68HC11PH8 phase locked loop circuitry.  
These are the PLL control register and the synthesizer program register, each of which is  
described below.  
TPG  
MOTOROLA  
2-8  
PIN DESCRIPTIONS  
MC68HC11PH8  
2.5.4.1  
PLLCR — PLL control register  
2
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
PLL control (PLLCR)  
$002E PLLON BCS AUTO BWC VCOT MCS T16EN WEN x010 1010  
This read/write register contains two bits that are used to enable and disable the synthesizer and  
to switch from slow (EXTALi) to one of the fast speeds.Two further bits are used to control the filter  
bandwidth. The SCI, timer, timer clock source and the slow clock for WAIT mode are also  
controlled by this register.  
PLLON — PLL on  
1 (set)  
Switch PLL on.  
0 (clear) – Switch PLL off.  
This bit activates the synthesizer circuit without connecting it to the control circuit. This allows the  
circuit to stabilize before it drives the CPU clocks.  
On reset, PLLON is forced low if the VDDSYN supply is low. If VDDSYN is at VDD, PLLON is set  
by reset to allow the control loop to stabilize during power-up. PLLON cannot be cleared whilst  
using VCOOUT to drive the internal processor clock, i.e. when BCS is set.  
BCS — Bus clock select  
1 (set)  
VCOOUT output drives the clock circuit (4XCLK).  
0 (clear) – EXTALi drives the clock circuit (4XCLK).  
This bit determines which signal drives the clock circuit generating the bus clocks. Once BCS has  
been altered it can take up to [1.5 EXTALi + 1.5 VCOOUT] cycles for the change in the clock to  
occur. Reset clears this bit.  
Note:  
PLLON and BCS have built-in safeguards so that VCOOUT cannot be selected as the  
clock source (BCS = 1) if the PLL is off (PLLON = 0). Similarly, the PLL cannot be  
turned off (PLLON = 0) if it is on and in use (BCS = 1).Turning the PLL on and selecting  
VCOOUT as the clock source therefore requires two independent writes to PLLCR.  
AUTO — Automatic bandwidth control (Test mode only)  
1 (set) Automatic bandwidth control selected.  
0 (clear) – Manual bandwidth control selected.  
Reset sets this bit.  
Warning: This bit must be cleared before an attempt is made to use BWC; manual bandwidth  
control should always be used.  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-9  
 
BWC — Bandwidth control  
1 (set) Wide (high and low) bandwidth control selected.  
2
0 (clear) – Narrow (low) bandwidth control selected.  
Bandwidth selection can only be controlled by BWC when AUTO is cleared. After the PLL is first  
enabled, or after a change in frequency, a delay of t  
is required before clearing BWC.The low  
PLLS  
bandwidth driver is always enabled, so this bit determines whether the high bandwidth driver is on  
or off. Reset clears this bit.  
VCOT — VCO test (Test mode only)  
1 (set)  
Loop filter operates as specified by AUTO and BWC.  
0 (clear) – Low bandwidth mode of the PLL filter is disabled.  
This bit is used to isolate the loop filter from the VCO for testing purposes. VCOT is always set in  
user modes. This bit is writable only in bootstrap and test modes. Reset sets this bit.  
MCS — Module clock select  
1 (set)  
0 (clear) – EXTALi is the source for the SCI and timer divider chain.  
Reset clears this bit.  
4XCLK is the source for the SCI and timer divider chain.  
T16EN — 16-bit timer clock enable (refer to Section 8)  
1 (set) 16-bit timer clock enabled.  
0 (clear) – 16-bit timer clock disabled.  
WEN — WAIT enable  
1 (set) Low-power WAIT mode selected (PLL set to ‘idle’ in WAIT mode).  
0 (clear) – Do not alter the 4XCLK during WAIT mode.  
This bit determines whether the 4XCLK is disconnected from VCOOUT during WAIT and  
connected to EXTALi. Reset clears this bit.  
When WEN is set, the CPU will respond to a WAIT instruction by first stacking the relevant  
registers, then by clearing BCS and setting the PLL to ‘idle’, with modulus = 1. BWC is set so that  
the wide bandwidth control is selected.  
Any interrupt, any reset, or the assertion of RAF (receiver active flag) in either of the SCIs will allow  
the PLL to resume operating at the frequency specified in the SYNR.The user must set BCS after  
the PLL has had time to adjust (t  
). If, for a specific SCI, the RE bit (receiver enable bit) is clear,  
PLLS  
then RAF cannot become set, hence the PLL will not resume normal operation. For a description  
of RAF and RE, see Section 5.  
TPG  
MOTOROLA  
2-10  
PIN DESCRIPTIONS  
MC68HC11PH8  
2.5.4.2  
SYNR — Synthesizer program register  
2
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Synthesizer program (SYNR)  
$002F SYNX1 SYNX0 SYNY5 SYNY4 SYNY3 SYNY2 SYNY1 SYNY0 0000 1011  
The PLL frequency synthesizer multiplies the frequency of the input oscillator. The multiplication  
factor is software programmable via a loop divider, which consists of a six-bit modulo N counter,  
with a further two bit scaling factor.  
X
The multiplication factor is given by 2(Y + 1)2 , where 0 X 3 and 0 Y 63.  
Bits in SYNR can be read at any time but can only be written if PLLON = 0.  
Note:  
Exceeding recommended operating frequencies can result in indeterminate MCU  
operation.  
SYNX[1:0]  
These bits program the binary taps (divide by 1, 2, 4 and 8). Reset clears these bits.  
SYNY[5:0]  
These bits program the six-bit modulo N (1 to 64) counter. Reset sets these bits to %001011.  
Note:  
The resolution of the multiplication factors decreases by a factor of two, as X increases:  
X
0
1
2
3
Y
Possible multipliers  
0 Ð 63 2, 4, 6, 8, É, 128  
0 Ð 63 4, 8, 12, 16, É, 256  
0 Ð 63 8, 16, 24, 32, É, 512  
0 Ð 63 16, 32, 48, 64, É, 1024  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-11  
2.6  
Interrupt request (IRQ)  
2
The IRQ input provides a means of applying asynchronous interrupt requests to the MCU. Either  
falling edge sensitive triggering or level sensitive triggering is program selectable (OPTION  
register). IRQ is always configured to level sensitive triggering at reset.  
Note:  
Connect an external pull-up resistor, typically 4.7 k, to V when IRQ is used in a level  
DD  
sensitive wired-OR configuration. See also Section 2.7.  
2.7  
Nonmaskable interrupt (XIRQ/VPPE)  
The XIRQ input provides a means of requesting a nonmaskable interrupt after reset initialization.  
During reset, the X bit in the condition code register (CCR) is set and any interrupt is masked until  
MCU software enables it. Because the XIRQ input is level-sensitive, it can be connected to a  
multiple-source wired-OR network with an external pull-up resistor to V . XIRQ is often used as  
DD  
a power loss detect interrupt.  
Whenever XIRQ or IRQ is used with multiple interrupt sources (IRQ must be configured for level  
sensitive operation if there is more than one source of IRQ interrupt), each source must drive the  
interrupt input with an open-drain type of driver to avoid contention between outputs.There should  
be a single pull-up resistor near the MCU interrupt input pin (typically 4.7 k).There must also be  
an interlock mechanism at each interrupt source so that the source holds the interrupt line low until  
the MCU recognizes and acknowledges the interrupt request. If one or more interrupt source is  
still pending after the MCU services a request, the interrupt line will still be held low and the MCU  
will be interrupted again as soon as the interrupt mask bit in the MCU is cleared (normally upon  
return from an interrupt). Refer to Section 10.  
On the MC68HC711PH8, the VPPE pin is used to input the external EPROM programming  
voltage, which must be present during EPROM programming.  
TPG  
MOTOROLA  
2-12  
PIN DESCRIPTIONS  
MC68HC11PH8  
2.8  
MODA and MODB (MODA/LIR and MODB/VSTBY)  
2
During reset, MODA and MODB select one of the four operating modes. Refer to Section 3.  
After the operating mode has been selected, the LIR pin provides an open-drain output (driven  
low) to indicate that execution of an instruction has begun. In order to detect consecutive  
instructions in a high-speed application, this signal drives high for a short time to prevent false  
triggering. A series of E clock cycles occurs during execution of each instruction. The LIR signal  
goes low during the first E clock cycle of each instruction (opcode fetch). This output is provided  
for assistance in program debugging and its operation is controlled by the LIRDV bit in the OPT2  
register.  
The VSTBY pin is used to input RAM stand-by power. The MCU is powered from the VDD pin  
unless the difference between the level of VSTBY and VDD is greater than one MOS threshold  
(about 0.7 volts). When these voltages differ by more than 0.7 volts, the internal 1024-byte RAM  
and part of the reset logic are powered from VSTBY rather than VDD. This allows RAM contents  
to be retained without VDD power applied to the MCU. Reset must be driven low before V is  
DD  
removed and must remain low until V has been restored to a valid level.  
DD  
VDD  
4.7kΩ  
To MODB/VSTBY  
pin of M68HC11  
VDD  
MAX 690  
VBATT  
VOUT  
4.8 V NiCd  
(+)  
Figure 2-7 RAM stand-by connections  
2.9  
VRH and VRL  
These pins provide the reference voltages for the analog-to-digital converter.  
2.10  
PG7/R/W  
This pin provides two separate functions, depending on the operating mode. In single chip and  
bootstrap modes, PG7/R/W acts as input/output port G bit 7. Refer to Section 4 for further information.  
In expanded and test modes, PG7/R/W performs the read/write function. PG7/R/W signals the  
direction of transfers on the external data bus. A high on this pin indicates that a read cycle is in  
progress.  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-13  
2.11  
Port signals  
2
62 pins on the device are arranged into seven 8-bit ports: A, B, C, E, F, G, and H, and one six-bit  
port (D). The lines of ports A, B, C, D, F, G, and H are fully bidirectional; E is input only. Each of  
the bidirectional ports serves a purpose other than I/O, depending on the operating mode or  
peripheral function selected. Note that ports B, C, F, and one bit of port G are available for I/O  
functions only in single chip and bootstrap modes. Refer to Table 2-2 for details of the port signals’  
functions in different operating modes.  
Note:  
When using the information about port functions, do not confuse pin function with the  
electrical state of the pin at reset. All general purpose I/O pins configured as inputs at  
reset are in a high-impedance state. Port data registers reflect the functional state of  
the port at reset. The pin function is mode dependent.  
2.11.1  
Port A  
Port A is an 8-bit general purpose I/O port with a data register (PORTA) and a data direction  
register (DDRA). Port A pins share functions with the 16-bit timer system (see Section 8 for further  
information). PORTA can be read at any time and always returns the pin level. If written, PORTA  
stores the data in internal latches.The pins are driven only if they are configured as outputs.Writes  
to PORTA do not change the pin state when the pins are configured for timer output compares.  
Out of reset, port A pins [7:0] are general purpose high-impedance inputs. When the functions  
associated with these pins are disabled, the bits in DDRA govern the I/O state of the associated  
pin. For further information, refer to Section 4.  
2.11.2  
Port B  
Port B is an 8-bit general purpose I/O port with a data register (PORTB) and a data direction  
register (DDRB). In single chip mode, port B pins are general purpose I/O pins (PB[7:0]). In  
expanded mode, port B pins act as the high-order address lines (A[15:8]) of the address bus. In  
either of these modes, the four high-order port B pins (B[7:4]) may be configured to drive four LCD  
segments (see Section 2.12)  
PORTB can be read at any time and always returns the pin level. If PORTB is written, the data is  
stored in internal latches. The pins are driven only if they are configured as outputs in single chip  
or bootstrap mode. For further information, refer to Section 4.  
Port B pins include on-chip pull-up devices which can be enabled or disabled via the port pull-up  
assignment register (PPAR).  
TPG  
MOTOROLA  
2-14  
PIN DESCRIPTIONS  
MC68HC11PH8  
Table 2-2 Port signal functions  
2
Single chip  
and  
bootstrap mode  
Expanded multiplexed  
Port/bit  
and  
special test mode  
PA0  
PA1  
PA0/IC3  
PA1/IC2  
PA2/IC1  
PA2  
PA3  
PA3/OC5/IC4 and/or OC1  
PA4/OC4 and/or OC1  
PA5/OC3 and/or OC1  
PA6/OC2 and/or OC1  
PA7/PAI and/or OC1  
PA4  
PA5  
PA6  
PA7  
PB[3:0]  
PB4  
PB5  
PB6  
PB7  
PC[7:0]  
PD0  
PD1  
PD2  
PD3  
PD4  
PD5  
PE[7:0]  
PF[7:0]  
PG0  
PG1  
PG2  
PG3  
PG4  
PG5  
PG6  
PG7  
PH0  
PH1  
PH2  
PH3  
PH4  
PH5  
PH6  
PH7  
PB[3:0]  
A[11:8]  
A12/LCD4  
A13/LCD5  
A14/LCD6  
A15/LCD7  
D[7:0]  
PB4/LCD4  
PB5/LCD5  
PB6/LCD6  
PB7/LCD7  
PC[7:0]  
PD0/RXD1  
PD1/TXD1  
PD2/MISO1  
PD3/MOSI1  
PD4/SCK1  
PD5/SS1  
Input only or analog inputs  
PF[7:0] A[7:0]  
PG0/RXD2  
PG1/TXD2  
PG2/MISO2  
PG3/MOSI2  
PG4/SCK2  
PG5/SS2  
PG6/LCDBP  
PG7  
R/W  
PH0/PW1  
PH1/PW2  
PH2/PW3  
PH3/PW4  
PH4  
PH5  
PH6/Modulus timer C clock input  
PH7/Modulus timer B clock input  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-15  
2.11.3  
Port C  
2
Port C is an 8-bit general purpose I/O port with a data register (PORTC) and a data direction  
register (DDRC). In single chip mode, port C pins are general purpose I/O pins (PC[7:0]). In the  
expanded mode, port C pins are configured as data bus pins (D[7:0]).  
PORTC can be read at any time and always returns the pin level. If PORTC is written, the data is  
stored in internal latches. The pins are driven only if they are configured as outputs in single chip  
or bootstrap mode. Port C pins are general purpose inputs out of reset in single chip and bootstrap  
modes. In expanded and test modes, these pins are data bus lines out of reset.  
The CWOM control bit in the OPT2 register disables port C’s p-channel output drivers. Because  
the n-channel driver is not affected by CWOM, setting CWOM causes port C to become an  
open-drain-type output port suitable for wired-OR operation. In wired-OR mode (PORTC bits at  
logic level zero), the pins are actively driven low by the n-channel driver. When a port C bit is at  
logic level one, the associated pin is in a high impedance state as neither the n-channel nor the  
p-channel devices are active. It is customary to have an external pull-up resistor on lines that are  
driven by open-drain devices. Port C can only be configured for wired-OR operation when the  
MCU is in single chip mode. For further information, refer to Section 4.  
2.11.4  
Port D  
Port D, a 6-bit general purpose I/O port, has a data register (PORTD) and a data direction register  
(DDRD). The six port D lines (D[5:0]) can be used for general purpose I/O, for one of the serial  
communications interfaces (SCI1, pins [1,0]) and for one of the serial peripheral interfaces (SPI1,  
pins [5:2]).  
PORTD can be read at any time; inputs return the pin level and outputs return the pin driver input  
level. If PORTD is written, the data is stored in internal latches. The pins are driven only if port D  
is configured for general purpose output.  
The DWOM bit in SPCR disables the p-channel output drivers of pins D[5:2], and the WOMS bit  
in SCCR1 disables those of pins D[1,0]. Because the n-channel driver is not affected by DWOM  
or WOMS, setting either bit causes the corresponding port D pins to become open-drain-type  
outputs suitable for wired-OR operation. In wired-OR mode (PORTD bits at logic level zero), the  
pins are actively driven low by the n-channel driver. When a port D bit is at logic level one, the  
associated pin is in a high impedance state as neither the n-channel nor the p-channel devices  
are active. It is customary to have an external pull-up resistor on lines that are driven by open-drain  
devices. Port D can be configured for wired-OR operation when the MCU is in single chip mode  
or expanded mode.  
For further information, refer to Section 4, Section 5 (SCI) and Section 7 (SPI).  
TPG  
MOTOROLA  
2-16  
PIN DESCRIPTIONS  
MC68HC11PH8  
2.11.5  
Port E  
2
Port E, PE/AD[7:0], is an input-only port that can also be used as the analog inputs for the  
analog-to-digital converter.  
For further information, refer to Section 4 and Section 9 (A/D).  
2.11.6  
Port F  
Port F is an 8-bit general purpose I/O port with a data register (PORTF) and a data direction  
register (DDRF). In single chip mode, port F pins are general purpose I/O pins (PF[7:0]). In  
expanded mode, port F pins act as the low-order address lines (A[7:0]) of the address bus.  
PORTF can be read at any time and always returns the pin level. If PORTF is written, the data is  
stored in internal latches. The pins are driven only if they are configured as outputs in single chip  
or bootstrap mode.  
Port F pins include on-chip pull-up devices that can be enabled or disabled via the port pull-up  
assignment register (PPAR). For further information, refer to Section 4.  
2.11.7  
Port G  
In normal modes, Port G is an 8-bit general purpose I/O port with a data register (PORTG) and a  
data direction register (DDRG). Port G pin 7 is the R/W line in expanded mode; pin 6 can be used  
for the LCD backplane signal (LCDBP) in any mode; the remaining pins can be used for general  
purpose I/O, for one of the SCI subsystems (SCI2 with MI-bus, pins [1,0]), or for one of the serial  
peripheral interface subsystems (SPI2, pins [5:2]).  
PORTG can be read at any time; inputs return the pin level and outputs return the pin driver input  
level. If PORTG is written, the data is stored in internal latches.The pins are driven only if they are  
configured as outputs (and only in single chip or bootstrap mode for pins G[7,6]).  
The GWOM bit in SP2CR disables the p-channel output drivers of pins G[5:2], and the WOMS2  
bit in S2CR1 disables those of pins G[1,0]. Because the n-channel driver is not affected by GWOM  
or WOMS2, setting either bit causes the corresponding port G pins to become open-drain-type  
outputs suitable for wired-OR operation. In wired-OR mode (appropriate PORTG bits at logic level  
zero), the pins are actively driven low by the n-channel driver. When a port G bit is at logic level  
one, the associated pin is in a high impedance state as neither the n-channel nor the p-channel  
devices are active. It is customary to have an external pull-up resistor on lines that are driven by  
open-drain devices. Port G pins [5:0] can be configured for wired-OR operation when the MCU is  
in single chip mode or expanded mode.  
Port G pins include on-chip pull-up devices that can be enabled or disabled via the port pull-up  
assignment register (PPAR). For further information, refer to Section 4, Section 5 (SCI), Section 6  
(MI BUS) and Section 7 (SPI).  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-17  
2.11.8  
Port H  
2
Port H is an 8-bit general purpose I/O port with a data register (PORTH) and a data direction  
register (DDRH). Port H pins support either input/output, pulse-width modulation channels (pins  
[3:0]) or act as clock inputs for two of the 8-bit modulus timers (pins [7,6]).  
PORTH can be read at any time and always returns the pin level.  
Port H pins include on-chip pull-up devices that can be enabled or disabled via the port pull-up  
assignment register (PPAR). Port H pins can be configured for wired-OR interrupt to wake-up from  
WAIT or STOP mode under control of the wired-OR interrupt register (WOIEH).  
For further information, refer to Section 4 and Section 8 (timer system).  
2.12  
LCD module  
The MC68HC11PH8 incorporates an LCD module that allows four LCD segments to be driven  
under control of the LCD control and data register. The four frontplane signals are output on port  
B pins [7:4], with the backplane signal output on PG6. A segment is ON when the corresponding  
frontplane and backplane are equal in frequency and opposite in phase.The LCD function can be  
enabled in any mode.  
2.12.1  
LCDR — LCD control and data register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
bit 0  
LCD control and data (LCDR)  
$002D LCD7 LCD6 LCD5 LCD4  
LCDCK LCDE 0000 0000  
LCD[7:4] — LCD segment data  
1 (set)  
Segment ON (corresponding LCD output port B is opposite in phase  
to LCDBP).  
0 (clear) – Segment OFF (corresponding LCD output port B is in phase with  
LCDBP).  
When LCD[7:4] are all cleared, the LCD backplane is forced low and all the LCD segments are  
off, thus reducing power consumption and RFI emissions.  
This is not the case on early versions of the MC68HC711PH8; contact your local Motorola  
Sales Representative for more information.  
TPG  
MOTOROLA  
2-18  
PIN DESCRIPTIONS  
MC68HC11PH8  
 
LCDCK — LCD frequency clock select  
1 (set) The clock source of the real time interrupt (RTI) toggles LCDBP.  
2
0 (clear) – 8-bit modulus timer A underflow (CLK64) toggles LCDBP.  
When the PLL clock generation circuit is not used (VDDSYN = 0), setting LCDCK selects the  
18  
ST4XCK clock divided by 2 as the LCD clock source. Conversely, when the PLL clock  
generation circuit is used (VDDSYN = 1), setting LCDCK selects the output of the 8-bit modulus  
3
3
timer A divided by 2 (CLK64/2 ) as the LCD clock source. Refer to Section 8.  
LCDE — LCD function enable  
1 (set)  
LCD function enabled.  
0 (clear) – LCD function disabled.  
The LCDE bit can be written only once (the first write to this register after reset will prevent later  
updates of this bit). When enabled, this function will force PG6 into output mode. This output will  
be the backplane signal (LCDBP) for the four LCD segments. The four port B pins (PB[7:4]) used  
to drive the LCD segments will also be forced into output mode. If enabled in expanded modes,  
PB[7:4] will operate as LCD outputs, while PB3 to PB0 output the address lines to access external  
resources. To avoid conflicts caused by the LCDE bit being set accidentally by program error, it is  
recommended that the LCDE bit be written to zero if the LCD function is not required.  
TPG  
MC68HC11PH8  
PIN DESCRIPTIONS  
MOTOROLA  
2-19  
2
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
2-20  
PIN DESCRIPTIONS  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
3
3
OPERATING MODES AND ON-CHIP MEMORY  
4
This section contains information about the modes that define MC68HC11PH8 operating conditions,  
and about the on-chip memory that allows the MCU to be configured for various applications.  
5
3.1  
Operating modes  
6
The values of the mode select inputs MODB and MODA during reset determine the operating  
mode (See Table 3-4). Single chip and expanded modes are the normal modes. In single chip  
mode only on-board memory is available. Expanded mode, however, allows access to external  
memory. Each of these two normal modes is paired with a special mode. Bootstrap, a variation of  
the single chip mode, is a special mode that executes a bootloader program in an internal  
bootstrap ROM. Test is a special mode that allows privileged access to internal resources.  
7
8
3.1.1  
Single chip operating mode  
9
In single chip operating mode, the MC68HC11PH8 microcontroller has no external address or  
data bus. Ports B, C, F, and the R/W pin are available for general purpose parallel I/O.  
10  
11  
12  
13  
14  
15  
3.1.2  
Expanded operating mode  
In expanded operating mode, the MCU can access a 64K byte physical address space. The  
address space includes the same on-chip memory addresses used for single chip mode, in  
addition to external memory and peripheral devices.  
The expansion bus is made up of ports B, C, and F, and the R/W signal. In expanded mode, high  
order address bits are output on the port B pins, low order address bits on the port F pins, and the  
data bus on port C. The R/W/PG7 pin signals the direction of data transfer on the port C bus.  
When internal resources are accessed in expanded mode, the last external address can be held on  
the output pins (A[15:0]) in order to reduce radio-frequency interference (RFI) emissions.This function  
is controlled by the FREEZ bit in the CONFIG register. See Section 3.3.2.1 for a description of this bit.  
To allow access to slow peripherals, off chip accesses can be extended by one E clock cycle, under  
control of the STRCH and STRX bits (in the OPT2 and INIT2 registers respectively). The E clock  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-1  
 
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
stretches externally, but the internal clocks are not affected so that timers and serial systems are not  
corrupted. See Section 3.3.2.5.  
EEPROM data can be protected while in expanded mode, using a security feature described in  
Section 3.4.4.  
3
3.1.3  
Special test -mode  
Special test, a variation of the expanded mode, is primarily used during Motorola’s internal  
production testing; however, it is accessible for programming the CONFIG register, programming  
calibration data into EEPROM, and supporting emulation and debugging during development.  
4
5
3.1.4  
Special bootstrap mode  
6
When the MCU is reset in special bootstrap mode, a small on-chip ROM is enabled at address  
$BE40–$BFFF.The ROM contains a reset vector and a bootloader program.The MCU fetches the  
reset vector, then executes the bootloader.  
7
For normal use of the bootloader program, send a synchronization byte $FF to the SCI receiver  
at either E clock ÷256, or E clock ÷1664 (7812 or 1200 baud respectively, for an E clock of 2MHz).  
Then download up to 2048 bytes of program data (which is put into RAM starting at $0080).These  
characters are echoed through the transmitter. The bootloader program ends the download after  
a timeout of four character times or 2048 bytes. When loading is complete, the program jumps to  
location $0080 and begins executing the code. Use of an external pull-up resistor is required when  
using the SCI transmitter pin (TXD) because port D pins are configured for wired-OR operation by  
the bootloader. In bootstrap mode, the interrupt vectors point to RAM. This allows the use of  
interrupts through a jump table.  
8
9
Further baud rate options are available on the MC68HC11PH8 by using a different value for the  
synchronization byte, as shown in the Table 3-1.  
10  
11  
12  
13  
14  
15  
A special mode exists that allows a low frequency crystal to be used if the PLL is active. In this case,  
the value on port F is loaded into the SYNR register just after reset, to be used as the multiplication  
factor for the crystal frequency. If the PLL is not active, then the bootloader runs at the crystal  
frequency. Refer to Section 2.5 for more information on the operation of the PLL circuitry.  
Refer also to Motorola application note AN1060, M68HC11 Bootstrap Mode (the bootloader  
mode is similar to that used on the MC68HC11K4).  
TPG  
MOTOROLA  
3-2  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
Table 3-1 Example bootloader baud rates  
Timeou  
t
Baud rates for an E clock of:  
2.00MHz 2.10MHz 3.00MHz 3.15MHz 4.00MHz  
Sync.  
byte  
delay  
$FF  
$FF  
$F0  
$FD  
$FD  
4 char.  
4
7812  
1200  
9600  
5208  
3906  
8192  
1260  
10080  
5461  
4096  
11718  
1800  
14400  
7812  
5859  
12288  
1890  
15120  
8192  
6144  
15624  
2400  
3
4.9  
19200  
10416  
7812  
17.3  
13  
4
5
3.2  
On-chip memory  
The MC68HC11PH8 MCU includes 2K bytes of on-chip RAM, 48K bytes of ROM/EPROM and 768  
bytes of EEPROM. The bootloader ROM occupies a 512 byte block of the memory map. The  
CONFIG register is implemented as a separate EEPROM byte.  
6
7
Start  
address  
$0000  
$0080  
$x000  
Register  
block  
Each of these blocks  
can be mapped to any  
4K page boundary,  
$x07F  
$x080  
$0880  
RAM  
8
using the INIT register.  
2K bytes  
$0D00  
$1000  
$x87F  
$xD00  
This block may be remapped  
to any 4K page, using INIT2.  
EEPROM  
768 bytes  
$xFFF  
$BE40  
9
BootROM  
Vectors  
Special bootstrap mode only.  
Special modes only.  
$BFFF  
$4000  
$4000  
48K bytes ROM  
10  
11  
12  
13  
14  
15  
(MC68HC11PH8) or  
48K bytes EPROM  
(MC68HC711PH8).  
$BE40  
$C000  
NVM  
48K bytes  
Can be mapped to either  
$0000Ð$BFFF or  
$4000Ð$FFFF,  
using the CONFIG register.  
$FFBF  
$FFFF  
$FFC0  
Vectors  
Normal mode vectors.  
Ñ$FFFF  
Single  
chip  
Expanded  
Special  
bootstrap  
Special  
test  
Figure 3-1 MC68HC11PH8/MC68HC711PH8 memory map  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-3  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3.2.1  
Mapping allocations  
Memory locations for on-chip resources are the same for both expanded and single chip modes. The  
128-byte register block originates at $0000 after reset and can be placed at any other 4K boundary  
($x000) after reset by writing an appropriate value to the INIT register.Refer to Figure 3-1, which shows  
the memory map.  
3
The on-board 2K byte RAM is initially located at $0080 after reset. The RAM is divided into two  
sections, of 128 bytes and 1920 bytes. If RAM and registers are both mapped to the same 4K  
boundary, RAM starts at $x080 and 128 bytes are remapped at $x800–$x87F. Otherwise, RAM  
starts at $x000. See Figure 3-3.  
4
Remapping is accomplished by writing appropriate values into the two nibbles of the INIT register.  
See Section 3.3.2.2.  
5
The 768-byte EEPROM is initially located at $0D00 after reset, when EEPROM is enabled in the  
memory map by the CONFIG register. EEPROM can be placed in any other 4K page ($xD00) by  
writing to the INIT2 register.  
6
The ROMAD and ROMON bits in the CONFIG register control the position and presence of ROM,  
or EPROM, in the memory map. In special test mode, the ROMON bit is cleared so the ROM is  
removed from the memory map. In single chip mode, the ROMAD bit is set to one after reset,  
which enables the ROM at $4000–$FFFF. In expanded mode, the ROM may be enabled from  
$0000–$BFFF (ROMAD = 0) to allow an external memory to contain the interrupt vectors and  
initialization code.  
7
8
In special bootstrap mode, a bootloader ROM is enabled at locations $BE40–$BFFF. The vectors  
for special bootstrap mode are contained in the bootloader program. The boot ROM occupies a  
512 byte block of the memory map, though not all locations are used.  
9
3.2.1.1  
RAM  
10  
11  
12  
13  
14  
15  
The MC68HC11PH8 has 2K bytes of fully static RAM that are used for storing instructions,  
variables and temporary data during program execution. RAM can be placed at any 4K boundary  
in the 64K byte address space by writing an appropriate value to the INIT register.  
By default, RAM is initially located at $0080 in the memory map. Direct addressing mode can  
access the first 128 locations of RAM using a one-byte address operand. Direct mode accesses  
save program memory space and execution time. Registers can be moved to other boundaries to  
allow 256 bytes of RAM to be located in direct addressing space. See Figure 3-3.  
The on-chip RAM is a fully static memory. RAM contents can be preserved during periods of  
processor inactivity by either of two methods, both of which reduce power consumption:  
TPG  
MOTOROLA  
3-4  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
1) During the software-based STOP mode, MCU clocks are stopped, but the  
MCU continues to draw power from V . Power supply current is directly  
DD  
related to operating frequency in CMOS integrated circuits and there is very  
little leakage when the clocks are stopped.These two factors reduce power  
consumption while the MCU is in STOP mode.  
2) To reduce power consumption to a minimum, V can be turned off, and the  
DD  
3
MODB/VSTBY pin can be used to supply RAM power from either a battery  
back-up or a second power supply. Although this method requires external  
hardware, it is very effective. Refer to Section 2 for information about how to  
connect the stand-by RAM power supply and to Section 10 for a description  
of low power operation.  
4
5
3.2.1.2  
ROM and EPROM  
The MCU has 48K bytes of ROM/EPROM.The ROM/EPROM array is enabled when the ROMON  
bit in the CONFIG register is set to one (erased). The ROMAD bit in CONFIG places the  
ROM/EPROM at either $4000–$FFFF (ROMAD = 1) or at $0000–$BFFF (ROMAD = 0) when  
coming out of reset in expanded mode.  
6
7
3.2.1.3  
Bootloader ROM  
The bootloader ROM is enabled at address $BE40–$BFFF during special bootstrap mode. The  
reset vector is fetched from this ROM and the MCU executes the bootloader firmware. In normal  
modes, the bootloader ROM is disabled.  
8
9
3.2.2  
Registers  
10  
11  
12  
13  
14  
15  
In Table 3-2, a summary of registers and control bits, the registers are shown in ascending order  
within the 128-byte register block. The addresses shown are for default block mapping  
($0000–$007F), however, the INIT register remaps the block to any 4K page ($x000–$x07F). See  
Section 3.3.2.2.  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-5  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
Table 3-2 Register and control bit assignments (Sheet 1 of 4)  
State  
on reset  
Register name  
Address bit 7  
$0000 PA7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Port A data (PORTA)  
Data direction A (DDRA)  
PA6  
PA5  
PA4  
PA3  
PA2  
PA1  
PA0 undeÞned  
3
$0001 DDA7 DDA6 DDA5 DDA4 DDA3 DDA2 DDA1 DDA0 0000 0000  
$0002 DDB7 DDB6 DDB5 DDB4 DDB3 DDB2 DDB1 DDB0 0000 0000  
$0003 DDF7 DDF6 DDF5 DDF4 DDF3 DDF2 DDF1 DDF0 0000 0000  
Data direction B (DDRB)  
Data direction F (DDRF)  
4
Port B data (PORTB)  
$0004  
$0005  
$0006  
PB7  
PF7  
PC7  
PB6  
PF6  
PC6  
PB5  
PF5  
PC5  
PB4  
PF4  
PC4  
PB3  
PF3  
PC3  
PB2  
PF2  
PC2  
PB1  
PF1  
PC1  
PB0 undeÞned  
PF0 undeÞned  
PC0 undeÞned  
Port F data (PORTF)  
Port C data (PORTC)  
5
Data direction C (DDRC)  
Port D data (PORTD)  
$0007 DDC7 DDC6 DDC5 DDC4 DDC3 DDC2 DDC1 DDC0 0000 0000  
$0008  
$0009  
0
0
0
0
PD5  
PD4  
PD3  
PD2  
PD1  
PD0 undeÞned  
Data direction D (DDRD)  
Port E data (PORTE)  
DDD5 DDD4 DDD3 DDD2 DDD1 DDD0 0000 0000  
6
$000A PE7  
PE6  
PE5  
PE4  
PE3  
PE2  
0
PE1  
0
PE0 undeÞned  
Timer compare force (CFORC)  
Output compare 1 mask (OC1M)  
Output compare 1 data (OC1D)  
Timer count (TCNT) high  
Timer count (TCNT) low  
$000B FOC1 FOC2 FOC3 FOC4 FOC5  
$000C OC1M7 OC1M6 OC1M5 OC1M4 OC1M3  
$000D OC1D7 OC1D6 OC1D5 OC1D4 OC1D3  
0
0
0
0000 0000  
0000 0000  
0000 0000  
0
0
7
0
0
$000E (bit 15) (14)  
$000F (bit 7) (6)  
$0010 (bit 15) (14)  
$0011 (bit 7) (6)  
$0012 (bit 15) (14)  
$0013 (bit 7) (6)  
$0014 (bit 15) (14)  
$0015 (bit 7) (6)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
OM5  
(bit 8) 0000 0000  
(bit 0) 0000 0000  
(bit 8) undeÞned  
(bit 0) undeÞned  
(bit 8) undeÞned  
(bit 0) undeÞned  
(bit 8) undeÞned  
(bit 0) undeÞned  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
OL5 0000 0000  
8
Timer input capture 1 (TIC1) high  
Timer input capture 1 (TIC1) low  
Timer input capture 2 (TIC2) high  
Timer input capture 2 (TIC2) low  
Timer input capture 3 (TIC3) high  
Timer input capture 3 (TIC3) low  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
9
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
10  
11  
12  
13  
14  
15  
Timer output compare 1 (TOC1) high $0016 (bit 15) (14)  
Timer output compare 1 (TOC1) low $0017 (bit 7) (6)  
Timer output compare 2 (TOC2) high $0018 (bit 15) (14)  
Timer output compare 2 (TOC2) low $0019 (bit 7) (6)  
Timer output compare 3 (TOC3) high $001A (bit 15) (14)  
Timer output compare 3 (TOC3) low $001B (bit 7) (6)  
Timer output compare 4 (TOC4) high $001C (bit 15) (14)  
Timer output compare 4 (TOC4) low $001D (bit 7) (6)  
Capture 4/compare 5 (TI4/O5) high $001E (bit 15) (14)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
Capture 4/compare 5 (TI4/O5) low  
Timer control 1 (TCTL1)  
$001F (bit 7)  
$0020 OM2  
(6)  
OL2  
OM3  
OL3  
OM4  
OL4  
Timer control 2 (TCTL2)  
$0021 EDG4B EDG4A EDG1B EDG1A EDG2B EDG2A EDG3B EDG3A 0000 0000  
$0022 OC1I OC2I OC3I OC4I I4/O5I IC1I IC2I IC3I 0000 0000  
Timer interrupt mask 1 (TMSK1)  
TPG  
MOTOROLA  
3-6  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
Table 3-2 Register and control bit assignments (Sheet 2 of 4)  
State  
on reset  
Register name  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer interrupt ßag 1 (TFLG1)  
Timer interrupt mask 2 (TMSK2)  
Timer interrupt ßag 2 (TFLG2)  
$0023 OC1F OC2F OC3F OC4F I4/O5F IC1F IC2F IC3F 0000 0000  
3
$0024  
$0025  
TOI  
TOF RTIF PAOVF PAIF  
PAEN PAMOD PEDGE  
(6) (5) (4)  
RTII PAOVI PAII  
0
0
0
0
PR1  
0
PR0 0000 0000  
0000 0000  
0
Pulse accumulator control (PACTL) $0026  
0
0
I4/O5 RTR1 RTR0 0000 0000  
(2) (1) (bit 0) undeÞned  
4
Pulse accumulator count (PACNT)  
SPI control (SPCR)  
$0027 (bit 7)  
(3)  
$0028 SPIE SPE DWOM MSTR CPOL CPHA SPR1 SPR0 0000 01uu  
SPI status (SPSR)  
$0029 SPIF WCOL  
0
MODF  
(4)  
0
0
(2)  
0
0
(1)  
0
0
0000 0000  
5
SPI data (SPDR)  
$002A (bit 7)  
$002B MBE  
(6)  
0
(5)  
(3)  
(bit 0) undeÞned  
EPGM 0000 0000  
à
EPROM programming (EPROG)  
ELAT EXCOL EXROW  
Port pull-up assignment (PPAR)  
LCD control and data (LCDR)  
PLL control (PLLCR)  
$002C  
0
0
0
HWOIF HPPUE GPPUE FPPUE BPPUE 0000 1111  
LCDCK LCDE 0000 0000  
6
$002D LCD7 LCD6 LCD5 LCD4  
0
0
$002E PLLON BCS AUTO BWC VCOT MCS T16EN WEN x010 1010  
$002F SYNX1 SYNX0 SYNY5 SYNY4 SYNY3 SYNY2 SYNY1 SYNY0 0000 1011  
Synthesizer program (SYNR)  
A/D control & status (ADCTL)  
A/D result 1 (ADR1)  
7
$0030 CCF  
$0031 (bit 7)  
$0032 (bit 7)  
$0033 (bit 7)  
$0034 (bit 7)  
$0035 BULKP  
$0036  
0
SCAN MULT  
CD  
(3)  
(3)  
(3)  
(3)  
CC  
(2)  
(2)  
(2)  
(2)  
CB  
(1)  
(1)  
(1)  
(1)  
CA u0uu uuuu  
(bit 0) undeÞned  
(bit 0) undeÞned  
(bit 0) undeÞned  
(bit 0) undeÞned  
(6)  
(6)  
(6)  
(6)  
0
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
A/D result 2 (ADR2)  
8
A/D result 3 (ADR3)  
A/D result 4 (ADR4)  
Block protect (BPROT)  
reserved  
BPRT4 PTCON BPRT3 BPRT2 BPRT1 BPRT0 1011 1111  
9
EEPROM mapping (INIT2)  
System conÞg. options 2 (OPT2)  
$0037  
EE3  
EE2  
EE1  
EE0 STRX  
0
M2DL1 M2DL0 0000 0000  
$0038 LIRDV CWOM STRCH IRVNE LSBF SPR2 EXT4X DISE x00x 0000  
10  
11  
12  
13  
14  
15  
System conÞg. options 1 (OPTION) $0039 ADPU CSEL IRQE DLY  
CME FCME CR1  
(3) (2) (1)  
CR0 0001 0000  
(bit 0) undeÞned  
COP timer arm/reset (COPRST)  
EEPROM programming (PPROG)  
Highest priority interrupt (HPRIO)  
RAM & I/O mapping (INIT)  
Factory test (TEST1)  
ConÞguration control (CONFIG)  
reserved  
$003A (bit 7)  
(6)  
(5)  
0
(4)  
$003B ODD EVEN  
BYTE ROW ERASE EELAT EEPGM 0000 0000  
$003C RBOOT SMOD MDA PSEL4 PSEL3 PSEL2 PSEL1 PSEL0 xxx0 0110  
$003D RAM3 RAM2 RAM1 RAM0 REG3 REG2 REG1 REG0 0000 0000  
$003E TILOP PLTST OCCR CBYP DISR FCM FCOP MIDLY 0000 0000  
$003F ROMAD FREEZ CLK4X PAREN NOSEC NOCOPROMON EEON xxxx xxxx  
$0040  
$0041  
$0042  
$0043  
$0044  
$0045  
reserved  
reserved  
reserved  
reserved  
reserved  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-7  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
Table 3-2 Register and control bit assignments (Sheet 3 of 4)  
State  
on reset  
Register name  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
reserved  
reserved  
$0046  
$0047  
$0048  
$0049  
$004A  
$004B  
3
reserved  
reserved  
4
reserved  
reserved  
SPI2 control (SP2CR)  
SPI2 status (SP2SR)  
SPI2 data (SP2DR)  
SPI2 control options (SP2OPT)  
SCI2/MI baud high (S2BDH)  
SCI2/MI baud low (S2BDL)  
SCI2/MI control 1 (S2CR1)  
SCI2/MI control 2 (S2CR2)  
SCI2/MI status 1 (S2SR1)  
SCI2/MI status 2 (S2SR2)  
SCI2/MI data high (S2DRH)  
SCI2/MI data low (S2DRL)  
reserved  
$004C SP2IE SP2E GWOM MSTR2 CPOL2 CPHA2 SP2R1 SP2R0 0000 01uu  
5
$004D SP2IF WCOL2  
0
(5)  
0
MODF2  
0
0
0
(1)  
0
0
0000 0000  
(bit 0) undeÞned  
0000 0000  
$004E (bit 7)  
$004F  
(6)  
0
(4)  
0
(3)  
(2)  
0
LSBF2 SP2R2  
0
6
$0050 B2TST B2SPL B2RST S2B12 S2B11 S2B10 S2B9 S2B8 0000 0000  
$0051 S2B7 S2B6 S2B5 S2B4 S2B3 S2B2 S2B1 S2B0 0000 0100  
$0052 LOPS2 WOMS2 MIE2  
M2 WAKE2 ILT2  
PE2  
PT2 0000 0000  
7
$0053 TIE2 TCIE2 RIE2 ILIE2 TE2  
$0054 TDRE2 TC2 RDRF2 IDLE2 OR2  
RE2 RWU2 SBK2 0000 0000  
NF2  
0
FE2  
0
PF2 1100 0000  
RAF2 0000 0000  
$0055  
$0056  
0
0
0
0
0
0
0
0
8
R8B  
T8B  
0
0
0
undeÞned  
$0057 R7T7B R6T6B R5T5B R4T4B R3T3B R2T2B R1T1B R0T0B undeÞned  
$0058  
9
8-bit modulus timer A data (T8ADR) $0059 (bit 7)  
8-bit modulus timer B data (T8BDR) $005A (bit 7)  
8-bit modulus timer C data (T8CDR) $005B (bit 7)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(bit 0) 1111 1111  
(bit 0) undeÞned  
(bit 0) undeÞned  
10  
11  
12  
13  
14  
15  
reserved  
$005C  
8-bit modulus timer A control (T8ACR) $005D T8AI T8AF  
8-bit modulus timer B control (T8BCR) $005E T8BI T8BF  
8-bit modulus timer C control (T8CCR) $005F T8CI T8CF  
0
0
0
0
0
0
0
CSA2 CSA1 CSA0 0000 0000  
PRB CSB2 CSB1 CSB0 0000 0000  
PRC CSC2 CSC1 CSC0 0000 0000  
Pulse width clock select (PWCLK)  
$0060 CON34 CON12 PCKA2 PCKA1  
0
PCKB3 PCKB2 PCKB1 0000 0000  
Pulse width polarity select (PWPOL) $0061 PCLK4 PCLK3 PCLK2 PCLK1 PPOL4 PPOL3 PPOL2 PPOL1 0000 0000  
Pulse width scale (PWSCAL)  
Pulse width enable (PWEN)  
$0062 (bit 7)  
(6)  
(5)  
0
(4)  
0
(3)  
(2)  
(1)  
(bit 0) 0000 0000  
$0063 TPWSL DISCP  
PWEN4 PWEN3 PWEN2 PWEN1 0000 0000  
Pulse width count 1 (PWCNT1)  
Pulse width count 2 (PWCNT2)  
Pulse width count 3 (PWCNT3)  
Pulse width count 4 (PWCNT4)  
Pulse width period 1 (PWPER1)  
$0064 (bit 7)  
$0065 (bit 7)  
$0066 (bit 7)  
$0067 (bit 7)  
$0068 (bit 7)  
(6)  
(6)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(1)  
(1)  
(bit 0) 0000 0000  
(bit 0) 0000 0000  
(bit 0) 0000 0000  
(bit 0) 0000 0000  
(bit 0) 1111 1111  
TPG  
MOTOROLA  
3-8  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
Table 3-2 Register and control bit assignments (Sheet 4 of 4)  
State  
on reset  
Register name  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Pulse width period 2 (PWPER2)  
Pulse width period 3 (PWPER3)  
Pulse width period 4 (PWPER4)  
Pulse width duty 1 (PWDTY1)  
Pulse width duty 2 (PWDTY2)  
Pulse width duty 3 (PWDTY3)  
Pulse width duty 4 (PWDTY4)  
SCI1 baud rate high (SCBDH)  
SCI1 baud rate low (SCBDL)  
SCI1 control 1 (SCCR1)  
SCI1 control 2 (SCCR2)  
SCI1 status 1 (SCSR1)  
SCI1 status 2 (SCSR2)  
SCI1 data high (SCDRH)  
SCI1 data low (SCDRL)  
reserved  
$0069 (bit 7)  
$006A (bit 7)  
$006B (bit 7)  
$006C (bit 7)  
$006D (bit 7)  
$006E (bit 7)  
$006F (bit 7)  
(6)  
(6)  
(6)  
(6)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(3)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(2)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(1)  
(1)  
(1)  
(1)  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
3
4
5
$0070 BTST BSPL BRST SBR12 SBR11 SBR10 SBR9 SBR8 0000 0000  
$0071 SBR7 SBR6 SBR5 SBR4 SBR3 SBR2 SBR1 SBR0 0000 0100  
$0072 LOOPS WOMS  
0
M
WAKE ILT  
PE  
PT 0000 0000  
6
$0073  
TIE  
TCIE  
TC  
0
RIE  
ILIE  
TE  
OR  
0
RE  
NF  
0
RWU SBK 0000 0000  
$0074 TDRE  
RDRF IDLE  
FE  
0
PF 1100 0000  
RAF 0000 0000  
$0075  
$0076  
0
0
0
0
0
7
R8  
T8  
0
0
0
0
undeÞned  
$0077 R7T7 R6T6 R5T5 R4T4 R3T3 R2T2 R1T1 R0T0 undeÞned  
$0078  
$0079  
$007A  
8
reserved  
reserved  
Wired-OR interrupt enable (WOIEH) $007B IEH7 IEH6 IEH5 IEH4 IEH3 IEH2 IEH1 IEH0 0000 0000  
9
Port H data (PORTH)  
Data direction H (DDRH)  
Port G data (PORTG)  
Data direction G (DDRG)  
$007C PH7  
$007D DDH7 DDH6 DDH5 DDH4 DDH3 DDH2 DDH1 DDH0 0000 0000  
$007E PG7 PG6 PG5 PG4 PG3 PG2 PG1 PG0 undeÞned  
$007F DDG7 DDG6 DDG5 DDG4 DDG3 DDG2 DDG1 DDG0 0000 0000  
PH6  
PH5  
PH4  
PH3  
PH2  
PH1  
PH0 undeÞned  
10  
11  
12  
13  
14  
15  
KEY  
à
Applies only to EPROM devices  
x State on reset depends on mode selected  
u State of bit on reset is undeÞned  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-9  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3.3  
System initialization  
Registers and bits that control initialization and the basic operation of the MCU are protected  
against writes except under special circumstances. The following table lists registers that can be  
written only once after reset, or that must be written within the first 64 cycles after reset.  
3
Table 3-3 Registers with limited write access  
Register  
address  
Register  
name  
Must be written in  
Write  
once only  
4
Þrst 64 cycles  
(1)  
$x024 Timer interrupt mask register 2 (TMSK2)  
$x02D LCD control and data register (LCDR)  
$x035 Block protect register (BPROT)  
Ñ
(2)  
No  
(3)  
Ñ
5
$x037 EEPROM mapping register (INIT2)  
$x038 System conÞguration options register 2 (OPT2)  
$x039 System conÞguration options register (OPTION)  
$x03D RAM and I/O map register (INIT)  
No  
Yes  
(4)  
No  
(5)  
Ñ
Ñ
6
(6)  
(1) When SMOD = 0, bits 1 and 0 can be written only once, during the Þrst 64 cycles, after  
which they become read-only. When SMOD = 1, however, these bits can be written at any  
time. All other bits can be written at any time.  
7
(2) Bit 0 (LCDE) can be written only once.  
(3) Bits can be written to zero once and only in the Þrst 64 cycles or in special modes. Bits can  
be set to one at any time.  
8
(4) Bit 0 (DISE) and bit 1 (EXT4X) can be written only once; bit 4 (IRVNE) can be written only  
once in single chip and user expanded modes.  
(5) Bits 5, 4, 2, 1, and 0 can be written once and only in the Þrst 64 cycles; when SMOD = 1,  
however, bits 5, 4, 2, 1, and 0 can be written at any time. All other bits can be written at any time.  
9
(6) When SMOD = 0, bits can be written only once, during the Þrst 64 cycles, after which the  
register becomes read-only. When SMOD = 1, bits can be written at any time.  
10  
11  
12  
13  
14  
15  
3.3.1  
Mode selection  
The four mode variations are selected by the logic states of the mode A (MODA) and mode B  
(MODB) pins during reset.The MODA and MODB logic levels determine the logic state of special  
mode (SMOD) and the mode A (MDA) control bits in the highest priority I-bit interrupt and  
miscellaneous (HPRIO) register.  
After reset is released, the mode select pins no longer influence the MCU operating mode. In  
single chip operating mode, MODA pin is connected to a logic zero. In expanded mode, MODA is  
normally connected to V through a pull-up resistor of 4.7 k. The MODA pin also functions as  
the load instruction register (LIR) pin when the MCU is not in reset.The open-drain active low LIR  
output pin drives low during the first E cycle of each instruction, if enabled by the LIRDV bit in the  
OPT2 register. The MODB pin also functions as the stand-by power input (VSTBY), which allows  
DD  
the RAM contents to be maintained in the absence of V  
.
DD  
TPG  
MOTOROLA  
3-10  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
 
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
Refer to Table 3-4, which is a summary of mode pin operation, the mode control bits and the four  
operating modes.  
A normal mode is selected when MODB is logic one during reset. One of three reset vectors is  
fetched from address $FFFA–$FFFF, and program execution begins from the address indicated  
by this vector. If MODB is logic zero during reset, the special mode reset vector is fetched from  
addresses $BFFA–$BFFF and software has access to special test features. Refer to Section 10.  
3
3.3.1.1  
HPRIO — Highest priority I-bit interrupt & misc. register  
4
State  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
Highest priority interrupt (HPRIO)  
$003C RBOOT SMOD MDA PSEL4 PSEL3 PSEL2 PSEL1 PSEL0 xxx0 0110  
5
Note:  
RBOOT, SMOD and MDA bits depend on the power-up initialization mode and can only  
be written in special modes when SMOD = 1. Refer to Table 3-4.  
6
RBOOT — Read bootstrap ROM  
1 (set) Bootloader ROM enabled, at $BE40–$BFFF.  
7
0 (clear) – Bootloader ROM disabled and not in map.  
8
SMOD — Special mode select  
1 (set)  
Special mode variation in effect.  
9
0 (clear) – Normal mode variation in effect.  
Once cleared, cannot be set again.  
10  
11  
12  
13  
14  
15  
MDA — Mode select A  
1 (set)  
Normal expanded or special test mode. (Expanded buses active.)  
0 (clear) – Normal single chip or special bootstrap mode. (Ports active.)  
Table 3-4 Hardware mode select summary  
Inputs  
Control bits in HPRIO (latched at reset)  
Mode  
MODB MODA  
RBOOT  
SMOD  
MDA  
1
1
0
0
0
1
0
1
Single chip  
0
0
1
0
0
0
1
1
0
1
0
1
Expanded  
Special bootstrap  
Special test  
PSEL[4:0] — Priority select bits (refer to Section 10)  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-11  
 
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3
4
5
6
7
8
9
3.3.2  
Initialization  
Because bits in the following registers control the basic configuration of the MCU, an accidental  
change of their values could cause serious system problems. The protection mechanism,  
overridden in special operating modes, requires a write to the protected bits only within the first 64  
bus cycles after any reset, or only once after each reset. See Table 3-3.  
3.3.2.1  
CONFIG — System configuration register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
ConÞguration control (CONFIG)  
$003F ROMAD FREEZ CLK4X PAREN NOSEC NOCOPROMON EEON xxxx xxxx  
CONFIG controls the presence and/or location of ROM/EPROM and EEPROM in the memory  
map and enables the COP watchdog system.The FREEZ bit provides a method of reducing RFI  
emissions in expanded mode, the CLK4X bit enables the 4XOUT pin to output either 4XCLK or  
the internal EXTAL signal (EXTALi), and the PAREN bit enables pull-ups on certain ports. A  
security feature that protects data in EEPROM and RAM is available, controlled by the NOSEC  
bit. Refer to Section 3.4.4.  
CONFIG is made up of EEPROM cells and static working latches. The operation of the MCU is  
controlled directly by these latches and not the EEPROM byte. When programming the CONFIG  
register, the EEPROM byte is accessed.When the CONFIG register is read, the static latches are  
accessed.  
These bits can be read at any time. The value read is the one latched into the register from the  
EEPROM cells during the last reset sequence. A new value programmed into this register is not  
readable until after a subsequent reset sequence.  
On the MC68HC711PH8, and on the MC68HC11PH8 if selected by a mask option, the ROMON  
10 bit can be written at any time if MDA = 1 (expanded mode or special test mode). It cannot be  
written in bootstrap mode, and is forced to a logic one in single chip mode.  
Other bits in CONFIG can be written at any time if SMOD = 1 (bootstrap or special test mode). If  
11  
SMOD = 0 (single chip or expanded mode), these bits can only be written using the EEPROM  
programming sequence, and none of the bits are readable or active until latched via the next reset.  
FREEZ is only active in expanded user mode.  
12  
ROMAD — ROM mapping control  
1 (set)  
ROM/EPROM addressed from $4000 to $FFFF.  
13  
14  
15  
0 (clear) – ROM/EPROM addressed from $0000 to $BFFF (expanded mode  
only).  
In single chip mode, reset sets this bit.  
TPG  
MOTOROLA  
3-12  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
 
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
FREEZ — Address bus freeze in expanded user mode  
1 (set) The external bus is only active when externally mapped resources  
are accessed (expanded mode only).  
0 (clear) – Normal operation.  
To reduce RFI emissions, the address bus (on ports B and F) is not active while internal resources  
are being accessed, but will instead freeze on the last external address. At this time, the data bus  
port C is three-stated (high impedance) with weak pull-ups active, R/W is forced high and the E  
clock enable is pulled low. At reset, the address bus is initialized to $FFFE. Refer to Figure 3-2.  
3
4
Internal E  
5
IMMP  
(internal  
Internal  
External  
Internal  
signal)  
6
E
7
ADDR  
DATA  
(Resistive pull-up)  
In  
Out  
8
R/W  
9
Figure 3-2 Example of expanded mode FREEZ actions  
10  
11  
12  
13  
14  
15  
CLK4X — 4X clock enable  
1 (set) 4XCLK or EXTALi driven out on the 4XOUT pin (see Section 3.3.2.5)  
0 (clear) – 4XOUT pin disabled.  
Note:  
The 4XOUT pin is not available on 84-pin packaged devices.  
PAREN — Pull-up assignment register enable (refer to Section 4)  
1 (set) Pull-ups can be enabled using PPAR.  
0 (clear) – All pull-ups disabled (not controlled by PPAR).  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-13  
 
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
NOSEC — EEPROM security disabled (refer to Section 3.4.4)  
1 (set) Disable security.  
0 (clear) – Enable security.  
NOCOP — COP system disable (refer to Section 10)  
3
1 (set)  
COP system disabled.  
0 (clear) – COP system enabled (forces reset on timeout).  
4
ROMON — ROM enable  
1 (set) ROM/EPROM included in the memory map.  
0 (clear) – ROM/EPROM excluded from the memory map.  
5
In single chip mode, reset sets this bit. In special test mode, reset clears ROMON. On the  
MC68HC711PH8, and on the MC68HC11PH8 if selected by a mask option, ROMON can be  
modified in expanded and special test modes. In this case, care must be taken to include reset  
and interrupt vectors in both internal and external memory maps. The routines for altering  
ROMON should not be located at addresses in the internal ROM/EPROM memory range, but  
rather at different external ROM/EPROM addresses or in internal EEPROM.  
6
7
EEON — EEPROM enable  
8
1 (set)  
EEPROM included in the memory map.  
0 (clear) – EEPROM is excluded from the memory map.  
9
3.3.2.2  
INIT — RAM and I/O mapping register  
State  
on reset  
10  
11  
12  
13  
14  
15  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
RAM & I/O mapping (INIT)  
$003D RAM3 RAM2 RAM1 RAM0 REG3 REG2 REG1 REG0 0000 0000  
The internal registers used to control the operation of the MCU can be relocated on 4K boundaries  
within the memory space with the use of INIT. This 8-bit special-purpose register can change the  
default locations of the RAM and control registers within the MCU memory map. It can be written  
to only once within the first 64 E clock cycles after a reset. It then becomes a read-only register.  
RAM[3:0] — RAM map position  
These four bits, which specify the upper hexadecimal digit of the RAM address, control the  
position of the RAM in the memory map. The RAM can be positioned at the beginning of any 4K  
page in the memory map. Refer to Table 3-5.  
TPG  
MOTOROLA  
3-14  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
REG[3:0] — 128-byte register block position  
These four bits specify the upper hexadecimal digit of the address for the 128-byte block of internal  
registers. The register block is positioned at the beginning of any 4K page in the memory map.  
Refer to Table 3-5.  
Table 3-5 RAM and register remapping  
3
RAM[3:0]  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
Location  
REG[3:0]  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
Location  
$0000Ð$07FF  
$1000Ð$17FF  
$2000Ð$27FF  
$3000Ð$37FF  
$4000Ð$47FF  
$5000Ð$57FF  
$6000Ð$67FF  
$7000Ð$77FF  
$8000Ð$87FF  
$9000Ð$97FF  
$A000Ð$A7FF  
$B000Ð$B7FF  
$C000Ð$C7FF  
$D000Ð$D7FF  
$E000Ð$E7FF  
$F000Ð$F7FF  
$0000Ð$007F  
$1000Ð$107F  
$2000Ð$207F  
$3000Ð$307F  
$4000Ð$407F  
$5000Ð$507F  
$6000Ð$607F  
$7000Ð$707F  
$8000Ð$807F  
$9000Ð$907F  
$A000Ð$A07F  
$B000Ð$B07F  
$C000Ð$C07F  
$D000Ð$D07F  
$E000Ð$E07F  
$F000Ð$F07F  
4
5
6
7
8
9
When the memory map has the 128-byte register block mapped at the same location as RAM, the  
registers have priority and the RAM is relocated to the memory space immediately following the  
register block.This mapping feature keeps all the RAM available for use. Refer to Figure 3-3, which  
illustrates the overlap.  
10  
11  
12  
13  
14  
15  
$x000  
$x07F  
$x080  
$x000  
$x07F  
$x080  
RAM A  
RAM B  
Register block  
RAM B  
$x7FF  
$x7FF  
$x800  
$x87F  
RAM A  
Register and RAM mapped  
to different 4K boundaries.  
Register and RAM mapped  
to the same 4K boundary.  
Figure 3-3 RAM and register overlap  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-15  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3.3.2.3  
INIT2 — EEPROM mapping and MI BUS delay register  
State  
Address bit 7  
$0037 EE3  
bit 6  
EE2  
bit 5  
EE1  
bit 4  
bit 3  
bit 2  
0
bit 1  
bit 0  
on reset  
EEPROM mapping (INIT2)  
EE0 STRX  
M2DL1 M2DL0 0000 0000  
3
This register determines the location of EEPROM in the memory map and controls stretching of  
external accesses. INIT2 may be read at any time but bits 7–4 may be written only once after reset  
in normal modes (bits 3, 1 and 0 may be written at any time).  
4
EE[3:0] — EEPROM map position  
EEPROM is located at $xD00–$xFFF, where x is the hexadecimal digit represented by EE[3:0].  
Refer to Table 3-6.  
5
Table 3-6 EEPROM remapping  
6
EE[3:0]  
Location  
EE[3:0]  
1000  
Location  
0000 $0D00Ð$0FFF  
0001 $1D00Ð$1FFF  
0010 $2D00Ð$2FFF  
0011 $3D00Ð$3FFF  
0100 $4D00Ð$4FFF  
0101 $5D00Ð$5FFF  
0110 $6D00Ð$6FFF  
0111 $7D00Ð$7FFF  
$8D00Ð$8FFF  
$9D00Ð$9FFF  
1001  
7
1010 $AD00Ð$AFFF  
1011 $BD00Ð$BFFF  
1100 $CD00Ð$CFFF  
1101 $DD00Ð$DFFF  
1110 $ED00Ð$EFFF  
1111 $FD00Ð$FFFF  
8
9
STRX — Stretch extended  
1 (set) All external accesses are extended by one E clock cycle.  
10  
11  
12  
13  
14  
15  
0 (clear) – Only external access from $0000 to $1FFF (ROMAD set) or from  
$C000 to $DFFF (ROMAD clear) are extended by one E clock cycle.  
This bit only has meaning in expanded mode, and only if the STRCH bit in OPT2 is set (see  
Section 3.3.2.5).  
Bit 2 — Not implemented; always reads zero.  
M2DL1, M2DL0 — MI BUS delay select (refer to Section 6)  
This bit is not present on early versions of the MC68HC711PH8. On those devices, bit 3 is not  
implemented and always reads zero, and the stretch function is controlled solely by the  
STRCH bit in OPT2 (see Section 3.3.2.5). Contact your local Motorola Sales Representative  
for further information.  
TPG  
MOTOROLA  
3-16  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
 
 
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
3.3.2.4  
OPTION — System configuration options register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
System conÞg. options 1 (OPTION) $0039 ADPU CSEL IRQE DLY  
CME FCME CR1  
CR0 0001 0000  
3
The 8-bit special-purpose OPTION register sets internal system configuration options during  
initialization. The time protected control bits IRQE, DLY, FCME and CR[1:0] can be written only  
once in the first 64 cycles after a reset and then they become read-only bits. This minimizes the  
possibility of any accidental changes to the system configuration.They may be written at any time  
in special modes.  
4
ADPU — A/D power-up (refer to Section 9)  
5
1 (set)  
A/D system power enabled.  
0 (clear) – A/D system disabled, to reduce supply current.  
6
After enabling the A/D power, at least 100µs should be allowed for system stabilization.  
CSEL — Clock select (refer to Section 9)  
7
1 (set)  
A/D, EPROM and EEPROM use internal RC clock source (about  
1.5MHz).  
0 (clear) – A/D, EPROM and EEPROM use system E clock  
(must be at least 1MHz).  
8
This bit selects the clock source for the on-chip EPROM, EEPROM and A/D charge pumps. The  
on-chip RC clock should be used when the E clock frequency falls below 1MHz.  
9
IRQE — Configure IRQ for falling edge sensitive operation  
1 (set)  
Falling edge sensitive operation.  
10  
11  
12  
13  
14  
15  
0 (clear) – Low level sensitive operation.  
DLY — Enable oscillator start-up delay  
1 (set)  
A stabilization delay is imposed as the MCU is started up from STOP  
mode (or from power-on reset).  
0 (clear) – The oscillator start-up delay is bypassed and the MCU resumes  
processing within about four bus cycles. A stable external oscillator  
is required if this option is selected.  
DLY is set on reset, so a delay is always imposed as the MCU is started up from power-on reset.  
A mask option on the MC68HC11PH8 allows the selection of either a short or long delay time for  
power-on reset and exit from STOP mode; either 128 or 4064 bus cycles. This option is not  
available on the MC68HC711PH8 where the delay time is 4064 bus cycles.  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-17  
 
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
CME — Clock monitor enable (refer to Section 10)  
1 (set) Clock monitor enabled.  
0 (clear) – Clock monitor disabled.  
In order to use both STOP and clock monitor, the CME bit should be set before executing STOP,  
then set again after recovering from STOP.  
3
FCME — Force clock monitor enable (refer to Section 10)  
1 (set)  
Clock monitor enabled; cannot be disabled until next reset.  
4
0 (clear) – Clock monitor follows the state of the CME bit.  
When FCME is set, slow or stopped clocks will cause a clock failure reset sequence. To utilize  
STOP mode, FCME should always be cleared.  
5
CR[1:0] — COP timer rate select bits (refer to Section 10)  
6
These control bits determine a scaling factor for the watchdog timer.  
3.3.2.5  
OPT2 — System configuration options register 2  
7
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
8
System conÞg. options 2 (OPT2)  
$0038 LIRDV CWOM STRCH IRVNE LSBF SPR2 EXT4X DISE x00x 000t0  
LIRDV — LIR driven  
9
1 (set)  
Enable LIR push-pull drive.  
0 (clear) – LIR not driven on MODA/LIR pin.  
10  
11  
12  
13  
14  
15  
This bit allows power savings in expanded modes by turning off the LIR output (it has no meaning  
in single chip or bootstrap modes). The LIR pin is driven low to indicate that execution of an  
instruction has begun. In order to detect consecutive instructions in a high speed application, this  
signal drives high for a quarter of a cycle to prevent false triggering. An external pull-up is required  
in expanded modes, while a hardwired VSS connection is possible in single chip modes. LIRDV  
is reset to zero in single chip modes, and to one in expanded modes.  
CWOM — Port C wired-OR mode (refer to Section 4)  
1 (set)  
Port C outputs are open-drain.  
0 (clear) – Port C operates normally.  
TPG  
MOTOROLA  
3-18  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
STRCH — Stretch external accesses  
1 (set) Off-chip accesses are selectively extended by one E clock cycle.  
0 (clear) – Normal operation.  
When this bit is set, off-chip accesses of selected addresses are extended by one E clock cycle  
to allow access to slow peripherals. The E clock stretches externally, but the internal clocks are  
not affected, so that timers and serial systems are not corrupted. The state of the STRX bit (in  
the INIT2 register) and the ROMAD bit (in the CONFIG register) determines which address range  
is affected. See Section 3.3.2.3.  
3
4
Note:  
STRCH is cleared on reset; therefore a program cannot execute out of reset in a slow  
external ROM.  
5
To use this feature, ROMON must be set on reset so that the device starts with internal ROM  
included in the memory map. STRCH should then be set.  
6
Setting STRX means that all external accesses are stretched. If required (and allowed), ROMON  
can then be cleared so that internal ROM is not present in the memory map (see Section 3.4.3).  
If STRX is cleared, then external accesses from $0000 to $1FFF (ROMAD set) or from $C000 to  
$DFFF (ROMAD cleared) are stretched.  
7
STRCH has no effect in single chip and boot modes.  
8
IRVNE — Internal read visibility/not E  
IRVNE can be written once in any user mode. In expanded modes, IRVNE determines whether  
IRV is on or off (but has no meaning in user expanded secure mode, as IRV must be disabled). In  
special test mode, IRVNE is reset to one. In normal modes, IRVNE is reset to zero.  
9
1 (set)  
Data from internal reads is driven out of the external data bus.  
10  
11  
12  
13  
14  
15  
0 (clear) – No visibility of internal reads on external bus.  
In single chip modes this bit determines whether the E clock drives out from the chip.  
1 (set)  
E pin is driven low.  
0 (clear) – E clock is driven out from the chip.  
Refer to the following table for a summary of the operation immediately following reset.  
The STRX bit is not present on early versions of the MC68HC711PH8; on those devices,  
setting STRCH means that external accesses either from $0000 to $FFFF or from $C000 to  
$DFFF are stretched, depending on the state of ROMAD. Contact your local Motorola Sales  
Representative for further information.  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-19  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
IRVNE  
E clock  
IRV  
IRVNE  
IRVNE  
Mode  
after reset after reset after reset affects only can be written  
Single chip  
Expanded  
Boot  
0
0
0
1
On  
On  
On  
On  
Off  
Off  
Off  
On  
E
Once  
Once  
IRV  
E
Unlimited  
Unlimited  
Special test  
IRV  
3
LSBF — LSB-first enable (refer to Section 7)  
1 (set) Data is transferred LSB first.  
4
0 (clear) – Data is transferred MSB first.  
SPR2 — SPI clock rate select (refer to Section 7)  
5
This bit adds a divide-by-four to the SPI clock chain.  
EXT4X — 4XLCK or EXTAL clock output select  
6
This bit can be written once and can be read at any time.  
1 (set)  
EXTALi clock output on the 4XOUT pin.  
7
0 (clear) – 4XCLK clock output on the 4XOUT pin.  
This bit selects which clock is to be output on the 4XOUT pin, when enabled by the CLK4X bit in  
CONFIG (see Section 3.3.2.1). On reset, or when BCS = 0, 4XCLK (the PLL output) is the same  
as EXTALi. Refer to Section 2-6. There is a phase delay between EXTALi and 4XOUT.  
8
9
Note:  
The 4XOUT pin is not available on 84-pin packaged devices.  
DISE — E clock output disable  
10  
11  
12  
13  
14  
15  
This bit can be written once and can be read at any time.  
1 (set)  
No E clock output.  
0 (clear) – E clock is output normally.  
IRVNE allows E clock to be turned off in single chip modes. DISE has been added for expanded  
modes, but can be used in every mode. Writing a zero to this bit prevents accidental E clock  
turn-off in systems requiring this signal.  
TPG  
MOTOROLA  
3-20  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
3.3.2.6  
BPROT — Block protect register  
State  
on reset  
Address bit 7  
$0035 BULKP  
bit 6  
0
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Block protect (BPROT)  
BPRT4 PTCON BPRT3 BPRT2 BPRT1 BPRT0 1011 1111  
3
BPROT prevents accidental writes to EEPROM and the CONFIG register. The bits in this register  
can be written to zero only once during the first 64 E clock cycles after reset in the normal modes;  
they can be set at any time. Once the bits are cleared, the EEPROM array and the CONFIG  
register can be programmed or erased. Setting the bits in the BPROT register to logic one protects  
the EEPROM and CONFIG register until the next reset. Refer to Table 3-7.  
4
BULKP — Bulk erase of EEPROM protect  
5
1 (set)  
EEPROM cannot be bulk or row erased.  
0 (clear) – EEPROM can be bulk erased normally.  
6
Bit 6 — Not implemented; always reads zero.  
BPRT4 — Block protect bit for top 256 bytes of EEPROM(see below)  
7
PTCON — Protect for CONFIG register  
1 (set)  
CONFIG register cannot be programmed or erased.  
8
0 (clear) – CONFIG register can be programmed or erased normally.  
Note that, in special modes, CONFIG may be written regardless of the state of PTCON.  
9
BPRT[4:0] — Block protect bits for EEPROM  
1 (set)  
Protection is enabled for associated block; it cannot be programmed  
or erased.  
10  
11  
12  
13  
14  
15  
0 (clear) – Protection disabled for associated block.  
Each of these five bits protects a block of EEPROM against writing or erasure, as follows:  
Table 3-7 EEPROM block protect  
Bit name Block protected Block size  
BPRT0 $xD00Ð$xD1F 32 bytes  
BPRT1 $xD20Ð$xD5F 64 bytes  
BPRT2 $xD60Ð$xDDF 128 bytes  
BPRT3 $xDE0Ð$xEFF 288 bytes  
BPRT4 $xF00Ð$xFFF 256 bytes  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-21  
 
 
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3.3.2.7  
TMSK2 — Timer interrupt mask register 2  
State  
on reset  
Address bit 7  
$0024 TOI  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
PR1  
bit 0  
Timer interrupt mask 2 (TMSK2)  
RTII PAOVI PAII  
PR0 0000 0000  
3
PR[1:0] are time-protected control bits and can be changed only once and then only within the first  
64 bus cycles after reset in normal modes.  
4
Note:  
Bits in TMSK2 correspond bit for bit with flag bits in TFLG2. Ones in TMSK2 enable the  
corresponding interrupt sources.  
5
TOI — Timer overflow interrupt enable (Refer to Section 8)  
1 (set) Interrupt requested when TOF is set.  
0 (clear) – TOF interrupts disabled.  
6
RTII — Real-time interrupt enable (Refer to Section 8)  
1 (set)  
Interrupt requested when RTIF set.  
7
0 (clear) – RTIF interrupts disabled.  
PAOVI — Pulse accumulator overflow interrupt enable (Refer to Section 8)  
8
1 (set)  
Interrupt requested when PAOVF set.  
0 (clear) PAOVF interrupts disabled.  
9
PAII — Pulse accumulator interrupt enable (Refer to Section 8)  
1 (set)  
Interrupt requested when PAIF set.  
10  
11  
12  
13  
14  
15  
0 (clear) PAIF interrupts disabled.  
Bits [3, 2] — Not implemented; always read zero.  
PR[1:0] — Timer prescaler select  
These two bits select the prescale rate for the main 16-bit free-running timer system. These bits  
can be written only once during the first 64 E clock cycles after reset in normal modes, or at any  
time in special modes. Refer to the following table:  
PR[1:0] Prescale factor  
0 0  
0 1  
1 0  
1 1  
1
4
8
16  
TPG  
MOTOROLA  
3-22  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
3.4  
EPROM, EEPROM and CONFIG register  
EPROM  
3.4.1  
Using the on-chip EPROM programming feature requires an external power supply (V ). Normal  
programming is accomplished using the EPROG register. Program EPROM at room temperature  
only and place an opaque label over the quartz window during and after programming.  
3
PPE  
The CSEL bit in the OPTION register selects an on-chip oscillator clock for programming the  
EPROM while operating at frequencies below 1MHz.  
4
The erased state of each EPROM byte is $FF.  
5
3.4.1.1  
EPROG — EPROM programming control register  
6
State  
on reset  
Address bit 7  
$002B MBE  
bit 6  
0
bit 5  
bit 4  
bit 3  
bit 2  
0
bit 1  
0
bit 0  
EPROM programming (EPROG)  
ELAT EXCOL EXROW  
EPGM 0000 0000  
7
MBE — Multiple byte program enable  
This bit may be read or written only in special modes; it will always read zero in normal modes.  
1 (set) Program 12 bytes with the same data.  
8
0 (clear) – Normal programming.  
EPROM is made up of three blocks of 16K bytes. When programming, address bits 4 and 7 are  
ignored, so that 4 addresses per block are programmed simultaneously. Address bits 14 and 15  
are also ignored so that a total of twelve addresses are written at once, four in each 16K byte block.  
For example, with the EPROM mapped to $4000–$FFF, a write to $4026 will actually program  
$4026, $4036, $40A6, $40B6, $8026, $8036, $80A6, $80B6, $C026, $C036. $C0A6 and $C0B6  
(i.e. %xx00 0000 x01x 0110).  
9
10  
11  
12  
13  
14  
15  
Bits [6, 2, 1] — Not implemented; always read zero.  
ELAT — EPROM latch control  
ELAT may be read and written at any time.  
1 (set)  
EPROM address and data buses configured for programming.  
EPROM cannot be read.  
0 (clear) – EPROM address and data buses configured for normal operation.  
When set, this bit causes the address and data for writes to the EPROM to be latched.  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-23  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
EXCOL — Select extra columns  
The EXCOL bit always reads zero in normal modes and may be read or written only in special  
modes.  
1 (set)  
User array disabled; extra column selected.  
0 (clear) – User array selected.  
3
The extra column may be accessed at bit 7; addresses use bits 15–5, bits 4–0 must be ones.  
EXROW — Select extra rows  
4
This bit always reads zero in normal modes and may be read or written only in special modes.  
1 (set)  
User array disabled; extra rows selected.  
5
0 (clear) – User array selected.  
There are six extra rows (two in each block). Addresses use bits 6–0, bits 11–7 must be zeros.  
(The high nibble determines which 16K block is accessed.)  
6
EPGM — EPROM program command  
7
This bit can be read at any time, but may only be written if ELAT is set.  
1 (set)  
Programming voltage (V  
) switched to the EPROM array.  
PPE  
0 (clear) – Programming voltage (V  
) disconnected from the EPROM array.  
PPE  
8
Note:  
If ELAT = 0 (normal operation) then EPGM = 0 (programming voltage disconnected).  
9
3.4.1.2  
EPROM programming  
10  
11  
12  
13  
14  
15  
The EPROM may be programmed and verified in software, via the MCU, using the following  
procedure. The ROMON bit in the CONFIG register should be set. To use this method in special  
bootstrap mode, the external EPROM programming voltage must be applied on pin VPPE. On  
entry, A contains the data to be programmed and X contains the EPROM address.  
EPROG LDAB  
STAB  
#$20  
$002B Set ELAT bit (PGM=0) to enable EPROM latches.  
$0, X Store data to EPROM address  
#$21  
STAA  
LDAB  
STAB  
JSR  
$002B Set EPGM bit, with ELAT=1, to enable prog. voltage  
DLYEP Delay tEPROG  
CLR  
$002B Turn off programming voltage and set to READ mode  
User-developed software can be uploaded through the SCI, or an EPROM programming utility  
resident in the bootstrap ROM can be used. To use the resident utility, bootload a three-byte  
program into RAM consisting of a single jump instruction to $BF00 (the starting address of a  
TPG  
MOTOROLA  
3-24  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
resident EPROM programming utility), along with instructions to set the X and Y index registers to  
default values. The utility program receives programming data from an external host and puts it in  
EPROM. The value in IX determines programming delay time; for example, at 4 MHz operation, a  
delay constant of 8000 in IX will give a 2ms delay time. The value in IY is a pointer to the first  
address in EPROM to be programmed (normally = $4000). When the utility program is ready to  
receive programming data, it sends the host an $FF character; then it waits. When the host sees  
the $FF character, the EPROM programming data is sent, starting with location $4000. After the  
last byte to be programmed is sent and the corresponding verification data is returned, the  
programming operation is terminated by resetting the MCU.  
3
4
3.4.2  
EEPROM  
5
The 768-byte on-board EEPROM is initially located from $0D00 to $0FFF after reset in all modes. It  
can be mapped to any other 4K page by writing to the INIT2 register.The EEPROM is enabled by the  
EEON bit in the CONFIG register. Programming and erasing are controlled by the PPROG register.  
6
Unlike information stored in ROM, data in the 768 bytes of EEPROM can be erased and  
reprogrammed under software control. Because programming and erasing operations use an  
on-chip charge pump driven by V , a separate external power supply is not required.  
DD  
7
An internal charge pump supplies the programming voltage. Use of the block protect register  
(BPROT) prevents inadvertent writes to (or erases of) blocks of EEPROM (see Section 3.3.2.6).  
The CSEL bit in the OPTION register selects an on-chip oscillator clock for programming and  
erasing the EEPROM while operating at frequencies below 1MHz.  
8
In special modes there is one extra row of EEPROM, which is used for factory testing. Endurance  
and data retention specifications do not apply to these cells.  
9
The erased state of each EEPROM byte is $FF.  
3.4.2.1  
PPROG — EEPROM programming control register  
10  
11  
12  
13  
14  
15  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
EEPROM programming (PPROG)  
$003B ODD EVEN  
BYTE ROW ERASE EELAT EEPGM 0000 0000  
Note:  
Writes to EEPROM addresses are inhibited while EEPGM is one. A write to a different  
EEPROM location is prevented while a program or erase operation is in progress.  
ODD — Program odd rows in half of EEPROM (Test)  
EVEN — Program even rows in half of EEPROM (Test)  
If both ODD and EVEN are set to one then all odd and even rows in half of the EEPROM will be  
programmed with the same data, within one programming cycle.  
Bit 5 — Not implemented; always reads zero.  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-25  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
BYTE — EEPROM byte erase mode  
1 (set) Erase only one byte of EEPROM.  
0 (clear) – Row or bulk erase mode used.  
This bit may be read or written at any time.  
3
ROW — EEPROM row/bulk erase mode (only valid when BYTE = 0)  
1 (set)  
Erase only one 16 byte row of EEPROM.  
4
0 (clear) – Erase all 768 bytes of EEPROM.  
This byte can be read or written at any time.  
5
Table 3-8 Erase mode selection  
Byte  
Row  
Action  
Bulk erase (all 768 bytes)  
Row erase (16 bytes)  
Byte erase  
6
0
0
1
1
0
1
0
1
7
Byte erase  
ERASE — Erase/normal control for EEPROM  
1 (set) Erase mode.  
8
0 (clear) – Normal read or program mode.  
This byte can be read or written at any time.  
9
EELAT — EEPROM latch control  
10  
11  
12  
13  
14  
15  
1 (set)  
EEPROM address and data bus set up for programming or erasing.  
0 (clear) – EEPROM address and data bus set up for normal reads.  
When the EELAT bit is cleared, the EEPROM can be read as if it were a ROM. The block protect  
register has no effect during reads. This bit can be read and written at any time.  
EEPGM — EEPROM program command  
1 (set)  
Program or erase voltage switched on to EEPROM array.  
0 (clear) – Program or erase voltage switched off to EEPROM array.  
This bit can be read at any time but can only be written if EELAT = 1.  
Note:  
If EELAT = 0 (normal operation) then EEPGM = 0 (programming voltage disconnected).  
TPG  
MOTOROLA  
3-26  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
During EEPROM programming, the ROW and BYTE bits of PPROG are not used. If the frequency  
of the E clock is 1MHz or less, set the CSEL bit in the OPTION register. Remember that the  
EEPROM must be erased by a separate erase operation before programming. The following  
example of how to program an EEPROM byte assumes that the appropriate bits in BPROT have  
been cleared.  
PROG  
LDAB  
STAB  
STAA  
LDAB  
STAB  
JSR  
#$02  
EELAT=1  
3
$003B Set EELAT bit  
$0D00 Store data to EEPROM address  
#$03  
$003B Turn on programming voltage  
DLY10 Delay tEEPROG  
EELAT=EEPGM=1  
4
CLR  
$003B Turn off high voltage and set to READ mode  
5
3.4.2.2  
EEPROM bulk erase  
6
To erase the EEPROM, ensure that the proper bits of the BPROT register are cleared, then  
complete the following steps using the PPROG register:  
1) Write to PPROG with the ERASE, EELAT and appropriate BYTE and ROW  
bits set.  
7
2) Write to the appropriate EEPROM address with any data. Row erase only  
requires a write to any location in the row. Bulk erase is accomplished by  
writing to any location in the array.  
8
3) Write to PPROG with ERASE, EELAT, EEPGM and the appropriate BYTE  
and ROW bits set.  
9
4) Delay for time t  
(See Section A.5.6).  
EEPROG  
5) Clear the EEPGM bit in PPROG to turn off the high voltage.  
6) Clear the PPROG register to reconfigure the EEPROM address and data  
buses for normal operation.  
10  
11  
12  
13  
14  
15  
The following is an example of how to bulk erase the 768-byte EEPROM.The CONFIG register is  
not affected in this example.  
BULKE LDAB  
STAB  
#$06  
EELAT=ERASE=1  
$003B Set EELAT bit  
STAA  
$0D00 Store data to any EEPROM address  
LDAB  
#$07  
EELAT=ERASE=EEPGM=1  
STAB  
JSR  
$003B Turn on programming voltage  
DLY10 Delay tEEPROG  
CLR  
$003B Turn off high voltage and set to READ mode  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-27  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3.4.2.3  
EEPROM row erase  
The following example shows how to perform a fast erase of 16 bytes of EEPROM:  
ROWE  
LDAB  
STAB  
STAB  
LDAB  
STAB  
JSR  
#$0E  
ROW=ERASE=EELAT=1  
$003B Set to ROW erase mode  
3
0,X  
#$0F  
Write any data to any address in ROW  
ROW=ERASE=EELAT=EEPGM=1  
$003B Turn on high voltage  
DLY10 Delay tEEPROG  
$003B Turn off high voltage and set to READ mode  
4
CLR  
3.4.2.4  
EEPROM byte erase  
5
The following is an example of how to erase a single byte of EEPROM:  
6
BYTEE LDAB  
STAB  
#$16  
BYTE=ERASE=EELAT=1  
$003B Set to BYTE erase mode  
0,X  
#$17  
$003B Turn on high voltage  
DLY10 Delay tEEPROG  
STAB  
LDAB  
STAB  
JSR  
Write any data to address to be erased  
BYTE=ERASE=EELAT=EEPGM=1  
7
CLR  
$003B Turn off high voltage and set to READ mode  
8
9
10  
11  
12  
13  
14  
15  
TPG  
MOTOROLA  
3-28  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
3.4.3  
CONFIG register programming  
Because the CONFIG register is implemented with EEPROM cells, use EEPROM procedures to  
erase and program this register. The procedure for programming is the same as for programming  
a byte in the EEPROM array, except that the CONFIG register address is used. CONFIG can be  
programmed or erased (including byte erase) while the MCU is operating in any mode, provided  
that PTCON in BPROT is clear. To change the value in the CONFIG register, complete the  
following procedure. Do not initiate a reset until the procedure is complete.  
3
1) Erase the CONFIG register.  
2) Program the new value to the CONFIG address.  
3) Initiate reset.  
4
5
CONFIG — System configuration register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
6
ConÞguration control (CONFIG)  
$003F ROMAD FREEZ CLK4X PAREN NOSEC NOCOPROMON EEON xxxx xxxx  
7
For a description of the bits contained in the CONFIG register refer to Section 3.3.2.1.  
CONFIG is made up of EEPROM cells and static working latches. The operation of the MCU is  
controlled directly by these latches and not the EEPROM byte. When programming the CONFIG  
register, the EEPROM byte is accessed.When the CONFIG register is read, the static latches are  
accessed.  
8
These bits can be read at any time. The value read is the one latched into the register from the  
EEPROM cells during the last reset sequence. A new value programmed into this register is not  
readable until after a subsequent reset sequence.  
9
On the MC68HC711PH8, and on the MC68HC11PH8 if selected by a mask option, the ROMON  
bit can be written at any time if MDA = 1 (expanded mode or special test mode). It cannot be  
written in bootstrap mode, and is forced to a logic one in single chip mode.  
10  
11  
12  
13  
14  
15  
Other bits in CONFIG can be written at any time if SMOD = 1 (bootstrap or special test mode). If  
SMOD = 0 (single chip or expanded mode), these bits can only be written using the EEPROM  
programming sequence, and none of the bits is readable or active until latched via the next reset.  
FREEZ is only active in expanded user mode.  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-29  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3.4.4  
RAM and EEPROM security  
The optional security feature protects the contents of EEPROM and RAM from unauthorized  
access. Data, codes, keys, a program, or a key portion of a program, can be protected against  
access. To accomplish this, the protection mechanism prevents operation of the device in special  
test mode. Only resident programs have unlimited access to the internal EEPROM and RAM and  
can read, write, or transfer the contents of these memories. To maintain RAM and EEPROM  
security, the following conditions should be satisfied:  
3
The internal ROM must be enabled and mapped at $4000–$FFFF, by setting  
the ROMON and ROMAD bits in the CONFIG register. This means that  
program execution starts after reset under control of the internal ROM (See  
Section 3.3.2.1).  
4
5
Access to external addresses should be restricted to data read or write.  
Program execution should not point from the internal resources to the  
external memory map.  
6
The FREEZ bit in the CONFIG register may be set to prevent internal  
address visibility on the ports (See Section 3.3.2.1).  
Alternatively, EEPROM-only security is possible:  
7
In expanded mode, program execution is possible in external resources, but  
the EEPROM read or write access is restricted by internal hardware;  
instructions must be executed from internal ROM/EPROM in the range  
$4000 to $43FF (with ROMAD set) or in the range $0000 to $03FF (with  
ROMAD clear). Avoid using indexed addressing in this ROM/EPROM range,  
and clear temporary copies of EEPROM data before returning to the main  
program.  
8
9
As above, the FREEZ bit in the CONFIG register may be set to prevent  
internal address visibility on the ports (See Section 3.3.2.1).  
10  
11  
12  
13  
14  
15  
Note:  
A mask option on the MC68HC11PH8 determines whether or not the security feature  
is available (it is always available on the MC68HC711PH8). If the feature is available,  
then the secure mode can be invoked by programming the NOSEC bit to zero.  
Otherwise, the NOSEC bit is permanently set to one, disabling security.  
TPG  
MOTOROLA  
3-30  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
PH8.DS03/Modes+mem  
—this line does not form part of the document—  
[DS97 v 4.1] 08/Apr/97@13:55  
1
2
If the security feature is present and enabled and bootstrap mode is selected, then the following  
sequence is performed by the bootstrap program:  
1) Output $FF on the SCI.  
2) Turn block protect off. Clear BPROT register.  
3) If EEPROM is enabled, erase it all.  
4) Verify that the EEPROM is erased; if not, begin sequence again.  
5) Write $FF to every RAM byte.  
3
6) Erase the CONFIG register.  
4
If all the above operations are successful, the bootloading process continues as if the device has  
not been secured.  
5
CONFIG — System configuration register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
6
ConÞguration control (CONFIG)  
$003F ROMAD FREEZ CLK4X PAREN NOSEC NOCOPROMON EEON xxxx xxxx  
7
For a description of the other bits contained in the CONFIG register refer to Section 3.3.2.1.  
NOSEC — EEPROM security disabled  
8
1 (set)  
Disable security.  
0 (clear) – Enable security.  
With security enabled, selection of special test mode is prevented; single chip and user expanded  
modes may be accessed. If the MODA and MODB pins are configured for special test mode, the  
part will start in bootstrap mode.  
9
10  
11  
12  
13  
14  
15  
TPG  
MC68HC11PH8  
OPERATING MODES AND ON-CHIP MEMORY  
MOTOROLA  
3-31  
08/Apr/97@13:55 [DS97 v 4.1]  
—this line does not form part of the document—  
PH8.DS03/Modes+mem  
1
2
3
4
5
6
7
THIS PAGE INTENTIONALLY LEFT BLANK  
8
9
10  
11  
12  
13  
14  
15  
TPG  
MOTOROLA  
3-32  
OPERATING MODES AND ON-CHIP MEMORY  
MC68HC11PH8  
4
PARALLEL INPUT/OUTPUT  
4
The MC68HC11PH8 has up to 54 input/output lines and 8 input-only lines, depending on the  
operating mode. To enhance the I/O functions, the data bus of this microcontroller is  
non-multiplexed.The following table is a summary of the configuration and features of each port.  
Table 4-1 Port configuration  
Input  
pins  
Output  
pins  
Bidirectional  
pins  
Port  
Alternate functions  
A
B
C
D
E
F
Ñ
Ñ
Ñ
Ñ
8
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
8
8
Timer  
High order address and LCD segment drivers  
Data bus  
8
6
SPI1 and SCI1  
Ñ
8
A/D converter  
Ñ
Ñ
Ñ
Low order address  
G
H
8
R/W on PG7, LCDBP on PG6, SPI2 and SCI2 (with MI bus)  
PWM and modulus timer clock inputs, keyboard interrupt  
8
Note:  
Do not confuse pin function with the electrical state of that pin at reset. All  
general-purpose I/O pins that are configured as inputs at reset are in a high-impedance  
state and the contents of the port data registers are undefined; in port descriptions, a  
‘u’ indicates this condition. The pin function is mode dependent.  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-1  
 
4.1  
Port A  
Port A is an 8-bit bidirectional port, with both data and data direction registers. In addition to their  
I/O capability, port A pins are shared with timer functions, as shown in the following table.  
Pin  
Alternate function  
PA0 IC3  
PA1 IC2  
PA2 IC1  
4
See Section 8 for  
more information.  
PA3 OC5 and/or OC1, or IC4  
PA4 OC4 and/or OC1  
PA5 OC3 and/or OC1  
PA6 OC2 and/or OC1  
PA7 PAI and/or OC1  
On reset the pins are configured as general purpose high-impedance inputs.  
4.1.1  
PORTA — Port A data register  
State  
on reset  
Address bit 7  
$0000 PA7  
bit 6  
PA6  
bit 5  
PA5  
bit 4  
PA4  
bit 3  
PA3  
bit 2  
PA2  
bit 1  
PA1  
bit 0  
Port A data (PORTA)  
PA0 undeÞned  
This is a read/write register and is not affected by reset. The bits may be read and written at any  
time, but, when a pin is allocated to its alternate function, a write to the corresponding register bit  
has no effect on the pin state.  
4.1.2  
DDRA — Data direction register for port A  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Data direction A (DDRA)  
$0001 DDA7 DDA6 DDA5 DDA4 DDA3 DDA2 DDA1 DDA0 0000 0000  
DDA[7:0] — Data direction for port A  
1 (set) The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MOTOROLA  
4-2  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
4.2  
Port B  
Port B is an 8-bit bidirectional port, with both data and data direction registers. In addition to their  
I/O capability, port B pins are used as the non-multiplexed high order address pins, as shown in  
the following table.  
Alternate  
function  
Pin  
PB0  
PB1  
PB2  
PB3  
PB4  
PB5  
PB6  
PB7  
A8  
A9  
4
In expanded or test  
mode, the pins  
become the high  
order address lines  
and port B is not  
included in the  
A10  
A11  
A12/LCD4  
A13/LCD5  
A14/ LCD6  
A15/LCD7  
memory map.  
The state of the pins on reset is mode dependent. In single chip or bootstrap mode, port B pins  
are high-impedance inputs with selectable internal pull-up resistors (see Section 4.9). In  
expanded or test mode, port B pins are high order address outputs and PORTB/DDRB are not in  
the memory map. Alternatively, four LCD segment drivers can be enabled, in all modes, on  
PB4–PB7 (See Section 2.12).  
4.2.1  
PORTB — Port B data register  
State  
on reset  
Address bit 7  
$0004 PB7  
bit 6  
PB6  
bit 5  
PB5  
bit 4  
PB4  
bit 3  
PB3  
bit 2  
PB2  
bit 1  
PB1  
bit 0  
Port B data (PORTB)  
PB0 undeÞned  
The bits may be read and written at any time and are not affected by reset.  
4.2.2  
DDRB — Data direction register for port B  
State  
bit 0  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
on reset  
Data direction B (DDRB)  
$0002 DDB7 DDB6 DDB5 DDB4 DDB3 DDB2 DDB1 DDB0 0000 0000  
DDB[7:0] — Data direction for port B  
1 (set) The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-3  
4.3  
Port C  
Port C is an 8-bit bidirectional port, with both data and data direction registers. In addition to their I/O  
capability, port C pins are used as the non-multiplexed data bus pins, as shown in the following table.  
Alternate  
Pin  
function  
PC0  
PC1  
PC2  
PC3  
PC4  
PC5  
PC6  
PC7  
D0  
D1  
D2  
D3  
D4  
D5  
D6  
D7  
4
In expanded or test  
mode, the pins  
become the data  
bus and port C is  
not included in the  
memory map.  
The state of the pins on reset is mode dependent. In single chip or bootstrap mode, port C pins  
are high-impedance inputs. In expanded or test modes, port C pins are the data bus I/O and  
PORTC/DDRC are not in the memory map.  
4.3.1  
PORTC — Port C data register  
State  
on reset  
Address bit 7  
$0006 PC7  
bit 6  
PC6  
bit 5  
PC5  
bit 4  
PC4  
bit 3  
PC3  
bit 2  
PC2  
bit 1  
PC1  
bit 0  
Port C data (PORTC)  
PC0 undeÞned  
The bits may be read and written at any time and are not affected by reset.  
4.3.2  
DDRC — Data direction register for port C  
State  
bit 0  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
on reset  
Data direction C (DDRC)  
$0007 DDC7 DDC6 DDC5 DDC4 DDC3 DDC2 DDC1 DDC0 0000 0000  
DDC[7:0] — Data direction for port C  
1 (set) The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MOTOROLA  
4-4  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
4.4  
Port D  
Port D is a 6-bit bidirectional port, with both data and data direction registers. In addition to their I/O  
capability, port D pins are shared with SCI1 and SPI1 functions, as shown in the following table.  
Alternate  
Pin  
function  
PD0  
PD1  
RXD1  
TXD1  
See Section 5 for  
more information.  
4
PD2  
PD3  
PD4  
PD5  
MISO1  
MOSI1  
SCK1  
SS1  
See Section 7 for  
more information.  
On reset the pins are configured as general purpose high-impedance inputs.  
4.4.1  
PORTD — Port D data register  
State  
on reset  
Address bit 7  
$0008  
bit 6  
0
bit 5  
PD5  
bit 4  
PD4  
bit 3  
PD3  
bit 2  
PD2  
bit 1  
PD1  
bit 0  
Port D data (PORTD)  
0
PD0 undeÞned  
This is a read/write register and is not affected by reset. The bits may be read and written at any  
time, but, when a pin is allocated to its alternate function, a write to the corresponding register bit  
has no effect on the pin state.  
4.4.2  
DDRD — Data direction register for port D  
State  
on reset  
Address bit 7  
$0009  
bit 6  
0
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Data direction D (DDRD)  
0
DDD5 DDD4 DDD3 DDD2 DDD1 DDD0 0000 0000  
Bits [7:6] — Reserved; always read zero  
DDD[5:0] — Data direction for port D  
1 (set)  
The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-5  
4.5  
Port E  
Port E is an 8-bit input-only port. In addition to their input capability, port E pins are shared with  
A/D functions, as shown in the following table.  
Alternate  
Pin  
function  
PE0  
PE1  
PE2  
PE3  
PE4  
PE5  
PE6  
PE7  
AD0  
AD1  
AD2  
AD3  
AD4  
AD5  
AD6  
AD7  
4
See Section 9 for  
more information.  
On reset the pins are configured as general purpose high-impedance inputs.  
4.5.1  
PORTE — Port E data register  
State  
on reset  
Address bit 7  
$000A PE7  
bit 6  
PE6  
bit 5  
PE5  
bit 4  
PE4  
bit 3  
PE3  
bit 2  
PE2  
bit 1  
PE1  
bit 0  
Port E data (PORTE)  
PE0 undeÞned  
This is a read-only register and is not affected by reset. The bits may be read at any time.  
Note:  
As port E shares pins with the A/D converter, a read of this register may affect any  
conversion currently in progress, if it coincides with the sample portion of the  
conversion cycle. Hence, normally port E should not be read during the sample portion  
of any conversion.  
TPG  
MOTOROLA  
4-6  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
4.6  
Port F  
Port F is an 8-bit bidirectional port, with both data and data direction registers. In addition to their  
I/O capability, port F pins are used as the non-multiplexed low order address pins, as shown in the  
following table.  
Alternate  
Pin  
function  
PF0  
PF1  
PF2  
PF3  
PF4  
PF5  
PF6  
PF7  
A0  
A1  
A2  
A3  
A4  
A5  
A6  
A7  
4
In expanded or test  
mode, the pins  
become the low  
order address and  
port F is not  
included in the  
memory map.  
The state of the pins on reset is mode dependent. In single chip or bootstrap mode, port F pins  
are high-impedance inputs with selectable internal pull-up resistors (see Section 4.9). In  
expanded or test modes, port F pins are low order address outputs and PORTF/DDRF are not in  
the memory map.  
4.6.1  
PORTF — Port F data register  
State  
on reset  
Address bit 7  
$0005 PF7  
bit 6  
PF6  
bit 5  
PF5  
bit 4  
PF4  
bit 3  
PF3  
bit 2  
PF2  
bit 1  
PF1  
bit 0  
Port F data (PORTF)  
PF0 undeÞned  
The bits may be read and written at any time and are not affected by reset.  
4.6.2  
DDRF — Data direction register for port F  
State  
bit 0  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
on reset  
Data direction F (DDRF)  
$0003 DDF7 DDF6 DDF5 DDF4 DDF3 DDF2 DDF1 DDF0 0000 0000  
DDF[7:0] — Data direction for port F  
1 (set) The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-7  
4.7  
Port G  
Port G is an 8-bit bidirectional port, with both data and data direction registers. In addition to their  
I/O capability, port G pins are shared with R/W, LCD, SCI2 (with MI-bus) and SPI2 functions, as  
shown in the following table.  
Alternate  
Pin  
function  
PG0  
PG1  
PG2  
PG3  
PG4  
PG5  
PG6  
PG7  
RXD2  
TXD2  
MISO2  
MOSI2  
SCK2  
SS2  
4
See Section 5 for  
more information.  
See Section 7 for  
more information.  
LCDBP  
R/W  
See Section 2 for  
more information.  
Pins PG[6:0] are high-impedance inputs with software selectable pull-up resistors, as is PG7 in  
single chip and bootstrap modes (see Section 4.9). In expanded or test modes, PG7 is the R/W  
output.  
4.7.1  
PORTG — Port G data register  
State  
on reset  
Address bit 7  
$007E PG7  
bit 6  
PG6  
bit 5  
PG5  
bit 4  
PG4  
bit 3  
PG3  
bit 2  
PG2  
bit 1  
PG1  
bit 0  
Port G data (PORTG)  
PG0 undeÞned  
This is a read/write register and is not affected by reset. The bits may be read and written at any  
time, but, when a pin is allocated to its alternate function, a write to the corresponding register bit  
has no effect on the pin state.  
4.7.2  
DDRG — Data direction register for port G  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Data direction G (DDRG)  
$007F DDG7 DDG6 DDG5 DDG4 DDG3 DDG2 DDG1 DDG0 0000 0000  
DDG[7:0] — Data direction for port G  
1 (set) The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MOTOROLA  
4-8  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
4.8  
Port H  
Port H is an 8-bit bidirectional port, with both data and data direction registers. In addition to their  
I/O capability, port H pins are shared with modulus timer and PWM functions, as shown in the  
following table. Each port H pin configured as an input can be used as a keyboard interrupt, if  
enabled (See Section 4.8.3).  
Alternate  
function  
Pin  
PH0  
PH1  
PH2  
PH3  
PH4  
PH5  
PH6  
PH7  
PW1  
4
PW2  
PW3  
PW4  
See Section 8 for  
more information.  
Ñ
Ñ
Modulus timer C clock input  
Modulus timer B clock input  
On reset the pins are configured as general purpose high-impedance inputs with selectable  
internal pull-ups (see Section 4.9).  
4.8.1  
PORTH — Port H data register  
State  
on reset  
Address bit 7  
$007C PH7  
bit 6  
PH6  
bit 5  
PH5  
bit 4  
PH4  
bit 3  
PH3  
bit 2  
PH2  
bit 1  
PH1  
bit 0  
Port H data (PORTH)  
PH0 undeÞned  
This is a read/write register and is not affected by reset. The bits may be read and written at any  
time, but when one of the pins PH[3:0] is allocated to its alternate function of PWM channel, a write  
to the corresponding register bit has no affect on the pin state.  
4.8.2  
DDRH — Data direction register for port H  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Data direction H (DDRH)  
$007D DDH7 DDH6 DDH5 DDH4 DDH3 DDH2 DDH1 DDH0 0000 0000  
DDH[7:0] — Data direction for port H  
1 (set) The corresponding pin is configured as an output.  
0 (clear) – The corresponding pin is configured as an input.  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-9  
4.8.3  
Wired-OR interrupt  
4.8.3.1  
WOIEH — WOI enable (WOIEH)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Wired-OR interrupt enable (WOIEH) $007B IEH7 IEH6 IEH5 IEH4 IEH3 IEH2 IEH1 IEH0 0000 0000  
4
IEHx — Port H pin x wired-OR interrupt enable  
1 (set)  
PHx wired-OR interrupt enabled.  
0 (clear) – PHx wired-OR interrupt disabled.  
With the wired-OR interrupt function enabled, any port H pin configured as an input may be used  
as a keyboard interrupt. A high to low transition on an enabled pin (with all other enabled pins high)  
will result in an interrupt.The wired-OR interrupt flag (bit 4 of the port pull-up assignment register)  
indicates that an interrupt has occurred (see Section 4.9.1). A wired-OR interrupt can wake the  
MCU from STOP or WAIT mode.  
TPG  
MOTOROLA  
4-10  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
4.9  
Internal pull-up resistors  
Four of the ports (B, F, G and H) have internal, software selectable pull-up resistors under control  
of the port pull-up assignment register (PPAR).  
4.9.1  
PPAR — Port pull-up assignment register  
State  
on reset  
Address bit 7  
$002C  
bit 6  
0
bit 5  
0
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
4
Port pull-up assignment (PPAR)  
0
HWOIF HPPUE GPPUE FPPUE BPPUE 0000 1111  
Bits [7:5] — Not implemented; always read zero.  
HWOIF — Port H wired-OR interrupt flag  
1 (set)  
Port H keyboard interrupt request.  
0 (clear) No port H keyboard interrupt request.  
This bit is cleared by a write to the PPAR register with HWOIF set. When this function is used,  
care must be taken when changing pull-up enable bits to prevent accidental clearing of this flag.  
xPPUE — Port x pin pull-up enable  
These bits control the on-chip pull-up devices connected to all the pins on I/O ports B, F, G and H.  
They are collectively enabled or disabled via the PAREN bit in the CONFIG register (see Section  
4.10.2).  
1 (set)  
Port x pin on-chip pull-up devices enabled.  
0 (clear) – Port x pin on-chip pull-up devices disabled.  
Note:  
Note:  
FPPUE and BPPUE have no effect in expanded mode since ports F and B are  
dedicated address bus or LCD outputs.  
When the SCI2 receiver is enabled, the associated pull-up on port G is disabled.  
4.10  
System configuration  
One bit in each of the following registers is directly concerned with the configuration of the I/O  
ports. For full details on the other bits in the registers, refer to the appropriate section.  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-11  
4.10.1  
OPT2 — System configuration options register 2  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
System conÞg. options 2 (OPT2)  
$0038 LIRDV CWOM STRCH IRVNE LSBF SPR2 EXT4X DISE x00x 0000  
LIRDV — LIR driven (refer to Section 3)  
1 (set) Enable LIR push-pull drive.  
4
0 (clear) – LIR not driven on MODA/LIR pin.  
CWOM — Port C wired-OR mode  
1 (set)  
Port C outputs are open-drain.  
0 (clear) – Port C operates normally.  
STRCH — Stretch external accesses (refer to Section 3)  
1 (set)  
Off-chip accesses are extended by one E clock cycle.  
0 (clear) – Normal operation.  
IRVNE — Internal read visibility/not E (refer to Section 3)  
1 (set)  
Data from internal reads is driven out of the external data bus.  
0 (clear) – No visibility of internal reads on external bus.  
In single chip mode this bit determines whether the E clock drives out from the chip.  
1 (set)  
E pin is driven low.  
0 (clear) – E clock is driven out from the chip.  
LSBF — LSB first enable (refer to Section 7)  
1 (set)  
SPI1 data is transferred LSB first.  
0 (clear) – SPI1 data is transferred MSB first.  
SPR2 — SPI1 clock rate select (refer to Section 7)  
EXT4X — 4XLCK or EXTAL clock output select (refer to Section 3  
1 (set)  
EXTALi clock output on the 4XOUT pin.  
0 (clear) – 4XCLK clock output on the 4XOUT pin.  
TPG  
MOTOROLA  
4-12  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
DISE— E clock output disable (refer to Section 3)  
1 (set) No E clock output.  
0 (clear) – E clock is output normally.  
4.10.2  
CONFIG — System configuration register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
4
ConÞguration control (CONFIG)  
$003F ROMAD FREEZ CLK4X PAREN NOSEC NOCOPROMON EEON xxxx xxxx  
ROMAD — ROM/EPROM mapping control (refer to Section 3)  
1 (set) ROM/EPROM addressed from $4000 to $FFFF.  
0 (clear) – ROM/EPROM addressed from $0000 to $BFFF (expanded mode  
only).  
FREEZ — Expanded user mode address bus freeze (refer to Section 3)  
1 (set)  
The external bus is only active when externally mapped resources  
are accessed (expanded mode only).  
0 (clear) – Normal operation.  
CLK4X — 4X clock enable (refer to Section 3)  
1 (set)  
4XCLK or EXTALi driven out on the 4XOUT pin.  
0 (clear) – 4XOUT pin disabled.  
PAREN — Pull-up assignment register enable  
1 (set)  
Pull-ups can be enabled using PPAR register.  
0 (clear) – All pull-ups disabled.  
NOSEC — EEPROM security disabled (refer to Section 3)  
1 (set)  
Disable security.  
0 (clear) – Enable security.  
NOCOP — COP system disable (refer to Section 10)  
1 (set)  
COP system disabled.  
0 (clear) – COP system enabled (forces reset on timeout).  
TPG  
MC68HC11PH8  
PARALLEL INPUT/OUTPUT  
MOTOROLA  
4-13  
ROMON — ROM/EPROM enable (refer to Section 3)  
1 (set) ROM/EPROM present in the memory map.  
0 (clear) – ROM/EPROM disabled from the memory map.  
EEON — EEPROM enable (refer to Section 3)  
1 (set)  
EEPROM is present in the memory map.  
0 (clear) – EEPROM is disabled from the memory map.  
4
TPG  
MOTOROLA  
4-14  
PARALLEL INPUT/OUTPUT  
MC68HC11PH8  
5
SERIAL COMMUNICATIONS INTERFACE  
The serial communications interface (SCI) is a universal asynchronous receiver transmitter  
(UART). It has a non-return to zero (NRZ) format (one start, eight or nine data, and one stop bit)  
that is compatible with standard RS-232 systems.  
5
The SCI shares I/O with two of port D’s pins:  
Alternate  
Pin  
function  
PD0  
PD1  
RXD1  
TXD1  
The SCI transmit and receive functions are enabled by TE and RE respectively, in SCCR2.  
The SCI features enabled on this MCU include: 13-bit modulus prescaler, idle line detect,  
receiver-active flag, transmitter and receiver hardware parity. A block diagram of the enhanced  
baud rate generator is shown in Figure 5-1. See Table 5-1 for example baud rate control values.  
Transmitter  
baud rate  
clock  
Internal  
phase 2 clock  
ST4XCK  
13-bit counter  
÷ 16  
Reset  
EQ  
Sync  
13-bit compare  
÷ 2  
Receiver  
baud rate  
clock  
SCBDH/L: SCI baud control  
Figure 5-1 SCI baud rate generator circuit diagram  
The MC68HC11PH8 contains two serial communications interfaces, both having similar  
operation. For ease of reference, a full description of SCI1 (PD0/RXD1, PD1/TXD1) is given  
first, followed by a summary of SCI2 (Section 5.8), detailing its differences.  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-1  
 
5.1  
Data format  
The serial data format requires the following conditions:  
An idle-line condition before transmission or reception of a message.  
A start bit, logic zero, transmitted or received, that indicates the start of each  
character.  
Data that is transmitted and received least significant bit (LSB) first.  
A stop bit, logic one, 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.)  
A break (defined as the transmission or reception of a logic zero for some  
multiple number of frames).  
5
Selection of the word length is controlled by the M bit of SCCR1.  
5.2  
Transmit operation  
The SCI transmitter includes a parallel data register (SCDRH/SCDRL) and a serial shift register.  
The contents of the shift register can only be written through the parallel data register.This double  
buffered operation allows a character to be shifted out serially while another character is waiting  
in the parallel data register to be transferred into the shift register. The output of the shift register  
is applied to TXD as long as transmission is in progress or the transmit enable (TE) bit of serial  
communication control register 2 (SCCR2) is set. The block diagram, Figure 5-2, shows the  
transmit serial shift register and the buffer logic at the top of the figure.  
5.3  
Receive operation  
During receive operations, the transmit sequence is reversed. The serial shift register receives  
data and transfers it to the parallel receive data registers (SCDRH/SCDRL) as a complete word.  
This double buffered operation allows a character to be shifted in serially while another character  
is still in the serial data registers. An advanced data recovery scheme distinguishes valid data from  
noise in the serial data stream. The data input is selectively sampled to detect receive data, and  
majority sampling logic determines the value and integrity of each bit.  
TPG  
MOTOROLA  
5-2  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
T8 SCDRH/SCDRL (transmit buffer)  
10/11-bit TX shift register  
LOOPS  
WOMS  
TXD1  
H 8 7  
0 L  
M
ST4XCK  
clock  
WAKE  
ILT  
LOOPS  
M
WOMS  
PE  
PE  
Transmitter  
control  
PT  
PT  
TE  
SBK  
TIE  
Flag control  
5
TCIE  
RIE  
ILIE  
TE  
WAKE  
PE  
PT  
RE  
RE  
Receiver  
control  
RWU  
SBK  
RWU  
M
LOOPS  
ILT  
WOMS  
10/11-bit RX shift register  
Data  
recovery  
RXD1  
8 7  
0
STOP  
START  
R8 SCDRH/SCDRL (receive buffer)  
SCSR1  
SCSR2  
OR  
&
RIE  
IDLE  
ILIE  
&
&
RDRF  
RIE  
SCI interrupt request  
&
&
+
TC  
TCIE  
Note: ꢀ = always reads as zero  
TDRE  
TIE  
Internal data bus  
Figure 5-2 SCI1 block diagram  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-3  
5.4  
Wake-up feature  
The wake-up feature reduces SCI service overhead in multiple receiver systems. Software for  
each receiver evaluates the first character or frame of each message. All receivers are placed in  
wake-up mode by writing a one to the RWU bit in the SCCR2 register. When RWU is set, the  
receiver-related status flags (RDRF, IDLE, OR, NF, FE, and PF) are inhibited (cannot be set).  
Although RWU can be cleared by a software write to SCCR2, to do so would be unusual. Normally  
RWU is set by software and is cleared automatically with hardware. Whenever a new message  
begins, logic alerts the dormant receivers to wake up and evaluate the initial character of the new  
message.  
Two methods of wake-up are available: idle-line wake-up and address mark wake-up. During  
idle-line wake-up, a dormant receiver activates as soon as the RXD line becomes idle. In the  
address mark wake-up, logic one in the most significant bit (MSB) of a character activates all  
sleeping receivers. To use either receiver wake-up method, establish a software addressing  
scheme to allow the transmitting devices to direct messages to individual receivers or to groups  
of receivers. This addressing scheme can take any form as long as all transmitting and receiving  
devices are programmed to understand the same scheme.  
5
5.4.1  
Idle-line wake-up  
Clearing the WAKE bit in SCCR1 register enables idle-line wake-up mode. In idle-line wake-up  
mode, all receivers are active (RWU bit in SCCR2 = 0) when each message begins. The first  
frames of each message are addressing frames. Each receiver in the system evaluates the  
addressing frames of a message to determine if the message is intended for that receiver. When  
a receiver finds that the message is not intended for it, it sets the RWU bit. Once set, the RWU  
control bit disables all but the necessary receivers for the remainder of the message, thus reducing  
software overhead for the remainder of that message. As soon as an idle line is detected by  
receiver logic, hardware automatically clears the RWU bit so that the first frames of the next  
message can be evaluated by all receivers in the system. This type of receiver wake-up requires  
a minimum of one idle frame time between messages, and no idle time between frames within a  
message.  
5.4.2  
Address-mark wake-up  
Setting the WAKE bit in SCCR1 register enables address-mark wake-up mode.The address-mark  
wake-up method uses the MSB of each frame to differentiate between address information  
(MSB = 1) and actual message data (MSB = 0). All frames consist of seven information bits (eight  
bits if M bit in SCCR1 = 1) and an MSB which, when set to one, indicates an address frame. The  
first frames of each message are addressing frames. Receiver logic evaluates these marked  
frames to determine the receivers for which that message is intended. When a receiver finds that  
the message is not intended for it, it sets the RWU bit. Once set, the RWU control bit disables all  
but the necessary receivers for the remainder of the message, thus reducing software overhead  
TPG  
MOTOROLA  
5-4  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
for the remainder of that message. When the next message begins, its first frame will have the  
MSB set which will automatically clear the RWU bit and indicate that this is an addressing frame.  
This frame is always the first frame received after wake-up because the RWU bit is cleared before  
the stop bit for the first frame is received.This method of wake-up allows messages to include idle  
times, however, there is a loss in efficiency due to the extra bit time required for the address bit in  
each frame.  
5.5  
SCI error detection  
Four error conditions can occur during SCI operation. These error conditions are: serial data  
register overrun, received bit noise, framing, and parity error. Four bits (OR, NF, FE, and PF) in  
serial communications status register 1 (SCSR1) indicate if one of these error conditions exists.  
5
The overrun error (OR) bit is set when the next byte is ready to be transferred from the receive  
shift register to the serial data registers (SCDRH/SCDRL) and the registers are already full (RDRF  
bit is set).When an overrun error occurs, the data that caused the overrun is lost and the data that  
was already in serial data registers is not disturbed. The OR is cleared when the SCSR is read  
(with OR set), followed by a read of the SCI data registers.  
The noise flag (NF) bit is set if there is noise on any of the received bits, including the start and  
stop bits. The NF bit is not set until the RDRF flag is set. The NF bit is cleared when the SCSR is  
read (with FE equal to one) followed by a read of the SCI data registers.  
When no stop bit is detected in the received data character, the framing error (FE) bit is set. FE is  
set at the same time as the RDRF. If the byte received causes both framing and overrun errors,  
the processor only recognizes the overrun error. The framing error flag inhibits further transfer of  
data into the SCI data registers until it is cleared. The FE bit is cleared when the SCSR is read  
(with FE equal to one) followed by a read of the SCI data registers.  
The parity error flag (PF) is set if received data has incorrect parity. The flag is cleared by a read  
of SCSR1 with PE set, followed by a read of SCDR.  
5.6  
SCI registers  
There are eight addressable registers in the SCI. SCBDH, SCBDL, SCCR1, and SCCR2 are  
control registers. The contents of these registers control functions and indicate conditions within  
the SCI. The status registers SCSR1 and SCSR2 contain bits that indicate certain conditions  
within the SCI. SCDRH and SCDRL are SCI data registers. These double buffered registers are  
used for the transmission and reception of data, and are used to form the 9-bit data word for the  
SCI. If the SCI is being used with 7 or 8-bit data, only SCDRL needs to be accessed. Note that if  
9-bit data format is used, the upper register should be written first to ensure that it is transferred  
to the transmitter shift register with the lower register.  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-5  
5.6.1  
SCBDH, SCBDL — SCI baud rate control registers  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SCI1 baud rate high (SCBDH)  
SCI1 baud rate low (SCBDL)  
$0070 BTST BSPL BRST SBR12 SBR11 SBR10 SBR9 SBR8 0000 0000  
$0071 SBR7 SBR6 SBR5 SBR4 SBR3 SBR2 SBR1 SBR0 0000 0100  
The contents of this register determine the baud rate of the SCI.  
BTST — Baud register test (Test mode only)  
BSPL — Baud rate counter split (Test mode only)  
BRST — Baud rate reset (Test mode only)  
SBR[12:0] — SCI baud rate selects  
5
Use the following formula to calculate SCI baud rate. Refer to the table of baud rate control values  
for example rates:  
ST4XCK  
16 × (2BR)  
SCI baud rate =  
----------------------------  
where the baud rate control value (BR) is the contents of SCBDH/L (BR = 1, 2, 3,... 8191).  
For example, to obtain a baud rate of 1200 with a ST4XCK frequency of 12MHz, the baud register  
(SCBDH/L) should contain $0138 (see Table 5-1).  
The clock rate generator is disabled if BR = 0, or if neither the receiver nor transmitter is enabled  
(both RE and TE in SCCR2 are cleared).  
Writes to the baud rate registers will only be successful if the last (or only) byte written is SCBDL.  
The use of an STD instruction is recommended as it guarantees that the bytes are written in the  
correct order.  
Note:  
ST4XCK may be the output of the PLL circuit or it may be the EXTAL input of the MCU  
(see Section 2.5, Figure 8-1 and Figure 8-2).  
TPG  
MOTOROLA  
5-6  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
Table 5-1 Example SCI baud rate control values  
ST4XCK frequency  
12 MHz  
Target  
baud  
rate  
8 MHz  
16 MHz  
Dec value Hex value Dec value Hex value Dec value Hex value  
110  
150  
2272  
1666  
833  
416  
208  
104  
52  
$08E0  
$0682  
$0341  
$01A0  
$00D0  
$0068  
$0034  
$001A  
$000D  
3409  
2500  
1250  
625  
312  
156  
78  
$0D51  
$09C4  
$04E2  
$0271  
$0138  
$009C  
$004E  
$0027  
$0014  
4545  
3333  
1666  
833  
416  
208  
104  
52  
$11C1  
$0D05  
$0682  
$0341  
$01A0  
$00D0  
$0068  
$0034  
$001A  
$000D  
300  
600  
1200  
2400  
4800  
9600  
19200  
38400  
5
26  
39  
13  
20  
26  
13  
5.6.2  
SCCR1 — SCI control register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
M
bit 3  
bit 2  
bit 1  
PE  
bit 0  
SCI1 control 1 (SCCR1)  
$0072 LOOPS WOMS  
WAKE ILT  
PT 0000 0000  
The SCCR1 register provides the control bits that determine word length and select the method  
used for the wake-up feature.  
LOOPS — SCI loop mode enable  
1 (set)  
SCI transmit and receive are disconnected from TXD and RXD pins,  
and transmitter output is fed back into the receiver input.  
0 (clear) – SCI transmit and receive operate normally.  
Both the transmitter and receiver must be enabled to use the LOOP mode.When the LOOP mode  
is enabled, the TXD pin is driven high (idle line state) if the transmitter is enabled.  
WOMS — Wired-OR mode for SCI pins (PD1, PD0)  
1 (set)  
TXD and RXD are open drains if operating as outputs.  
0 (clear) – TXD and RXD operate normally.  
Bit 5 — Not implemented; always reads zero  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-7  
 
M — Mode (select character format)  
1 (set) Start bit, 9 data bits, 1 stop bit.  
0 (clear) – Start bit, 8 data bits, 1 stop bit.  
WAKE — Wake-up by address mark/idle  
1 (set)  
Wake-up by address mark (most significant data bit set).  
0 (clear) – Wake-up by IDLE line recognition.  
ILT — Idle line type  
1 (set)  
Long (SCI counts ones only after stop bit).  
5
0 (clear) – Short (SCI counts consecutive ones after start bit).  
This bit determines which of two types of idle line detection method is used by the SCI receiver.  
In short mode the stop bit and any bits that were ones before the stop bit will be considered as  
part of that string of ones, possibly resulting in erroneous or premature detection of an idle line  
condition. In long mode the SCI system does not begin counting ones until a stop bit is received.  
PE — Parity enable  
1 (set)  
Parity enabled.  
0 (clear) – Parity disabled.  
PT — Parity type  
1 (set)  
Parity odd (an odd number of ones causes parity bit to be zero, an  
even number of ones causes parity bit to be one).  
0 (clear) – Parity even (an even number of ones causes parity bit to be zero, an  
odd number of ones causes parity bit to be one).  
TPG  
MOTOROLA  
5-8  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
5.6.3  
SCCR2 — SCI control register 2  
State  
on reset  
Address bit 7  
$0073 TIE  
bit 6  
bit 5  
RIE  
bit 4  
ILIE  
bit 3  
TE  
bit 2  
RE  
bit 1  
bit 0  
SCI1 control 2 (SCCR2)  
TCIE  
RWU SBK 0000 0000  
The SCCR2 register provides the control bits that enable or disable individual SCI functions.  
TIE — Transmit interrupt enable  
1 (set)  
SCI interrupt requested when TDRE status flag is set.  
0 (clear) – TDRE interrupts disabled.  
5
TCIE — Transmit complete interrupt enable  
1 (set)  
SCI interrupt requested when TC status flag is set.  
0 (clear) – TC interrupts disabled.  
RIE — Receiver interrupt enable  
1 (set)  
SCI interrupt requested when RDRF flag or the OR status flag is set.  
0 (clear) – RDRF and OR interrupts disabled.  
ILIE — Idle line interrupt enable  
1 (set)  
SCI interrupt requested when IDLE status flag is set.  
0 (clear) – IDLE interrupts disabled.  
TE — Transmitter enable  
1 (set) Transmitter enabled.  
0 (clear) Transmitter disabled.  
RE — Receiver enable  
1 (set) Receiver enabled.  
0 (clear) – Receiver disabled.  
RWU — Receiver wake-up control  
1 (set)  
Wake-up enabled and receiver interrupts inhibited.  
0 (clear) – Normal SCI receiver.  
SBK — Send break  
1 (set)  
0 (clear) – Break generator off.  
Break codes generated as long as SBK is set.  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-9  
 
5.6.4  
SCSR1 — SCI status register 1  
State  
on reset  
Address bit 7  
$0074 TDRE  
bit 6  
TC  
bit 5  
bit 4  
bit 3  
OR  
bit 2  
NF  
bit 1  
FE  
bit 0  
SCI1 status 1 (SCSR1)  
RDRF IDLE  
PF 1100 0000  
The bits in SCSR1 indicate certain conditions in the SCI hardware and are automatically cleared  
by special acknowledge sequences.  
TDRE — Transmit data register empty flag  
1 (set)  
SCDR empty.  
0 (clear) – SCDR busy.  
5
This flag is set when SCDR is empty. Clear the TDRE flag by reading SCSR1 with TDRE set and  
then writing to SCDR.  
TC — Transmit complete flag  
1 (set)  
Transmitter idle.  
0 (clear) Transmitter busy.  
This flag is set when the transmitter is idle (no data, preamble, or break transmission in progress).  
Clear the TC flag by reading SCSR1 with TC set and then writing to SCDR.  
RDRF — Receive data register full flag  
1 (set)  
SCDR full.  
0 (clear) – SCDR empty.  
Once cleared, IDLE is not set again until the RXD line has been active and becomes idle again.  
RDRF is set if a received character is ready to be read from SCDR. Clear the RDRF flag by  
reading SCSR1 with RDRF set and then reading SCDR.  
IDLE — Idle line detected flag  
1 (set)  
RXD line is idle.  
0 (clear) – RXD line is active.  
This flag is set if the RXD line is idle. Once cleared, IDLE is not set again until the RXD line has  
been active and becomes idle again. The IDLE flag is inhibited when RWU = 1. Clear IDLE by  
reading SCSR1 with IDLE set and then reading SCDR.  
TPG  
MOTOROLA  
5-10  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
OR — Overrun error flag  
1 (set) Overrun detected.  
0 (clear) – No overrun.  
OR is set if a new character is received before a previously received character is read from SCDR.  
Clear the OR flag by reading SCSR1 with OR set and then reading SCDR.  
NF — Noise error flag  
1 (set)  
Noise detected.  
0 (clear) – Unanimous decision.  
NF is set if the majority sample logic detects anything other than a unanimous decision. Clear NF  
by reading SCSR1 with NF set and then reading SCDR.  
5
FE — Framing error  
1 (set)  
Zero detected.  
0 (clear) – Stop bit detected.  
FE is set when a zero is detected where a stop bit was expected. Clear the FE flag by reading  
SCSR1 with FE set and then reading SCDR.  
PF — Parity error flag  
1 (set)  
Incorrect parity detected.  
0 (clear) – Parity correct.  
PF is set if received data has incorrect parity. Clear PF by reading SCSR1 with PE set and then  
reading SCDR.  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-11  
5.6.5  
SCSR2 — SCI status register 2  
State  
on reset  
Address bit 7  
$0075  
bit 6  
0
bit 5  
0
bit 4  
0
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
SCI1 status 2 (SCSR2)  
0
RAF 0000 0000  
In the SCSR2 only bit 0 is used, to indicate receiver active.The other seven bits always read zero.  
Bits [7:1] — Not implemented; always read zero  
RAF — Receiver active flag (read only)  
1 (set)  
A character is being received.  
5
0 (clear) – A character is not being received.  
5.6.6  
SCDRH, SCDRL — SCI data high/low registers  
State  
on reset  
Address bit 7  
$0076 R8  
bit 6  
T8  
bit 5  
0
bit 4  
0
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
0
SCI1 data high (SCDRH)  
SCI1 data low (SCDRL)  
undeÞned  
$0077 R7T7 R6T6 R5T5 R4T4 R3T3 R2T2 R1T1 R0T0 undeÞned  
SCDRH/SCDRL is a parallel register that performs two functions. It is the receive data register  
when it is read, and the transmit data register when it is written. Reads access the receive data  
buffer and writes access the transmit data buffer. Data received or transmitted is double buffered.  
If the SCI is being used with 7 or 8-bit data, only SCDRL needs to be accessed. Note that if 9-bit  
data format is used, the upper register should be written first to ensure that it is transferred to the  
transmitter shift register with the lower register.  
R8 — Receiver bit 8  
Ninth serial data bit received when SCI is configured for a nine data bit operation  
T8 — Transmitter bit 8  
Ninth serial data bit transmitted when SCI is configured for a nine data bit operation  
Bits [5:0] — Not implemented; always read zero  
R/T[7:0] — Receiver/transmitter data bits [7:0]  
SCI data is double buffered in both directions.  
TPG  
MOTOROLA  
5-12  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
 
5.7  
Status flags and interrupts  
The SCI transmitter has two status flags. These status flags can be read by software (polled) to  
tell when certain conditions exist. Alternatively, a local interrupt enable bit can be set to enable  
each of these status conditions to generate interrupt requests. Status flags are automatically set  
by hardware logic conditions, but must be cleared by software. This provides an interlock  
mechanism that enables logic to know when software has noticed the status indication. The  
software clearing sequence for these flags is automatic — functions that are normally performed  
in response to the status flags also satisfy the conditions of the clearing sequence.  
TDRE and TC flags are normally set when the transmitter is first enabled (TE set to one). The  
TDRE flag indicates there is room in the transmit queue to store another data character in the  
transmit data register. The TIE bit is the local interrupt mask for TDRE. When TIE is zero, TDRE  
must be polled. When TIE and TDRE are one, an interrupt is requested.  
5
The TC flag indicates the transmitter has completed the queue. The TCIE bit is the local interrupt  
mask for TC.When TCIE is zero, TC must be polled; when TCIE is one and TC is one, an interrupt  
is requested.  
Writing a zero to TE requests that the transmitter stop when it can.The transmitter completes any  
transmission in progress before shutting down. Only an MCU reset can cause the transmitter to  
stop and shut down immediately. If TE is cleared when the transmitter is already idle, the pin  
reverts to its general purpose I/O function (synchronized to the bit-rate clock). If anything is being  
transmitted when TE is cleared, that character is completed before the pin reverts to general  
purpose I/O, but any other characters waiting in the transmit queue are lost. The TC and TDRE  
flags are set at the completion of this last character, even though TE has been disabled.  
5.7.1  
Receiver flags  
The SCI receiver has seven status flags, three of which can generate interrupt requests. The  
status flags are set by the SCI logic in response to specific conditions in the receiver. These flags  
can be read (polled) at any time by software. Refer to Figure 5-3, which shows SCI interrupt  
arbitration.  
When an overrun takes place, the new character is lost, and the character that was in its way in  
the parallel receive data register (RDR) is undisturbed. RDRF is set when a character has been  
received and transferred into the parallel RDR. The OR flag is set instead of RDRF if overrun  
occurs. A new character is ready to be transferred into the RDR before a previous character is read  
from the RDR.  
The NF, FE and PF flags provide additional information about the character in the RDR, but do not  
generate interrupt requests.  
The receiver active flag (RAF) indicates that the receiver is busy.  
The last receiver status flag and interrupt source come from the IDLE flag.The RXD line is idle if it has  
constantly been at logic one for a full character time. The IDLE flag is set only after the RXD line has  
been busy and becomes idle.This prevents repeated interrupts for the time RXD remains idle.  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-13  
Note: The bit names shown are for SCI1.The diagram  
applies equally to SCI2, when the appropriate bit  
names are substituted.  
Begin  
Yes  
Yes  
Yes  
Yes  
Yes  
RDRF = 1?  
No  
Yes  
Yes  
Yes  
Yes  
Yes  
OR = 1?  
No  
RIE = 1?  
No  
RE = 1?  
No  
Yes  
TDRE = 1?  
No  
TIE = 1?  
No  
TE = 1?  
5
No  
TC = 1?  
No  
TCIE = 1?  
No  
Yes  
IDLE = 1?  
No  
ILIE = 1?  
No  
RE = 1?  
No  
No valid SCI  
interrupt request  
Valid SCI  
interrupt request  
Figure 5-3 Interrupt source resolution within SCI  
TPG  
MOTOROLA  
5-14  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
5.8  
SCI2  
In addition to the subsystem described in the above paragraphs (SCI1), the MC68HC11PH8 has  
another, similar, SCI module (SCI2). This system is identical to SCI1, with the following  
exceptions:  
SCI2 shares I/O with two port G pins:  
Alternate  
function  
Pin  
PG0  
PG1  
RXD2  
TXD2  
5
The SCI2 transmit and receive functions are enabled by TE2 and RE2  
respectively, in S2CR2.  
SCI1 functions and data are handled by a register block at $0070–$0077.  
The corresponding registers for SCI2 are at addresses $0050–$0057, as  
described in the following sections.  
The SCI2 baud rate register is at address $0050/51.  
In addition to the SCI functions,SCI2 is also used for MI BUS, controlled by  
bit 5 of S2CR1. Refer to Section 6 for full details of MI BUS operation.  
5.8.1  
S2BDH, S2BDL — SCI2 baud rate control registers  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SCI2/MI baud high (S2BDH)  
SCI2/MI baud low (S2BDL)  
$0050 B2TST B2SPL B2RST S2B12 S2B11 S2B10 S2B9 S2B8 0000 0000  
$0051 S2B7 S2B6 S2B5 S2B4 S2B3 S2B2 S2B1 S2B0 0000 0100  
The contents of this register determine the baud rate for SCI2. For details of the bits and the  
corresponding baud rates, see Section 5.6.1. This register also controls the MI BUS clock rate  
(see Section 6).  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-15  
5.8.2  
S2CR1 — SCI2 control register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
PE2  
bit 0  
SCI2/MI control 1 (S2CR1)  
$0052 LOPS2 WOMS2 MIE2  
M2 WAKE2 ILT2  
PT2 0000 0000  
The S2CR1 register provides the control bits that determine word length and select the method  
used for the wake-up feature. Bit 5 has an MI BUS control function detailed below (for details of  
the other bits see Section 5.6.2).  
WOMS2 — Wired-OR mode for SCI pins (PG1, PG0)  
1 (set)  
TXD2 and RXD2 are open drains if operating as inputs.  
5
0 (clear) – TXD2 and RXD2 operate normally.  
MIE2 — Motorola interface bus enable 2  
1 (set)  
MI BUS is enabled for this subsystem.  
0 (clear) – The SCI functions normally.  
When MIE2 is set, the SCI2 registers, bits and pins assume the functionality required for MI BUS.  
5.8.3  
S2CR2 — SCI2 control register 2  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SCI2/MI control 2 (S2CR2)  
$0053 TIE2 TCIE2 RIE2 ILIE2 TE2  
RE2 RWU2 SBK2 0000 0000  
The S2CR2 register provides the control bits that enable or disable individual SCI functions. For  
details of the bits, see Section 5.6.3.  
5.8.4  
S2SR1 — SCI2 status register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
NF2  
bit 1  
FE2  
bit 0  
SCI2/MI status 1 (S2SR1)  
$0054 TDRE2 TC2 RDRF2 IDLE2 OR2  
PF2 1100 0000  
The bits in S2SR1 indicate certain conditions in the SCI hardware and are automatically cleared  
by special acknowledge sequences. For details of the bits, see Section 5.6.4.  
TPG  
MOTOROLA  
5-16  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
5.8.5  
S2SR2 — SCI2 status register 2  
State  
on reset  
Address bit 7  
$0055  
bit 6  
0
bit 5  
0
bit 4  
0
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
SCI2/MI status 2 (S2SR2)  
0
RAF2 0000 0000  
In the S2SR2 only bit 0 is used, to indicate receiver active (see Section 5.6.5 for details).The other  
seven bits always read zero.  
5.8.6  
S2DRH, S2DRL — SCI2 data high/low registers  
5
State  
on reset  
Address bit 7  
$0056 R8B  
bit 6  
T8B  
bit 5  
0
bit 4  
0
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
0
SCI2/MI data high (S2DRH)  
SCI2/MI data low (S2DRL)  
undeÞned  
$0057 R7T7B R6T6B R5T5B R4T4B R3T3B R2T2B R1T1B R0T0B undeÞned  
S2DRH/S2DRL is a parallel register that performs two functions. It is the receive data register  
when it is read, and the transmit data register when it is written. Reads access the receive data  
buffer and writes access the transmit data buffer. Data received or transmitted is double buffered.  
See Section 5.6.6 for more details.  
TPG  
MC68HC11PH8  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
5-17  
5
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
5-18  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC11PH8  
6
MOTOROLA INTERCONNECT BUS (MI BUS)  
The Motorola Interconnect Bus (MI BUS) is a serial communications protocol which supports  
distributed real-time control efficiently and with a high degree of noise immunity, at a typical bit rate  
for the data transfer of 20kHz. The MI BUS is suitable for medium speed networks requiring very  
low cost multiplex wiring; only one wire is required to connect to slave devices.  
The MI BUS uses a push-pull sequence to transfer data. The master device, which in this case is  
the MC68HC11PH8, sends a push field to the slave devices connected to the bus. The push field  
contains data plus an address that is recognized by one of the slaves.The slave addressed returns  
data which the master pulls from the MI BUS over the same wire. Specific details of the message  
format are covered later in this section. The MCU (master) can take the bus at any time, with a  
start bit that violates the rules of Manchester biphase encoding. Up to eight slave devices may be  
addressed by the MI BUS. Other features of MI BUS include message validation, error detection,  
and default value setting.  
6
On the MC68HC11PH8 the MI BUS module shares the same pins on port G as the SCI2 module.  
Data is transmitted (or ‘pushed’) via the TXD pin, and received (‘pulled’) via the RXD pin. While  
data is being pushed, RXD will be disconnected from the receiver circuitry.The message frame is  
handled automatically in hardware. The MCU register interface is similar to that for the SCI.  
Alternate  
Pin  
function  
PG0  
PG1  
RXD2  
TXD2  
MI BUS functions are enabled by MIE2 in S2CR1  
Related information on Motorola’s MI BUS is contained in the following Motorola publications:  
EB409/D — The MI BUS and Product family for Multiplexing Systems  
AN475/D — Single Wire MI BUS Controlling Stepper Motors  
BR477/D — Smart Mover – Stepper Motors with Integrated Serial Bus Controller  
TPG  
MC68HC11PH8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MOTOROLA  
6-1  
6.1  
Push-pull sequence  
Communication between the MCU and the slave device always utilizes the same frame  
organization. First, the MCU sends serial data to the selected device. This data field is called the  
‘push field’. At the end of the push field, the selected device automatically sends back to the MCU  
the data held during the push sequence. The MCU reads the serial data sent by the selected  
device. This data is called the ‘pull field’ and contains status information followed by the  
end-of-frame information from the selected device.  
Time slots  
Push (biphase coded)  
Pull (NRZ coded)  
Push-pull function  
TXD pin (true data)  
MI BUS wire  
1 0  
0 1  
6
0 1 2 3 4 5 6 7  
Stop  
Start  
Push  
sync  
Pull  
Bit Þelds  
Start  
D0 D1 D2 D3 D4 A0 A1 A2  
sync  
NRZ  
Data  
Data  
Address  
End of frame  
Push Þeld  
(driven by MCU)  
Pull Þeld  
(driven by slave)  
Message frame  
Figure 6-1 MI BUS timing  
6.1.1  
The push field  
The push field consists of a start bit, a push synchronization bit, a push data field and a push  
address field. The start consists of three time slots having the dominant logical state ‘0’. The start  
marks the beginning of the message frame by violation of the rule of the Manchester code. The  
push synchronization bit consists of a biphase coded ‘0’. Biphase coding will be discussed later.  
The push data field consists of five bits of biphase coded data.The push address consists of three  
bits of biphase coded data. Data and address are written to the lower byte of the SCI data register  
(S2DRL). The push data occupies the lower five bits and the push address occupies the upper  
three bits of the register.  
TPG  
MOTOROLA  
6-2  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MC68HC11PH8  
6.1.2  
The pull field  
The pull field consists of a pull synchronization bit, a pull data field and an end of frame. The pull  
synchronization bit is a biphase coded ‘1’ and is initiated by the MCU during the time slot after the  
last address bit of the push field. The pull data field consists of an NRZ coded transmission, each  
bit taking one time slot. Once shifted in, the pull data is stored in the lower byte of the SCI data  
register (S2DRL). The end-of-frame field is a square wave signal having a typical frequency of  
20kHz ± 1% tolerance (i.e. the bit rate of the push field) when the data sent to the selected device  
is valid.  
6.2  
Biphase coding  
Manchester biphase L coding is used for the push field bits. Each bit requires two time slots to  
encode the logic value of the bit. This encoding allows the detection of a single error at the time  
slot level. Bits are encoded as follows:  
6
1 (set)  
In the first time slot, the logic level is set to zero, followed by a logic  
level one in the second time slot;  
0 (clear) – In the first time slot, the logic level is set to one, followed by a logic  
level zero in the second time slot.  
Ô0Õ  
Ô1Õ  
Biphase coded signal  
t
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
a
a
b
b
a
a
b
b
Biphase detection  
Noise detection  
aÕ  
bÕ  
aÕ  
bÕ  
Figure 6-2 Biphase coding and error detection  
TPG  
MC68HC11PH8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MOTOROLA  
6-3  
6.3  
Message validation  
The communication between the MCU and the selected device is valid when the MCU reads a pull  
data field having correct codes (excluding the codes ‘111’ and ‘000’) followed by a square wave  
signal, having a frequency of 20kHz, contained in the end-of-frame information.  
An MI BUS error is detected when the pull field contains the code ‘111’ followed by the  
end-of-frame permanently tied to logical state1’.This means that the communication between the  
MCU and the selected device was not accomplished.  
6.3.1  
Controller detected errors  
There are three different MI BUS error types which are detected by the selected slave device and  
are not mutually exclusive. The MCU cannot determine which error occurred.  
Noise error Slave devices take two samples in each time slot of the biphase  
encoded push field.An error occurs when the two samples for each time slot  
are not the same logical level.  
6
Biphase error Slave devices receiving the push field detect the biphase  
code. An error occurs when the two time slots of the biphase code do not  
yield a logical exclusive-OR function.  
Field error A field error is detected when the fixed-form of the push field is  
violated.  
6.3.2  
MCU detected errors  
There is a fourth error that can be detected by the MCU. This error causes the noise flag (NF) to  
be asserted in the S2SR1 register during the push field sequence.  
Bit error A bit error can be detected by the MCU during the push field.The  
MI BUS serial system monitors the bus via on-chip hardware at the RXD pin  
at the same time as sending data.A bit error is detected at that bit time when  
the value monitored is different from the bit value sent.  
TPG  
MOTOROLA  
6-4  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MC68HC11PH8  
T8  
Transmit buffer  
LOPS2  
WOMS2  
MIE2  
M2  
10/11-bit TX shift register  
TXD2  
H 8 7  
0 L  
WAKE2  
ILT2  
ST4XCK  
clock  
WOMS  
PE2  
MIE2  
Transmitter  
control  
PT2  
PT2  
TE2  
SBK2  
TIE2  
Flag control  
TCIE2  
RIE2  
ILIE2  
TE2  
MIE2  
RE2  
6
RE2  
Receiver  
control  
RWU2  
SBK2  
WOMS  
10/11-bit RX shift register  
Data  
recovery  
RXD2  
8 7  
0
STOP  
START  
R8  
Receive buffer  
S2SR1  
S2SR2  
IDLE2  
ILIE2  
&
&
RDRF2  
&
&
RIE2  
SCI interrupt request  
+
TC2  
TCIE2  
Note: ꢀ = always reads as zero  
= not used in MI BUS mode  
TDRE2  
TIE2  
Internal data bus  
Figure 6-3 MI BUS block diagram  
TPG  
MC68HC11PH8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MOTOROLA  
6-5  
6.4  
Interfacing to MI BUS  
Physically the MI BUS consists of only a single wire. In the example shown in Figure 6-4, only a  
single transistor and a few passive components are required to connect up the MC68HC11PH8  
for full MI BUS operation.  
V
DD  
+12V  
1.2kΩ  
4.7kΩ  
18V  
MI BUS  
V
DD  
T1  
TX  
3.9kΩ  
10kΩ  
V
DD  
6
MCU  
22kΩ  
10kΩ  
RX  
V
SS  
Figure 6-4 A typical interface between the MC68HC11PH8 and the MI BUS  
The transistor serves both to drive the MI BUS during the push field and to protect the MCU TX  
pin from voltage transients generated in the wiring. Without the transistor, EMI could damage the  
TX pin. Similarly, the input pin (RX) is protected from EMI by clamping it to the MCU supply rails  
with two diodes.When a load dump occurs, the zener diode (18V) is switched on and hence turns  
the transistor on; this generates the logic ‘0’ state on the MI BUS. After eight time slots (200ms)  
of continuous ‘0’ state, all devices on the MI BUS will have their outputs disabled.  
The MI BUS line can take two states, recessive or dominant. The recessive state (‘1’) is  
represented by 5V, through a pull-up resistor of 10k. The dominant state (‘0’) is represented by  
a maximum 0.3V (V  
of the transistor, T1).  
CESAT  
The bus load depends on the number of devices on the bus. Each device has a pull-up resistor of  
10k. An external termination resistor is used to stabilize the load resistance of the bus at 600.  
TPG  
MOTOROLA  
6-6  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MC68HC11PH8  
6.5  
MI BUS clock rate  
The MI BUS clock rate is set via the SCI baud registers. To use the MI BUS, the ST4XCK clock  
frequency that drives the SCI clock generator must be selected to match the minimum resolution  
of the MI BUS logic. This is expressed by the following formula:  
ST4XCK = 16 • 2n • (2 • Push_field_bit_rate) = 16 • 2n • 40kHz = n • 1280kHz  
where ‘n’ is an integer and 20kHz is the minimum Push field bit rate for the MI BUS. Values for  
ST4XCK could be 1280kHz, 2560kHz, …, n • 1280kHz. The value ‘n’ is the modulus for the  
MI BUS baud register (see Section 6.6.2). ST4XCK may be the output of the PLL circuit or it may  
be the EXTAL input of the MCU. Refer to Section 2.5.  
6.6  
SCI2/MI BUS registers  
6
MI BUS operation is controlled by the same group of registers as is used for the SCI. However the  
functions of some of the bits are modified when in MI BUS mode. A description of the registers,  
as applicable to the MI BUS function, is given here.  
Note:  
In MI BUS mode, bits that have no meaning are reserved by Motorola, and are not  
described.  
TPG  
MC68HC11PH8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MOTOROLA  
6-7  
6.6.1  
INIT2 — EEPROM mapping and MI BUS delay register  
State  
on reset  
Address bit 7  
$0037 EE3  
bit 6  
EE2  
bit 5  
EE1  
bit 4  
bit 3  
bit 2  
0
bit 1  
bit 0  
EEPROM mapping (INIT2)  
EE0 STRX  
M2DL1 M2DL0 0000 0000  
This register sets the MI BUS delay time. INIT2 may be read at any time but bits 7–4 may be  
written only once after reset in normal modes (bits 3, 1 and 0 may be written at any time).  
EE[3:0] — EEPROM map position (Refer to Section 3.3.2.3.)  
EEPROM is located at $xD00–$xFFF, where x is the hexadecimal digit represented by EE[3:0].  
STRX — Stretch extended (Refer to Section 3.3.2.3)  
1 (set)  
All external accesses are extended by one E clock cycle.  
6
0 (clear) – Only external access from $0000 to $1FFF (ROMAD set) or from  
$C000 to $DFFF (ROMAD clear) are extended by one E clock cycle.  
Bit 2 — Not implemented, always read zero.  
M2DL1:M2DL0 — MI BUS delay select  
These bits are used to set up the delay for the start of the NRZ receive for MI BUS operation as  
shown (for a 20kHz bit rate) in the following table.  
(1)  
M2DL1 M2DL0 Delay factor Delay time  
(2)  
0
0
1
1
0
1
0
1
1
2
3
4
1.5625µs  
3.1250µs  
4.6875µs  
6.2500µs  
(1) 20kHz bit rate requires 25µs (40kHz) time slots.  
(2) 25µs ÷ 16  
TPG  
MOTOROLA  
6-8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MC68HC11PH8  
6.6.2  
S2BDH, S2BDL — MI BUS clock rate control registers  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SCI2/MI baud high (S2BDH)  
SCI2/MI baud low (S2BDL)  
$0050 B2TST B2SPL B2RST S2B12 S2B11 S2B10 S2B9 S2B8 0000 0000  
$0051 S2B7 S2B6 S2B5 S2B4 S2B3 S2B2 S2B1 S2B0 0000 0100  
The contents of this register determine the clock rate for MI BUS.  
S2B[12:0] — SCI baud rate/ MI BUS clock rate selects  
Use the following formula to calculate MI BUS clock rate. Refer to the table of baud rate control  
values (see Table 5-1) for example rates:  
ST4XCK  
16 × (2BR)  
MI BUS clock rate =  
----------------------------  
6
where the baud rate control value (BR) is the contents of S2BDH/L (BR = 1, 2, 3,... 8191).  
The clock rate generator is disabled if BR = 0, or if neither the receiver nor transmitter is enabled  
(both RE and TE in SCCR2 are cleared).  
Writes to the baud rate registers will only be successful if the last (or only) byte written is SCBDL.  
The use of an STD instruction is recommended as it guarantees that the bytes are written in the  
correct order.  
Note:  
ST4XCK may be the output of the PLL circuit or it may be the EXTAL input of the MCU.  
Selection is made by the MCS bit in the PLLCR (see Section 2.5).  
6.6.3  
S2CR1 — MI BUS control register 1  
State  
on reset  
Address bit 7  
$0052  
bit 6  
bit 5  
bit 4  
Ñ
bit 3  
Ñ
bit 2  
Ñ
bit 1  
Ñ
bit 0  
SCI2/MI control 1 (S2CR1)  
Ñ
WOMS2 MIE2  
PT2 0000 0000  
WOMS2 — Wired-OR mode for MI BUS pins (PG0, PG1)  
1 (set) TXD2 and RXD2 are open drains if operating as outputs.  
0 (clear) – TXD2 and RXD2 operate normally.  
MIE2 — Motorola interface bus enable 2  
1 (set)  
MI BUS is enabled for this subsystem.  
0 (clear) – The SCI functions normally.  
When MIE2 is set, the SCI2 registers, bits and pins assume the functionality required for MI BUS.  
TPG  
MC68HC11PH8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MOTOROLA  
6-9  
PT2 — MI BUS TX polarity (See Section 5.6.2)  
1 (set) MI BUS transmit pin will send inverted data.  
0 (clear) – MI BUS transmit pin functions normally.  
This control bit allows for different driver interfaces between the MCU and the MI BUS wire.  
6.6.4  
S2CR2 — MI BUS control register 2  
State  
on reset  
Address bit 7  
$0053  
bit 6  
Ñ
bit 5  
bit 4  
Ñ
bit 3  
TE2  
bit 2  
RE2  
bit 1  
Ñ
bit 0  
SCI2/MI control 2 (S2CR2)  
Ñ
RIE2  
SBK2 0000 0000  
RIE2 — Receiver interrupt enable 2  
1 (set) MI BUS interrupt requested when RDRF2 flag is set.  
6
0 (clear) – RDRF2 and OR2 interrupts disabled.  
TE2 — Transmitter enable 2  
1 (set)  
Transmitter enabled and port pin dedicated to the MI BUS.  
0 (clear) Transmitter disabled.  
RE2 — Receiver enable 2  
1 (set) Port pin dedicated to the MI BUS; the receiver is enabled by a pull  
sync and is inhibited during a push field.  
0 (clear) – Receiver disabled.  
SBK2 — Send break 2  
1 (set) MI transmit line is set low for 20 time slots.  
0 (clear) – No action.  
When an MI BUS wire is held low for eight or more time slots an internal circuit on any slave device  
connected to the bus may reset or preset the device with default values.  
TPG  
MOTOROLA  
6-10  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MC68HC11PH8  
6.6.5  
S2SR1 — MI BUS status register 1  
State  
on reset  
Address bit 7  
$0054  
bit 6  
Ñ
bit 5  
bit 4  
Ñ
bit 3  
OR2  
bit 2  
NF2  
bit 1  
Ñ
bit 0  
Ñ
SCI2/MI status 1 (S2SR1)  
Ñ
RDRF2  
1100 0000  
The bits in S2SR1 indicate certain conditions in the MI BUS hardware and are automatically  
cleared by special acknowledge sequences.The receive related flag bits in S2SR1 (RDRF2, OR2  
and NF2) are cleared by a read of this register followed by a read of the transmit/receive data  
register. However, only those bits that were set when S2SR1 was read will be cleared by the  
subsequent read of the transmit/receive data register.  
RDRF2 — Receive data register full flag 2  
1 (set)  
Contents of the receiver serial shift register have been transferred to  
the receiver data register.  
6
0 (clear) – Contents of the receiver serial shift register have not been  
transferred to the receiver data register.  
This bit is set when the contents of the receiver serial shift register have been transferred to the  
receiver data register.  
The EOF (end-of-frame) during an MI BUS pull-field is a continuous square wave, which will result  
in multiple RDRFs. This may be dealt with in any of the following ways:  
By clearing the RIE2 mask, ignoring unneeded RDRF2s, initiating a push  
field, waiting for TDRE2 and then clearing the RDRF2;  
By clearing the RE2 bit when a pull field is complete, followed by setting the RE2  
bit after the TDRE2 flag associated with the next push field is asserted;  
By disabling the MI BUS.  
OR2 — Bit error 2  
1 (set)  
A bit error has been detected.  
0 (clear) – No bit error has been detected.  
This bit is set when a push field bit value on the MI BUS does not match the bit value that was  
sent.This is known as an MI BUS bit error. OR2 does not generate an interrupt request in MI BUS  
mode.  
Note that TDRE2 and TC2 will both behave in the same way as during normal SCI  
transmissions. The MI BUS will still be receiving when the TC2 bit becomes set, hence any  
queued transmission will not start until the current pull field has finished.  
See also Section 5.6.4.  
TPG  
MC68HC11PH8  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MOTOROLA  
6-11  
NF2 — Noise error flag 2  
1 (set) Noise detected.  
0 (clear) – No noise detected.  
This bit is set when noise is detected on the receive line during an MI BUS pull field.  
6.6.6  
S2SR2 — MI BUS2 status register 2  
State  
on reset  
Address bit 7  
$0055  
bit 6  
0
bit 5  
0
bit 4  
0
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
SCI/MI 2 status 2 (S2SR2)  
0
RAF2 0000 0000  
RAF2 — Receiver active flag (read only)  
1 (set) A character is being received.  
0 (clear) – A character is not being received.  
6
6.6.7  
S2DRL — MI BUS2 data register  
State  
bit 0  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
on reset  
SCI/MI 2 data low (S2DRL)  
$0057 R7T7B R6T6B R5T5B R4T4B R3T3B R2T2B R1T1B R0T0B undeÞned  
0
1
0
1
S1  
D3  
S2  
D2  
S3  
D1  
1
Pull Þeld  
A2  
A1  
A0  
D4  
D0  
Push Þeld  
This register forms the 8-bit data/address word for the MI push field and contains the 3-bit data  
word received as the MI pull field.  
R/T[7:0] — Receiver/transmitter data bits [7:0]  
READ: Reads access the three bits of pull field data (stored in bits 3–1) of the read-only MI BUS  
receive data register. Bits [7:4, 0] are a fixed data pattern when a valid status and end-of-frame is  
returned. A valid status is represented by the following data pattern: 0101 xxx1 (bits 7–0), where  
‘xxx’ is the status. All ones in the receive data register indicate that an error occurred on the  
MI BUS. Bits are received LSB first by the MCU, and the status bits map as shown in the above  
table.  
WRITE: Writes access the eight bits of the write-only MI BUS transmit data register. MI BUS  
devices require a 5-bit data pattern followed by a 3-bit address pattern to be sent during the push  
field.The data pattern is mapped to the lowest five bits of the data register and the address to the  
highest three bits, as shown in the above table. Thus MI-data[4:0] is written to S2DRL[4:0] and  
MI-address[2:0] is written to S2DRL[7:5].  
TPG  
MOTOROLA  
6-12  
MOTOROLA INTERCONNECT BUS (MI BUS)  
MC68HC11PH8  
7
SERIAL PERIPHERAL INTERFACE  
The serial peripheral interface (SPI), an independent serial communications subsystem, allows  
the MCU to communicate synchronously with peripheral devices, such as transistor-transistor  
logic (TTL) shift registers, liquid crystal (LCD) display drivers, analog-to-digital converter  
subsystems, and other microprocessors. The SPI is also capable of inter-processor  
communication in a multiple master system.The SPI system can be configured as either a master  
or a slave device, with data rates as high as one half of the E clock rate when configured as a  
master and as fast as the E clock rate when configured as a slave.  
The SPI shares I/O with four of port D’s pins and is enabled by SPE in the SPCR:  
7
Alternate  
Pin  
function  
PD2  
PD3  
PD4  
PD5  
MISO1  
MOSI1  
SCK1  
SS1  
7.1  
Functional description  
The central element in the SPI system is the block containing the shift register and the read data  
buffer (see Figure 7-1).The system is single buffered in the transmit direction and double buffered  
in the receive direction.This means that new data for transmission cannot be written to the shifter  
until the previous transfer is complete; however, received data is transferred into a parallel read  
data buffer so the shifter is free to accept a second serial character. As long as the first character  
is read out of the read data buffer before the next serial character is ready to be transferred, no  
overrun condition occurs. A single MCU register address is used for reading data from the read  
data buffer and for writing data to the shifter.  
The SPI status block represents the SPI status functions (transfer complete, write collision, and mode  
fault) performed by the serial peripheral status register (SPSR).The SPI control block represents those  
functions that control the SPI system through the serial peripheral control register (SPCR).  
The MC68HC11PH8 contains two serial peripheral interfaces having similar operation. For ease  
of reference, a full description of SPI1 is given first, followed by a summary of SPI2 (Section 7.6).  
TPG  
MC68HC11PH8  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
7-1  
7.2  
SPI transfer formats  
During an SPI transfer, data is simultaneously transmitted and received. A serial clock line  
synchronizes shifting and sampling of the information on the two serial data lines. A slave select  
line allows individual selection of a slave SPI device; slave devices that are not selected do not  
interfere with SPI bus activities. On a master SPI device, the select line can optionally be used to  
indicate a multiple master bus contention. Refer to Figure 7-2.  
MISO  
PD2  
S
M
M
S
MOSI  
PD3  
MCU  
system clock  
8-bit shift register  
Read data buffer  
Divider  
÷2 ÷4 ÷8 ÷16 ÷32 ÷64 ÷128  
Shift control logic  
Pin  
control  
logic  
7
SPI clock (master)  
Select  
S
Clock  
logic  
SCK  
PD4  
M
SS  
PD5  
OPT2 Ð Options register 2  
MSTR  
SPE  
SPI control  
SPIE  
SPSR Ð SPI status register  
SPCR Ð SPI control register  
SPDR Ð SPI data register  
SPI interrupt  
request  
Internal bus  
Figure 7-1 SPI block diagram  
TPG  
MOTOROLA  
7-2  
SERIAL PERIPHERAL INTERFACE  
MC68HC11PH8  
SCK cycle #  
(for reference)  
1
2
3
4
5
6
7
8
SCK (CPOL=0)  
SCK (CPOL=1)  
Sample input  
Data out (CPHA=0)  
MSB  
6
5
4
3
2
1
LSB  
Sample input  
Data out (CPHA=1)  
MSB  
6
5
4
3
2
1
LSB  
SS (to slave)  
Note: this Þgure shows the LSBF=0 (default) case. If LSBF=1, data is transferred in the reverse order (LSB Þrst).  
Figure 7-2 SPI transfer format  
7.2.1  
Clock phase and polarity controls  
7
Software can select one of four combinations of serial clock phase and polarity using two bits in  
the SPI control register (SPCR). The clock polarity is specified by the CPOL control bit, which  
selects an active high or active low clock, and has no significant effect on the transfer format. The  
clock phase (CPHA) control bit selects one of two different transfer formats. The clock phase and  
polarity should be identical for the master SPI device and the communicating slave device. In  
some cases, the phase and polarity are changed between transfers to allow a master device to  
communicate with peripheral slaves having different requirements.  
When CPHA equals zero, the SS line must be deasserted and reasserted between each  
successive serial byte. Also, if the slave writes data to the SPI data register (SPDR) while SS is  
low, a write collision error results.  
When CPHA equals one, the SS line can remain low between successive transfers.  
7.3  
SPI signals  
The following paragraphs contain descriptions of the four SPI signals: master in slave out (MISO),  
master out slave in (MOSI), serial clock (SCK), and slave select (SS).  
Any SPI output line must have its corresponding data direction bit in DDRD register set. If the DDR  
bit is clear, that line is disconnected from the SPI logic and becomes a general-purpose input. All  
SPI input lines are forced to act as inputs regardless of the state of the corresponding DDR bits in  
DDRD register.  
TPG  
MC68HC11PH8  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
7-3  
7.3.1  
Master in slave out  
MISO is one of two unidirectional serial data signals. It is an input to a master device and an output  
from a slave device. The MISO line of a slave device is placed in the high-impedance state if the  
slave device is not selected.  
7.3.2  
Master out slave in  
The MOSI line is the second of the two unidirectional serial data signals. It is an output from a  
master device and an input to a slave device. The master device places data on the MOSI line a  
half-cycle before the clock edge that the slave device uses to latch the data.  
7.3.3  
Serial clock  
SCK, an input to a slave device, is generated by the master device and synchronizes data  
movement in and out of the device through the MOSI and MISO lines. Master and slave devices  
are capable of exchanging a byte of information during a sequence of eight clock cycles.  
7
There are four possible timing relationships that can be chosen by using control bits CPOL and  
CPHA in the serial peripheral control register (SPCR). Both master and slave devices must operate  
with the same timing. The SPI clock rate select bits, SPR[1:0], in the SPCR of the master device,  
select the clock rate. In a slave device, SPR[1:0] have no effect on the operation of the SPI.  
7.3.4  
Slave select  
The slave select SS input of a slave device must be externally asserted before a master device  
can exchange data with the slave device. SS must be low before data transactions begin and must  
stay low for the duration of the transaction.  
The SS line of the master must be held high. If it goes low, a mode fault error flag (MODF) is set  
in the serial peripheral status register (SPSR). To disable the mode fault circuit, write a one in bit  
5 of the port D data direction register. This sets the SS pin to act as a general-purpose output,  
rather than a dedicated input to the slave select circuit, thus inhibiting the mode fault flag. The  
other three lines are dedicated to the SPI whenever the serial peripheral interface is on.  
The state of the master and slave CPHA bits affects the operation of SS. CPHA settings should be  
identical for master and slave.When CPHA = 0, the shift clock is the OR of SS with SCK. In this clock  
phase mode, SS must go high between successive characters in an SPI message. When CPHA =  
1, SS can be left low between successive SPI characters. In cases where there is only one SPI slave  
MCU, its SS line can be tied to V as long as only CPHA = 1 clock mode is used.  
SS  
TPG  
MOTOROLA  
7-4  
SERIAL PERIPHERAL INTERFACE  
MC68HC11PH8  
 
7.4  
SPI system errors  
Two kinds of system errors can be detected by the SPI system. The first type of error arises in a  
multiple-master system when more than one SPI device simultaneously tries to be a master. This  
error is called a mode fault.The second type of error, write collision, indicates that an attempt was  
made to write data to the SPDR while a transfer was in progress.  
When the SPI system is configured as a master and the SS input line goes to active low, a mode  
fault error has occurred — usually because two devices have attempted to act as master at the  
same time. In the case where more than one device is concurrently configured as a master, there  
is a chance of contention between two pin drivers. For push-pull CMOS drivers, this contention  
can cause permanent damage. The mode fault detection circuitry attempts to protect the device  
by disabling the drivers. The MSTR control bit in the SPCR and all four DDRD control bits  
associated with the SPI are cleared and an interrupt is generated (subject to masking by the SPIE  
control bit and the I bit in the CCR).  
Other precautions may need to be taken to prevent driver damage. If two devices are made  
masters at the same time, the mode fault detector does not help protect either one unless one of  
them selects the other as slave. The amount of damage possible depends on the length of time  
both devices attempt to act as master.  
7
A write collision error occurs if the SPDR is written while a transfer is in progress. Because the  
SPDR is not double buffered in the transmit direction, writes to SPDR cause data to be written  
directly into the SPI shift register. Because this write corrupts any transfer in progress, a write  
collision error is generated.The transfer continues undisturbed, and the write data that caused the  
error is not written to the shifter.  
A write collision is normally a slave error because a slave has no control over when a master  
initiates a transfer. A master knows when a transfer is in progress, so there is no reason for a  
master to generate a write-collision error, although the SPI logic can detect write collisions in both  
master and slave devices.  
The SPI configuration determines the characteristics of a transfer in progress. For a master, a  
transfer begins when data is written to SPDR and ends when SPIF is set. For a slave with CPHA  
equal to zero, a transfer starts when SS goes low and ends when SS returns high. In this case,  
SPIF is set at the middle of the eighth SCK cycle when data is transferred from the shifter to the  
parallel data register, but the transfer is still in progress until SS goes high. For a slave with CPHA  
equal to one, transfer begins when the SCK line goes to its active level, which is the edge at the  
beginning of the first SCK cycle.The transfer ends when SPIF is set, for a slave in which CPHA=1.  
7.5  
SPI registers  
The three SPI registers, SPCR, SPSR, and SPDR, provide control, status, and data storage  
functions. Refer to the following information for a description of how these registers are organized.  
TPG  
MC68HC11PH8  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
7-5  
 
7.5.1  
SPCR — SPI control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SPI control (SPCR)  
$0028 SPIE SPE DWOM MSTR CPOL CPHA SPR1 SPR0 0000 01uu  
SPIE — Serial peripheral interrupt enable  
1 (set)  
A hardware interrupt sequence is requested each time SPIF or  
MODF is set.  
0 (clear) – SPI interrupts are inhibited.  
Set the SPIE bit to a one to request a hardware interrupt sequence 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 condition code  
register is one.  
SPE — Serial peripheral system enable  
1 (set)  
Port D [5:2] is dedicated to the SPI.  
0 (clear)  
Port D has its default I/O functions and the clock generator is stopped.  
7
When the SPE bit is set, the port D pins 2, 3, 4, and 5 are dedicated to the SPI functions and lose  
their general purpose I/O functions. When the SPI system is enabled and expects any of PD[4:2]  
to be inputs then those pins will be inputs regardless of the state of the associated DDRD bits. If  
any of PD[4:2] are expected to be outputs then those pins will be outputs only if the associated  
DDRD bits are set. However, if the SPI is in the master mode, DDD5 determines whether PD5 is  
an error detect input (DDD5 = 0) or a general-purpose output (DDD5 = 1).  
DWOM — Port D wired-OR mode  
1 (set)  
Port D [5:2] buffers configured for open-drain outputs.  
0 (clear) – Port D [5:2] buffers configured for normal CMOS outputs.  
MSTR — Master mode select  
1 (set)  
Master mode  
0 (clear) – Slave mode  
CPOL — Clock polarity  
1 (set) SCK is active low.  
0 (clear) – SCK is active high.  
When the clock polarity bit is cleared and data is not being transferred, the SCK pin of the master  
device has a steady state low value. When CPOL is set, SCK idles high. Refer to Figure 7-2 and  
Section 7.2.1.  
TPG  
MOTOROLA  
7-6  
SERIAL PERIPHERAL INTERFACE  
MC68HC11PH8  
CPHA — Clock phase  
The clock phase bit, in conjunction with the CPOL bit, controls the clock-data relationship between  
master and slave. The CPHA bit selects one of two different clocking protocols. Refer to Figure  
7-2 and Section 7.2.1.  
SPR1 and SPR0 — SPI clock rate selects  
These two bits select the SPI clock rate, as shown in Table 7-1. Note that SPR2 is located in the  
OPT2 register, and that its state on reset is zero.  
Table 7-1 SPI clock rates  
SPI clock frequency (baud rate) for:  
E clock  
divide ratio  
SPR[2:0]  
E = 2MHz  
1.0 MHz  
500 kHz  
125 kHz  
62.5 kHz  
250 kHz  
125 kHz  
31.3 kHz  
15.6 kHz  
E = 3MHz  
1.5 MHz  
750kHz  
E = 4MHz  
2.0 MHz  
1.0 MHz  
250 kHz  
125 kHz  
500 kHz  
250 kHz  
62.5 kHz  
31.3 kHz  
0 0 0  
0 0 1  
0 1 0  
0 1 1  
1 0 0  
1 0 1  
1 1 0  
1 1 1  
2
4
16  
32  
8
187.5 kHz  
93.7 kHz  
375 kHz  
187.5 kHz  
46.9 kHz  
23.4 kHz  
7
16  
64  
128  
7.5.2  
SPSR — SPI status register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
bit 3  
bit 2  
0
bit 1  
0
bit 0  
0
SPI status (SPSR)  
$0029 SPIF WCOL  
MODF  
0
0000 0000  
SPIF — SPI interrupt complete flag  
1 (set) Data transfer to external device has been completed.  
0 (clear) – No valid completion of data transfer.  
SPIF is set upon completion of data transfer between the processor and the external device. If  
SPIF goes high, and if SPIE is set, a serial peripheral interrupt is generated.To clear the SPIF bit,  
read the SPSR with SPIF set, then access the SPDR. Unless SPSR is read (with SPIF set) first,  
attempts to write SPDR are inhibited.  
TPG  
MC68HC11PH8  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
7-7  
WCOL — Write collision  
1 (set) Write collision.  
0 (clear) – No write collision.  
Clearing the WCOL bit is accomplished by reading the SPSR (with WCOL set) followed by an  
access of SPDR. Refer to Section 7.3.4 and Section 7.4.  
MODF — Mode fault  
1 (set)  
Mode fault.  
0 (clear) – No mode fault.  
To clear the MODF bit, read the SPSR (with MODF set), then write to the SPCR. Refer to Section  
7.3.4 and Section 7.4.  
Bits [5, 3:0] — Not implemented; always read zero.  
7.5.3  
SPDR — SPI data register  
7
State  
on reset  
Address bit 7  
$002A (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
SPI data (SPDR)  
(bit 0) undeÞned  
The SPDR is used when transmitting or receiving data on the serial bus. Only a write to this  
register initiates transmission or reception of a byte, and this only occurs in the master device. At  
the completion of transferring a byte of data, the SPIF status bit is set in both the master and slave  
devices.  
A read of the SPDR is actually a read of a buffer. To prevent an overrun and the loss of the byte  
that caused the overrun, the first SPIF must be cleared by the time a second transfer of data from  
the shift register to the read buffer is initiated.  
SPI is double buffered in and single buffered out.  
TPG  
MOTOROLA  
7-8  
SERIAL PERIPHERAL INTERFACE  
MC68HC11PH8  
7.5.4  
OPT2 — System configuration options register 2  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
System conÞg. options 2 (OPT2)  
$0038 LIRDV CWOM STRCH IRVNE LSBF SPR2 EXT4X DISE x00x 0000  
LIRDV — LIR driven (refer to Section 3)  
1 (set) Enable LIR push-pull drive.  
0 (clear) – LIR not driven on MODA/LIR pin.  
CWOM — Port C wired-OR mode (refer to Section 4)  
1 (set)  
Port C outputs are open-drain.  
0 (clear) – Port C operates normally.  
STRCH — Stretch external accesses (refer to Section 3)  
1 (set)  
Off-chip accesses are extended by one E clock cycle.  
7
0 (clear) – Normal operation.  
IRVNE — Internal read visibility/not E (refer to Section 3)  
1 (set)  
Data from internal reads is driven out of the external data bus.  
0 (clear) – No visibility of internal reads on external bus.  
In single chip mode this bit determines whether the E clock drives out from the chip.  
1 (set)  
E pin is driven low.  
0 (clear) – E clock is driven out from the chip.  
LSBF — LSB first enable  
1 (set) SPI1 data is transferred LSB first.  
0 (clear) – SPI1 data is transferred MSB first.  
If this bit is set, data, which is usually transferred MSB first, is transferred LSB first. LSBF does not  
affect the position of the MSB and LSB in the data register. Reads and writes of the data register  
always have MSB in bit 7.  
SPR2 — SPI clock rate select  
When set, SPR2 adds a divide-by-4 prescaler to the SPI clock chain. With the two bits in the  
SPCR, this bit specifies the SPI clock rate. Refer to Table 7-1.  
TPG  
MC68HC11PH8  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
7-9  
EXT4X — 4XCLK or EXTAL clock output select (refer to Section 3)  
1 (set) EXTALi clock output on the 4XOUT pin.  
0 (clear) – 4XCLK clock output on the 4XOUT pin.  
DISE — E clock output disable (refer to Section 3)  
1 (set)  
No E clock output.  
0 (clear) – E clock is output normally.  
7.6  
SPI2  
In addition to the subsystem described in the above paragraphs (SPI1), the MC68HC11PH8 has  
another SPI module (SPI2). This system is identical to SPI1, with the following exceptions:  
SPI2 shares I/O with four port G pins:  
7
Alternate  
function  
Pin  
PG2  
PG3  
PG4  
PG5  
MISO2  
MOSI2  
SCK2  
SS2  
SPI1 functions and data are handled by a register block at $0028–$002A  
along with the system configuration options register 2 at address $0038.The  
corresponding registers for SPI2 are at addresses $004C–$004E along with  
the SPI2 control options register at address $004F. The SPI2 registers are  
described in the following sections.  
TPG  
MOTOROLA  
7-10  
SERIAL PERIPHERAL INTERFACE  
MC68HC11PH8  
7.6.1  
SP2CR — SPI2 control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SPI2 control (SP2CR)  
$004C SP2IE SP2E GWOM MSTR2 CPOL2 CPHA2 SP2R1 SP2R0 0000 01uu  
For details of the functions of bits 2,3,4,6 and 7, see Section 7.5.1.  
GWOM — Port G wired-OR mode  
1 (set)  
Port G [5:2] buffers configured for open-drain outputs.  
0 (clear) – Port G [5:2] buffers configured for normal CMOS outputs.  
SP2R1 and SP2R0 — SPI2 clock rate selects  
These two bits, along with the SP2R2 bit, select the SPI clock rate as shown in Table 7-1. Note  
that SP2R2 is located in the SP2OPT register, and that its state on reset is zero.  
7.6.2  
SP2SR — SPI2 status register  
7
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
0
SPI2 status (SP2SR)  
$004D SP2IF WCOL2  
MODF2  
0000 0000  
For a description of bits 4,6 and 7, see Section 7.5.2.  
7.6.3  
SP2DR — SPI2 data register  
State  
on reset  
Address bit 7  
$004E (bit 7)  
Bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
SPI2 data (SP2DR)  
(bit 0) undeÞned  
For a description of this register, see Section 7.5.3.  
7.6.4  
SP2OPT — SPI2 control options register  
State  
bit 0  
Address bit 7  
$004F  
bit 6  
0
bit 5  
0
bit 4  
0
bit 3  
bit 2  
bit 1  
0
on reset  
SPI2 control options (SP2DR)  
0
LSBF2 SP2R2  
0
0000 0000  
For a description of bits 2 and 3, see Section 7.5.4.  
TPG  
MC68HC11PH8  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
7-11  
7
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
7-12  
SERIAL PERIPHERAL INTERFACE  
MC68HC11PH8  
8
TIMING SYSTEM  
The MC68HC11PH8 has three timing modules: a 16-bit timer system (incorporating pulse  
accumulator, RTI and COP), a pulse width modulation (PWM) system and an 8-bit modulus timing  
system comprising timers A, B and C.  
8.1  
16-bit timer  
The M68HC11 timing system is composed of several clock divider chains. The main clock divider  
chain includes a 16-bit free-running counter, which is driven by a programmable prescaler.The main  
timer’s programmable prescaler provides one of the four clocking rates to drive the 16-bit counter.  
Two prescaler control bits select the prescale rate.The prescaler output divides the system clock by  
1, 4, 8, or 16. Taps from this main clocking chain drive circuitry may be used to generate the slower  
clocks used by the pulse accumulator, the real-time interrupt (RTI), the computer operating properly  
(COP) watchdog subsystems and the LCD module. Refer to Figure 8-1 and Figure 8-2.  
8
All main timer system activities can be referenced to the free-running counter.The counter begins  
incrementing from $0000 as the MCU comes out of reset, and continues to the maximum count,  
$FFFF. At the maximum count, the counter rolls over to $0000, sets an overflow flag and continues  
to increment. As long as the MCU is running in a normal operating mode, there is no way to reset,  
change or interrupt the counting, unless, for reduced power consumption and if the PLL is in  
operation, the 16-bit counter is disabled under control of the T16EN bit (see Section 8.1.1.1). The  
capture/compare subsystem features three input capture channels, four output compare channels  
and one channel that can be selected to perform either input capture or output compare. Each of  
the input capture functions has its own 16-bit input capture register (time capture latch) and each  
of the output compare functions has its own 16-bit compare register. All timer functions, including  
the timer overflow and RTI, have their own interrupt controls and separate interrupt vectors. See  
Table 8-1 for related frequencies and periods.  
The pulse accumulator contains an 8-bit counter and edge select logic. The pulse accumulator  
can operate in either event counting mode or gated time accumulation mode. During event  
counting mode, the pulse accumulator’s 8-bit counter increments when a specified edge is  
detected on an input pin. During gated time accumulation mode, an internal clock source  
8
(ST4XCK/2 ) increments the 8-bit counter while an input signal has a predetermined logic level.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-1  
The real-time interrupt (RTI) is a programmable periodic interrupt circuit that permits pacing of the  
execution of software routines by selecting one of four interrupt rates. It may be clocked by the  
15  
16-bit timer (ST4XCK/2 ) or by the underflow of 8-bit modulus timer A (CLK64), depending on  
whether or not the PLL system is active (see Figure 8-1, Figure 8-2 and Section 8.1.5).  
The COP watchdog clock input may be tapped off from the free-running counter chain  
17  
(ST4XCK/2 ), or may be the underflow of the 8-bit modulus timer A (CLK64/4), depending on  
whether or not the PLL system is active (see Figure 8-1, Figure 8-2 and Section 8.1.6). The COP  
automatically times out unless it is serviced within a specific time by a program reset sequence. If  
the COP is allowed to time out, a reset is generated, which drives the RESET pin low to reset the  
MCU and the external system (see Section 10).  
The LCD module can drive up to four LCD segments, and may be clocked by the 16-bit timer  
18  
(ST4XCK/2 ), or by the underflow of the 8-bit modulus timer A (CLK64 or CLK64/8), depending on  
whether or not the PLL system is active (see Figure 8-1, Figure 8-2 and Section 2).  
Table 8-1 Timer resolution and capacity  
Clock  
(1)  
4.0MHz  
1.0MHz  
1000ns  
1.0µs  
8.0MHz 12.0MHz 16.0MHz  
ST4XCK  
ST4XCK/4  
4/ST4XCK  
Crystal  
Clock  
2.0MHz  
500ns  
500ns  
3.0MHz  
333ns  
333ns  
4.0MHz  
250ns  
250ns  
Control bits  
PR[1:0]  
Period  
4/ST4XCK Рresolution  
0 0  
0 1  
1 0  
1 1  
18  
8
65.536ms 32.768ms 21.845ms 16.384ms 2 /ST4XCK Ð overßow  
4.0µs  
2.0µs  
1.333µs  
1.0µs  
16/ST4XCK Рresolution  
20  
262.14ms 131.07ms 87.381ms 65.536ms 2 /ST4XCK Ð overßow  
8.0µs  
4.0µs  
2.667µs  
2.0µs  
32/ST4XCK Рresolution  
21  
524.29ms 262.14ms 174.76ms 131.07ms 2 /ST4XCK Ð overßow  
16.0µs  
8.0µs  
5.333µs  
4.0µs  
64/ST4XCK Рresolution  
22  
1049 ms 524.29ms 349.53ms 262.14ms 2 /ST4XCK Ð overßow  
(1) Crystal frequencies are valid only if the PLL is not active.  
TPG  
MOTOROLA  
8-2  
TIMING SYSTEM  
MC68HC11PH8  
8.1.1  
Timer enable control  
The 16-bit timer may be enabled or disabled under control of the T16EN bit in the PLL control  
register.  
8.1.1.1  
PLLCR — PLL control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
PLL control (PLLCR)  
$002E PLLON BCS AUTO BWC VCOT MCS T16EN WEN 1010 1010  
PLLON — PLL on (See Section 2.5.4.1)  
1 (set) Switch PLL on.  
0 (clear) – Switch PLL off.  
BCS — Bus clock select (See Section 2.5.4.1)  
1 (set)  
VCOOUT output drives the clock circuit (4XCLK).  
0 (clear) – EXTALi drives the clock circuit (4XCLK).  
AUTO — Automatic bandwidth control (See Section 2.5.4.1)  
8
1 (set)  
Automatic bandwidth control selected.  
0 (clear) – Manual bandwidth control selected.  
BWC — Bandwidth control (See Section 2.5.4.1)  
1 (set)  
High bandwidth control selected.  
0 (clear) – Low bandwidth control selected.  
VCOT — VCO test (Test mode only, see Section 2.5.4.1)  
1 (set)  
Loop filter operates as specified by AUTO and BWC.  
0 (clear) – Low bandwidth mode of the PLL filter is disabled.  
MCS — Module clock select (See Section 2.5.4.1)  
1 (set)  
4XCLK is the source for the SCI and timer divider chain.  
0 (clear) – EXTALi is the source for the SCI and timer divider chain.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-3  
 
T16EN — 16-bit timer clock enable  
1 (set) 16-bit timer clock enabled.  
0 (clear) – 16-bit timer clock disabled.  
Power consumption may be reduced by disabling the 16-bit timer clock.This bit cannot be cleared  
whilst VDDSYN is low, as then the 16-bit timer provides the clock source for the COP and RTI.  
When VDDSYN is high, the 8-bit modulus timer A supplies the clock source for the COP and RTI  
functions, which are therefore independent from the 16-bit timer clock. Reset sets this bit.  
WEN — WAIT enable (See Section 2.5.4.1)  
1 (set)  
Low-power WAIT mode selected (PLL set to ‘idle’ in WAIT mode).  
0 (clear) – Do not alter the 4XCLK during WAIT mode.  
8.1.2  
Timer structure  
The timer functions share I/O with all eight pins of port A:  
Pin  
Alternate function  
PA0 IC3  
PA1 IC2  
PA2 IC1  
8
PA3 OC5 and/or OC1, or IC4  
PA4 OC4 and/or OC1  
PA5 OC3 and/or OC1  
PA6 OC2 and/or OC1  
PA7 PAI and/or OC1  
Figure 8-3 shows the capture/compare system block diagram. The port A pin control block  
includes logic for timer functions and for general-purpose I/O. For pins PA3, PA2, PA1 and PA0,  
this block contains both the edge-detection logic and the control logic that enables the selection  
of which edge triggers an input capture. The digital level on PA[3:0] can be read at any time (read  
PORTA register), even if the pin is being used for the input capture function. Pins PA[6:3] are used  
either for general-purpose I/O, or as output compare pins. When one of these pins is being used  
for an output compare function, it cannot be written directly as if it were a general-purpose output.  
Each of the output compare functions (OC[5:2]) is related to one of the port A output pins. Output  
compare 1 (OC1) has extra control logic, allowing it optional control of any combination of the  
PA[7:3] pins. The PA7 pin can be used as a general-purpose I/O pin, as an input to the pulse  
accumulator or as an OC1 output pin.  
TPG  
MOTOROLA  
8-4  
TIMING SYSTEM  
MC68HC11PH8  
Bus  
clock  
select  
1
0
E clock  
4XCLK  
PLL  
÷ 4  
Internal bus clock  
PH2 (for CPU, PWM,  
A/D and memory)  
BCS  
Prescaler  
SPI  
÷ 2, 4, 8,16, 32, 64, 128  
SPR[2:0]  
Baud  
÷ 1, 2, 3, 4,É, 8191  
SBR[12:0]  
Module  
clock  
select  
1
0
SCI receiver clock  
÷ 2  
Crystal  
oscillator  
EXTALi  
SCI transmitter clock  
(baud rate)  
÷ 16  
ST4XCK  
MCS  
÷ 4  
TOF  
Prescaler  
TCNT  
÷ 1, 4, 8, 16  
PR[1:0]  
IC/OC  
Prescaler  
÷ 1, 4, 8  
6
Pulse accumulator  
Real time interrupt  
÷ 2  
CSA[2:0]  
Prescaler  
÷ 1, 2, 4, 64  
RTR[1:0]  
CLK64  
8-bit modulus timer A  
÷ 2  
8
LCDCK  
LCD  
clock  
select  
0
1
LCD  
÷ 4  
÷ 2  
Prescaler  
÷ 1, 4, 16, 64  
CR[1:0]  
Set  
Q
Q
Set  
Q
Q
FF1  
FF2  
Reset  
Clear COP timer  
System reset  
Reset  
Force COP reset  
+
Figure 8-1 Timer clock divider chains (PLL enabled — VDDSYN high)  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-5  
 
E clock  
Crystal  
oscillator  
EXTALi ST4XCK  
÷ 4  
Internal bus clock  
PH2 (for CPU, PWM,  
A/D and memory)  
Prescaler  
SPI  
÷ 2, 4, 8,16, 32, 64, 128  
SPR[2:0]  
Baud  
÷ 1, 2, 3, 4,É, 8191  
SBR[12:0]  
SCI receiver clock  
÷ 2  
SCI transmitter clock  
(baud rate)  
÷ 16  
CLK64  
LCDCK  
8-bit modulus timer A  
÷ 2  
LCD  
0
1
clock  
LCD  
18  
select  
÷ 2  
÷ 4  
TOF  
Prescaler  
TCNT  
÷ 1, 4, 8, 16  
PR[1:0]  
IC/OC  
8
6
Pulse accumulator  
Real time interrupt  
÷ 2  
13  
÷ 2  
Prescaler  
÷ 1, 2, 4, 8  
RTR[1:0]  
÷ 4  
Prescaler  
÷ 1, 4, 16, 64  
CR[1:0]  
Set  
Q
Set  
Q
FF1  
FF2  
Reset  
Reset  
Q
Clear COP timer  
System reset  
Q
Force COP reset  
+
Figure 8-2 Timer clock divider chains (PLL disabled — VDDSYN low)  
TPG  
MOTOROLA  
8-6  
TIMING SYSTEM  
MC68HC11PH8  
TOI  
TCNT (hi) TCNT (lo)  
Prescaler  
÷ 1, 4, 8, 16  
PR[1:0]  
9
8
7
6
5
4
&
ST4XCK/4  
TOF  
16-bit  
free running counter  
Note ꢀ  
To pulse accumulator  
16-bit timer bus  
CFORC  
Force O/P  
compare  
OC1I  
OC2I  
OC3I  
OC4I  
I4/O5I  
&
+
16-bit comparator EQ  
TOC1 (hi) TOC1 (lo)  
PA7/  
OC1/  
PAI  
OC1F  
OC2F  
OC3F  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
FOC1  
FOC2  
FOC3  
FOC4  
FOC5  
&
+
16-bit comparator EQ  
TOC2 (hi) TOC2 (lo)  
PA6/  
OC2/  
OC1  
&
+
16-bit comparator EQ  
TOC3 (hi) TOC3 (lo)  
PA5/  
OC3/  
OC1  
&
+
16-bit comparator EQ  
TOC4 (hi) TOC4 (lo)  
OC4F  
OC5  
PA4/  
OC4/  
OC1  
&
+
16-bit comparator EQ  
8
PA3/  
OC5/  
OC1/  
IC4  
I4/O5F  
IC4  
TI4/O5 (hi) TI4/O5 (lo)  
Bit 3  
Bit 2  
CLK  
16-bit latch  
IC1I  
IC2I  
IC3I  
I4/O5  
3
2
1
&
&
&
PA2/  
IC1  
CLK  
IC1F  
IC2F  
IC3F  
16-bit latch  
TIC1 (hi) TIC1 (lo)  
PA1/  
IC2  
CLK  
Bit 1  
16-bit latch  
TIC2 (hi) TIC2 (lo)  
PA0/  
IC3  
CLK  
Bit 0  
16-bit latch  
TIC3 (hi) TIC3 (lo)  
TFLG1  
status  
ßags  
TMSK1  
interrupt  
enables  
Port A  
pin  
Pins/  
functions  
controlà  
ꢀ Interrupt requests 1Ð9 (these are further qualiÞed by the I-bit in the CCR)  
à Port A pin actions are controlled by OC1M, OC1D, PACTL, TCTL1 and TCTL2 registers  
Figure 8-3 Capture/compare block diagram  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-7  
8.1.3  
Input capture  
The input capture function records the time an external event occurs by latching the value of the  
free-running counter when a selected edge is detected at the associated timer input pin. Software  
can store latched values and use them to compute the periodicity and duration of events. For  
example, by storing the times of successive edges of an incoming signal, software can determine  
the period and pulse width of a signal. To measure period, two successive edges of the same  
polarity are captured. To measure pulse width, two alternate polarity edges are captured.  
In most cases, input capture edges are asynchronous with respect to the internal timer counter,  
which is clocked relative to an internal clock (PH2). These asynchronous capture requests are  
synchronized with PH2 so that latching occurs on the opposite half cycle of PH2 from when the  
timer counter is being incremented. This synchronization process introduces a delay from when  
the edge occurs to when the counter value is detected. Because these delays cancel out when  
the time between two edges is being measured, the delay can be ignored. When an input capture  
is being used with an output compare, there is a similar delay between the actual compare point  
and when the output pin changes state.  
The control and status bits that implement the input capture functions are contained in the PACTL,  
TCTL2, TMSK1, and TFLG1 registers.  
To configure port A bit 3 as an input capture, clear the DDA3 bit of the DDRA register. Note that  
this bit is cleared out of reset. To enable PA3 as the fourth input capture, set the I4/O5 bit in the  
PACTL register. Otherwise, PA3 is configured as a fifth output compare out of reset, with bit I4/O5  
being cleared. If the DDA3 bit is set (configuring PA3 as an output), and IC4 is enabled, then writes  
to PA3 cause edges on the pin to result in input captures.Writing to TI4/O5 has no effect when the  
TI4/O5 register is acting as IC4.  
8
TPG  
MOTOROLA  
8-8  
TIMING SYSTEM  
MC68HC11PH8  
8.1.3.1  
TCTL2 — Timer control register 2  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer control 2 (TCTL2)  
$0021 EDG4B EDG4A EDG1B EDG1A EDG2B EDG2A EDG3B EDG3A 0000 0000  
Use the control bits of this register to program input capture functions to detect a particular edge  
polarity on the corresponding timer input pin. Each of the input capture functions can be  
independently configured to detect rising edges only, falling edges only, any edge (rising or falling),  
or to disable the input capture function.The input capture functions operate independently of each  
other and can capture the same TCNT value if the input edges are detected within the same timer  
count cycle.  
EDGxB and EDGxA — Input capture edge control  
EDGxB EDGxA  
ConÞguration  
ICx disabled  
0
0
1
1
0
1
0
1
ICx captures on rising edges only  
ICx captures on falling edges only  
ICx captures on any edge  
8
There are four pairs of these bits. Each pair is cleared by reset and must be encoded to configure  
the corresponding input capture edge detector circuit. IC4 functions only if the I4/O5 bit in the  
PACTL register is set.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-9  
8.1.3.2  
TIC1–TIC3 — Timer input capture registers  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer input capture 1 (TIC1) high  
Timer input capture 1 (TIC1) low  
Timer input capture 2 (TIC2) high  
Timer input capture 2 (TIC2) low  
Timer input capture 3 (TIC3) high  
Timer input capture 3 (TIC3) low  
$0010 (bit 15) (14)  
$0011 (bit 7) (6)  
$0012 (bit 15) (14)  
$0013 (bit 7) (6)  
$0014 (bit 15) (14)  
$0015 (bit 7) (6)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(bit 8) undeÞned  
(bit 0) undeÞned  
(bit 8) undeÞned  
(bit 0) undeÞned  
(bit 8) undeÞned  
(bit 0) undeÞned  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
When an edge has been detected and synchronized, the 16-bit free-running counter value is  
transferred into the input capture register pair as a single 16-bit parallel transfer. Timer counter  
value captures and timer counter incrementing occur on opposite half-cycles of the phase 2 clock  
so that the count value is stable whenever a capture occurs. Input capture values can be read from  
a pair of 8-bit read-only registers. A read of the high-order byte of an input capture register pair  
inhibits a new capture transfer for one bus cycle. If a double-byte read instruction, such as LDD,  
is used to read the captured value, coherency is assured. When a new input capture occurs  
immediately after a high-order byte read, transfer is delayed for an additional cycle but the value  
is not lost.  
The TICx registers are not affected by reset.  
8
8.1.3.3  
TI4/O5 Timer input capture 4/output compare 5 register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Capture 4/compare 5 (TI4/O5) high $001E (bit 15) (14)  
Capture 4/compare 5 (TI4/O5) low $001F (bit 7) (6)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(9)  
(1)  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
Use TI4/O5 as either an input capture register or an output compare register, depending on the  
function chosen for the PA3 pin. To enable it as an input capture pin, set the I4/O5 bit in the pulse  
accumulator control register (PACTL) to logic level one. To use it as an output compare register,  
set the I4/O5 bit to a logic level zero. Refer to Section 8.1.8.1.  
The TI4/O5 register pair resets to ones ($FFFF).  
TPG  
MOTOROLA  
8-10  
TIMING SYSTEM  
MC68HC11PH8  
8.1.4  
Output compare  
Use the output compare (OC) function to program an action to occur at a specific time — when  
the 16-bit counter reaches a specified value. For each of the five output compare functions, there  
is a separate 16-bit compare register and a dedicated 16-bit comparator.The value in the compare  
register is compared to the value of the free-running counter on every bus cycle. When the  
compare register matches the counter value, an output compare status flag is set.The flag can be  
used to initiate the automatic actions for that output compare function.  
To produce a pulse of a specific duration, write a value to the output compare register that  
represents the time the leading edge of the pulse is to occur. The output compare circuit is  
configured to set the appropriate output either high or low, depending on the polarity of the pulse  
being produced. After a match occurs, the output compare register is reprogrammed to change  
the output pin back to its inactive level at the next match. A value representing the width of the  
pulse is added to the original value, and then written to the output compare register. Because the  
pin state changes occur at specific values of the free-running counter, the pulse width can be  
controlled accurately at the resolution of the free-running counter, independent of software  
latency. To generate an output signal of a specific frequency and duty cycle, repeat this  
pulse-generating procedure.  
There are four 16-bit read/write output compare registers: TOC1, TOC2, TOC3, and TOC4, and  
the TI4/O5 register, which functions under software control as either IC4 or OC5. Each of the OC  
registers is set to $FFFF on reset. A value written to an OC register is compared to the  
free-running counter value during each E clock cycle. If a match is found, the particular output  
compare flag is set in timer interrupt flag register 1 (TFLG1). If that particular interrupt is enabled  
in the timer interrupt mask register 1 (TMSK1), an interrupt is generated. In addition to an interrupt,  
a specified action can be initiated at one or more timer output pins. For OC[5:2], the pin action is  
controlled by pairs of bits (OMx and OLx) in the TCTL1 register.The output action is taken on each  
successful compare, regardless of whether or not the OCxF flag in the TFLG1 register was  
previously cleared.  
8
OC1 is different from the other output compares in that a successful OC1 compare can affect any  
or all five of the OC pins.The OC1 output action taken when a match is found is controlled by two  
8-bit registers with three bits unimplemented: the output compare 1 mask register, OC1M, and the  
output compare 1 data register, OC1D. OC1M specifies which port A outputs are to be used, and  
OC1D specifies what data is placed on these port pins.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-11  
8.1.4.1  
TOC1–TOC4 — Timer output compare registers  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer output compare 1 (TOC1) high $0016 (bit 15) (14)  
Timer output compare 1 (TOC1) low $0017 (bit 7) (6)  
Timer output compare 2 (TOC2) high $0018 (bit 15) (14)  
Timer output compare 2 (TOC2) low $0019 (bit 7) (6)  
Timer output compare 3 (TOC3) high $001A (bit 15) (14)  
Timer output compare 3 (TOC3) low $001B (bit 7) (6)  
Timer output compare 4 (TOC4) high $001C (bit 15) (14)  
Timer output compare 4 (TOC4) low $001D (bit 7) (6)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(9)  
(1)  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(bit 8) 1111 1111  
(bit 0) 1111 1111  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
All output compare registers are 16-bit read-write. Each is initialized to $FFFF at reset. If an output  
compare register is not used for an output compare function, it can be used as a storage location.  
A write to the high-order byte of an output compare register pair inhibits the output compare  
function for one bus cycle. This inhibition prevents inappropriate subsequent comparisons.  
Coherency requires a complete 16-bit read or write. However, if coherency is not needed, byte  
accesses can be used.  
For output compare functions, write a comparison value to output compare registers TOC1–TOC4  
and TI4/O5. When TCNT value matches the comparison value, specified pin actions occur.  
8
All TOCx register pairs reset to ones ($FFFF).  
8.1.4.2  
CFORC — Timer compare force register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
0
bit 1  
0
bit 0  
0
Timer compare force (CFORC)  
$000B FOC1 FOC2 FOC3 FOC4 FOC5  
0000 0000  
The CFORC register allows forced early compares. FOC[1:5] correspond to the five output  
compares. These bits are set for each output compare that is to be forced. The action taken as a  
result of a forced compare is the same as if there were a match between the OCx register and the  
free-running counter, except that the corresponding interrupt status flag bits are not set. The  
forced channels trigger their programmed pin actions to occur at the next timer count transition  
after the write to CFORC.  
The CFORC bits should not be used on an output compare function that is programmed to toggle  
its output on a successful compare because a normal compare that occurs immediately before or  
after the force can result in an undesirable operation.  
TPG  
MOTOROLA  
8-12  
TIMING SYSTEM  
MC68HC11PH8  
FOC[1:5] — Force output compares  
1 (set) A forced output compare action will occur on the specified pin.  
0 (clear) – No action.  
Bits [2:0] — Not implemented; always read zero  
8.1.4.3  
OC1M — Output compare 1 mask register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
0
bit 1  
0
bit 0  
0
Output compare 1 mask (OC1M)  
$000C OC1M7 OC1M6 OC1M5 OC1M4 OC1M3  
0000 0000  
Use OC1M with OC1 to specify the bits of port A that are affected by a successful OC1 compare.  
The bits of the OC1M register correspond to PA7–PA3.  
OC1M[7:3] — Output compare masks for OC1  
1 (set)  
OC1 is configured to control the corresponding pin of port A.  
0 (clear) – OC1 will not affect the corresponding port A pin.  
Bits [2:0] — Not implemented; always read zero.  
8
8.1.4.4  
OC1D — Output compare 1 data register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
0
bit 1  
0
bit 0  
0
Output compare 1 data (OC1D)  
$000D OC1D7 OC1D6 OC1D5 OC1D4 OC1D3  
0000 0000  
Use this register with OC1 to specify the data that is to be written to the affected pin of port A after  
a successful OC1 compare.When a successful OC1 compare occurs, a data bit in OC1D is written  
to the corresponding pin of port A for each bit that is set in OC1M.  
OC1D[7:3] — Output compare data for OC1  
If OC1Mx is set, data in OC1Dx is output to port A pin x on successful OC1 compares.  
Bits [2:0] — Not implemented; always read zero  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-13  
8.1.4.5  
TCNT — Timer counter register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer count (TCNT) high  
Timer count (TCNT) low  
$000E (bit 15) (14)  
$000F (bit 7) (6)  
(13)  
(5)  
(12)  
(4)  
(11)  
(3)  
(10)  
(2)  
(9)  
(1)  
(bit 8) 0000 0000  
(bit 0) 0000 0000  
The 16-bit read-only TCNT register contains the prescaled value of the 16-bit timer. A full counter  
read addresses the more significant byte (MSB) first. A read of this address causes the less  
significant byte (LSB) to be latched into a buffer for the next CPU cycle so that a double-byte read  
returns the full 16-bit state of the counter at the time of the MSB read cycle.  
TCNT resets to $0000.  
8.1.4.6  
TCTL1 — Timer control register 1  
State  
on reset  
Address bit 7  
$0020 OM2  
bit 6  
OL2  
bit 5  
bit 4  
OL3  
bit 3  
bit 2  
OL4  
bit 1  
bit 0  
Timer control 1 (TCTL1)  
OM3  
OM4  
OM5  
OL5 0000 0000  
The bits of this register specify the action taken as a result of a successful OCx compare.  
8
OM[2:5] — Output mode  
OL[2:5] — Output level  
OMx  
OLx Action taken on successful compare  
0
0
1
1
0
1
0
1
Timer disconnected from OCx pin logic  
Toggle OCx output line  
Clear OCx output line to 0  
Set OCx output line to 1  
These control bit pairs are encoded to specify the action taken after a successful OCx compare.  
OC5 functions only if the I4/O5 bit in the PACTL register is clear.  
TPG  
MOTOROLA  
8-14  
TIMING SYSTEM  
MC68HC11PH8  
8.1.4.7  
TMSK1 — Timer interrupt mask register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
IC2I  
bit 0  
Timer interrupt mask 1 (TMSK1)  
$0022 OC1I OC2I OC3I OC4I I4/O5I IC1I  
IC3I 0000 0000  
Use this 8-bit register to enable or inhibit the timer input capture and output compare interrupts.  
Note:  
Bits in TMSK1 correspond bit for bit with flag bits in TFLG1. Ones in TMSK1 enable the  
corresponding interrupt sources.  
OC1I–OC4I — Output compare x interrupt enable  
1 (set) OCx interrupt is enabled.  
0 (clear) – OCx interrupt is disabled.  
If the OCxI enable bit is set when the OCxF flag bit is set, a hardware interrupt sequence is requested.  
I4/O5I — Input capture 4/output compare 5 interrupt enable  
1 (set)  
IC4/OC5 interrupt is enabled.  
0 (clear) – IC4/OC5 interrupt is disabled.  
8
When I4/O5 in PACTL is set, I4/O5I is the input capture 4 interrupt enable bit.  
When I4/O5 in PACTL is zero, I4/O5I is the output compare 5 interrupt enable bit.  
IC1I–IC3I — Input capture x interrupt enable  
1 (set)  
ICx interrupt is enabled.  
0 (clear) – ICx interrupt is disabled.  
If the ICxI enable bit is set when the ICxF flag bit is set, a hardware interrupt sequence is requested.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-15  
8.1.4.8  
TFLG1 — Timer interrupt flag register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer interrupt ßag 1 (TFLG1)  
$0023 OC1F OC2F OC3F OC4F I4/O5F IC1F IC2F IC3F 0000 0000  
Bits in this register indicate when timer system events have occurred. Coupled with the bits of  
TMSK1, the bits of TFLG1 allow the timer subsystem to operate in either a polled or interrupt  
driven system. Clear flags by writing a one to the corresponding bit position(s).  
Note:  
Bits in TFLG1 correspond bit for bit with flag bits in TMSK1. Ones in TMSK1 enable the  
corresponding interrupt sources.  
OC1F–OC4F — Output compare x flag  
1 (set) Counter has reached the preset output compare x value.  
0 (clear) – Counter has not reached the preset output compare x value.  
These flags are set each time the counter matches the corresponding output compare x values.  
I4/O5F — Input capture 4/output compare 5 flag  
Set by IC4 or OC5, depending on the function enabled by I4/O5 bit in PACTL  
8
IC1F–IC3F — Input capture x flag  
1 (set)  
Selected edge has been detected on corresponding port pin.  
0 (clear) – Selected edge has not been detected on corresponding port pin.  
These flags are set each time a selected active edge is detected on the ICx input line  
TPG  
MOTOROLA  
8-16  
TIMING SYSTEM  
MC68HC11PH8  
8.1.4.9  
TMSK2 — Timer interrupt mask register 2  
State  
on reset  
Address bit 7  
$0024 TOI  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
PR1  
bit 0  
Timer interrupt mask 2 (TMSK2)  
RTII PAOVI PAII  
PR0 0000 0000  
Use this 8-bit register to enable or inhibit timer overflow and real-time interrupts. The timer  
prescaler control bits are included in this register.  
Note:  
Bits in TMSK2 correspond bit for bit with flag bits in TFLG2. Ones in TMSK2 enable the  
corresponding interrupt sources.  
TOI — Timer overflow interrupt enable  
1 (set) Timer overflow interrupt requested when TOF is set.  
0 (clear) – TOF interrupts disabled.  
RTII — Real-time interrupt enable (refer to Section 8.1.5)  
1 (set)  
Real time interrupt requested when RTIF is set.  
0 (clear) – Real time interrupts disabled.  
8
PAOVI — Pulse accumulator overflow interrupt enable (refer to Section 8.1.8)  
PAII — Pulse accumulator input edge interrupt enable (refer to Section 8.1.8)  
Bits [3, 2] — Not implemented; always read zero.  
PR[1:0] — Timer prescaler select  
PR[1:0] Prescaler  
0 0  
0 1  
1 0  
1 1  
1
4
8
16  
These bits are used to select the prescaler divide-by ratio. In normal modes, PR[1:0] can only be  
written once, and the write must be within 64 cycles after reset. See Table 8-1 for specific timing  
values.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-17  
 
8.1.4.10 TFLG2 — Timer interrupt flag register 2  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
0
Timer interrupt ßag 2 (TFLG2)  
$0025 TOF RTIF PAOVF PAIF  
0000 0000  
Bits in this register indicate when certain timer system events have occurred. Coupled with the  
four high-order bits of TMSK2, the bits of TFLG2 allow the timer subsystem to operate in either a  
polled or interrupt driven system. Clear flags by writing a one to the corresponding bit position(s).  
Note:  
Bits in TFLG2 correspond bit for bit with flag bits in TMSK2. Ones in TMSK2 enable the  
corresponding interrupt sources.  
TOF — Timer overflow interrupt flag  
1 (set) TCNT has overflowed from $FFFF to $0000.  
0 (clear) – No timer overflow has occurred.  
RTIF — Real time (periodic) interrupt flag (refer to Section 8.1.5)  
1 (set)  
RTI period has elapsed.  
0 (clear) – RTI flag has been cleared.  
8
PAOVF — Pulse accumulator overflow interrupt flag (refer to Section 8.1.8)  
PAIF — Pulse accumulator input edge interrupt flag (refer to Section 8.1.8.)  
Bits [3:0] — Not implemented; always read zero  
TPG  
MOTOROLA  
8-18  
TIMING SYSTEM  
MC68HC11PH8  
 
8.1.5  
Real-time interrupt  
The real-time interrupt (RTI) feature, used to generate hardware interrupts at a fixed periodic rate,  
has two possible clock sources. When the PLL clock generation is not used (VDDSYN low), the  
15  
RTI function is clocked by the 16-bit free-running counter (ST4XCK/2 ). When the PLL clock  
generation is used (VDDSYN high), the RTI clock source is the underflow of the 8-bit modulus  
timer A (CLK64). This ensures that the RTI interrupt rate is unaffected by changes made to the  
bus speed by the PLL circuit. See Figure 8-1 and Figure 8-2. The RTI clock rate is controlled and  
configured by two bits (RTR1 and RTR0) in the pulse accumulator control (PACTL) register. The  
different rates available are a product of the source frequency and the value of bits RTR[1:0]. If  
15  
VDDSYN is low, the source frequency, ST4XCK/2 , can be divided by 1,2,4 or 8. If VDDSYN is  
high, the source frequency, CLK64, can be divided by 1,2,4 or 64. Refer to Table 8-2 and Table  
8-3 which show examples of periodic real-time interrupt rates. The RTII bit in the TMSK2 register  
enables the interrupt capability.  
Table 8-2 RTI periodic rates (PLL disabled)  
RTR[1:0] ST4XCK = 12MHz ST4XCK = 8MHz  
ST4XCK = 4MHz  
ST4XCK = xMHz  
15  
0 0  
0 1  
1 0  
1 1  
2.731ms  
5.461ms  
10.923ms  
21.845ms  
4.096ms  
8.192ms  
16.384ms  
32.768ms  
8.192ms  
16.384ms  
32.768ms  
65.536ms  
2 /ST4XCK  
16  
2 /ST4XCK  
17  
2 /ST4XCK  
18  
2 /ST4XCK  
8
Table 8-3 RTI periodic rates (PLL enabled)  
RTR[1:0] EXTALi = 640kHz EXTALi = 32.768kHz EXTALi = 32kHz  
EXTALi = xkHz  
8
0 0  
0 1  
1 0  
1 1  
0.4ms  
0.8ms  
1.6ms  
25.6ms  
7.81ms  
15.63ms  
31.25ms  
500ms  
8.0ms  
16.0ms  
32.0ms  
512ms  
2 /EXTALi  
9
2 /EXTALi  
10  
2 /EXTALi  
14  
2 /EXTALi  
Note:  
The values in Table 8-3 assume that the 8-bit modulus timer is loaded to give an  
EXTALi/2 prescaler value. Other prescaler values are possible, in the range EXTALi/4  
8
to EXTALi/4080 (see Section 8.3.1).  
Either clock source causes the time between successive RTI timeouts to be a constant that is  
independent of the software latency associated with flag clearing and service. For this reason, an  
RTI period starts from the previous timeout, not from when RTIF is cleared.  
Every timeout causes the RTIF bit in TFLG2 to be set, and if RTII is set, an interrupt request is  
generated. After reset, one entire RTI period elapses before the RTIF flag is set for the first time.  
Refer to the TMSK2, TFLG2, and PACTL registers.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-19  
 
 
 
8.1.5.1  
TMSK2 — Timer interrupt mask register 2  
State  
on reset  
Address bit 7  
$0024 TOI  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
PR1  
bit 0  
Timer interrupt mask 2 (TMSK2)  
RTII PAOVI PAII  
PR0 0000 0000  
This register contains the real-time interrupt enable bit.  
Note:  
Bits in TMSK2 correspond bit for bit with flag bits in TFLG2. Ones in TMSK2 enable the  
corresponding interrupt sources.  
TOI — Timer overflow interrupt enable (refer to Section 8.1.4.9)  
1 (set) Timer overflow interrupt requested when TOF is set.  
0 (clear) – TOF interrupts disabled.  
RTII — Real-time interrupt enable  
1 (set)  
Real time interrupt requested when RTIF is set.  
0 (clear) – Real time interrupts disabled.  
PAOVI — Pulse accumulator overflow interrupt enable (refer to Section 8.1.8)  
PAII — Pulse accumulator input edge (refer to Section 8.1.8)  
Bits[3, 2] — Not implemented; always reads zero  
8
PR[1, 0] — Timer prescaler select (refer to Section 8.1.4.9)  
TPG  
MOTOROLA  
8-20  
TIMING SYSTEM  
MC68HC11PH8  
8.1.5.2  
TFLG2 — Timer interrupt flag register 2  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
0
bit 0  
0
Timer interrupt ßag 2 (TFLG2)  
$0025 TOF RTIF PAOVF PAIF  
0000 0000  
Bits of this register indicate the occurrence of timer system events. Coupled with the four  
high-order bits of TMSK2, the bits of TFLG2 allow the timer subsystem to operate in either a polled  
or interrupt driven system. Clear flags by writing a one to the corresponding bit position(s).  
Note:  
Bits in TFLG2 correspond bit for bit with flag bits in TMSK2. Ones in TMSK2 enable the  
corresponding interrupt sources.  
TOF — Timer overflow interrupt flag (refer to Section 8.1.4.10)  
1 (set) TCNT has overflowed from $FFFF to $0000.  
0 (clear) – No timer overflow has occurred.  
RTIF — Real-time interrupt flag  
1 (set)  
RTI period has elapsed.  
0 (clear) – RTI flag has been cleared.  
8
The RTIF status bit is automatically set to one at the end of every RTI period.  
PAOVF — Pulse accumulator overflow interrupt flag (refer to Section 8.1.8)  
PAIF — Pulse accumulator input edge interrupt flag (refer to Section 8.1.8)  
Bits [3:0] — Not implemented; always read zero  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-21  
8.1.5.3  
PACTL — Pulse accumulator control register  
State  
on reset  
Address bit 7  
Pulse accumulator control (PACTL) $0026  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
bit 1  
bit 0  
0
PAEN PAMOD PEDGE  
I4/O5 RTR1 RTR0 0000 0000  
Bits RTR[1:0] of this register select the rate for the RTI system. The remaining bits control the  
pulse accumulator and IC4/OC5 functions.  
Bits [7, 3] — Not implemented; always read zero  
PAEN — Pulse accumulator system enable (refer to Section 8.1.8)  
1 (set)  
Pulse accumulator enabled.  
0 (clear) – Pulse accumulator disabled.  
PAMOD — Pulse accumulator mode (refer to Section 8.1.8)  
1 (set)  
Gated time accumulation mode.  
0 (clear) – Event counter mode.  
PEDGE — Pulse accumulator edge control (refer to Section 8.1.8)  
8
This bit has different meanings depending on the state of the PAMOD bit.  
I4/O5 — Input capture 4/output compare 5 (refer to Section 8.1.8)  
1 (set)  
Input capture 4 function is enabled (no OC5).  
0 (clear) – Output compare 5 function is enabled (no IC4).  
RTR[1:0] — RTI interrupt rate select  
These two bits determine the rate at which the RTI system requests interrupts.The RTI system is  
15  
driven either by CLK64 or by an ST4XCK/2 clock rate that is compensated so it is independent  
of the timer prescaler.These two control bits select an additional division factor. Refer to Table 8-2  
and Table 8-3.  
TPG  
MOTOROLA  
8-22  
TIMING SYSTEM  
MC68HC11PH8  
8.1.6  
Computer operating properly watchdog function  
There are two possible clock sources for the COP function (see Figure 8-1 and Figure 8-2).When  
PLL clock generation is not used (VDDSYN low), the clocking chain for the COP function is tapped  
17  
off from the main timer divider chain (ST4XCK/2 ). When the PLL clock generation is used  
(VDDSYN high), the COP function is clocked by the underflow of the 8-bit modulus timer A  
(CLK64/4). The CR[1:0] bits in the OPTION register and the NOCOP bit in the CONFIG register  
control and configure the COP function. One additional register, COPRST, is used to arm and  
clear the COP watchdog reset system. Refer to Section 10 for a more detailed discussion of the  
COP function.  
8.1.7  
LCD module  
There are three possible clock sources for the LCD module, under control of the LCDCK bit and  
depending on the state of VDDSYN. When LCDCK = 0, the LCD module is clocked by the output  
of 8-bit modulus timer A (CLK64). When LCDCK = 1, the LCD module is clocked by CLK64/8 if  
18  
PLL clock generation is used (VDDSYN high), and by ST4XCK/2 if PLL clock generation is not  
used (VDDSYN low). Refer to Figure 8-1, Figure 8-2 and Section 2.12.  
8.1.8  
Pulse accumulator  
8
The MC68HC11PH8 has an 8-bit counter that can be configured to operate either as a simple  
event counter, or for gated time accumulation, depending on the state of the PAMOD bit in the  
PACTL register. Refer to the pulse accumulator block diagram, Figure 8-4.  
In the event counting mode, the 8-bit counter is clocked to increasing values by an external pin.  
The maximum clocking rate for the external event counting mode is the E clock divided by two. In  
8
gated time accumulation mode, a free-running ST4XCK/2 signal drives the 8-bit counter, but only  
while the external PAI pin is activated. Refer to Table 8-4. The pulse accumulator counter can be  
read or written at any time.  
Table 8-4 Pulse accumulator timing  
(1)  
8
Crystal frequency  
4.0 MHz  
ST4XCK/4 clock Cycle time 2 /ST4XCK PACNT overßow  
1.0 MHz  
2.0 MHz  
3.0 MHz  
4.0 MHz  
1000 ns  
500 ns  
333 ns  
250 ns  
64 µs  
32 µs  
16.384 ms  
8.192 ms  
5.461 ms  
4.096 ms  
8.0 MHz  
12.0 MHz  
21.33 µs  
16.0 µs  
16.0 MHz  
(1) Crystal frequency values are only valid if the PLL is not active.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-23  
TOF  
RTIF  
PAOVF  
PAIF  
1
&
&
0
0
0
0
TOI  
RTII  
PAOVI  
PAII  
0
Interrupt  
requests  
2
0
ST4XCK/28 clock  
(from main timer)  
PR1  
PR0  
&
Overßow  
Enable  
2:1  
MUX  
Clock  
PACNT  
PA7/  
OC1/  
PAI  
Input buffer  
and edge detector  
Output buffer  
From  
OC1  
PACTL  
8
From  
DDRA7  
Internal data bus  
Figure 8-4 Pulse accumulator block diagram  
Pulse accumulator control bits are located within the PACTL, TMSK2 and TFLG2 registers, as  
described in the following paragraphs.  
TPG  
MOTOROLA  
8-24  
TIMING SYSTEM  
MC68HC11PH8  
8.1.8.1  
PACTL — Pulse accumulator control register  
State  
on reset  
Address bit 7  
Pulse accumulator control (PACTL) $0026  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
bit 1  
bit 0  
0
PAEN PAMOD PEDGE  
I4/O5 RTR1 RTR0 0000 0000  
Four of this register’s bits control an 8-bit pulse accumulator system. Another bit enables either the  
OC5 function or the IC4 function, while two other bits select the rate for the real-time interrupt system.  
Bits [7, 3] — Not implemented; always read zero  
PAEN — Pulse accumulator system enable  
1 (set)  
Pulse accumulator enabled.  
0 (clear) – Pulse accumulator disabled.  
PAMOD — Pulse accumulator mode  
1 (set)  
Gated time accumulation mode.  
0 (clear) – Event counter mode.  
PEDGE — Pulse accumulator edge control  
This bit has different meanings depending on the state of the PAMOD bit, as shown:  
8
PAMOD PEDGE  
Action of clock  
0
0
1
1
0
1
0
1
PAI falling edge increments the counter.  
PAI rising edge increments the counter.  
A zero on PAI inhibits counting.  
A one on PAI inhibits counting.  
I4/O5 — Input capture 4/output compare 5  
1 (set) Input capture 4 function is enabled (no OC5).  
0 (clear) – Output compare 5 function is enabled (no IC4)  
RTR[1:0] — RTI interrupt rate selects (refer to Section 8.1.5)  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-25  
8.1.8.2  
PACNT — Pulse accumulator count register  
State  
on reset  
Address bit 7  
$0027 (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
Pulse accumulator count (PACNT)  
(bit 0) undeÞned  
This 8-bit read/write register contains the count of external input events at the PAI input, or the  
accumulated count. In gated time accumulation mode, PACNT is readable even if PAI is not active.  
The counter is not affected by reset and can be read or written at any time. Counting is  
synchronized to the internal PH2 clock so that incrementing and reading occur during opposite  
half cycles.  
8.1.8.3  
Pulse accumulator status and interrupt bits  
The pulse accumulator control bits, PAOVI and PAII, PAOVF and PAIF are located within timer  
registers TMSK2 and TFLG2.  
8.1.8.4  
TMSK2 — Timer interrupt mask 2 register  
State  
on reset  
Address bit 7  
$0024 TOI  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
PR1  
bit 0  
8
Timer interrupt mask 2 (TMSK2)  
RTII PAOVI PAII  
PR0 0000 0000  
8.1.8.5  
TFLG2 — Timer interrupt flag 2 register  
State  
bit 0  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
0
bit 1  
0
on reset  
Timer interrupt ßag 2 (TFLG2)  
$0025 TOF RTIF PAOVF PAIF  
0
0000 0000  
PAOVI and PAOVF — Pulse accumulator interrupt enable and overflow flag  
The PAOVF status bit is set each time the pulse accumulator count rolls over from $FF to $00. To  
clear this status bit, write a one in the corresponding data bit position (bit 5) of the TFLG2 register.  
The PAOVI control bit allows the pulse accumulator overflow to be configured for polled or  
interrupt-driven operation and does not affect the state of PAOVF. When PAOVI is zero, pulse  
accumulator overflow interrupts are inhibited, and the system operates in a polled mode, which  
requires that PAOVF be polled by user software to determine when an overflow has occurred.  
When the PAOVI control bit is set, a hardware interrupt request is generated each time PAOVF is  
set. Before leaving the interrupt service routine, software must clear PAOVF.  
TPG  
MOTOROLA  
8-26  
TIMING SYSTEM  
MC68HC11PH8  
PAII and PAIF — Pulse accumulator input edge interrupt enable and flag  
The PAIF status bit is automatically set each time a selected edge is detected at the PA7/PAI/OC1  
pin. To clear this status bit, write to the TFLG2 register with a one in the corresponding data bit  
position (bit 4). The PAII control bit allows the pulse accumulator input edge detect to be  
configured for polled or interrupt-driven operation but does not affect setting or clearing the PAIF  
bit. When PAII is zero, pulse accumulator input interrupts are inhibited, and the system operates  
in a polled mode. In this mode, the PAIF bit must be polled by user software to determine when  
an edge has occurred. When the PAII control bit is set, a hardware interrupt request is generated  
each time PAIF is set. Before leaving the interrupt service routine, software must clear PAIF.  
8.2  
Pulse-width modulation (PWM) timer  
The PWM timer subsystem provides up to four 8-bit pulse-width modulated waveforms on the port  
H pins. Channel pairs can be concatenated to create 16-bit PWM outputs. Three clock sources  
(A, B, and S) and a flexible clock select scheme give the PWM a wide range of frequencies.  
Alternate  
Pin  
function  
PH0  
PH1  
PH2  
PH3  
PW1  
PW2  
PW3  
PW4  
8
Four control registers configure the PWM outputs — PWCLK, PWPOL, PWSCAL, and PWEN.  
The PWCLK register selects the prescale value for the PWM clock sources and enables the 16-bit  
PWM functions. The PWPOL register determines each channel’s polarity and selects the clock  
source for each channel.The PWSCAL register derives a user-scaled clock based on the A clock  
source, and the PWEN register enables the PWM channels.  
Each channel also has a separate 8-bit counter, period register, and duty cycle register.The period  
and duty cycle registers are double buffered so that if they are changed while the channel is  
enabled, the change does not take effect until the counter rolls over or the channel is disabled. A  
new period or duty cycle can be forced into effect immediately by writing to the period or duty cycle  
register and then writing to the counter.  
With PWMs configured for 8-bit mode and E equal to 4MHz, PWM signals can be produced from  
40 kHz (1% duty cycle resolution) to less than 10 cycles per second (approximately 0.4% duty  
cycle resolution). By configuring the PWMs for 16-bit mode with E equal to 4MHz, PWM periods  
greater than one minute are possible.  
In 16-bit mode, duty cycle resolution of up to 15 parts per million can be achieved (at a PWM  
frequency of 60Hz). In the same system, a PWM frequency of 1kHz corresponds to a duty cycle  
resolution of 0.025%.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-27  
8.2.1  
PWM timer block diagram  
Figure 8-5 shows the block diagram of the PWM timer subsystem. Three different clock sources  
are selectable and provide inputs to the control registers. Each of the four channels has a counter,  
a period register, and a duty register. The waveform output is the result of a match between the  
period register (PWPERx) and the value in the counter (PWCNTx). The duty register (PWDTYx)  
changes the state of the output during the period to determine the duty cycle.  
8.2.2  
PWCLK — PWM clock prescaler and 16-bit select register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
0
bit 2  
bit 1  
bit 0  
Pulse width clock select (PWCLK)  
$0060 CON34 CON12 PCKA2 PCKA1  
PCKB3 PCKB2 PCKB1 0000 0000  
This register contains bits for selecting the 16-bit PWM options and the prescaler values for the clocks.  
8.2.2.1  
16-bit PWM function  
The PWCLK register contains two control bits, each of which is used to concatenate a pair of PWM  
channels into one 16-bit channel. Channels 3 and 4 are concatenated with the CON34 bit, and  
channels 1 and 2 are concatenated with the CON12 bit.  
8
When the 16-bit concatenated mode is selected, the clock source is determined by the low order  
channel. Channel 2 is the low order channel when channels 1 and 2 are concatenated. Channel  
4 is the low order channel when channels 3 and 4 are concatenated. The pins associated with  
channels 1 and 3 can be used for general-purpose I/O when 16-bit PWM mode is selected.  
Channel 1 registers are the high order byte of the double-byte channel when channels 1 and 2 are  
concatenated. Channel 3 registers are the high order byte of the double-byte channel when  
channels 3 and 4 are concatenated. Reads of the high order byte cause the low order byte to be  
latched for one cycle to guarantee that double byte reads are accurate. Writes to the low byte of the  
counter cause reset of the entire counter. Writes to the upper bytes of the counter have no effect.  
CON34 — Concatenate channels 3 and 4  
1 (set)  
Channels 3 and 4 are concatenated into one 16-bit PWM channel.  
0 (clear) – Channels 3 and 4 are separate 8-bit PWMs.  
When concatenated, channel 3 is the high-order byte and the channel 4 pin (PH3) is the output.  
CON12 — Concatenate channels 1 and 2  
1 (set)  
Channels 1 and 2 are concatenated into one 16-bit PWM channel.  
0 (clear) – Channels 1 and 2 are separate 8-bit PWMs.  
When concatenated, channel 1 is the high-order byte and the channel 2 pin (PH1) is the output.  
TPG  
MOTOROLA  
8-28  
TIMING SYSTEM  
MC68HC11PH8  
CON34  
PWEN3  
PWEN4  
PCKB1 PCKB2 PCKB3  
CNT4  
CNT3  
Clock B  
Prescale select  
8
4
Clock  
select  
÷1, 2, 4, 8, 16, 32, 64, 128  
Prescale select  
÷1, 2, 4, 8  
reset  
8-bit counter  
PCLK3  
PCLK4  
PCKA1  
PCKA2  
EQ  
8-bit comparator  
PWSCAL  
÷2  
MCU  
E clock  
PCLK1  
PCLK2  
CNT2  
CNT1  
Clock  
select  
Clock A  
CON12  
PWEN1  
PWEN2  
PPOL1  
EQ  
EQ  
S
Q
Q
8-bit comparator  
PH0/  
Bit 0  
Bit 1  
MUX  
MUX  
PWDTY1  
PW1  
R
8-bit comparator  
16-bit  
PWM  
control  
PWPER1  
reset  
reset  
8
EQ  
EQ  
S
R
Q
Q
8-bit comparator  
PH1/  
PW2  
PWDTY2  
8-bit comparator  
PWPER2  
Port H  
pin  
control  
PPOL2  
PPOL3  
carry  
CON12  
EQ  
EQ  
S
R
Q
Q
8-bit comparator  
PH2/  
PW3  
Bit 2  
Bit 3  
MUX  
PWDTY3  
8-bit comparator  
16-bit  
PWM  
control  
PWPER3  
reset  
reset  
EQ  
EQ  
S
R
Q
Q
8-bit comparator  
PH3/  
PW4  
MUX  
PWDTY4  
8-bit comparator  
PWPER4  
PPOL4  
carry  
CON34  
Figure 8-5 PWM timer block diagram  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-29  
 
8.2.2.2  
Clock prescaler selection  
The three available clocks are clock A, clock B, and clock S (scaled). Clock A can be software  
selected to be E, E/2, E/4, or E/8. Clock B can be software selected to be E, E/2, E/4,..., E/128.  
The scaled clock (clock S) uses clock A as an input and divides it with a reloadable counter. The  
rates available are software selectable to be clock A/2, down to clock A /512.  
The clock source portion of the block diagram shows the three clock sources and how the scaled  
clock is created. Clock A is an input to an 8-bit counter which is then compared to a user  
programmable scale value. When they match, this circuit has an output that is divided by two and  
the counter is reset.  
Each PWM timer channel can be driven by one of two clocks. Refer to Figure 8-5.  
PCKA[2:1] — Prescaler for clock A  
Determines the frequency of clock A. Refer to Table 8-5.  
Bit 3 — Not implemented; always reads zero  
PCKB[3:1] — Prescaler for clock B  
Determines the frequency of clock B. Refer to Table 8-5.  
8
Table 8-5 Clock A and clock B prescalers  
PCKA[2:1]  
Clock A  
E
PCKB[3:1]  
0 0 0  
Clock B  
E
0 0  
0 1  
1 0  
1 1  
E/2  
0 0 1  
E/2  
E/4  
0 1 0  
E/4  
E/8  
0 1 1  
E/8  
1 0 0  
E/16  
E/32  
E/64  
E/128  
1 0 1  
1 1 0  
1 1 1  
TPG  
MOTOROLA  
8-30  
TIMING SYSTEM  
MC68HC11PH8  
 
8.2.3  
PWPOL — PWM timer polarity & clock source select register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Pulse width polarity select (PWPOL) $0061 PCLK4 PCLK3 PCLK2 PCLK1 PPOL4 PPOL3 PPOL2 PPOL1 0000 0000  
PCLK[4:3] — Pulse width channel 4/3 clock select  
1 (set)  
Clock S is source.  
0 (clear) – Clock B is source.  
PCLK[2:1] — Pulse width channel 2/1 clock select  
1 (set)  
Clock S is source.  
0 (clear) – Clock A is source.  
PPOL[4:1] — Pulse width channel x polarity  
1 (set)  
PWM channel x output is high at the beginning of the clock cycle and  
goes low when duty count is reached.  
0 (clear) – PWM channel x output is low at the beginning of the clock cycle and  
goes high when duty count is reached.  
8
Each channel has a polarity bit that allows a cycle to start with either a high or a low level. This is  
shown on the block diagram, Figure 8-5, as a selection of either the Q output or the Q output of the  
PWM output flip flop.When one of the bits in the PWPOL register is set, the associated PWM channel  
output is high at the beginning of the clock cycle, then goes low when the duty count is reached.  
8.2.4  
PWSCAL — PWM timer prescaler register  
State  
on reset  
Address bit 7  
$0062 (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
Pulse width scale (PWSCAL)  
(bit 0) 0000 0000  
Scaled clock S is generated by dividing clock A by the value in PWSCAL, then dividing the result  
by two. If PWSCAL = $00, clock A is divided by 256, then divided by two to generate clock S.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-31  
8.2.5  
PWEN — PWM timer enable register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
0
bit 3  
bit 2  
bit 1  
bit 0  
Pulse width enable (PWEN)  
$0063 TPWSL DISCP  
PWEN4 PWEN3 PWEN2 PWEN1 0000 0000  
Each timer has an enable bit to start its waveform output. Writing any of these PWENx bits to one  
causes the associated port line to become an output regardless of the state of the associated DDR  
bit. This does not change the state of the DDR bit and when PWENx returns to zero the DDR bit  
again controls I/O state. On the front end of the PWM timer the clock is connected to the PWM  
circuit by the PWENx enable bit being high. There is a synchronizing circuit to guarantee that the  
clock will only be enabled or disabled at an edge.  
PWEN contains 4 PWM enable bits — one for each channel.When an enable bit is set to one, the  
pulse modulated signal becomes available at the associated port pin.  
TPWSL — PWM scaled clock test bit (Test mode only)  
1 (set)  
Clock S output to PWSCAL register (Test only).  
0 (clear) – Normal operation.  
When TPWSL is one, clock S from the PWM timer is output to PWSCAL register. Normal writing  
to the PWSCAL register still functions.  
8
DISCP — Disable compare scaled E clock (Test mode only)  
1 (set)  
Match of period does not reset associated count register (Test only).  
0 (clear) – Normal operation.  
Bits [5:4] — Not implemented; always read zero  
PWEN[4:1] — Pulse width channels 4–1  
1 (set)  
Channel enabled on the associated port pin.  
0 (clear) – Channel disabled.  
TPG  
MOTOROLA  
8-32  
TIMING SYSTEM  
MC68HC11PH8  
8.2.6  
PWCNT1–4 — PWM timer counter registers 1 to 4  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Pulse width count 1 (PWCNT1)  
$0064 (bit 7)  
$0065 (bit 7)  
$0066 (bit 7)  
$0067 (bit 7)  
(6)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(1)  
(bit 0) 0000 0000  
(bit 0) 0000 0000  
(bit 0) 0000 0000  
(bit 0) 0000 0000  
Pulse width count 2 (PWCNT2)  
Pulse width count 3 (PWCNT3)  
Pulse width count 4 (PWCNT4)  
Each channel has its own counter which can be read at any time without affecting the count or the  
operation of the PWM channel. Writing to a counter causes it to be reset to $00; this is generally  
done before the counter is enabled. A counter may also be written to whilst it is enabled; this may  
cause a truncated PWM period.  
8.2.7  
PWPER1–4 — PWM timer period registers 1 to 4  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Pulse width period 1 (PWPER1)  
$0068 (bit 7)  
$0069 (bit 7)  
$006A (bit 7)  
$006B (bit 7)  
(6)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(1)  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
Pulse width period 2 (PWPER2)  
Pulse width period 3 (PWPER3)  
Pulse width period 4 (PWPER4)  
8
There is one period register for each channel. The value in this register determines the period of  
the associated PWM timer channel. PWPERx is connected internally to a buffer which compares  
directly with the counter register. The period value in PWPERx is loaded into the buffer when the  
counter is cleared by the termination of the previous period or by a write to the counter. This  
register can be written at any time, and the written value will take effect from the start of the next  
PWM timer cycle. Reads of this register return the most recent value written.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-33  
8.2.8  
PWDTY1–4 — PWM timer duty cycle registers 1 to 4  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Pulse width duty 1 (PWDTY1)  
$006C (bit 7)  
$006D (bit 7)  
$006E (bit 7)  
$006F (bit 7)  
(6)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(1)  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
(bit 0) 1111 1111  
Pulse width duty 2 (PWDTY2)  
Pulse width duty 3 (PWDTY3)  
Pulse width duty 4 (PWDTY4)  
There is one duty register for each channel. The value in this register determines the duty cycle of  
the associated PWM timer channel. PWDTYx is compared to the counter contents and if they are  
equal, a match occurs and the output goes to the state defined by the associated polarity bit. If the  
register is written while the channel is enabled, then the new value is held in a buffer until the counter  
rolls over or the channel is disabled. Reads of this register return the most recent value written.  
Note:  
If PWDTYx PWPERx then there will be no change of state due to the duty cycle value.  
In addition, if the duty register is set to $00, then the output will always be in the state  
which would normally be result from the duty change of state (see also Section 8.2.9).  
PWMx  
8
PWDTYx  
PWPERx  
Figure 8-6 PWM duty cycle  
8.2.9  
Boundary cases  
The following boundary conditions apply to the values stored in the PWDTYx and PWPERx  
registers and the PPOLx bits:  
If PWDTYx = $00, PWPERx > $00 and PPOLx = 0 then the output is always high.  
If PWDTYx = $00, PWPERx > $00 and PPOLx = 1 then the output is always low.  
If PWDTYx PWPERx and PPOLx = 0 then the output is always low.  
If PWDTYx PWPERx and PPOLx = 1 then the output is always high.  
If PWPERx = $00 and PPOLx = 0 then the output is always low.  
If PWPERx = $00 and PPOLx = 1 then the output is always high.  
TPG  
MOTOROLA  
8-34  
TIMING SYSTEM  
MC68HC11PH8  
 
8.3  
8-bit modulus timers  
The MC68HC11PH8 has three 8-bit modulus timers: A, B and C. These timers can generate a  
wide range of low-frequency, periodic interrupts. In addition, timer A may be used as a clock  
source for the LCD segments, the COP watchdog system and the real time interrupt (RTI), in  
applications using PLL clock generation.  
Each modulus timer consists of an 8-bit down-counter, an 8-bit modulus register and a load  
mechanism. Only the 8-bit modulus register may be written to in software. Each timer is configured  
by an associated control register that enables and flags interrupts, and selects the clock source  
for the down-counter. Figure 8-7 provides a block diagram of the modulus timers.  
8.3.1  
Modulus timer operation  
The down-counter in each timer contains a value which is decremented at a preselected clock  
rate. When this counter value reaches $00 (‘underflow’), an output pulse is generated and, if  
enabled, a hardware interrupt is requested. At this point, a new value is loaded into the  
down-counter from the modulus register;at the next clock, the counter will contain this value minus  
one.  
Note:  
For all three timers, modulus register values of $00 or $01 should be avoided.  
Because modulus timer A is used to clock the COP monitor and cannot be stopped, the  
loading mechanism on modulus timer A is inhibited for values of $00 or $01; at  
underflow, the counter will roll over from $00 to $FF and continue decrementing.  
8
The frequency that is output from the timer is equal to the clock frequency divided by the value in  
the 8-bit modulus register; a modulus register value of n generates a modulus timer underflow  
every n input clocks.Therefore, the modulus timer can divide an input frequency by any value from  
2 to 255. In addition, the timer A clock output is further divided by two to give the CLK64 signal.  
There are several software-selectable input clocks for the modulus timers (see Section 8.3.2 and  
Figure 8-7). For example, the modulus timer A clock source can be EXTALi, EXTALi/4 or EXTALi/8.  
Consequently, CLK64 can vary in frequency from EXTALi/4 (EXTALi ÷ 2 ÷ 2) to EXTALi/4080  
(EXTALi/8 ÷ 255 ÷ 2).The following table provides an example of how to obtain a 64Hz frequency  
from various EXTALi values, using timer A.  
Modulus timer A  
EXTALi  
Input clock  
EXTALi  
Modulus register Output  
32kHz  
32.768kHz  
38.4kHz  
$FA  
$40  
$46  
64Hz  
64Hz  
64Hz  
EXTALi/4  
EXTALi/4  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-35  
T8AI  
T8AF  
0
&
Data bus  
8-bit down-counter  
0
Data bus  
Load  
Underßow  
detect  
0
Timer  
A
CSA0  
CSA1  
CSA2  
Clock  
T8ADR  
Clock  
select  
EXTALi  
Data bus  
EXTALi/4  
EXTALi/8  
Modulus  
timer  
interrupt  
request  
CLK64  
÷ 2  
T8BI  
+
&
T8BF  
0
Data bus  
0
Data bus  
Load  
Underßow  
detect  
+
8-bit down-counter  
PRB  
CSB0  
CSB1  
CSB2  
Timer  
B
Clock  
8
T8BDR  
Clock  
select  
PH7  
Data bus  
Stop  
EXTALi  
EXTALi/4  
EXTALi/8  
Timer A output clock  
Timer C output clock  
T8CI  
T8CF  
0
&
Data bus  
0
Data bus  
Load  
Underßow  
detect  
8-bit down-counter  
+
PRC  
CSC0  
CSC1  
CSC2  
Timer  
C
Clock  
T8CDR  
Clock  
select  
PH6  
Stop  
Data bus  
EXTALi  
EXTALi/4  
EXTALi/8  
Timer B output clock  
Timer A output clock  
Figure 8-7 8-bit modulus timer system  
TPG  
MOTOROLA  
8-36  
TIMING SYSTEM  
MC68HC11PH8  
The modulus register can be written to at any time without affecting the down-counter; care must  
be taken by the programmer to ensure that a new value is written to the modulus register before  
the down-counter reaches $00, unless the previous value is to be reloaded. A read of the modulus  
register with the timer running will access a latched value of the down-counter. This latch  
guarantees a stable value during the read and is updated with each timer clock. To determine the  
value in the modulus register itself (for timers B and C), the timer must be stopped by the  
appropriate clock selection (see Section 8.3.2), then a one must be written to the preset bit in the  
control register. The down-counter now contains the modulus register value.  
Note:  
Because it is used to clock the COP watchdog in applications using PLL clock  
generation, timer A cannot be stopped (therefore, the value in modulus register A  
cannot be determined).  
Note:  
The timer preset bits only have an effect if the timer is stopped under hardware control  
(timers B and C only).  
The recommended procedure for configuring timers B and C is as follows:  
1) Stop the timer by writing %000 to the relevant clock select control bits.  
2) Set the modulus register by writing the required value to the timer data register.  
3) Write a one to the timer preset bit.  
4) Select the desired clock source to start the counter decrementing.  
8
8.3.2  
Clock rate selection  
A number of clock rates can be selected in software for each of the three modulus timers. The  
selection is controlled by bits 0-2 in the timer control register, as shown in the tables below.  
Timer A may be used as a prescaler for timers B and C (see Figure 8-7). Similarly timer B may be  
used as a prescaler for timer C, and vice versa.  
Table 8-6 Modulus timers clock sources  
CSA[2:0] Timer A clock source  
CSB[2:0] Timer B clock source  
CSC[2:0] Timer C clock source  
0 0 0  
0 0 1  
0 1 0  
0 1 1  
1 0 0  
1 0 1  
1 1 0  
1 1 1  
EXTALi/8  
EXTALi  
0 0 0  
0 0 1  
0 1 0  
0 1 1  
1 0 0  
1 0 1  
1 1 0  
1 1 1  
Stopped  
EXTALi  
0 0 0  
0 0 1  
0 1 0  
0 1 1  
1 0 0  
1 0 1  
1 1 0  
1 1 1  
Stopped  
EXTALi  
EXTALi/4  
EXTALi/8  
EXTALi/8  
EXTALi/8  
EXTALi/8  
EXTALi/8  
EXTALi/4  
EXTALi /4  
EXTALi/8  
EXTALi /8  
Timer A underßow  
Timer C underßow  
Rising edge PH7  
Stopped  
Timer A underßow  
Timer B underßow  
Rising edge PH6  
Stopped  
Warning: Selecting EXTALi as a clock source when the PLL function is not used, i.e. when the  
bus frequency is EXTALi/4, could lead to read or write errors in the timer registers.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-37  
8.3.2.1  
T8ADR — 8-bit modulus timer A data register  
State  
on reset  
Address bit 7  
8-bit modulus timer A data (T8ADR) $0059 (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
(0) 1111 1111  
This 8-bit register contains the value that will be loaded into the timer A down-counter on the next  
underflow. At reset, the timer A clock source is the EXTALi clock divided by 8, and the modulus  
register is initialized to its highest value.  
Because timer A is used to clock the COP watchdog in applications using the PLL clock  
generation, it is not possible to stop timer A. For the same reason, a write of values $00 or $01 to  
this register will not be loaded from the modulus register to the counter.  
8.3.2.2  
T8ACR — 8-bit modulus timer A control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
0
bit 3  
0
bit 2  
bit 1  
bit 0  
8-bit modulus timer A control (T8ACR) $005D T8AI T8AF  
CSA2 CSA1 CSA0 0000 0000  
T8AI — 8-bit timer A interrupt enable  
1 (set)  
Hardware interrupt requested when T8AF flag set.  
8
0 (clear) – Interrupt disabled.  
When set, an 8-bit modulus timer interrupt occurs when the timer reaches $00. At this time the  
timer counter is loaded with the value stored in T8ADR and the 8-bit counter will continue to count  
down at the selected clock rate.  
T8AF — 8-bit timer A underflow flag  
Set when 8-bit modulus timer A reaches $00. An interrupt is generated if enabled by T8AI.This bit  
is cleared by a write to the T8ACR register with T8AF set.  
Bits [5:3] — Not implemented; always read zero  
CSA[2:0] — 8-bit timer A clock rate  
These bits select the timer A clock, as shown in Table 8-6.  
TPG  
MOTOROLA  
8-38  
TIMING SYSTEM  
MC68HC11PH8  
8.3.2.3  
T8BDR — 8-bit modulus timer B data register  
State  
on reset  
Address bit 7  
8-bit modulus timer B data (T8BDR) $005A (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
(0)  
undeÞned  
This 8-bit register contains the value that will be loaded into the timer B down-counter at the next  
underflow. At reset, timer B is stopped and the state of the modulus register is indeterminate.  
8.3.2.4  
T8BCR — 8-bit modulus timer B control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
0
bit 3  
bit 2  
bit 1  
bit 0  
8-bit modulus timer B control (T8BCR) $005E T8BI T8BF  
PRB CSB2 CSB1 CSB0 0000 0000  
T8BI — 8-bit timer B interrupt enable  
1 (set)  
Hardware interrupt requested when T8BF flag set.  
0 (clear) – Interrupt disabled.  
When set, an 8-bit modulus timer interrupt occurs when the timer reaches $00. At this time the  
timer counter is loaded with the value stored in T8BDR and the 8-bit counter will continue to count  
down at the selected clock rate.  
8
T8BF — 8-bit timer B underflow flag  
1 (set)  
Underflow has occurred.  
0 (clear) – No underflow has occurred.  
Set when 8-bit modulus timer B reaches $00. An interrupt is generated if enabled by T8BI.This bit  
is cleared by a write to the T8BCR register with T8BF set.  
Bits [5, 4] — Not implemented; always read zero  
PRB — 8-bit timer B preset  
A write to theT8BCR register with this bit set will preset the timer B counter to the modulus register  
value. The clock must be stopped before writing to the register. This bit always reads as 0.  
CSB[2:0] — 8-bit timer B clock rate  
These bits select the timer B clock, as shown in Table 8-6. At reset, timer B is not clocked.  
TPG  
MC68HC11PH8  
TIMING SYSTEM  
MOTOROLA  
8-39  
8.3.2.5  
T8CDR — 8-bit modulus timer C data register  
State  
on reset  
Address bit 7  
8-bit modulus timer C data (T8CDR) $005B (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
(0)  
undeÞned  
This 8-bit register contains the value that will be loaded into the timer C down-counter at the next  
underflow. At reset, timer C is stopped and state of the modulus register is indeterminate.  
8.3.2.6  
T8CCR — 8-bit modulus timer C control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
0
bit 4  
0
bit 3  
bit 2  
bit 1  
bit 0  
8-bit modulus timer C control (T8CCR) $005F T8CI T8CF  
PRC CSC2 CSC1 CSC0 0000 0000  
T8CI8 — bit timer C interrupt enable  
1 (set)  
Hardware interrupt requested when T8CF flag set.  
0 (clear) – Interrupt disabled.  
When set, an 8-bit modulus timer interrupt occurs when the timer reaches $00. At this time the  
timer counter is loaded with the value stored in T8CDR and the 8-bit counter will continue to count  
down at the selected clock rate.  
8
T8CF — 8-bit timer C underflow flag  
1 (set)  
Underflow has occurred.  
0 (clear) – No underflow has occurred.  
Set when 8-bit modulus timer C reaches $00. An interrupt is generated if enabled by T8CI. This  
bit is cleared by a write to the T8CCR register with T8CF set.  
Bits [5, 4] — Not implemented; always read zero  
PRC — 8-bit timer C preset  
A write to theT8CCR register with this bit set will preset the timer C counter to the modulus register  
value. The clock must be stopped before writing to the register. This bit always reads as 0.  
CSC[2:0] — 8-bit timer C clock rate  
These bits select the timer C clock, as shown in Table 8-6. At reset, timer C is not clocked.  
TPG  
MOTOROLA  
8-40  
TIMING SYSTEM  
MC68HC11PH8  
9
ANALOG-TO-DIGITAL CONVERTER  
The analog-to-digital (A/D) system, a successive approximation converter, uses an all-capacitive  
charge redistribution technique to convert analog signals to digital values.  
The A/D converter shares input pins with port E:  
Alternate  
Pin  
function  
PE0  
PE1  
PE2  
PE3  
PE4  
PE5  
PE6  
PE7  
AD0  
AD1  
AD2  
AD3  
AD4  
AD5  
AD6  
AD7  
9
9.1  
Overview  
The A/D system is an 8-channel, 8-bit, multiplexed-input converter. The VDD AD and VSS AD  
pins are used to input supply voltage to the A/D converter. This allows the supply voltage to be  
bypassed independently. The converter does not require external sample and hold circuits  
because of the type of charge redistribution technique used. A/D converter timing can be  
synchronized to the system E clock, or to an internal resistor capacitor (RC) oscillator. The A/D  
converter system consists of four functional blocks: multiplexer, analog converter, digital control  
and result storage. Refer to Figure 9-1.  
TPG  
MC68HC11PH8  
ANALOG-TO-DIGITAL CONVERTER  
MOTOROLA  
9-1  
 
VRH  
VRL  
PE0/  
AD0  
8-bit capacitive DAC  
with sample and hold  
PE1/  
AD1  
Successive approximation  
register and control  
PE2/  
AD2  
Result  
Internal  
data bus  
PE3/  
AD3  
Analog  
MUX  
PE4/  
AD4  
CCF  
0
PE5/  
AD5  
SCAN  
MULT  
CD  
PE6/  
AD6  
CC  
CB  
PE7/  
AD7  
CA  
Result register interface  
ADR1 - A/D result 1  
ADR2 - A/D result 2  
ADR3 - A/D result 3  
ADR4 - A/D result 4  
9
Figure 9-1 A/D converter block diagram  
9.1.1  
Multiplexer  
The multiplexer selects one of 16 inputs for conversion. Input selection is controlled by the value  
of bits CD – CA in the ADCTL register. The eight port E pins are fixed-direction analog inputs to  
the multiplexer, and additional internal analog signal lines are routed to it.  
Port E pins can also be used as digital inputs (see Section 4). Digital reads of port E pins should  
be avoided during the sample portion of an A/D conversion cycle, when the gate signal to the  
N-channel input gate is on. Because no P-channel devices are directly connected to either input  
pins or reference voltage pins, voltages above V  
do not cause a latchup problem, although  
DD  
current and voltage should be limited according to maximum ratings. Refer to Figure 9-2, which is  
a functional diagram of an input pin.  
TPG  
MOTOROLA  
9-2  
ANALOG-TO-DIGITAL CONVERTER  
MC68HC11PH8  
Input  
protection  
device  
Diffusion and  
poly coupler  
Analog  
input  
4kΩ  
Note 1  
<2pF  
20pF  
400nA  
junction  
leakage  
DAC  
capacitance  
+20V  
Ð0.7V  
VRL  
Note 1: The analog switch is closed only during the 12 cycle sample time  
Note 2: All component values are approximate  
Figure 9-2 Electrical model of an A/D input pin (in sample mode)  
9.1.2  
Analog converter  
Conversion of an analog input selected by the multiplexer occurs in this block. It contains a  
digital-to-analog capacitor (DAC) array, a comparator, and a successive approximation register  
(SAR). Each conversion is a sequence of eight comparison operations, beginning with the most  
significant bit (MSB). Each comparison determines the value of a bit in the SAR.  
The DAC array performs two functions. It acts as a sample and hold circuit during the entire  
conversion sequence, and provides comparison voltage to the comparator during each  
successive comparison.  
9
The result of each successive comparison is stored in the SAR. When a conversion sequence is  
complete, the contents of the SAR are transferred to the appropriate result register.  
A charge pump provides switching voltage to the gates of analog switches in the multiplexer.  
Charge pump output must stabilize between 7 and 8 volts within up to 100 µs before the converter  
can be used. The charge pump is enabled by the ADPU bit in the OPTION register.  
9.1.3  
Digital control  
All A/D converter operations are controlled by bits in register ADCTL. In addition to selecting the  
analog input to be converted, ADCTL bits indicate conversion status, and control whether single  
or continuous conversions are performed. Finally, the ADCTL bits determine whether conversions  
are performed on single or multiple channels.  
TPG  
MC68HC11PH8  
ANALOG-TO-DIGITAL CONVERTER  
MOTOROLA  
9-3  
9.1.4  
Result registers  
Four 8-bit registers (ADR1 – ADR4) store conversion results. Each of these registers can be  
accessed by the processor in the CPU. The conversion complete flag (CCF) indicates when valid  
data is present in the result registers.The result registers are written during a portion of the system  
clock cycle when reads do not occur, so there is no conflict.  
9.1.5  
A/D converter clocks  
The CSEL bit in the OPTION register selects whether the A/D converter uses the system E clock  
or an internal RC oscillator for synchronization.When E clock frequency is below 750kHz, charge  
leakage in the capacitor array can cause errors, and the internal oscillator should be used. When  
the RC clock is used, additional errors can occur because the comparator is sensitive to the  
additional system clock noise.  
9.1.6  
Conversion sequence  
A/D converter operations are performed in sequences of four conversions each. A conversion  
sequence can repeat continuously or stop after one iteration.The conversion complete flag (CCF)  
is set after the fourth conversion in a sequence to show the availability of data in the result  
registers. Figure 9-3 shows the timing of a typical sequence. Synchronization is referenced to the  
system E clock.  
9
E clock  
12 cycles  
4 cycles 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc  
MSB bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0  
END  
Sample analog input  
Successive approximation sequence  
Convert Þrst  
channel and  
update ADR1  
Convert second  
Convert third  
channel and  
update ADR3  
Convert fourth  
channel and  
update ADR4  
channel and  
update ADR2  
0
32  
64  
96  
128 E clock cycles  
Figure 9-3 A/D conversion sequence  
TPG  
MOTOROLA  
9-4  
ANALOG-TO-DIGITAL CONVERTER  
MC68HC11PH8  
 
9.1.7  
Conversion process  
The A/D conversion sequence begins one E clock cycle after a write to the A/D control/status  
register, ADCTL. The bits in ADCTL select the channel and the mode of conversion.  
An input voltage equal to V converts to $00 and an input voltage equal to V converts to $FF  
RL  
RH  
(full scale), with no overflow indication. For ratiometric conversions of this type, the source of each  
analog input should use V as the supply voltage and be referenced to V  
.
RL  
RH  
9.2  
A/D converter power-up and clock select  
ADPU (bit 7 of the OPTION register) controls A/D converter power up. Clearing ADPU removes  
power from and disables the A/D converter system; setting ADPU enables the A/D converter  
system. After the A/D converter is turned on, the analog bias voltages will take up to 100µs to  
stabilize.  
When the A/D converter system is operating from the MCU E clock, all switching and comparator  
operations are synchronized to the MCU clocks.This allows the comparator results to be sampled  
at ‘quiet’ times, which minimizes noise errors. The internal RC oscillator is asynchronous with  
respect to the MCU clock, so noise can affect the A/D converter results. This results in a slightly  
lower typical accuracy when using the internal oscillator (CSEL = 1).  
9.2.1  
OPTION — System configuration options register 1  
9
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
System conÞg. options 1 (OPTION) $0039 ADPU CSEL IRQE DLY  
CME FCME CR1  
CR0 0001 0000  
The 8-bit special-purpose OPTION register sets internal system configuration options during  
initialization.The time protected control bits, IRQE, DLY, FCME and CR[1:0] can be written to only  
once in the first 64 cycles after a reset and then they become read-only bits. This minimizes the  
possibility of any accidental changes to the system configuration.They may be written at any time  
in special modes.  
ADPU — A/D power-up  
1 (set)  
A/D system power enabled.  
0 (clear) – A/D system disabled, to reduce supply current.  
After enabling the A/D power, at least 100µs should be allowed for system stabilization.  
TPG  
MC68HC11PH8  
ANALOG-TO-DIGITAL CONVERTER  
MOTOROLA  
9-5  
CSEL — Clock select  
1 (set)  
A/D, EPROM and EEPROM use internal RC clock source  
(about 1.5MHz).  
0 (clear) – A/D, EPROM and EEPROM use system E clock  
(must be at least 1MHz).  
Selects alternate clock source for on-chip EPROM, EEPROM and A/D charge pumps.The on-chip  
RC clock should be used when the E clock frequency falls below 1MHz.  
IRQE — Configure IRQ for falling edge sensitive operation (refer to Section 3)  
1 (set)  
Falling edge sensitive operation.  
0 (clear) – Low level sensitive operation.  
DLY — Enable oscillator start-up delay (refer to Section 3)  
1 (set)  
A stabilization delay is imposed as the MCU is started up from STOP  
mode or from power-on reset.  
0 (clear) – The oscillator start-up delay coming out of STOP is bypassed and the  
MCU resumes processing within about four bus cycles. A stable  
external oscillator is required if this option is selected.  
CME — Clock monitor enable (refer to Section 10)  
1 (set)  
Clock monitor enabled.  
0 (clear) – Clock monitor disabled.  
9
FCME — Force clock monitor enable (refer to Section 10)  
1 (set)  
Clock monitor enabled, cannot be disabled until next reset.  
0 (clear) – Clock monitor follows the state of the CME bit.  
CR[1:0] — COP timer rate select bits (refer to Section 10)  
TPG  
MOTOROLA  
9-6  
ANALOG-TO-DIGITAL CONVERTER  
MC68HC11PH8  
9.3  
Channel assignments  
The multiplexer allows the A/D converter to select one of sixteen analog signals. Eight of these  
channels correspond to port E input lines to the MCU, four others are internal reference points or  
test functions; the remaining four channels are reserved. Refer to Table 9-1.  
Table 9-1 A/D converter channel assignments  
Channel Channel Result in ADRx  
number  
signal  
AD0  
AD1  
AD2  
AD3  
AD4  
AD5  
AD6  
AD7  
if MULT = 1  
ADR1  
ADR2  
ADR3  
ADR4  
ADR1  
ADR2  
ADR3  
ADR4  
Ñ
1
2
3
4
5
6
7
8
9Ð12  
13  
14  
15  
16  
reserved  
(1)  
V
ADR1  
ADR2  
ADR3  
ADR4  
RH  
(1)  
V
RL  
(1)  
V
/2  
RH  
(1)  
reserved  
(1) Used for factory testing.  
9
9.3.1  
Single-channel operation  
There are two types of single-channel operation. In the first type (SCAN = 0), the single selected  
channel is converted four consecutive times. The first result is stored in A/D result register 1  
(ADR1), and the fourth result is stored in ADR4. After the fourth conversion is complete, all  
conversion activity is halted until a new conversion command is written to the ADCTL register. In  
the second type of single-channel operation (SCAN = 1), conversions continue to be performed  
on the selected channel with the fifth conversion being stored in register ADR1 (overwriting the  
first conversion result), the sixth conversion overwriting ADR2, and so on.  
TPG  
MC68HC11PH8  
ANALOG-TO-DIGITAL CONVERTER  
MOTOROLA  
9-7  
9.3.2  
Multiple-channel operation  
There are two types of multiple-channel operation. In the first type (SCAN = 0), a selected group  
of four channels is converted once only. The first result is stored in A/D result register 1 (ADR1),  
and the fourth result is stored in ADR4. After the fourth conversion is complete, all conversion  
activity is halted until a new conversion command is written to the ADCTL register. In the second  
type of multiple-channel operation (SCAN = 1), conversions continue to be performed on the  
selected group of channels with the fifth conversion being stored in register ADR1 (replacing the  
earlier conversion result for the first channel in the group), the sixth conversion overwriting ADR2,  
and so on.  
9.4  
Control, status and results registers  
9.4.1  
ADCTL — A/D control and status register  
State  
on reset  
Address bit 7  
$0030 CCF  
bit 6  
0
bit 5  
bit 4  
bit 3  
CD  
bit 2  
CC  
bit 1  
CB  
bit 0  
A/D control & status (ADCTL)  
SCAN MULT  
CA u0uu uuuu  
All bits in this register can be read or written, except bit 7, which is a read-only status indicator,  
and bit 6, which always reads as zero.Write to ADCTL to initiate a conversion.To quit a conversion  
in progress, write to this register and a new conversion sequence begins immediately.  
9
CCF — Conversions complete flag  
1 (set)  
All four A/D result registers contain valid conversion data.  
0 (clear) – At least one of the A/D result registers contains invalid data.  
A read-only status indicator, this bit is set when all four A/D result registers contain valid  
conversion results. Each time the ADCTL register is overwritten, this bit is automatically cleared  
to zero and a conversion sequence is started. In the continuous mode, CCF is set at the end of  
the first conversion sequence.  
Bit 6 — Not implemented; always reads zero.  
SCAN — Continuous scan control  
1 (set)  
A/D conversions take place continuously.  
0 (clear) – Each of the four conversions is performed only once.  
When this control bit is clear, the four requested conversions are performed once to fill the four  
result registers. When this control bit is set, the four conversions are repeated continuously with  
the result registers updated as data becomes available.  
TPG  
MOTOROLA  
9-8  
ANALOG-TO-DIGITAL CONVERTER  
MC68HC11PH8  
MULT — Multiple-channel/single-channel control  
1 (set) Each A/D channel has a result register allocated to it.  
0 (clear) – Four consecutive conversions from the same A/D channel are stored  
in the results registers.  
When this bit is clear, the A/D converter system is configured to perform four consecutive  
conversions on the single channel specified by the four channel select bits CD–CA (bits 3–0 of the  
ADCTL register). When this bit is set, the A/D system is configured to perform a conversion on  
each of the four channels where each result register corresponds to one channel.  
Note:  
When the multiple-channel continuous scan mode is used, extra care is needed in the  
design of circuitry driving the A/D inputs. The charge on the capacitive DAC array before  
the sample time is related to the voltage on the previously converted channel. A charge  
share situation exists between the internal DAC capacitance and the external circuit  
capacitance. Although the amount of charge involved is small, the rate at which it is  
repeated is every 64 µs for an E clock of 2 MHz.The RC charging rate of the external circuit  
must be balanced against this charge sharing effect to avoid errors in accuracy.Refer to the  
M68HC11 Reference Manual (M68HC11RM/AD) for further information.  
CD–CA — Channel selects D–A  
When a multiple channel mode is selected (MULT = 1), the two least significant channel select bits  
(CB and CA) have no meaning and the CD and CC bits specify which group of four channels is to  
be converted.  
9
Channel select  
Channel Result in ADRx  
control bits  
signal  
if MULT = 1  
CD:CC:CB:CA  
0 0 0 0  
0 0 0 1  
0 0 1 0  
0 0 1 1  
0 1 0 0  
0 1 0 1  
0 1 1 0  
0 1 1 1  
1 0 X X  
1 1 0 0  
1 1 0 1  
1 1 1 0  
AD0  
AD1  
AD2  
AD3  
AD4  
AD5  
AD6  
AD7  
ADR1  
ADR2  
ADR3  
ADR4  
ADR1  
ADR2  
ADR3  
ADR4  
Ñ
reserved  
(1)  
V
ADR1  
ADR2  
ADR3  
RH  
(1)  
V
RL  
(1)  
V
/2  
RH  
(1  
reserved  
1 1 1 1  
ADR4  
)
TPG  
MC68HC11PH8  
ANALOG-TO-DIGITAL CONVERTER  
MOTOROLA  
9-9  
(1) Used for factory testing.  
9.4.2  
ADR1–ADR4 — A/D converter results registers  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
A/D result 1 (ADR1)  
A/D result 2 (ADR2)  
A/D result 3 (ADR3)  
A/D result 4 (ADR4)  
$0031 (bit 7)  
$0032 (bit 7)  
$0033 (bit 7)  
$0034 (bit 7)  
(6)  
(6)  
(6)  
(6)  
(5)  
(5)  
(5)  
(5)  
(4)  
(4)  
(4)  
(4)  
(3)  
(3)  
(3)  
(3)  
(2)  
(2)  
(2)  
(2)  
(1)  
(1)  
(1)  
(1)  
(bit 0) undeÞned  
(bit 0) undeÞned  
(bit 0) undeÞned  
(bit 0) undeÞned  
These read-only registers hold an 8-bit conversion result.Writes to these registers have no effect.  
Data in the A/D converter result registers is valid when the CCF flag in the ADCTL register is set,  
indicating a conversion sequence is complete. If conversion results are needed sooner, refer to  
Figure 9-3, which shows the A/D conversion sequence diagram.  
9.5  
Operation in STOP and WAIT modes  
If a conversion sequence is in progress when either the STOP or WAIT mode is entered, the  
conversion of the current channel is suspended. When the MCU resumes normal operation, that  
channel is resampled and the conversion sequence is resumed. As the MCU exits the WAIT mode,  
the A/D circuits are stable and valid results can be obtained on the first conversion. However, in  
STOP mode, all analog bias currents are disabled and it is necessary to allow a stabilization period  
when leaving the STOP mode. If the STOP mode is exited with a delay (DLY = 1), there is enough  
time for these circuits to stabilize before the first conversion. If the STOP mode is exited with no  
delay (DLY bit in OPTION register = 0), allow 10 ms for the A/D circuitry to stabilize to avoid invalid  
results.  
9
TPG  
MOTOROLA  
9-10  
ANALOG-TO-DIGITAL CONVERTER  
MC68HC11PH8  
10  
RESETS AND INTERRUPTS  
Resets and interrupt operations load the program counter with a vector that points to a new  
location from which instructions are to be fetched. A reset immediately stops execution of the  
current instruction and forces the program counter to a known starting address. Internal registers  
and control bits are initialized so that the MCU can resume executing instructions. An interrupt  
temporarily suspends normal program execution whilst an interrupt service routine is being  
executed. After an interrupt has been serviced, the main program resumes as if there had been  
no interruption.  
10.1  
Resets  
There are four possible sources of reset. Power-on reset (POR) and external reset share the  
normal reset vector. The computer operating properly (COP) reset and the clock monitor reset  
each has its own vector.  
10.1.1  
Power-on reset  
10  
A positive transition on VDD generates a power-on reset (POR), which is used only for power-up  
conditions. POR cannot be used to detect drops in power supply voltages. A delay is imposed  
which allows the clock generator to stabilize after the oscillator becomes active. If RESET is at  
logical zero at the end of the delay time, the CPU remains in the reset condition until RESET goes  
to logical one. A mask option selects one of two delay times; either 128 or 4064 t  
cycles).  
(internal clock  
CYC  
Note:  
This mask option is not available on the MC68HC711PH8, where the delay time is  
4064 t  
.
CYC  
It is important to protect the MCU during power transitions. Most M68HC11 systems need an  
external circuit that holds the RESET pin low whenever V is below the minimum operating level.  
DD  
This external voltage level detector, or other external reset circuits, are the usual source of reset  
in a system.The POR circuit only initializes internal circuitry during cold starts. Refer to Figure 2-3.  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-1  
 
10.1.2  
External reset (RESET)  
The CPU distinguishes between internal and external reset conditions by sensing whether the  
reset pin rises to a logic one in less than four E clock cycles after an internal device releases reset.  
When a reset condition is sensed, the RESET pin is driven low by an internal device for eight E  
clock cycles, then released. Four E clock cycles later it is sampled. If the pin is still held low, the  
CPU assumes that an external reset has occurred. If the pin is high, it indicates that the reset was  
initiated internally by either the COP system or the clock monitor. It is not advisable to connect an  
external resistor capacitor (RC) power-up delay circuit to the reset pin of M68HC11 devices  
because the circuit charge time constant can cause the device to misinterpret the type of reset  
that occurred. To guarantee recognition of an external reset, the RESET pin should be held low  
for at least 16 clock cycles.  
10.1.3  
COP reset  
The MCU includes a COP system to help protect against software failures. When the COP is  
enabled, the software is responsible for keeping a free-running watchdog timer from timing out.  
When the software is no longer being executed in the intended sequence, a system reset is  
initiated.  
The state of the NOCOP bit in the CONFIG register determines whether the COP system is  
enabled or disabled. To change the enable status of the COP system, change the contents of the  
CONFIG register and then perform a system reset. In the special test and bootstrap operating  
modes, the COP system is initially inhibited by the disable resets (DISR) control bit in the TEST1  
register. The DISR bit can subsequently be written to zero to enable COP resets.  
The COP function has two possible clock sources. When PLL clock generation is not used  
(VDDSYN = 0), the clocking chain for the COP function is tapped off from the main timer divider  
15  
chain (E/2 ); refer to Figure 8-1.When the PLL clock generation is used (VDDSYN = 1), the COP  
function can be clocked by the underflow of the 8-bit modulus timer A (CLK64/4); see Figure 8-2.  
The COP timer rate control bits CR[1:0] in the OPTION register determine the COP timeout  
period.The COP clock source frequency is scaled by the factor shown in Table 10-1 or Table 10-2.  
After reset, bits CR[1:0] are zero, which selects the shortest timeout period. In normal operating  
modes, these bits can only be written once, within 64 bus cycles after reset.  
10  
TPG  
MOTOROLA  
10-2  
RESETS AND INTERRUPTS  
MC68HC11PH8  
Table 10-1 COP timer rate select (PLL disabled)  
Divide EXTALi = 8MHz: EXTALi = 12MHz: EXTALi = 16MHz:  
CR[1:0]  
15  
(1)  
(1)  
(1)  
E/2 by  
timeout  
timeout  
timeout  
0 0  
0 1  
1 0  
1 1  
1
4
16.384 ms  
65.536 ms  
262.14 ms  
1.049 sec  
2.0 MHz  
10.923 ms  
43.691 ms  
174.76 ms  
699.05 ms  
3.0 MHz  
8.192 ms  
32.768 ms  
131.07 ms  
524.29 ms  
4.0 MHz  
16  
64  
E =  
15  
(1) The timeout period has a tolerance of Ð0/+one cycle of the E/2 clock due to  
the asynchronous implementation of the COP circuitry. For example, with  
EXTALi = 8MHz, the uncertainty is Ð0/+16.384ms. See also the M68HC11  
Reference Manual, (M68HC11RM/AD).  
Table 10-2 COP timer rate select (PLL enabled)  
Divide  
CLK64 by  
CLK64 = 4.096 kHz: CLK64 =64 Hz: CLK64 = 4 Hz:  
CR[1:0]  
(1)  
(1)  
(1)  
timeout  
timeout  
timeout  
0 0  
0 1  
1 0  
1 1  
4
1 ms  
62.5 ms  
250 ms  
1 s  
1 s  
16  
3.9 ms  
15.6 ms  
62.5 sec  
4 s  
64  
16 s  
64 s  
256  
4 s  
(1) The timeout period has a tolerance of Ð0/+one cycle of the CLK64/4 clock due to  
the asynchronous implementation of the COP circuitry. For example, with  
CLK64 = 64 Hz, the uncertainty is Ð0/+62.5ms. See also the M68HC11  
Reference Manual, (M68HC11RM/AD).  
10.1.3.1 COPRST — Arm/reset COP timer circuitry register  
10  
State  
on reset  
Address bit 7  
$003A (bit 7)  
bit 6  
(6)  
bit 5  
(5)  
bit 4  
(4)  
bit 3  
(3)  
bit 2  
(2)  
bit 1  
(1)  
bit 0  
COP timer arm/reset (COPRST)  
(bit 0) not affected  
Complete the following reset sequence to service the COP timer. Write $55 to COPRST to arm  
the COP timer clearing mechanism.Then write $AA to COPRST to clear the COP timer. Executing  
instructions between these two steps is possible as long as both steps are completed in the  
correct sequence before the timer times out.  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-3  
 
 
10.1.4  
Clock monitor reset  
The clock monitor circuit is based on an internal RC time delay. If no MCU clock edges are  
detected within this RC time delay, the clock monitor can optionally generate a system reset. The  
clock monitor function is enabled or disabled by the CME control bit in the OPTION register. The  
presence of a timeout is determined by the RC delay, which allows the clock monitor to operate  
without any MCU clocks.  
Clock monitor is used as a backup for the COP system. Because the COP needs a clock to  
function, it is disabled when the clocks stop. Therefore, the clock monitor system can detect clock  
failures not detected by the COP system.  
Semiconductor wafer processing causes variations of the RC timeout values between individual  
devices. An E clock frequency below 10 kHz is detected as a clock monitor error. An E clock  
frequency of 200 kHz or more prevents clock monitor errors. Using the clock monitor function  
when the E clock is below 200 kHz is not recommended.  
Special considerations are needed when a STOP instruction is executed and the clock monitor is  
enabled. Because the STOP function causes the clocks to be halted, the clock monitor function  
generates a reset sequence if it is enabled at the time the STOP mode was initiated. Before  
executing a STOP instruction, clear the CME bit in the OPTION register to zero to disable the clock  
monitor. After recovery from STOP, set the CME bit to logic one to enable the clock monitor.  
10.1.5  
OPTION — System configuration options register 1  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
System conÞg. options 1 (OPTION) $0039 ADPU CSEL IRQE DLY  
CME FCME CR1  
CR0 0001 0000  
The special-purpose OPTION register sets internal system configuration options during  
initialization.The time protected control bits (IRQE, DLY, FCME and CR[1:0]) can be written to only  
once in the first 64 cycles after a reset and then they become read-only bits. This minimizes the  
possibility of any accidental changes to the system configuration.They may be written at any time  
in special modes.  
10  
ADPU — A/D power-up (Refer to Section 9)  
1 (set)  
A/D system power enabled.  
0 (clear) – A/D system disabled, to reduce supply current.  
CSEL — Clock select (Refer to Section 9)  
1 (set)  
A/D, EPROM and EEPROM use internal RC clock (about 1.5MHz).  
0 (clear) – A/D, EPROM and EEPROM use system E clock  
(must be at least 1MHz).  
TPG  
MOTOROLA  
10-4  
RESETS AND INTERRUPTS  
MC68HC11PH8  
IRQE — Configure IRQ for falling edge sensitive operation (Refer to Section 3)  
1 (set) Falling edge sensitive operation.  
0 (clear) – Low level sensitive operation.  
DLY — Enable oscillator start-up delay  
1 (set)  
A stabilization delay is imposed as the MCU is started up from STOP  
mode (or from power-on reset).  
0 (clear) – The oscillator start-up delay is bypassed and the MCU resumes  
processing within about four bus cycles. A stable external oscillator  
is required if this option is selected.  
Note:  
Because DLY is set on reset, a delay is always imposed as the MCU is started up from  
power-on reset.  
A mask option on the MC68HC11PH8 allows the selection of either a short or long delay time for  
power-on reset and exit from STOP mode; either 128 or 4064 bus cycles. This option is not  
available on the MC68HC711PH8 where the delay time is 4064 bus cycles.  
CME — Clock monitor enable  
1 (set)  
Clock monitor enabled.  
0 (clear) – Clock monitor disabled.  
This control bit can be read or written at any time and controls whether or not the internal clock  
monitor circuit triggers a reset sequence when the system clock is slow or absent.When it is clear,  
the clock monitor circuit is disabled, and when it is set, the clock monitor circuit is enabled. Reset  
clears the CME bit.  
10  
In order to use both STOP and clock monitor, the CME bit should be cleared before executing  
STOP, then set again after recovering from STOP.  
FCME — Force clock monitor enable  
1 (set)  
Clock monitor enabled; cannot be disabled until next reset.  
0 (clear) – Clock monitor follows the state of the CME bit.  
When FCME is set, slow or stopped clocks will cause a clock failure reset sequence. To utilize  
STOP mode, FCME should always be cleared.  
CR[1:0] — COP timer rate select bits  
15  
The COP function can be clocked either by the internal E clock divided by 2 , or by the output of  
the 8-bit modulus timer A, CLK64/4.These control bits determine a scaling factor for the watchdog  
timer period. See Table 10-1 and Table 10-2.  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-5  
10.1.6  
CONFIG — Configuration control register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
ConÞguration control (CONFIG)  
$003F ROMAD FREEZ CLK4X PAREN NOSEC NOCOPROMON EEON xxxx xxxx  
Among other things, CONFIG controls the presence and location of EEPROM in the memory map  
and enables the COP watchdog system. A security feature that protects data in EEPROM and  
RAM is available on mask programmed MCUs.  
CONFIG is made up of EEPROM cells and static working latches. The operation of the MCU is  
controlled directly by these latches and not the EEPROM byte. When programming the CONFIG  
register, the EEPROM byte is accessed. When the CONFIG register is read, the static latches  
are accessed.  
These bits can be read at any time. The value read is the one latched into the register from the  
EEPROM cells during the last reset sequence. A new value programmed into this register is not  
readable until after a subsequent reset sequence.  
On the MC68HC711PH8, and on the MC68HC11PH8 if selected by a mask option, the ROMON  
bit can be written at any time if MDA = 1 (expanded mode or special test mode). It cannot be  
written in bootstrap mode, and is forced to a logic one in single chip mode.  
Other bits in CONFIG can be written at any time if SMOD = 1 (bootstrap or special test mode). If  
SMOD = 0 (single chip or expanded mode), these bits can only be written using the EEPROM  
programming sequence, and none of the bits are readable or active until latched via the next reset.  
FREEZ is only active in expanded user mode.  
ROMAD — ROM/EPROM mapping control (refer to Section 3)  
1 (set)  
ROM addressed from $4000 to $FFFF.  
10  
0 (clear) – ROM addressed from $0000 to $BFFF (expanded mode only).  
In single chip mode, reset sets this bit.  
FREEZ — Expanded user mode address bus freeze (refer to Section 3)  
1 (set)  
The external bus is only active when externally mapped resources  
are accessed (expanded mode only)  
0 (clear) – Normal operation.  
CLK4X — 4X clock enable (refer to Section 3)  
1 (set)  
4XCLK or EXTALi driven out on the 4XOUT pin.  
0 (clear) – 4XOUT pin disabled.  
TPG  
MOTOROLA  
10-6  
RESETS AND INTERRUPTS  
MC68HC11PH8  
PAREN — Pull-up assignment register enable (refer to Section 4)  
1 (set) PPAR register enabled; pull-ups can be enabled using PPAR.  
0 (clear) – PPAR register disabled; all pull-ups disabled.  
NOSEC — EEPROM security disabled (refer to Section 3)  
1 (set)  
Disable security.  
0 (clear) – Enable security.  
NOCOP — COP system disable  
1 (set)  
COP system disabled.  
0 (clear) – COP system enabled (forces reset on timeout).  
ROMON — ROM/EPROM enable (refer to Section 3)  
1 (set)  
ROM/EPROM included in the memory map.  
0 (clear) – ROM/EPROM excluded from the memory map.  
EEON — EEPROM enable (refer to Section 3)  
1 (set)  
EEPROM included in the memory map.  
0 (clear) – EEPROM excluded from the memory map.  
10.2  
Effects of reset  
When a reset condition is recognized, the internal registers and control bits are forced to an initial  
state. Depending on the cause of the reset and the operating mode, the reset vector can be  
fetched from any of six possible locations, as shown in Table 10-3.  
10  
Table 10-3 Reset cause, reset vector and operating mode  
Cause of reset  
POR or RESET pin  
Clock monitor failure  
COP watchdog timeout  
Normal mode vector Special test or bootstrap  
$FFFE, $FFFF  
$FFFC, $FFFD  
$FFFA, $FFFB  
$BFFE, $BFFF  
$BFFC, $BFFD  
$BFFA, $BFFB  
These initial states then control on-chip peripheral systems to force them to known start-up states,  
as described in the following paragraphs.  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-7  
10.2.1  
Central processing unit  
After reset, the CPU fetches the restart vector from the appropriate address during the first three  
cycles, and begins executing instructions. The stack pointer and other CPU registers are  
indeterminate immediately after reset; however, the X and I interrupt mask bits in the condition  
code register (CCR) are set to mask any interrupt requests. Also, the S-bit in the CCR is set to  
inhibit the STOP mode.  
10.2.2  
Memory map  
After reset, the INIT register is initialized to $00, putting the 2K bytes of RAM at locations  
$0080–$087F, and the control registers at locations $0000–$007F. The INIT2 register puts  
EEPROM at locations $0D00–$0FFF.  
10.2.3  
Parallel I/O  
When a reset occurs in expanded operating modes, port B, C, and F pins used for parallel I/O are  
dedicated to the expansion bus. If a reset occurs during a single chip operating mode, all ports are  
configured as general purpose high-impedance inputs.  
Note:  
Do not confuse pin function with the electrical state of the pin at reset. All  
general-purpose I/O pins configured as inputs at reset are in a high-impedance state.  
Port data registers reflect the port’s functional state at reset. The pin function is mode  
dependent.  
10.2.4  
Timer  
10  
During reset, the timer system is initialized to a count of $0000. The prescaler bits are cleared,  
and all output compare registers are initialized to $FFFF. All input capture registers are  
indeterminate after reset. The output compare 1 mask (OC1M) register is cleared so that  
successful OC1 compares do not affect any I/O pins. The other four output compares are  
configured so that they do not affect any I/O pins on successful compares. All input capture  
edge-detector circuits are configured for capture disabled operation. The timer overflow interrupt  
flag and all eight timer function interrupt flags are cleared. All nine timer interrupts are disabled  
because their mask bits have been cleared.  
The I4/O5 bit in the PACTL register is cleared to configure the I4/O5 function as OC5; however,  
the OM5:OL5 control bits in the TCTL1 register are clear so OC5 does not control the PA3 pin.  
TPG  
MOTOROLA  
10-8  
RESETS AND INTERRUPTS  
MC68HC11PH8  
10.2.5  
Real-time interrupt (RTI)  
The real-time interrupt flag (RTIF) is cleared and automatic hardware interrupts are masked. The  
rate control bits are cleared after reset and can be initialized by software before the real-time  
interrupt (RTI) system is used.  
10.2.6  
Pulse accumulator  
The pulse accumulator system is disabled at reset so that the pulse accumulator input (PAI) pin  
defaults to being a general-purpose input pin.  
10.2.7  
Computer operating properly (COP)  
The COP watchdog system is enabled if the NOCOP control bit in the CONFIG register is cleared,  
and disabled if NOCOP is set. The COP rate is set for the shortest duration timeout.  
10.2.8  
8-bit modulus timer system  
On reset, the clock source for Timer A is set at EXTALi/8 and the associated modulus register is  
initialized to $FF. Timers B and C are stopped on reset and pins PH6 and PH7 default to being  
general purpose I/O pins.  
10.2.9  
Serial communications interface (SCI)  
The reset condition of the SCI system is independent of the operating mode. At reset, the SCI  
baud rate control register is initialized to $0004. All transmit and receive interrupts are masked and  
both the transmitter and receiver are disabled so the port pins default to being general purpose  
I/O lines.The SCI frame format is initialized to an 8-bit character size.The send break and receiver  
wake-up functions are disabled. The TDRE and TC status bits in the SCI status register are both  
set, indicating that there is no transmit data in either the transmit data register or the transmit serial  
shift register. The RDRF, IDLE, OR, NF, FE, PF, and RAF receive-related status bits are cleared.  
10  
Note:  
The foregoing paragraph also applies to SCI2. The MI BUS function is disabled, since  
MIE2 is cleared on reset.  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-9  
10.2.10 Serial peripheral interface (SPI)  
The SPI1 and SPI2 systems are disabled by reset. Their associated port pins default to being  
general purpose I/O lines.  
10.2.11 Analog-to-digital converter  
The A/D converter configuration is indeterminate after reset. The ADPU bit is cleared by reset,  
which disables the A/D system. The conversion complete flag is cleared by reset.  
10.2.12 LCD module  
The LCD module is disabled by reset. PB4-PB7 default to being general purpose I/O lines in single  
chip mode, or higher order address outputs in expanded mode.  
10.2.13 System  
The EEPROM programming controls are disabled, so the memory system is configured for normal  
read operation. PSEL[4:0] are initialized with the binary value %00110, causing the external IRQ  
pin to have the highest I-bit interrupt priority.The IRQ pin is configured for level-sensitive operation  
(for wired-OR systems).The RBOOT, SMOD, and MDA bits in the HPRIO register reflect the status  
of the MODB and MODA inputs at the rising edge of reset.The DLY control bit is set to specify that  
an oscillator start-up delay is imposed upon recovery from STOP mode or power-on reset. The  
clock monitor system is disabled because CME and FCME are cleared.  
10  
TPG  
MOTOROLA  
10-10  
RESETS AND INTERRUPTS  
MC68HC11PH8  
10.3  
Reset and interrupt priority  
Resets and interrupts have a hardware priority that determines which reset or interrupt is serviced  
first when simultaneous requests occur. Any maskable interrupt can be given priority over other  
maskable interrupts.  
The first six interrupt sources are not maskable by the I-bit in the CCR. The priority arrangement  
for these sources is fixed and is as follows:  
1) POR or RESET pin  
2) Clock monitor reset  
3) COP watchdog reset  
4) XIRQ interrupt  
Illegal opcode interrupt — see Section 10.4.3 for details of handling  
Software interrupt (SWI) — see Section 10.4.4 for details of handling  
The maskable interrupt sources have the following priority arrangement:  
5) IRQ  
6) Real-time interrupt  
7) Timer input capture 1  
8) Timer input capture 2  
9) Timer input capture 3  
10)Timer output compare 1  
11)Timer output compare 2  
12)Timer output compare 3  
13)Timer output compare 4  
14)Timer input capture 4/output compare 5  
15)SPI2 transfer complete  
16)SCI2/MI BUS system  
17)Timer overflow  
10  
18)8-bit modulus timers  
19)Pulse accumulator overflow  
20)Pulse accumulator input edge  
21)Wired-OR port H  
22)SPI1 transfer complete  
23)SCI1 system  
Any one of these maskable interrupts can be assigned the highest maskable interrupt priority by  
writing the appropriate value to the PSEL bits in the HPRIO register. Otherwise, the priority  
arrangement remains the same. An interrupt that is assigned highest priority is still subject to  
global masking by the I-bit in the CCR, or by any associated local bits. Interrupt vectors are not  
affected by priority assignment. To avoid race conditions, HPRIO can only be written while I-bit  
interrupts are inhibited.  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-11  
10.3.1  
HPRIO — Highest priority I-bit interrupt and misc. register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Highest priority interrupt (HPRIO)  
$003C RBOOT SMOD MDA PSEL4 PSEL3 PSEL2 PSEL1 PSEL0 xxx0 0110  
RBOOT, SMOD, and MDA bits depend on power-up initialization mode and can only be written in  
special modes when SMOD = 1. Refer to Table 3-4.  
RBOOT — Read bootstrap ROM (refer to Section 3)  
1 (set)  
Bootloader ROM enabled, at $BE40–$BFFF.  
0 (clear) – Bootloader ROM disabled and not in map.  
SMOD — Special mode select (refer to Section 3)  
1 (set)  
Special mode variation in effect.  
0 (clear) – Normal mode variation in effect.  
MDA — Mode select A (refer to Section 3)  
1 (set)  
Normal expanded or special test mode in effect.  
0 (clear) – Normal single chip or special bootstrap mode in effect.  
PSEL[4:0] — Priority select bits  
These bits select one interrupt source to be elevated above all other I-bit-related sources and can  
be written to only while the I-bit in the CCR is set (interrupts disabled). See Table 10-4.  
10  
TPG  
MOTOROLA  
10-12  
RESETS AND INTERRUPTS  
MC68HC11PH8  
Table 10-4 Highest priority interrupt selection  
PSELx  
Interrupt source promoted  
4
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
3
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
2
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
1
1
X
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
X
0
X
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
X
X
Reserved (default to IRQ)  
Reserved (default to IRQ)  
Reserved (default to IRQ)  
IRQ (external pin)  
Real-time interrupt  
Timer input capture 1  
Timer input capture 2  
Timer input capture 3  
Timer output compare 1  
Timer output compare 2  
Timer output compare 3  
Timer output compare 4  
Timer output compare 5/input capture 4  
Timer overßow  
Pulse accumulator overßow  
Pulse accumulator input edge  
SPI1 serial transfer complete  
SCI1 serial system  
SPI2 serial transfer complete  
SCI2/MI BUS serial system  
8-bit modulus timers  
Wired-OR port H  
Reserved (default to IRQ)  
Reserved (default to IRQ)  
Reserved (default to IRQ)  
10  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-13  
Table 10-5 Interrupt and reset vector assignments  
CCR  
mask bit mask  
Local  
Vector address  
FFC0, C1 Ð FFCC, CD reserved  
Interrupt source  
Ñ
I
Ñ
FFCE, CF  
¥ Wired-OR port H  
IEH[7:0]  
¥ 8-bit modulus timer A underßow  
¥ 8-bit modulus timer B underßow  
¥ 8-bit modulus timer C underßow  
T8AI  
T8BI  
T8CI  
FFD0, D1  
I
¥ SCI2/MI BUS receive data register full  
¥ SCI2/MI BUS receiver overrun  
¥ SCI2 transmit data register empty  
¥ SCI2 transmit complete  
RIE2  
RIE2  
TIE2  
TCIE2  
ILIE2  
FFD2, D3  
FFD4, D5  
FFD6, D7  
I
I
I
¥ SCI2 idle line detect  
SPI2 serial transfer complete  
SP2IE  
¥ SCI1 receive data register full  
¥ SCI1 receiver overrun  
¥ SCI1 transmit data register empty  
¥ SCI1 transmit complete  
¥ SCI1 idle line detect  
RIE  
RIE  
TIE  
TCIE  
ILIE  
FFD8, D9  
FFDA, DB  
FFDC, DD  
FFDE, DF  
FFE0, E1  
FFE2, E3  
FFE4, E5  
FFE6, E7  
FFE8, E9  
FFEA, EB  
FFEC, ED  
FFEE, EF  
FFF0, F1  
FFF2, F3  
FFF4, F5  
FFF6, F7  
FFF8, F9  
FFFA, FB  
FFFC, FD  
FFFE, FF  
SPI1 serial transfer complete  
Pulse accumulator input edge  
Pulse accumulator overßow  
Timer overßow  
I
SPIE  
PAII  
I
I
PAOVI  
TOI  
I
Timer input capture 4/output compare 5  
Timer output compare 4  
Timer output compare 3  
Timer output compare 2  
Timer output compare 1  
Timer input capture 3  
Timer input capture 2  
Timer input capture 1  
Real-time interrupt  
IRQ pin  
I
I4/O5I  
OC4I  
OC3I  
OC2I  
OC1I  
IC3I  
I
I
I
I
I
I
IC2I  
I
IC1I  
10  
I
I
RTII  
None  
None  
None  
None  
XIRQ pin  
X
Software interrupt  
None  
None  
Illegal opcode trap  
COP failure  
None NOCOP  
Clock monitor fail  
None  
None  
CME  
None  
RESET  
TPG  
MOTOROLA  
10-14  
RESETS AND INTERRUPTS  
MC68HC11PH8  
10.4  
Interrupts  
Excluding reset type interrupts, the MC68HC11PH8 has 22 interrupt vectors that support 32  
interrupt sources. The 19 maskable interrupts are generated by on-chip peripheral systems.  
These interrupts are recognized when the global interrupt mask bit (I) in the condition code  
register (CCR) is clear.The three nonmaskable interrupt sources are illegal opcode trap, software  
interrupt, and XIRQ pin. Refer to Table 10-5, which shows the interrupt sources and vector  
assignments for each source.  
For some interrupt sources, such as the SCI interrupts, the flags are automatically cleared during  
the normal course of responding to the interrupt requests. For example, the RDRF flag in the SCI  
system is cleared by the automatic clearing mechanism consisting of a read of the SCI status  
register while RDRF is set, followed by a read of the SCI data register.The normal response to an  
RDRF interrupt request would be to read the SCI status register to check for receive errors, then  
to read the received data from the SCI data register. These two steps satisfy the automatic  
clearing mechanism without requiring any special instructions.  
10.4.1  
Interrupt recognition and register stacking  
An interrupt can be recognized at any time after it is enabled by its local mask, if any, and by the  
global mask bit in the CCR. Once an interrupt source is recognized, the CPU responds at the  
completion of the instruction being executed. Interrupt latency varies according to the number of  
cycles required to complete the current instruction. When the CPU begins to service an interrupt,  
the contents of the CPU registers are pushed onto the stack in the order shown in Table 10-6. After  
the CCR value is stacked, the I-bit and the X-bit, if XIRQ is pending, are set to inhibit further  
interrupts. The interrupt vector for the highest priority pending source is fetched, and execution  
continues at the address specified by the vector. At the end of the interrupt service routine, the  
return from interrupt instruction is executed and the saved registers are pulled from the stack in  
reverse order so that normal program execution can resume. Refer to Section 11 for further  
information.  
10  
Table 10-6 Stacking order on entry to interrupts  
Memory location CPU registers  
SP  
PCL  
PCH  
IYL  
SP Ð 1  
SP Ð 2  
SP Ð 3  
SP Ð 4  
SP Ð 5  
SP Ð 6  
SP Ð 7  
SP Ð 8  
IYH  
IXL  
IXH  
ACCA  
ACCB  
CCR  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-15  
10.4.2  
Nonmaskable interrupt request (XIRQ)  
Nonmaskable interrupts are useful because they can always interrupt CPU operations. The most  
common use for such an interrupt is for serious system problems, such as program runaway or  
power failure. The XIRQ input is an updated version of the NMI (nonmaskable interrupt) input of  
earlier MCUs.  
Upon reset, both the X-bit and I-bit of the CCR are set to inhibit all maskable interrupts and XIRQ.  
After minimum system initialization, software can clear the X-bit by a TAP instruction, enabling  
XIRQ interrupts. Thereafter, software cannot set the X-bit. Thus, an XIRQ interrupt is a  
nonmaskable interrupt. Because the operation of the I-bit-related interrupt structure has no effect  
on the X-bit, the internal XIRQ pin remains unmasked. In the interrupt priority logic, the XIRQ  
interrupt has a higher priority than any source that is maskable by the I-bit. All I-bit-related  
interrupts operate normally with their own priority relationship.  
When an I-bit-related interrupt occurs, the I-bit is automatically set by hardware after stacking the  
CCR byte. The X-bit is not affected. When an X-bit-related interrupt occurs, both the X and I bits  
are automatically set by hardware after stacking the CCR. A return from interrupt instruction  
restores the X and I bits to their pre-interrupt request state.  
10.4.3  
Illegal opcode trap  
Because not all possible opcodes or opcode sequences are defined, the MCU includes an illegal  
opcode detection circuit, which generates an interrupt request.When an illegal opcode is detected  
and the interrupt is recognized, the current value of the program counter is stacked. After interrupt  
service is complete, the user should reinitialize the stack pointer to ensure that repeated execution  
of illegal opcodes does not cause stack underflow. Left uninitialized, the illegal opcode vector can  
point to a memory location that contains an illegal opcode. This condition causes an infinite loop  
that causes stack underflow. The stack grows until the system crashes.  
10  
The illegal opcode trap mechanism works for all unimplemented opcodes on all four opcode map  
pages. The address stacked as the return address for the illegal opcode interrupt is the address  
of the first byte of the illegal opcode. Otherwise, it would be almost impossible to determine  
whether the illegal opcode had been one or two bytes. The stacked return address can be used  
as a pointer to the illegal opcode, so that the illegal opcode service routine can evaluate the  
offending opcode.  
10.4.4  
Software interrupt  
SWI is an instruction, and thus cannot be interrupted until complete. SWI is not inhibited by the  
global mask bits in the CCR. Because execution of SWI sets the I mask bit, once an SWI interrupt  
begins, other interrupts are inhibited until SWI is complete, or until user software clears the I bit in  
the CCR.  
TPG  
MOTOROLA  
10-16  
RESETS AND INTERRUPTS  
MC68HC11PH8  
10.4.5  
Maskable interrupts  
The maskable interrupt structure of the MCU can be extended to include additional external  
interrupt sources through the IRQ pin. The default configuration of this pin is a low-level sensitive  
wired-OR network.When an event triggers an interrupt, a software accessible interrupt flag is set.  
When enabled, this flag causes a constant request for interrupt service. After the flag is cleared,  
the service request is released.  
10.4.6  
Reset and interrupt processing  
The following flow diagrams illustrate the reset and interrupt process. Figure 10-1 and Figure 10-2  
illustrate how the CPU begins from a reset and how interrupt detection relates to normal opcode  
fetches. Figure 10-3 to Figure 10-4 provide an expanded version of a block in Figure 10-1 and illustrate  
interrupt priorities. Figure 10-7 shows the resolution of interrupt sources within the SCI subsystem.  
10.5  
Low power operation  
Both STOP and WAIT suspend CPU operation until a reset or interrupt occurs.The WAIT condition  
suspends processing and reduces power consumption to an intermediate level. The STOP  
condition turns off all on-chip clocks and reduces power consumption to an absolute minimum  
while retaining the contents of all bytes of the RAM.  
10.5.1  
WAIT  
The WAI opcode places the MCU in the WAIT condition, during which the CPU registers are stacked  
and CPU processing is suspended until a qualified interrupt is detected. The interrupt can be an  
external IRQ, an XIRQ, or any of the internally generated interrupts, such as the timer or serial  
interrupts.The on-chip crystal oscillator remains active throughout the WAIT stand-by period.  
10  
The reduction of power in the WAIT condition depends on how many internal clock signals driving  
on-chip peripheral functions can be shut down. The CPU is always shut down during WAIT. While  
in the wait state, the address/data bus repeatedly runs read cycles to the address where the CCR  
contents were stacked. The MCU leaves the wait state when it senses any interrupt that has not  
been masked.  
The PH2 clock to the free-running timer system is stopped if the I-bit is set and the COP system  
is disabled by NOCOP being set. In addition, further power can be saved if the clock to the 16-bit  
counter is stopped by clearing the T16EN bit in PLLCR, with the PLL active (see Section 8.1.1.1).  
Several other systems can also be in a reduced power consumption state depending on the state  
of software-controlled configuration control bits. Power consumption by the analog-to-digital (A/D)  
converter is not affected significantly by the WAIT condition. However, the A/D converter current  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-17  
can be eliminated by writing the ADPU bit to zero and halting the RC clock (CSEL cleared). The  
SPI system is enabled or disabled by the SPE control bit. The SCI transmitter is enabled or  
disabled by the TE bit, and the SCI receiver is enabled or disabled by the RE bit (lowest power  
consumption is achieved when RE=TE=0). Power consumption is reduced if all the PWM enable  
bits (PWEN[4:1]) are cleared, thereby disabling every PWM channel. Setting the WEN bit in  
PLLCR will result in WAIT mode using a slower clock and hence less power (see Section 2.5).  
Therefore the power consumption in WAIT is dependent on the particular application.  
10.5.2  
STOP  
Executing the STOP instruction while the S-bit in the CCR is clear places the MCU in the STOP  
condition. If the S-bit is set, the STOP opcode is treated as a no-op (NOP). The STOP condition  
offers minimum power consumption because all clocks, including the crystal oscillator, are  
stopped while in this mode. To exit STOP and resume normal processing, a logic low level must  
be applied to one of the external interrupts (IRQ or XIRQ) or to the RESET pin. A keyboard  
interrupt on port H or a pending edge-triggered IRQ can also bring the CPU out of STOP.  
Because all clocks are stopped in this mode, all internal peripheral functions also stop. The data  
in the internal RAM is retained as long as V power is maintained. The CPU state and I/O pin  
DD  
levels are static and are unchanged by STOP. Therefore, when an interrupt comes to restart the  
system, the MCU resumes processing as if there were no interruption. If reset is used to restart  
the system a normal reset sequence results where all I/O pins and functions are also restored to  
their initial states.  
To use the IRQ pin as a means of recovering from STOP, the I-bit in the CCR must be clear (IRQ  
not masked). The XIRQ pin can be used to wake up the MCU from STOP regardless of the state  
of the X-bit in the CCR, although the recovery sequence depends on the state of the X-bit. If X is  
clear (XIRQ not masked), the MCU starts up, beginning with the stacking sequence leading to  
normal service of the XIRQ request. If X is set (XIRQ masked or inhibited), then processing  
continues with the instruction that immediately follows the STOP instruction, and no XIRQ  
interrupt service is requested or pending.  
10  
Because the oscillator is stopped in STOP mode, a restart delay may be imposed to allow oscillator  
stabilization upon leaving STOP. If the internal oscillator is being used, this delay is required; however,  
if a stable external oscillator is being used, the DLY control bit can be used to bypass this start-up delay.  
The DLY control bit is set by reset and can be optionally cleared during initialization. If the DLY equal  
to zero option is used to avoid start-up delay on recovery from STOP, then reset should not be used as  
the means of recovering from STOP, as this causes DLY to be set again by reset, imposing the restart  
delay. This same delay also applies to power-on-reset, regardless of the state of the DLY control bit,  
but does not apply to a reset while the clocks are running. See Section 3.3.2.4.  
TPG  
MOTOROLA  
10-18  
RESETS AND INTERRUPTS  
MC68HC11PH8  
Highest  
Power-on reset  
(POR)  
Priority  
External  
reset  
Clock monitor fail  
(CME = 1)  
Lowest  
Delay  
(128/4064 cycles )  
COP watchdog  
timeout  
(NOCOP = 0)  
Load program counter  
Load program counter  
with contents of  
$FFFC, $FFFD  
(vector fetch)  
Load program counter  
with contents of  
$FFFA, $FFFB  
with contents of  
$FFFE, $FFFF  
(vector fetch)  
(vector fetch)  
Set S, X, and I bits  
in CCR.  
Reset MCU hardware  
1A  
Begin an instruction  
sequence  
10  
Yes  
X-bit in  
CCR set?  
No  
Stack CPU registers.  
Yes  
XIRQ pin  
low?  
Set X and I bits.  
Fetch vector at  
$FFF4, $FFF5  
No  
1B  
See Section 10.1.5  
Figure 10-1 Processing flow out of reset (1 of 2)  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-19  
1B  
I-bit in  
Yes  
CCR set?  
No  
I-bit interrupt  
pending?  
Stack  
CPU registers  
Yes  
No  
Fetch  
opcode  
Stack CPU registers.  
Set I bit.  
Legal  
No  
Fetch vector at  
$FFF8, $FFF9  
opcode?  
Yes  
WAI?  
No  
Yes  
Stack  
CPU registers  
Stack CPU registers.  
Set I bit.  
Fetch vector at  
$FFF6, $FFF7  
Interrupt  
yet?  
Yes  
Yes  
No  
SWI?  
No  
10  
Yes  
Restore  
CPU registers  
from Stack  
RTI?  
Set I-bit  
No  
Resolve interrupt  
priority and fetch vector  
for highest pending  
source (Figure 10-3)  
Execute this  
instruction  
Start next instruction  
sequence  
1A  
Figure 10-2 Processing flow out of reset (2 of 2)  
TPG  
MOTOROLA  
10-20  
RESETS AND INTERRUPTS  
MC68HC11PH8  
Begin  
Set X-bit in CCR.  
Fetch vector at  
$FFF4, $FFF5  
X-bit in  
CCR set?  
XIRQ pin  
low?  
Yes  
Yes  
Yes  
No  
No  
Highest priority  
interrupt?  
Fetch vector  
No  
Fetch vector at  
$FFF2, $FFF3  
Yes  
Yes  
IRQ?  
No  
Fetch vector at  
$FFF0, $FFF1  
Yes  
Yes  
Yes  
Yes  
Yes  
RTII = 1?  
No  
RTIF = 1?  
No  
Fetch vector at  
$FFEE, $FFEF  
Yes  
Yes  
Yes  
Yes  
IC1I = 1?  
No  
IC1F = 1?  
No  
Fetch vector at  
$FFEC, $FFED  
IC2I = 1?  
No  
IC2F = 1?  
No  
Fetch vector at  
$FFEA, $FFEB  
10  
IC3I = 1?  
No  
IC3F = 1?  
No  
Fetch vector at  
$FFE8, $FFE9  
OC1I = 1?  
No  
OC1F = 1?  
No  
2A  
2B  
Figure 10-3 Interrupt priority resolution (1 of 3)  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-21  
2A  
2B  
Fetch vector at  
$FFE6, $FFE7  
Yes  
Yes  
Yes  
Yes  
Yes  
OC2I = 1?  
No  
OC2F = 1?  
No  
Fetch vector at  
$FFE4, $FFE5  
Yes  
Yes  
OC3I = 1?  
No  
OC3F = 1?  
No  
Fetch vector at  
$FFE2, $FFE3  
OC4I = 1?  
No  
OC4F = 1?  
No  
Fetch vector at  
$FFE0, $FFE1  
Yes  
Yes  
I4/O5I = 1?  
No  
I4/O5F = 1?  
No  
Fetch vector at  
$FFD4, $FFD5  
Yes  
Yes  
SP2IE = 1?  
No  
SP2IF = 1?  
No  
MODF2 = 1?  
No  
Yes  
Yes  
SCI2  
interrupt?  
Fetch vector at  
$FFD2, $FFD3  
10  
No  
Fetch vector at  
$FFDE, $FFDF  
Yes  
TOI = 1?  
No  
TOF = 1?  
No  
Modulus timer  
interrupt?  
Fetch vector at  
$FFD0, $FFD1  
Yes  
à
No  
2C  
2D  
ꢀ Refer to Figure 10-6 for further details on SCI interrupts.  
à Refer to Figure 10-7 for further details on modulus timer interrupts.  
Figure 10-4 Interrupt priority resolution (2 of 3)  
TPG  
MOTOROLA  
10-22  
RESETS AND INTERRUPTS  
MC68HC11PH8  
2C  
2D  
Fetch vector at  
$FFDC, $FFDD  
Yes  
Yes  
Yes  
Yes  
PAOVI = 1?  
No  
PAOVF = 1?  
No  
Fetch vector at  
$FFDA, $FFDB  
PAII = 1?  
No  
PAIF = 1?  
No  
Wired-OR  
interrupt?  
Fetch vector at  
$FFCE, $FFCF  
Yes  
Yes  
Yes  
WOIF = 1?  
No  
No  
Fetch vector at  
$FFD8, $FFD9  
Yes  
Yes  
SPIE = 1?  
No  
SPIF = 1?  
No  
MODF = 1?  
No  
SCI1  
interrupt?  
Fetch vector at  
$FFD6, $FFD7  
Yes  
No  
Spurious interrupt Ñ take IRQ vector  
Fetch vector at  
$FFF2, $FFF3  
10  
ꢀ Refer to Figure 10-6 for further details on SCI interrupts.  
END  
Figure 10-5 Interrupt priority resolution (3 of 3)  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-23  
Note: The bit names shown are for SCI1.The diagram  
applies equally to SCI2, when the appropriate bit  
names are substituted.  
Begin  
Yes  
Yes  
Yes  
Yes  
Yes  
RDRF = 1?  
No  
Yes  
Yes  
Yes  
Yes  
Yes  
OR = 1?  
No  
RIE = 1?  
No  
RE = 1?  
No  
Yes  
TDRE = 1?  
No  
TIE = 1?  
No  
TE = 1?  
No  
TC = 1?  
No  
TCIE = 1?  
No  
Yes  
IDLE = 1?  
No  
ILIE = 1?  
No  
RE = 1?  
No  
No valid SCI  
interrupt request  
Valid SCI  
interrupt request  
Figure 10-6 Interrupt source resolution within the SCI subsystem  
10  
TPG  
MOTOROLA  
10-24  
RESETS AND INTERRUPTS  
MC68HC11PH8  
Begin  
Yes  
Yes  
Yes  
Yes  
Yes  
Yes  
T8AI = 1?  
No  
T8AF = 1?  
No  
T8BI = 1?  
No  
T8BF = 1?  
No  
T8CI = 1?  
No  
T8CF = 1?  
No  
No valid modulus timer  
interrupt request  
Valid modulus timer  
interrupt request  
Figure 10-7 Interrupt source resolution within the 8-bit modulus timer subsystem  
10  
TPG  
MC68HC11PH8  
RESETS AND INTERRUPTS  
MOTOROLA  
10-25  
THIS PAGE INTENTIONALLY LEFT BLANK  
10  
TPG  
MOTOROLA  
10-26  
RESETS AND INTERRUPTS  
MC68HC11PH8  
11  
CPU CORE AND INSTRUCTION SET  
This section discusses the M68HC11 central processing unit (CPU) architecture, its addressing  
modes and the instruction set. For more detailed information on the instruction set, refer to the  
M68HC11 Reference Manual (M68HC11RM/AD).  
The CPU is designed to treat all peripheral, I/O and memory locations identically, as addresses in  
the 64Kbyte memory map. This is referred to as memory-mapped I/O. There are no special  
instructions for I/O that are separate from those used for memory. This architecture also allows  
accessing an operand from an external memory location with no execution-time penalty.  
11.1  
Registers  
M68HC11 CPU registers are an integral part of the CPU and are not addressed as if they were  
memory locations. The seven registers are shown in Figure 11-1 and are discussed in the  
following paragraphs.  
7
15  
Accumulator A  
0 7  
Accumulator B  
0
0
A:B  
D
Double accumulator D  
Index register X  
Index register Y  
Stack pointer  
15  
0
0
IX  
15  
IY  
15  
0
SP  
PC  
CCR  
11  
15  
Program counter  
0
S
X
H
I
N
Z
V
C
Condition code register  
Carry  
Overßow  
Zero  
Negative  
I Interrupt mask  
Half carry (from bit 3)  
X Interrupt mask  
Stop disable  
Figure 11-1 Programming model  
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-1  
 
11.1.1  
Accumulators A, B and D  
Accumulators A and B are general purpose 8-bit registers that hold operands and results of  
arithmetic calculations or data manipulations. For some instructions, these two accumulators are  
treated as a single double-byte (16-bit) accumulator called accumulator D. Although most  
operations can use accumulators A or B interchangeably, the following exceptions apply:  
The ABX and ABY instructions add the contents of 8-bit accumulator B to the contents of 16-bit  
register X or Y, but there are no equivalent instructions that use A instead of B.  
The TAP and TPA instructions transfer data from accumulator A to the condition code register,  
or from the condition code register to accumulator A, however, there are no equivalent  
instructions that use B rather than A.  
The decimal adjust accumulator A (DAA) instruction is used after binary-coded decimal (BCD)  
arithmetic operations, but there is no equivalent BCD instruction to adjust accumulator B.  
The add, subtract, and compare instructions associated with both A and B (ABA, SBA, and  
CBA) only operate in one direction, making it important to plan ahead to ensure the correct  
operand is in the correct accumulator.  
11.1.2  
Index register X (IX)  
The IX register provides a 16-bit indexing value that can be added to the 8-bit offset provided in  
an instruction to create an effective address. The IX register can also be used as a counter or as  
a temporary storage register.  
11.1.3  
Index registerY (IY)  
The 16-bit IY register performs an indexed mode function similar to that of the IX register.  
However, most instructions using the IY register require an extra byte of machine code and an  
extra cycle of execution time because of the way the opcode map is implemented. Refer to Section  
11.3 for further information.  
11  
11.1.4  
Stack pointer (SP)  
The M68HC11 CPU has an automatic program stack. This stack can be located anywhere in the  
address space and can be any size up to the amount of memory available in the system. Normally  
the SP is initialized by one of the first instructions in an application program. The stack is  
configured as a data structure that grows downward from high memory to low memory. Each time  
a new byte is pushed onto the stack, the SP is decremented. Each time a byte is pulled from the  
stack, the SP is incremented. At any given time, the SP holds the 16-bit address of the next free  
location in the stack. Figure 11-2 is a summary of SP operations.  
TPG  
MOTOROLA  
11-2  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
JSR, Jump to subroutine  
BSR, Branch to subroutine  
Main program  
Main program  
Stack  
PC  
$9D = JSR  
dd  
Next instruction  
PC  
$8D = BSR  
rr  
Next instruction  
SPÐ2  
SPÐ1  
SP  
RTN  
H
RTN  
L
DIRECT  
IND, X  
RTN  
RTN  
Main program  
PC  
$AD = JSR  
ff  
SWI, Software interrupt  
Stack  
SPÐ9  
SPÐ8  
SPÐ7  
SPÐ6  
SPÐ5  
SPÐ4  
SPÐ3  
SPÐ2  
SPÐ1  
SP  
RTN  
Next instruction  
Main program  
$3F = SWI  
Stack  
Condition Code  
Accumulator B  
Accumulator A  
Index register (IX )  
H
Index register (IX )  
L
PC  
RTN  
SPÐ2  
SPÐ1  
SP  
Main program  
RTN  
H
RTN  
L
PC  
$18 = PRE  
$AD = JSR  
ff  
IND, Y  
Index register (IY )  
H
WAI, Wait for interrupt  
RTN  
Next instruction  
Index register (IY )  
L
RTN  
H
Main program  
$3E = WAI  
Main program  
RTN  
L
PC  
RTN  
PC  
$BD = JSR  
hh  
EXTEND  
ll  
RTN  
Next instruction  
RTI, Return from interrupt  
Interrupt program  
Stack  
PC  
$3B = RTI  
SP  
SP+1  
SP+2  
SP+3  
SP+4  
SP+5  
SP+6  
SP+7  
SP+8  
SP+9  
Condition Code  
Accumulator B  
Accumulator A  
RTS, Return from subroutine  
Index register (IX )  
H
Index register (IX )  
Index register (IY )  
H
Index register (IY )  
L
L
Stack  
Main program  
SP  
SP+1  
SP+2  
PC  
$39 = RTS  
RTN  
H
RTN  
H
RTN  
L
RTN  
L
11  
LEGEND  
RTN Address of the next instruction in the main program, to be executed on return from subroutine  
RTN More signiÞcant byte of return address  
H
RTN Less signiÞcant byte of return address  
L
Shaded cells show stack pointer position after the operation is complete  
dd 8-bit direct address ($0000Ð$00FF); the high byte is assumed to be $00  
ff 8-bit positive offset ($00 to $FF (0 to 256)) is added to the index register contents  
hh High order byte of 16-bit extended address  
ll Low order byte of 16-bit extended address  
rr Signed relative offset ($80 to $7F (Ð128 to +127)); offset is relative to the address following the offset byte  
Figure 11-2 Stacking operations  
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-3  
 
When a subroutine is called by a jump to subroutine (JSR) or branch to subroutine (BSR)  
instruction, the address of the instruction after the JSR or BSR is automatically pushed onto the  
stack, less significant byte first. When the subroutine is finished, a return from subroutine (RTS)  
instruction is executed. The RTS pulls the previously stacked return address from the stack, and  
loads it into the program counter. Execution then continues at this recovered return address.  
When an interrupt is recognized, the current instruction finishes normally, the return address (the  
current value in the program counter) is pushed onto the stack, all of the CPU registers are pushed  
onto the stack, and execution continues at the address specified by the vector for the interrupt. At  
the end of the interrupt service routine, an RTI instruction is executed.The RTI instruction causes  
the saved registers to be pulled off the stack in reverse order. Program execution resumes at the  
return address.  
There are instructions that push and pull the A and B accumulators and the X and Y index  
registers. These instructions are often used to preserve program context. For example, pushing  
accumulator A onto the stack when entering a subroutine that uses accumulator A, and then  
pulling accumulator A off the stack just before leaving the subroutine, ensures that the contents of  
a register will be the same after returning from the subroutine as it was before starting the  
subroutine.  
11.1.5  
Program counter (PC)  
The program counter, a 16-bit register, contains the address of the next instruction to be executed.  
After reset, the program counter is initialized from one of six possible vectors, depending on  
operating mode and the cause of reset.  
Table 11-1 Reset vector comparison  
POR or RESET pin  
$FFFE, $FFFF  
Clock monitor  
$FFFC, $FFFD  
$BFFE, $BFFF  
COP watchdog  
$FFFA, $FFFB  
$BFFE, $BFFF  
Normal  
Test or Boot  
$BFFE, $BFFF  
11  
11.1.6  
Condition code register (CCR)  
This 8-bit register contains five condition code indicators (C, V, Z, N, and H), two interrupt masking  
bits, (IRQ and XIRQ) and a stop disable bit (S). In the M68HC11 CPU, condition codes are  
automatically updated by most instructions. For example, load accumulator A (LDAA) and store  
accumulator A (STAA) instructions automatically set or clear the N, Z, and V condition code flags.  
Pushes, pulls, add B to X (ABX), add B toY (ABY), and transfer/exchange instructions do not affect  
the condition codes. Refer to Table 11-2, which shows the condition codes that are affected by a  
particular instruction.  
TPG  
MOTOROLA  
11-4  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
11.1.6.1 Carry/borrow (C)  
The C-bit is set if the arithmetic logic unit (ALU) performs a carry or borrow during an arithmetic  
operation. The C-bit also acts as an error flag for multiply and divide operations. Shift and rotate  
instructions operate with and through the carry bit to facilitate multiple-word shift operations.  
11.1.6.2 Overflow (V)  
The overflow bit is set if an operation causes an arithmetic overflow. Otherwise, the V-bit is cleared.  
11.1.6.3 Zero (Z)  
The Z-bit is set if the result of an arithmetic, logic, or data manipulation operation is zero.  
Otherwise, the Z-bit is cleared. Compare instructions do an internal implied subtraction and the  
condition codes, including Z, reflect the results of that subtraction. A few operations (INX, DEX,  
INY, and DEY) affect the Z-bit and no other condition flags. For these operations, only = and ≠  
conditions can be determined.  
11.1.6.4 Negative (N)  
The N-bit is set if the result of an arithmetic, logic, or data manipulation operation is negative;  
otherwise, the N-bit is cleared. A result is said to be negative if its most significant bit (MSB) is set  
(MSB = 1). A quick way to test whether the contents of a memory location has the MSB set is to  
load it into an accumulator and then check the status of the N-bit.  
11.1.6.5 Interrupt mask (I)  
The interrupt request (IRQ) mask (I-bit) is a global mask that disables all maskable interrupt  
sources. While the I-bit is set, interrupts can become pending, but the operation of the CPU  
continues uninterrupted until the I-bit is cleared. After any reset, the I-bit is set by default and can  
only be cleared by a software instruction. When an interrupt is recognized, the I-bit is set after the  
registers are stacked, but before the interrupt vector is fetched. After the interrupt has been  
serviced, a return from interrupt instruction is normally executed, restoring the registers to the  
values that were present before the interrupt occurred. Normally, the I-bit is zero after a return from  
interrupt is executed. Although the I-bit can be cleared within an interrupt service routine, ‘nesting’  
interrupts in this way should only be done when there is a clear understanding of latency and of  
the arbitration mechanism. Refer to Section 10.  
11  
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-5  
11.1.6.6 Half carry (H)  
The H-bit is set when a carry occurs between bits 3 and 4 of the arithmetic logic unit during an  
ADD, ABA, or ADC instruction. Otherwise, the H-bit is cleared. Half carry is used during BCD  
operations.  
11.1.6.7 X interrupt mask (X)  
The XIRQ mask (X) bit disables interrupts from the XIRQ pin. After any reset, X is set by default  
and must be cleared by a software instruction. When an XIRQ interrupt is recognized, the X- and  
I-bits are set after the registers are stacked, but before the interrupt vector is fetched. After the  
interrupt has been serviced, an RTI instruction is normally executed, causing the registers to be  
restored to the values that were present before the interrupt occurred. The X interrupt mask bit is  
set only by hardware RESET or XIRQ acknowledge). X is cleared only by program instruction  
(TAP, where the associated bit of A is 0; or RTI, where bit 6 of the value loaded into the CCR from  
the stack has been cleared). There is no hardware action for clearing X.  
11.1.6.8 Stop disable (S)  
Setting the STOP disable (S) bit prevents the STOP instruction from putting the M68HC11 into a  
low-power stop condition. If the STOP instruction is encountered by the CPU while the S-bit is set,  
it is treated as a no-operation (NOP) instruction, and processing continues to the next instruction.  
S is set by reset — STOP disabled by default.  
11.2  
Data types  
The M68HC11 CPU supports the following data types:  
Bit data  
8-bit and 16-bit signed and unsigned integers  
16-bit unsigned fractions  
16-bit addresses  
11  
A byte is eight bits wide and can be accessed at any byte location. A word is composed of two  
consecutive bytes with the most significant byte at the lower value address. Because the  
M68HC11 is an 8-bit CPU, there are no special requirements for alignment of instructions or  
operands.  
TPG  
MOTOROLA  
11-6  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
11.3  
Opcodes and operands  
The M68HC11 family of microcontrollers uses 8-bit opcodes. Each opcode identifies a particular  
instruction and associated addressing mode to the CPU. Several opcodes are required to provide  
each instruction with a range of addressing capabilities. Only 256 opcodes would be available if  
the range of values were restricted to the number able to be expressed in 8-bit binary numbers.  
A four-page opcode map has been implemented to expand the number of instructions. An  
additional byte, called a prebyte, directs the processor from page 0 of the opcode map to one of  
the other three pages. As its name implies, the additional byte precedes the opcode.  
A complete instruction consists of a prebyte, if any, an opcode, and zero, one, two, or three  
operands. The operands contain information the CPU needs for executing the instruction.  
Complete instructions can be from one to five bytes long.  
11.4  
Addressing modes  
Six addressing modes; immediate, direct, extended, indexed, inherent, and relative, detailed in the  
following paragraphs, can be used to access memory. All modes except inherent mode use an  
effective address. The effective address is the memory address from which the argument is  
fetched or stored, or the address from which execution is to proceed. The effective address can  
be specified within an instruction, or it can be calculated.  
11.4.1  
Immediate (IMM)  
In the immediate addressing mode an argument is contained in the byte(s) immediately following  
the opcode.The number of bytes following the opcode matches the size of the register or memory  
location being operated on. There are two, three, and four (if prebyte is required) byte immediate  
instructions. The effective address is the address of the byte following the instruction.  
11  
11.4.2  
Direct (DIR)  
In the direct addressing mode, the low-order byte of the operand address is contained in a single  
byte following the opcode, and the high-order byte of the address is assumed to be $00.  
Addresses $00–$FF are thus accessed directly, using two-byte instructions. Execution time is  
reduced by eliminating the additional memory access required for the high-order address byte. In  
most applications, this 256-byte area is reserved for frequently referenced data. In M68HC11  
MCUs, the memory map can be configured for combinations of internal registers, RAM, or  
external memory to occupy these addresses.  
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-7  
11.4.3  
Extended (EXT)  
In the extended addressing mode, the effective address of the argument is contained in two bytes  
following the opcode byte. These are three-byte instructions (or four-byte instructions if a prebyte  
is required). One or two bytes are needed for the opcode and two for the effective address.  
11.4.4  
Indexed (IND, X; IND,Y)  
In the indexed addressing mode, an 8-bit unsigned offset contained in the instruction is added to  
the value contained in an index register (IX or IY) — the sum is the effective address. This  
addressing mode allows referencing any memory location in the 64Kbyte address space. These  
are two- to five-byte instructions, depending on whether or not a prebyte is required.  
11.4.5  
Inherent (INH)  
In the inherent addressing mode, all the information necessary to execute the instruction is  
contained in the opcode. Operations that use only the index registers or accumulators, as well as  
control instructions with no arguments, are included in this addressing mode. These are one or  
two-byte instructions.  
11.4.6  
Relative (REL)  
The relative addressing mode is used only for branch instructions. If the branch condition is true,  
an 8-bit signed offset included in the instruction is added to the contents of the program counter  
to form the effective branch address. Otherwise, control proceeds to the next instruction. These  
are usually two-byte instructions.  
11  
11.5  
Instruction set  
Refer to Table 11-2, which shows all the M68HC11 instructions in all possible addressing modes.  
For each instruction, the table shows the operand construction, the number of machine code  
bytes, and execution time in CPU E clock cycles.  
TPG  
MOTOROLA  
11-8  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
Table 11-2 Instruction set (Sheet 1 of 6)  
Instruction  
Condition codes  
Addressing  
mode  
Mnemonic  
Operation  
Description  
A + B  
Opcode  
1B  
Operand  
Cycles  
S
X
H
I
N
Z
V
C
ABA  
ABX  
Add accumulators  
Add B to X  
A
INH  
INH  
INH  
Ñ
Ñ
Ñ
2
3
4
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
IX + (00:B) IX  
IY + (00:B) IY  
3A  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
ABY  
Add B to Y  
18 3A  
ADCA (opr)  
Add with carry to A  
A + M + C  
B + M + C  
A + M  
A
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
89  
99  
B9  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
A9  
18 A9  
ADCB (opr)  
ADDA (opr)  
ADDB (opr)  
ADDD (opr)  
ANDA (opr)  
ANDB (opr)  
ASL (opr)  
Add with carry to B  
Add memory to A  
Add memory to B  
Add 16-bit to D  
B
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C9  
D9  
F9  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
E9  
18 E9  
A
B
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
8B  
9B  
BB  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
AB  
18 AB  
B + M  
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
CB  
DB  
FB  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
EB  
18 EB  
D + (M:M+1)  
D
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C3  
D3  
F3  
jj kk  
dd  
hh ll  
ff  
ff  
4
5
6
6
7
Ñ
Ñ
Ñ
Ñ
E3  
18 E3  
AND A with memory  
AND B with memory  
Arithmetic shift left  
A ¥ M  
A
B
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
84  
94  
B4  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
A4  
18 A4  
B ¥ M  
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C4  
D4  
F4  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
0
E4  
18 E4  
EXT  
IND, X  
IND, Y  
78  
68  
18 68  
hh ll  
ff  
ff  
6
6
7
C
C
0
0
b7  
b0  
b0  
ASLA  
ASLB  
ASLD  
Arithmetic shift left A  
Arithmetic shift left B  
Arithmetic shift left D  
A
B
INH  
INH  
INH  
48  
58  
05  
Ñ
Ñ
Ñ
2
2
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
b15  
11  
ASR  
Arithmetic shift right  
EXT  
IND, X  
IND, Y  
77  
67  
18 67  
hh ll  
ff  
ff  
6
6
7
Ñ
Ñ
Ñ
Ñ
C
b7  
b0  
ASRA  
ASRB  
Arithmetic shift right A  
Arithmetic shift right B  
Branch if carry clear  
Clear bit(s)  
A
B
INH  
INH  
REL  
47  
57  
24  
Ñ
Ñ
rr  
2
2
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
BCC (rel)  
C = 0 ?  
Ñ
Ñ
Ñ
Ñ
)
M ¥ (mm  
M
DIR  
IND, X  
IND, Y  
15  
1D  
18 1D  
dd mm  
ff mm  
ff mm  
6
7
8
BCLR (opr)  
(msk)  
BCS (rel)  
BEQ (rel)  
BGE (rel)  
BGT (rel)  
BHI (rel)  
Branch if carry set  
Branch if equal to zero  
Branch if zero  
C = 1 ?  
Z = 1 ?  
REL  
REL  
REL  
REL  
REL  
25  
27  
2C  
2E  
22  
rr  
rr  
rr  
rr  
rr  
3
3
3
3
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
N
V = 0 ?  
Branch if > zero  
Z + (N V) = 0 ?  
C + Z = 0 ?  
Branch if higher  
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-9  
Table 11-2 Instruction set (Sheet 2 of 6)  
Instruction  
Condition codes  
Addressing  
mode  
Mnemonic  
Operation  
Description  
Opcode  
Operand  
Cycles  
S
X
H
I
N
Ñ
Z
Ñ
V
Ñ
0
C
BHS (rel)  
BITA (opr)  
Branch if higher or same  
Bit(s) test A with memory  
C = 0 ?  
A ¥ M  
REL  
24  
rr  
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
85  
95  
B5  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
A5  
18 A5  
BITB (opr)  
Bit(s) test B with memory  
B ¥ M  
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C5  
D5  
F5  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
0
Ñ
E5  
18 E5  
BLE (rel)  
BLO (rel)  
BLS (rel)  
BLT (rel)  
BMI (rel)  
BNE (rel)  
BPL(rel)  
BRA (rel)  
Branch if zero  
Branch if lower  
Z + (N V) = 1 ?  
C = 1 ?  
REL  
REL  
REL  
REL  
REL  
REL  
REL  
REL  
2F  
25  
23  
2D  
2B  
26  
2A  
20  
rr  
rr  
rr  
rr  
rr  
rr  
rr  
rr  
3
3
3
3
3
3
3
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Branch if lower or same  
Branch if < zero  
Branch if minus  
C + Z = 1 ?  
N
V = 1 ?  
N = 1 ?  
Branch if zero  
Branch if plus  
Z = 0 ?  
N = 0 ?  
1 = 1 ?  
Branch always  
BRCLR(opr)  
(msk)  
Branch if bit(s) clear  
M ¥ mm = 0 ?  
DIR  
IND, X  
IND, Y  
13  
1F  
18 1F  
dd mm rr  
ff mm rr  
ff mm rr  
6
7
8
(rel)  
BRN (rel)  
Branch never  
1 = 0 ?  
REL  
21  
12  
rr  
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
BRSET(opr)  
(msk)  
Branch if bit(s) set  
M ¥ mm = 0 ?  
DIR  
IND, X  
IND, Y  
dd mm rr  
6
7
8
1E ff mm rr  
(rel)  
18 1E ff mm rr  
BSET (opr)  
(msk)  
Set bit(s)  
M + mm  
M
DIR  
IND, X  
IND, Y  
14  
1C  
18 1C  
dd mm  
ff mm  
ff mm  
6
7
8
Ñ
Ñ
Ñ
Ñ
0
Ñ
BSR (rel)  
BVC (rel)  
BVS (rel)  
CBA  
Branch to subroutine  
Branch if overßow clear  
Branch if overßow set  
Compare A with B  
Clear carry bit  
see Figure 11-2  
V = 0 ?  
REL  
REL  
REL  
INH  
INH  
INH  
8D  
28  
29  
11  
0C  
0E  
rr  
6
3
3
2
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
rr  
V = 1 ?  
rr  
A Ð B  
Ñ
Ñ
Ñ
CLC  
0
C
I
Ñ
Ñ
0
Ñ
Ñ
1
Ñ
Ñ
0
0
CLI  
Clear interrupt mask  
Clear memory byte  
0
Ñ
0
CLR (opr)  
0
M
DIR  
IND, X  
IND, Y  
7F  
6F  
18 6F  
hh ll  
ff  
ff  
6
6
7
Ñ
CLRA  
CLRB  
Clear accumulator A  
Clear accumulator B  
Clear overßow ßag  
0
0
0
A
B
V
A
B
INH  
INH  
INH  
4F  
5F  
0A  
Ñ
Ñ
Ñ
2
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
1
1
0
0
0
0
11  
CLV  
Ñ
Ñ
0
Ñ
CMPA (opr)  
Compare A with memory  
A Ð M  
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
81  
91  
B1  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
A1  
18 A1  
CMPB (opr)  
COM (opr)  
Compare B with memory  
B Ð M  
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C1  
D1  
F1  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
E1  
18 E1  
Ones complement memory byte  
$FF Ð M  
M
EXT  
IND, X  
IND, Y  
73  
63  
18 63  
hh ll  
ff  
ff  
6
6
7
0
1
COMA  
COMB  
Ones complement A  
Ones complement B  
$FF Ð A  
$FF Ð B  
A
B
A
B
INH  
INH  
43  
53  
Ñ
Ñ
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
1
1
TPG  
MOTOROLA  
11-10  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
Table 11-2 Instruction set (Sheet 3 of 6)  
Instruction  
Condition codes  
Addressing  
mode  
Mnemonic  
Operation  
Description  
Opcode  
Operand  
Cycles  
S
X
H
I
N
Z
V
C
CPD (opr)  
Compare D with memory (16-bit)  
D Ð (M:M+1)  
IMM  
DIR  
EXT  
IND, X  
IND, Y  
1A 83  
1A 93  
1A B3  
1A A3  
CD A3  
jj kk  
dd  
hh ll  
ff  
ff  
5
6
7
7
7
Ñ
Ñ
Ñ
Ñ
CPX (opr)  
CPY (opr)  
Compare IX with memory (16-bit)  
Compare IY with memory (16-bit)  
IX Ð (M:M+1)  
IY Ð (M:M+1)  
IMM  
DIR  
EXT  
IND, X  
IND, Y  
8C  
9C  
BC  
jj kk  
dd  
hh ll  
ff  
ff  
4
5
6
6
7
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
AC  
CD AC  
IMM  
DIR  
EXT  
IND, X  
IND, Y  
18 8C  
18 9C  
18 BC  
1A AC  
18 AC  
jj kk  
dd  
hh ll  
ff  
ff  
5
6
7
7
7
DAA  
Decimal adjust A  
adjust sum to BCD  
INH  
19  
Ñ
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
?
DEC (opr)  
Decrement memory byte  
M Ð 1  
M
EXT  
IND, X  
IND, Y  
7A  
6A  
18 6A  
hh ll  
ff  
ff  
6
6
7
Ñ
DECA  
DECB  
DES  
Decrement accumulator A  
Decrement accumulator B  
Decrement stack pointer  
A Ð 1  
B Ð 1  
A
B
A
B
INH  
INH  
INH  
INH  
INH  
4A  
5A  
Ñ
Ñ
Ñ
Ñ
Ñ
2
2
3
3
4
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
SP Ð 1 SP  
IX Ð 1 IX  
IY Ð 1 IY  
34  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
DEX  
Decrement index register X  
Decrement index register Y  
Exclusive OR A with memory  
09  
DEY  
18 09  
EORA (opr)  
A
M
A
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
88  
98  
B8  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
A8  
18 A8  
EORB (opr)  
Exclusive OR B with memory  
B
M
A
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C8  
D8  
F8  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
0
Ñ
E8  
18 E8  
FDIV  
IDIV  
Fractional divide, 16 by 16  
Integer divide, 16 by 16  
Increment memory byte  
D / IX  
D / IX  
IX; r  
IX; r  
D
D
INH  
INH  
03  
02  
Ñ
Ñ
41  
41  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
INC (opr)  
M + 1  
M
EXT  
IND, X  
IND, Y  
7C  
6C  
18 6C  
hh ll  
ff  
ff  
6
6
7
Ñ
INCA  
INCB  
INS  
Increment accumulator A  
Increment accumulator B  
Increment stack pointer  
Increment index register X  
Increment index register Y  
Jump  
A + 1  
B + 1  
A
B
A
B
INH  
INH  
INH  
INH  
INH  
4C  
5C  
Ñ
Ñ
Ñ
Ñ
Ñ
2
2
3
3
4
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
SP + 1 SP  
IX + 1 IX  
31  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
INX  
08  
11  
INY  
IY + 1 IY  
18 08  
JMP (opr)  
see Figure 11-2  
EXT  
IND, X  
IND, Y  
7E  
6E  
18 6E  
hh ll  
ff  
ff  
3
3
4
Ñ
JSR (opr)  
Jump to subroutine  
Load accumulator A  
see Figure 11-2  
DIR  
EXT  
IND, X  
IND, Y  
9D  
BD  
AD  
dd  
hh ll  
ff  
ff  
5
6
6
7
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
Ñ
Ñ
18 AD  
LDAA (opr)  
M
A
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
86  
96  
B6  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
A6  
18 A6  
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-11  
Table 11-2 Instruction set (Sheet 4 of 6)  
Instruction  
Condition codes  
Addressing  
mode  
Mnemonic  
Operation  
Description  
Opcode  
Operand  
Cycles  
S
X
H
I
N
Z
V
C
LDAB (opr)  
Load accumulator B  
M
B
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C6  
D6  
F6  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
0
Ñ
E6  
18 E6  
LDD (opr)  
LDS (opr)  
LDX (opr)  
LDY (opr)  
LSL (opr)  
Load double accumulator D  
Load stack pointer  
M
A; M+1  
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
CC  
DC  
FC  
jj kk  
dd  
hh ll  
ff  
ff  
3
4
5
5
6
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
Ñ
Ñ
Ñ
Ñ
EC  
18 EC  
M:M+1 SP  
M:M+1 IX  
M:M+1 IY  
IMM  
DIR  
EXT  
IND, X  
IND, Y  
8E  
9E  
BE  
jj kk  
dd  
hh ll  
ff  
ff  
3
4
5
5
6
AE  
18 AE  
Load index register X  
Load index register Y  
Logical shift left  
IMM  
DIR  
EXT  
IND, X  
IND, Y  
CE  
DE  
FE  
jj kk  
dd  
hh ll  
ff  
ff  
3
4
5
5
6
0
EE  
CD EE  
IMM  
DIR  
EXT  
IND, X  
IND, Y  
18 CE  
18 DE  
18 FE  
1A EE  
18 EE  
jj kk  
dd  
hh ll  
ff  
ff  
4
5
6
6
6
0
EXT  
IND, X  
IND, Y  
78  
68  
18 68  
hh ll  
ff  
ff  
6
6
7
C
C
0
0
b7  
b0  
b0  
LSLA  
LSLB  
LSLD  
Logical shift left A  
Logical shift Left B  
Logical shift left D  
A
B
INH  
INH  
INH  
48  
58  
05  
Ñ
Ñ
Ñ
2
2
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
b15  
LSR (opr)  
Logical shift right  
EXT  
IND, X  
IND, Y  
74  
64  
18 64  
hh ll  
ff  
ff  
6
6
7
Ñ
Ñ
Ñ
Ñ
0
0
0
C
C
b7  
b0  
b0  
LSRA  
LSRB  
LSRD  
Logical shift right A  
Logical shift right B  
Logical shift right D  
A
B
INH  
INH  
INH  
44  
54  
04  
Ñ
Ñ
Ñ
2
2
3
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
0
b15  
MUL  
Multiply, 8 x 8  
A * B  
0 Ð M  
D
INH  
3D  
Ñ
10  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
NEG (opr)  
Twos complement memory byte  
M
EXT  
IND, X  
IND, Y  
70  
60  
18 60  
hh ll  
ff  
ff  
6
6
7
NEGA  
NEGB  
NOP  
Twos complement A  
Twos complement B  
No operation  
0 Ð A  
0 Ð B  
A
B
A
B
INH  
INH  
INH  
40  
50  
01  
Ñ
Ñ
Ñ
2
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
11  
no operation  
Ñ
Ñ
Ñ
Ñ
ORAA  
OR accumulator A (inclusive)  
A + M  
A
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
8A  
9A  
BA  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
AA  
18 AA  
ORAB  
OR accumulator B (inclusive)  
B + M  
B
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
CA  
DA  
FA  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
0
Ñ
EA  
18 EA  
PSHA  
PSHB  
PSHX  
PSHY  
Push A onto stack  
Push B onto stack  
A
B
Stack; SP = SPÐ1  
Stack; SP = SPÐ1  
A
B
INH  
INH  
INH  
INH  
36  
37  
Ñ
Ñ
Ñ
Ñ
3
3
4
5
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Push IX onto stack (low Þrst)  
Push IY onto stack (low Þrst)  
IX Stack; SP = SPÐ2  
IY Stack; SP = SPÐ2  
3C  
18 3C  
TPG  
MOTOROLA  
11-12  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
Table 11-2 Instruction set (Sheet 5 of 6)  
Instruction  
Condition codes  
Addressing  
mode  
Mnemonic  
Operation  
Description  
Opcode  
32  
Operand  
Cycles  
S
X
H
I
N
Z
V
C
PULA  
PULB  
Pull A from stack  
Pull B from stack  
SP = SP+1; Stack  
SP = SP+1; Stack  
A
B
A
B
INH  
INH  
INH  
INH  
Ñ
Ñ
Ñ
Ñ
4
4
5
6
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
33  
PULX  
Pull IX from stack (high Þrst)  
Pull IY from stack (high Þrst)  
Rotate left  
SP = SP+2; Stack IX  
SP = SP+2; Stack IY  
38  
PULY  
18 38  
ROL (opr)  
EXT  
IND, X  
IND, Y  
79  
69  
18 69  
hh ll  
ff  
ff  
6
6
7
C
b7  
b0  
ROLA  
ROLB  
Rotate left A  
Rotate left B  
Rotate right  
A
B
INH  
INH  
49  
59  
Ñ
Ñ
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
ROR (opr)  
EXT  
IND, X  
IND, Y  
76  
66  
18 66  
hh ll  
ff  
ff  
6
6
7
C
b7  
b0  
RORA  
RORB  
RTI  
Rotate right A  
Rotate right B  
A
B
INH  
INH  
INH  
INH  
INH  
46  
56  
3B  
39  
10  
Ñ
Ñ
Ñ
Ñ
Ñ
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Return from interrupt  
Return from subroutine  
Subtract B from A  
see Figure 11-2  
see Figure 11-2  
12  
5
RTS  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
SBA  
A Ð B  
A
2
SBCA (opr)  
Subtract with carry from A  
A Ð M Ð C  
A
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
82  
92  
B2  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
A2  
18 A2  
SBCB (opr)  
Subtract with carry from B  
B Ð M Ð C  
B
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C2  
D2  
F2  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
E2  
18 E2  
SEC  
SEI  
Set carry  
1
C
INH  
INH  
INH  
0D  
0F  
0B  
Ñ
Ñ
Ñ
2
2
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
1
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
1
1
Set interrupt mask  
Set overßow ßag  
Store accumulator A  
1
I
Ñ
Ñ
Ñ
SEV  
1
V
M
Ñ
Ñ
STAA (opr)  
A
A
A
A
A
DIR  
EXT  
IND, X  
IND, Y  
97  
B7  
A7  
dd  
hh ll  
ff  
ff  
3
4
4
5
0
18 A7  
STAB (opr)  
STD (opr)  
Store accumulator B  
Store accumulator D  
B
M
B
B
B
B
DIR  
EXT  
IND, X  
IND, Y  
D7  
F7  
E7  
dd  
hh ll  
ff  
ff  
3
4
4
5
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
Ñ
Ñ
18 E7  
A
M; B M+1  
DIR  
EXT  
IND, X  
IND, Y  
DD  
FD  
ED  
dd  
hh ll  
ff  
ff  
4
5
5
6
18 ED  
11  
STOP  
Stop internal clocks  
Store stack pointer  
Ñ
INH  
CF  
Ñ
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
Ñ
Ñ
STS (opr)  
SP M:M+1  
DIR  
EXT  
IND, X  
IND, Y  
9F  
BF  
AF  
dd  
hh ll  
ff  
ff  
4
5
5
6
18 AF  
STX (opr)  
STY (opr)  
Store index register X  
Store index register Y  
IX M:M+1  
IY M:M+1  
DIR  
EXT  
IND, X  
IND, Y  
DF  
FF  
EF  
dd  
hh ll  
ff  
ff  
4
5
5
6
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
Ñ
Ñ
CD EF  
DIR  
EXT  
IND, X  
IND, Y  
18 DF  
18 FF  
1A EF  
18 EF  
dd  
hh ll  
ff  
ff  
5
6
6
6
TPG  
MC68HC11PH8  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
11-13  
Table 11-2 Instruction set (Sheet 6 of 6)  
Instruction  
Condition codes  
Addressing  
mode  
Mnemonic  
Operation  
Description  
Opcode  
Operand  
Cycles  
S
X
H
I
N
Z
V
C
SUBA (opr)  
Subtract memory from A  
A Ð M  
B Ð M  
A
B
A
A
A
A
A
IMM  
DIR  
EXT  
IND, X  
IND, Y  
80  
90  
B0  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
A0  
18 A0  
SUBB (opr)  
SUBD (opr)  
Subtract memory from B  
Subtract memory from D  
B
B
B
B
B
IMM  
DIR  
EXT  
IND, X  
IND, Y  
C0  
D0  
F0  
ii  
dd  
hh ll  
ff  
ff  
2
3
4
4
5
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
E0  
18 E0  
D Ð M:M+1  
D
IMM  
DIR  
EXT  
IND, X  
IND, Y  
83  
93  
B3  
jj kk  
dd  
hh ll  
ff  
ff  
4
5
6
6
7
A3  
18 A3  
SWI  
TAB  
Software interrupt  
Transfer A to B  
see Figure 11-2  
INH  
INH  
INH  
INH  
INH  
INH  
3F  
16  
06  
17  
00  
07  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
14  
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
1
Ñ
Ñ
Ñ
0
Ñ
Ñ
A
B
CCR  
A
Ñ
TAP  
Transfer A to CC register  
Transfer B to A  
A
2
0
TBA  
B
2
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
TEST  
TPA  
Test (only in test modes)  
Transfer CC register to A  
Test for zero or minus  
address bus increments  
CCR  
M Ð 0  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
A
2
TST (opr)  
EXT  
IND, X  
IND, Y  
7D  
6D  
18 6D  
hh ll  
ff  
ff  
6
6
7
TSTA  
TSTB  
TSX  
Test A for zero or minus  
Test B for zero or minus  
Transfer stack pointer to X  
Transfer stack pointer to Y  
Transfer X to stack pointer  
Transfer Y to stack pointer  
Wait for interrupt  
A Ð 0  
B Ð 0  
A
B
INH  
INH  
INH  
INH  
INH  
INH  
INH  
INH  
INH  
4D  
5D  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
2
2
3
4
3
4
à
3
4
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
0
0
0
0
SP + 1 IX  
SP + 1 IY  
30  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
TSY  
18 30  
35  
TXS  
IX Ð 1 SP  
TYS  
IY Ð 1 SP  
18 35  
3E  
WAI  
stack registers & WAIT  
IX D; D IX  
IY D; D IY  
XGDX  
XGDY  
Exchange D with X  
8F  
Exchange D with Y  
18 8F  
Operators  
Operands  
Is transferred to  
Boolean AND  
dd 8-bit direct address ($0000Ð$00FF); the high byte is assumed  
to be zero  
¥
+
Arithmetic addition, except where used as an  
inclusive-OR symbol in Boolean formulae  
Exclusive-OR  
Multiply  
Concatenation  
ff 8-bit positive offset ($00 to $FF (0 to 256)) is added to the  
contents of the index register  
hh High order byte of 16-bit extended address  
ii One byte of immediate data  
jj High order byte of 16-bit immediate data  
kk Low order byte of 16-bit immediate data  
ll Low order byte of 16-bit extended address  
mm 8-bit mask (set bits to be affected)  
rr Signed relative offset ($80 to $7F (Ð128 to +127));  
offset is relative to the address following the offset byte  
11  
*
:
Ð
Arithmetic subtraction, or negation symbol  
(Twos complement)  
Cycles  
Condition Codes  
Bit not changed  
à
InÞnite, or until reset occurs  
Ñ
12 cycles are used, beginning with the opcode  
fetch. A wait state is entered, which remains  
in effect for an integer number of MPU E clock  
cycles (n) until an interrupt is recognised.  
Finally, two additional cycles are used to fetch  
the appropriate interrupt vector. (14 + n, total).  
0
1
Bit always cleared  
Bit always set  
?
Bit set or cleared, depending on the operation  
Bit can be cleared, but cannot become set  
Not deÞned  
TPG  
MOTOROLA  
11-14  
CPU CORE AND INSTRUCTION SET  
MC68HC11PH8  
A
ELECTRICAL SPECIFICATIONS (STANDARD)  
This section contains the electrical specifications and associated timing information for the  
standard supply voltage (V = 5V ± 10%) MC68HC11PH8 variants.  
DD  
1.1  
Maximum ratings  
Rating  
Symbol  
Value  
Unit  
V
(1)  
Supply voltage  
V
Ð 0.3 to +7.0  
Ð 0.3 to +7.0  
DD  
(1)  
Input voltage  
V
V
in  
Operating temperature range  
Ð MC68HC11PH8, MC68HC711PH8  
T
T to T  
L H  
Ð40 to +85  
A
°C  
°C  
Storage temperature range  
T
Ð 55 to +150  
stg  
(2)  
Current drain per pin  
I
25  
mA  
D
Ð not VDD, VSS, VDD AD, VSS AD, VRH or VRL  
(1) All voltages are with respect to V  
.
SS  
(2) Maximum current drain per pin is for one pin at a time, observing maximum power  
dissipation limits.  
Note:  
This device contains circuitry designed to protect against damage due to high  
electrostatic voltages or electric fields. However, it is recommended that normal  
precautions be taken to avoid the application of any voltages higher than those given  
in the maximum ratings table to this high impedance circuit. For maximum reliability all  
unused inputs should be tied to either V or V  
.
SS  
DD  
12  
1.2  
Thermal characteristics and power considerations  
The average chip junction temperature, T , in degrees Celsius can be obtained from the following  
J
equation:  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-1  
TJ = TA + (PD • θJA  
)
[1]  
where:  
T = Ambient temperature (°C)  
A
θ
= Package thermal resistance, junction-to-ambient (°C/W)  
JA  
P = Total power dissipation = P  
+ P (W)  
I/O  
D
INT  
P
= Internal chip power = I • V (W)  
DD DD  
INT  
P
= Power dissipation on input and output pins (user determined)  
I/O  
An approximate relationship between P and T (if P is neglected) is:  
D
J
I/O  
K
PD  
=
[2]  
[3]  
---------------------  
TJ + 273  
Solving equations [1] and [2] for K gives:  
K = PD • (TA + 273) + θJA PD  
2
where K is a constant for a particular part. K can be determined by measuring P (at equilibrium)  
D
for a known T . Using this value of K, the values of P and T can be obtained for any value of T ,  
A
D
J
A
by solving the above equations. The package thermal characteristics are shown below:  
Characteristics  
Thermal resistance  
Symbol Value  
Unit  
θ
°C/W  
JA  
Ð 84-pin PLCC package  
Ð 84-pin CERQUAD package (EPROM)  
Ð 112-pin QFP package  
50  
50  
TBD  
12  
TPG  
MOTOROLA  
A-2  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
1.3  
Test methods  
~V  
DD  
Clocks,  
strobes  
V
Ð 0.8V  
DD  
0.4V  
0.4V  
nominal  
~V  
SS  
nominal  
70% of V  
20% of V  
DD  
DD  
Inputs  
nominal timing  
~V  
~V  
DD  
V
0.4V  
Ð 0.8V  
DD  
Outputs  
SS  
(b) DC testing  
~V  
DD  
Clocks,  
strobes  
70% of V  
DD  
20% of V  
20% of V  
spec.  
DD  
DD  
~V  
SS  
spec.  
(2)  
V
Ð 0.8V  
(2)  
DD  
70% of V  
DD  
Inputs  
20% of V  
DD  
0.4V  
spec. timing  
~V  
~V  
DD  
70% of V  
DD  
DD  
Outputs  
20% of V  
SS  
(c) AC testing  
Notes:  
(1) Full test loads are applied during all DC electrical tests and AC timing measurements.  
(2) During AC timing measurements, inputs are driven to 0.4V and VDD Ð 0.8V;  
timing measurements are taken at the 20% and 70% of VDD points.  
Figure A-1 Test methods  
12  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-3  
1.4  
DC electrical characteristics  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T , unless otherwise noted)  
DD  
SS  
A
L
H
Characteristic  
Symbol  
Min.  
Max.  
Unit  
(1)  
Output voltage (I  
= ± 10 µA):  
LOAD  
All outputs except XTAL  
V
Ñ
0.1  
Ñ
V
V
OL  
All outputs except XTAL, RESET & MODA  
V
V
V
Ð 0.1  
OH  
DD  
(1)  
Output high voltage (I  
= Ð0.8mA, V =4.5V):  
DD  
LOAD  
All outputs except XTAL, RESET & MODA  
V
Ð 0.8  
Ñ
V
OH  
DD  
Output low voltage (I  
= +1.6mA):  
LOAD  
All outputs except XTAL  
V
Ñ
0.4  
V
V
OL  
Input high voltage:  
All inputs except RESET  
RESET  
V
IH  
0.7V  
0.8V  
V
V
+ 0.3  
DD  
DD  
DD  
DD  
+ 0.3  
Input low voltage Ð all inputs  
V
V
Ð 0.3  
0.2V  
DD  
V
IL  
SS  
(2)  
IL  
I/O ports three-state leakage (V = V or V )  
:
IN  
IH  
Ports A, B, C, D, F, G, H, MODA/LIR, RESET  
I
Ñ
±10  
µA  
µA  
OZ  
(2)  
Input leakage (V = V or VSS):  
I
IN  
IN  
DD  
MODB/VSTBY  
IRQ, XIRQ (ROM parts)  
XIRQ (EPROM parts)  
Ñ
Ñ
Ñ
±10  
±1  
±10  
Input current with pull-up resistors (V = V ):  
IN  
IL  
Ports B, C, F, G, H  
I
20  
2.0  
Ñ
100  
µA  
V
IPR  
RAM stand-by voltage (power down)  
RAM stand-by current (power down)  
V
V
DD  
SB  
SB  
I
10  
µA  
pF  
Input capacitance:  
C
IN  
Port E, IRQ, XIRQ, EXTAL  
Ports A, B, C, D, F, G, H, MODA/LIR, RESET  
Ñ
Ñ
8
12  
Output load capacitance:  
C
pF  
L
All outputs except PD[4:1], PG[4:1], XTAL, MODA/LIR  
PD[4:1], PG[4:1]  
Ñ
Ñ
90  
200  
(1) V speciÞcation for RESET and MODA is not applicable as they are open-drain pins.  
OH  
V
speciÞcation is not applicable to port C, port D and port G[5:0] in wired-OR mode.  
OH  
(2) Refer to A/D speciÞcation for the leakage current value for port E.  
12  
TPG  
MOTOROLA  
A-4  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
A.4.1  
DC electrical characteristics — modes of operation  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T , unless otherwise noted)  
DD  
SS  
A
L
H
Characteristic  
Symbol 6kHz 2MHz 3MHz 4MHz  
Unit  
(1)  
Maximum total supply current (including PLL)  
RUN: Single chip mode  
:
I
DD  
TBD  
TBD  
500  
50  
27  
35  
500  
50  
32  
42  
500  
50  
40  
50  
500  
50  
mA  
mA  
µA  
µA  
RUN: Expanded mode  
WAIT: Single chip mode  
(2)  
STOP: Single chip mode  
Maximum power dissipation: Single chip mode  
Maximum power dissipation: Expanded mode  
P
TBD  
TBD  
149  
193  
176  
231  
220  
275  
mW  
mW  
D
(1) All current measurements taken with suitable decoupling capacitors across the power supply to suppress  
the transient switching currents inherent in CMOS designs.  
EXTAL is driven with a square wave, with t  
devices.  
= 167ms for 6kHz devices; 500/333/250ns for 2/3/4MHz  
CYC  
VIL 0.2V; VIH VDD Ð 0.2V; no DC loads  
WAIT: all peripheral functions shut down  
STOP: all clocks stopped  
(2) WAIT values in the 6 kHz column obtained by using an external clock of 32 kHz and the PLL low-power  
WAIT mode (WEN = 1).  
12  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-5  
1.5  
Control timing  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T )  
DD  
SS  
A
L
H
2.0MHz  
3.0MHz  
4.0MHz  
(1)  
Characteristic  
Symbol  
Unit  
Min.  
Max.  
2.0  
Ñ
Min.  
Max.  
3.0  
Min.  
Max.  
4.0  
Frequency of operation  
E clock period  
f
0
500  
Ñ
0
333  
Ñ
0
250  
Ñ
MHz  
ns  
OP  
t
Ñ
Ñ
CYC  
Crystal frequency  
f
8.0  
8.0  
Ñ
12.0  
12.0  
Ñ
16.0  
16.0  
Ñ
MHz  
MHz  
ns  
XTAL  
External oscillator frequency  
Processor control set-up time (t  
4f  
0
0
0
OP  
= t /4 + 50ns)  
t
175  
133  
112  
PCSU CYC  
PCSU  
PW  
RSTL  
(3)  
16  
1
Ñ
Ñ
16  
1
Ñ
Ñ
16  
1
Ñ
Ñ
(2)  
Reset input pulse width  
t
t
CYC  
PW  
RSTL  
(4)  
Mode programming set-up time  
Mode programming hold time  
t
2
Ñ
Ñ
2
Ñ
Ñ
2
Ñ
Ñ
MPS  
CYC  
t
10  
10  
10  
ns  
MPH  
t
t
t
CYC  
+20  
CYC  
CYC  
Interrupt pulse width (IRQ edge sensitive mode)  
PW  
PW  
Ñ
Ñ
Ñ
Ñ
Ñ
Ñ
ns  
IRQ  
+20  
+20  
Timer pulse width  
(Input capture and pulse accumulator inputs)  
t
t
t
CYC  
+20  
CYC  
CYC  
ns  
TIM  
+20  
+20  
WAIT recovery start-up time  
Clock monitor reset  
t
Ñ
4
Ñ
4
Ñ
4
t
WRS  
CYC  
f
10  
200  
10  
200  
10  
200  
kHz  
CMON  
(1) All timing is given with respect to 20% and 70% of V , unless otherwise noted.  
DD  
(2) Reset is recognized during the Þrst clock cycle it is held low. Internal circuitry then drives the pin low for eight clock cycles,  
releases the pin and samples the pin level four cycles later to determine the source of the interrupt. (See Section 10.)  
(3) To guarantee an external reset vector.  
(4) This is the minimum input time; it can be pre-empted by an internal reset.  
PA[3:0](1)  
PWTIM  
PA[3:0](2)  
PA7(1), (3)  
PA7(2), (3)  
12  
Notes  
(1) Rising edge sensitive input.  
(2) Falling edge sensitive input.  
(3) Maximum pulse accumulator clocking rate is E clock frequency divided by two (E/2).  
Figure A-2 Timer inputs  
TPG  
MOTOROLA  
A-6  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
VDD  
EXTAL  
(1)  
t
PORDELAY  
E
t
PCSU  
PW  
MPS  
RSTL  
RESET  
t
t
MPH  
MODA,  
MODB  
New  
PC  
New  
PC  
FFFE FFFE FFFE FFFE FFFF  
FFFE FFFE FFFE FFFE FFFE FFFF  
Address  
(1) tPORDELAY = 4064 tCYC (or 128 tCYC depending on mask option - MC68HC11PH8 only)  
Figure A-3 Reset timing  
E clock  
t
PCSU  
IRQ(1)  
IRQ(2), XIRQ  
or internal  
interrupt  
PW  
IRQ  
New  
PC  
Address(3)  
Data(4)  
OA OA+1 SP  
SPÐ1 SPÐ2 SPÐ3 SPÐ4 SPÐ5 SPÐ6 SPÐ7 SPÐ8 SPÐ8 VA VA+1  
OP  
Ð Ð  
PCL PCH IYL  
IYH  
IXL  
IXH  
B
A
CCR РР 
VH  
VL  
OP  
12  
R/W  
Notes:  
(1) Edge sensitive IRQ pin (IRQE = 1).  
(2) Level sensitive IRQ pin (IRQE = 0).  
(3) Where OA = Opcode address and VA = Vector address.  
(4) Where OP = Opcode, VH = Vector (MSB) and VL = Vector (LSB).  
Figure A-4 Interrupt timing  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-7  
Internal  
clocks  
IRQ(1)  
PW  
IRQ  
IRQ(2)  
or XIRQ  
(3)  
STOPDELAY  
t
E clock  
Op-  
code  
Address(4)  
(6)  
SA  
SA+1  
SA+1  
Resume program with instruction which follows the STOP instruction  
New  
PC  
Address(5)  
SA  
SA+1  
SA+1 SA+2 SPÉ SPÐ7 SPÐ8 SPÐ8 FFF2 FFF3  
(6)  
Notes:  
(1) Edge sensitive IRQ pin (IRQE = 1).  
(2) Level sensitive IRQ pin (IRQE = 0).  
(3) If DLY = 1: tSTOPDELAY = 4064 tCYC (or 128 tCYC depending on mask option - MC68HC11PH8 only)  
If DLY = 0: tSTOPDELAY = 4 tCYC  
(4) XIRQ with X-bit in CCR = 1.  
(5) IRQ (or XIRQ, with X-bit = 0; in this case vector fetch will be $FFF4/5).  
(6) SA = STOP address.  
Figure A-5 STOP recovery timing  
E clock  
t
PCSU  
IRQ, XIRQ,  
or internal  
interrupts  
t
WRS  
New  
PC  
(1)  
(2)  
WA  
WA+1 SP SPÐ1 SPÐ2ÉSPÐ8 SPÐ8 SPÐ8ÉSPÐ8 SPÐ8 SPÐ8 SPÐ8 VA  
Stack registers  
VA+1  
Address  
R/W  
12  
Notes:  
RESET also causes recovery from WAIT.  
(1) WA = WAIT address.  
(2) VA = Vector address.  
Figure A-6 WAIT recovery timing  
TPG  
MOTOROLA  
A-8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
A.5.1  
Peripheral port timing  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T )  
DD  
SS  
A
L
H
2.0MHz  
3.0MHz  
4.0MHz  
(1)  
Characteristic  
Symbol  
Unit  
Min.  
Max.  
2.0  
Ñ
Min.  
Max.  
3.0  
Ñ
Min. Max.  
Frequency of operation (E clock frequency)  
E clock period  
f
0
0
0
4.0  
Ñ
Ñ
Ñ
MHz  
ns  
OP  
t
500  
100  
50  
333  
100  
50  
250  
100  
50  
CYC  
(2)  
Peripheral data set-up time, all ports  
t
Ñ
Ñ
ns  
PDSU  
(2)  
Peripheral data hold time, all ports  
t
Ñ
Ñ
ns  
PDH  
Delay time, peripheral data write  
MCU write to port A, B, G or H  
t
ns  
PWD  
Ñ
Ñ
200  
225  
Ñ
Ñ
200  
183  
Ñ
Ñ
200  
162  
MCU write to port C, D or F (tPWD = tCYC/4 + 100ns)  
(1) All timing is given with respect to 20% and 70% of V , unless otherwise noted.  
DD  
(2) Port C, D and G timing is valid for active drive (CWOM, DWOM, GWOM, WOMS and WOMS2 bits clear).  
MCU read of port  
E clock  
t
t
PDH  
PDSU  
Ports  
A, C, D, F  
t
t
PDH  
PDSU  
Ports  
B, E, G, H  
Figure A-7 Port read timing diagram  
MCU write to port  
E clock  
t
PWD  
Ports  
C, D, F  
Previous port data  
New data valid  
t
PWD  
Ports  
A, B, G, H  
12  
Previous port data  
New data valid  
Figure A-8 Port write timing diagram  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-9  
A.5.2  
PLL control timing  
(VDD = 5.0Vdc ±10%, VSS = 0Vdc, T = T to T unless otherwise noted)  
A
L
H
(1)  
Mask option 1  
Mask option 2  
Typical Maximum  
Characteristic  
Symbol  
Units  
Min Typical Maximum  
Min  
PLL reference frequency  
f
f
25  
32  
50  
50  
614  
2000  
kHz  
REF  
SYS  
System frequency  
PLL output frequency  
External clock operation  
dc  
0.05  
dc  
Ñ
Ñ
4
16  
16  
dc  
0.1  
dc  
Ñ
Ñ
4
16  
16  
f
MHz  
VCOOUT  
f
XTAL  
Capacitor on pin XFC  
C
Ñ
Ñ
47  
20  
Ñ
Ñ
Ñ
47  
10  
Ñ
nF  
XFC  
(2)  
PLL stabilization time  
t
TBD  
TBD  
ms  
PLLS  
(3)(4)  
4XCLK stability  
Short term  
Long term  
C
TBD  
TBD  
Ñ
Ñ
TBD  
TBD  
TBD  
TBD  
Ñ
Ñ
TBD  
TBD  
%
STAB  
(1) This mask option does not exist on the MC68HC711PH8, on which the PLL is optimized for use at 32kHz.  
(2) Assumes that stable VDDSYN is applied, that an external Þlter capacitor with a value of 47nF is attached to the XFC pin,  
and that the crystal oscillator is stable. Stabilization time is measured from power-up to RESET release.This speciÞcation  
also applies to the period required for PLL stabilization after changing the X and Y frequency control bits in the  
synthesizer control register (SYNR) while PLL is running, and to the period required for the clock to stabilize after WAIT  
with WEN = 1.  
(3) Short term stability is the average deviation from programmed frequency measured over a 2µs interval at maximum f  
,
SYS  
Long term 4XCLK stability is the average deviation from programmed frequency measured over a 1ms interval at  
maximum f . Stability is measured with a stable external clock applied Ñ variation in crystal oscillator frequency is  
SYS  
additive to this Þgure.  
(4) This parameter is periodically sampled rather than 100% tested.  
12  
TPG  
MOTOROLA  
A-10  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
A.5.3  
Analog-to-digital converter characteristics  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T , 750kHz E 4MHz, unless otherwise noted)  
DD  
SS  
A
L
H
(1)  
(1)  
(1)  
2MHz  
3MHz  
4MHz  
Characteristic  
Parameter  
Min. Absolute  
Unit  
bits  
Max.  
Max.  
Max.  
Resolution  
Number of bits resolved by ADC  
Ñ
Ñ
8
Ñ
Ñ
Ñ
Maximum deviation from the ideal ADC transfer  
characteristics  
Non-linearity  
Ñ
±0.5  
±0.5  
±0.5  
±1  
±1  
±1  
±1  
±1  
±1  
LSB  
Difference from the output of an ideal ADC for zero  
input voltage  
Zero error  
Ñ
Ñ
Ñ
Ñ
LSB  
LSB  
Difference from the output of an ideal ADC for  
full-scale input voltage  
Full-scale error  
Total unadjusted  
error  
Maximum sum of non-linearity, zero and full-scale  
errors  
Ñ
Ñ
Ñ
Ñ
±0.5  
±0.5  
±1.5  
±0.5  
±1.5 LSB  
±0.5 LSB  
Quantization error Uncertainty due to converter resolution  
Difference between the actual input voltage and the  
Absolute accuracy full-scale weighted equivalent of the binary output  
code, including all error sources  
Ñ
Ñ
±1  
±2  
±2  
LSB  
Conversion range Analog input voltage range  
V
Ñ
Ñ
Ñ
Ñ
V
V
V
RH  
V
V
V
V
RL  
RH  
RH  
(2)  
V
V
Analog reference voltage (high)  
V
V +0.1 V +0.1 V +0.1  
DD DD DD  
RH  
RL  
RL  
(2)  
Analog reference voltage (low)  
Minimum difference between V and V  
RL  
V
Ð0.1  
V
V
V
RH  
SS  
RH  
RH  
(2)  
V  
3
Ñ
Ñ
Ñ
R
RH  
Total time to perform a single A/D conversion:  
E clock  
Internal RC oscillator  
t
CY  
Conversion time  
Monotonicity  
Ñ
Ñ
32  
Ñ
Ñ
Ñ
Ñ
C
t
+32  
t
+32  
t
+32  
CYC  
CYC  
CYC  
µs  
Conversion result never decreases with an increase  
in input voltage and has no missing codes  
Guaranteed  
Ñ
Zero input reading Conversion result when V = V  
$00  
Ñ
Ñ
Ñ
Ñ
Ñ
Hex  
IN  
RL  
Full-scale reading Conversion result when V = V  
$FF  
$FF  
$FF Hex  
IN  
RH  
Analog input acquisition sampling time:  
E clock  
Internal RC oscillator  
Sample acquisition  
time  
t
CY  
C
Ñ
Ñ
12  
Ñ
Ñ
12  
Ñ
12  
Ñ
12  
µs  
Sample/hold  
capacitance  
Input capacitance (PE[0:7]) during sample  
Ñ
20 (typ)  
Ñ
Ñ
Ñ
pF  
Input leakage on A/D pins:  
PE[0:7]  
Input leakage  
Ñ
Ñ
Ñ
Ñ
400  
1.0  
400  
1.0  
400  
1.0  
nA  
µA  
V
, V  
12  
RL RH  
(1) For f < 2MHz, source impedances should be approximately 10k. For f 2MHz, source impedances should be in the  
OP  
OP  
range 5Ð10k. Source impedances greater than 10khave an adverse affect on A/D accuracy, because of input leakage.  
(2) Performance veriÞed down to V = 2.5V, however accuracy is tested and guaranteed at V = 5V ± 10%.  
R
R
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-11  
A.5.4  
Serial peripheral interface timing  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T )  
DD  
SS  
A
L
H
2.0MHz  
3.0MHz  
4.0MHz  
(1)  
Num  
Characteristic  
Operating frequency  
Symbol  
Unit  
Min. Max. Min. Max. Min. Max.  
Master  
Slave  
f
0
0
0.5  
2.0  
0
0
0.5  
3.0  
0
0
0.5  
4.0 MHz  
f
OP  
OP(M)  
f
OP(S)  
1
2
3
4
5
6
7
Cycle time  
Master  
Slave  
t
t
2.0  
500  
Ñ
Ñ
2.0  
333  
Ñ
Ñ
2.0  
250  
Ñ
Ñ
t
CYC  
ns  
CYC(M)  
CYC(S)  
(2)  
Enable lead time  
Master  
Slave  
t
Ñ
250  
Ñ
Ñ
Ñ
240  
Ñ
Ñ
Ñ
200  
Ñ
Ñ
LEAD(M)  
ns  
ns  
ns  
ns  
ns  
ns  
t
LEAD(S)  
(2)  
Enable lag time  
Master  
Slave  
t
t
Ñ
250  
Ñ
Ñ
Ñ
240  
Ñ
Ñ
Ñ
200  
Ñ
Ñ
LAG(M)  
LAG(S)  
Clock (SCK) high time  
Clock (SCK) low time  
Input data set-up time  
Input data hold time  
Master  
Slave  
t
t
340  
190  
Ñ
Ñ
227  
127  
Ñ
Ñ
130  
85  
Ñ
Ñ
W(SCKH)M  
W(SCKH)S  
Master  
Slave  
t
t
340  
190  
Ñ
Ñ
227  
127  
Ñ
Ñ
130  
85  
Ñ
Ñ
W(SCKL)M  
W(SCKL)S  
Master  
Slave  
t
100  
100  
Ñ
Ñ
100  
100  
Ñ
Ñ
100  
100  
Ñ
Ñ
SU(M)  
t
SU(S)  
Master  
Slave  
t
100  
100  
Ñ
Ñ
100  
100  
Ñ
Ñ
100  
100  
Ñ
Ñ
H(M)  
t
H(S)  
8
9
Access time (from high-z to data active) Slave  
t
0
Ñ
Ñ
0
120  
300  
240  
Ñ
0
Ñ
Ñ
0
120  
300  
167  
Ñ
0
Ñ
Ñ
0
120  
300  
125  
Ñ
ns  
ns  
ns  
ns  
A
Disable time (hold time to high-z state)  
Slave  
t
DIS  
(3)  
10 Data valid (after enable edge)  
t
V(S)  
11 Output data hold time (after enable edge)  
t
HO  
(3)  
12 Rise time  
SPI outputs (SCK, MOSI and MISO)  
SPI inputs (SCK, MOSI, MISO and SS)  
t
t
Ñ
Ñ
100  
2.0  
Ñ
Ñ
100  
2.0  
Ñ
Ñ
100  
2.0  
ns  
µs  
RM  
RS  
(3)  
13 Fall time  
SPI outputs (SCK, MOSI and MISO)  
SPI inputs (SCK, MOSI, MISO and SS)  
t
t
Ñ
Ñ
100  
2.0  
Ñ
Ñ
100  
2.0  
Ñ
Ñ
100  
2.0  
ns  
µs  
FM  
FS  
(1) All timing is given with respect to 20% and 70% of V , unless otherwise noted.  
DD  
(2) Signal production depends on software.  
(3) Assumes 200pF load on all SPI pins.  
12  
TPG  
MOTOROLA  
A-12  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
SS  
(input)  
SS is held high on master  
1
12  
13  
13  
12  
5
SCK (CPOL=0)  
(output)  
(see note)  
(see note)  
4
5
SCK (CPOL=1)  
(output)  
4
6
7
MISO  
(input)  
MSB in  
Bit 6ÉÉ1  
LSB in  
10 (ref.)  
11  
Master MSB out  
10  
11 (ref.)  
MOSI  
(output)  
Bit 6ÉÉ1  
Master LSB out  
13  
12  
Note: This Þrst clock edge is generated internally, but is not seen at the SCK pin.  
Figure A-9 SPI master timing (CPHA = 0)  
SS  
(input)  
SS is held high on master  
1
13  
12  
12  
13  
5
4
(see note)  
(see note)  
SCK (CPOL=0)  
(output)  
4
5
SCK (CPOL=1)  
(output)  
6
7
MISO  
(input)  
MSB in  
Bit 6ÉÉ1  
LSB in  
10 (ref.)  
11  
Master MSB out  
10  
11 (ref.)  
MOSI  
(output)  
Bit 6ÉÉ1  
Master LSB out  
13  
12  
Note: This last clock edge is generated internally, but is not seen at the SCK pin.  
12  
Figure A-10 SPI master timing (CPHA = 1)  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-13  
SS  
(input)  
1
13  
12  
12  
13  
3
5
4
SCK (CPOL=0)  
(input)  
4
5
2
SCK (CPOL=1)  
(input)  
6
7
MOSI  
MSB in  
Bit 6ÉÉ1  
Bit 6ÉÉ1  
LSB in  
(input)  
8
10  
11  
9
MISO  
(output)  
Slave MSB out  
Slave LSB out  
(see note)  
Note: Not deÞned, but normally the MSB of character just received.  
Figure A-11 SPI slave timing (CPHA = 0)  
SS  
(input)  
1
13  
12  
12  
13  
3
5
4
SCK (CPOL=0)  
(input)  
4
5
2
SCK (CPOL=1)  
(input)  
6
7
MOSI  
(input)  
MSB in  
Bit 6ÉÉ1  
LSB in  
8
10  
11  
9
MISO  
(output)  
(see note)  
Slave MSB out  
Bit 6ÉÉ1  
Slave LSB out  
Note: Not deÞned, but normally the LSB of character last transmitted.  
12  
Figure A-12 SPI slave timing (CPHA = 1)  
TPG  
MOTOROLA  
A-14  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
A.5.5  
Non-multiplexed expansion bus timing  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T )  
DD  
SS  
A
L
H
2.0MHz  
3.0MHz  
4.0MHz  
(1)  
Num  
Characteristic  
Symbol  
Unit  
Min. Max. Min. Max. Min. Max.  
Frequency of operation (E clock frequency)  
E clock period  
f
0
2.0  
Ñ
Ñ
Ñ
0
3.0  
Ñ
Ñ
Ñ
0
4.0  
Ñ
Ñ
Ñ
MHz  
ns  
OP  
1
2
3
t
500  
230  
225  
333  
147  
142  
250  
105  
100  
CYC  
(2), (3)  
Pulse width, E low  
PW  
ns  
EL  
(2), (3)  
Pulse width, E high  
PW  
ns  
EH  
4A E clock  
4B  
rise time  
fall time  
t
t
Ñ
Ñ
20  
20  
Ñ
Ñ
20  
18  
Ñ
Ñ
20  
15  
r
ns  
f
(3)  
9
Address hold time  
t
t
53  
Ñ
Ñ
103  
Ñ
32  
Ñ
Ñ
82  
Ñ
Ñ
Ñ
40  
Ñ
Ñ
Ñ
10  
21  
Ñ
Ñ
71  
Ñ
Ñ
Ñ
40  
Ñ
Ñ
Ñ
10  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
AH  
AD  
(3)  
11 Address delay time  
(3)  
12 Address valid to E rise time  
17 Read data set-up time  
18 Read data hold time  
19 Write data delay time  
t
127  
30  
0
65  
30  
0
34  
20  
0
AV  
t
Ñ
DSR  
DHR  
t
Ñ
t
t
Ñ
40  
Ñ
Ñ
Ñ
DDW  
DHW  
(3)  
21 Write data hold time  
63  
348  
185  
Ñ
42  
203  
102  
Ñ
31  
144  
60  
Ñ
(3)  
29 MPU address access time  
t
Ñ
ACCA  
(3)  
39 Write data set-up time  
t
Ñ
DSW  
57 Address valid to data three-state time  
t
10  
AVDZ  
(1) All timing is given with respect to 20% and 70% of V , unless otherwise noted.  
DD  
(2) Input clock duty cycles other than 50% will affect the bus performance.  
(3) For f 2MHz the following formulae may be used to calculate parameter values:  
OP  
PW = t /2 Ð 20ns  
PW = t /2 Ð 25ns  
EL CYC  
EH CYC  
t
t
t
= t /8 Ð 10ns  
t
t
t
= t /8 + 40ns  
= t /8  
DHW CYC  
AH CYC  
AD CYC  
= PW Ð t  
AV  
EL AD  
= t  
Ð t Ð t  
Ð t  
= PW Ð t  
ACCA CYC  
f
DSR AD  
DSW EH DDW  
12  
TPG  
MC68HC11PH8  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MOTOROLA  
A-15  
1
3
4B  
9
2
E clock  
4A  
11  
12  
R/W,  
Address  
29  
17  
18  
Data  
(read)  
19  
39  
21  
57  
Data  
(write)  
Figure A-13 Expansion bus timing  
A.5.6  
EEPROM characteristics  
Temperature range  
Characteristic  
Unit  
Ð40 to +85°C  
(1)  
Programming time, t  
EEPROG  
<1MHz, RCO enabled  
1Ð2MHz, RCO disabled  
2MHz & whenever RCO enabled  
10  
20  
10  
ms  
(1)  
Erase time: byte, row and bulk  
10  
10000  
10  
ms  
(2)  
Write/erase endurance  
cycles  
years  
(2)  
Data retention  
(1) The RC oscillator (RCO) must be enabled (by setting the CSEL bit in the OPTION  
register) for EEPROM programming and erasure when the E clock frequency is less  
than 1.0MHz.  
(2) Refer to the current issue of MotorolaÕs quarterly Reliability Monitor Report for the  
latest failure rate information.  
12  
A.5.7  
EPROM characteristics  
(V = 5.0 Vdc ± 10%, V = 0 Vdc, T = T to T , unless otherwise noted)  
DD  
SS  
A
L
H
Characteristic  
Symbol  
Min  
12  
Max  
12.75  
TBD  
5
Unit  
V
Programming voltage  
V
PPE  
Programming voltage detect level  
Programming time  
V
TBD  
V
PPH  
t
ms  
EPROG  
TPG  
MOTOROLA  
A-16  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MC68HC11PH8  
B
MECHANICAL DATA AND ORDERING  
INFORMATION  
B.1  
Pin assignments  
The MC68HC11PH8 is available in 84-pin PLCC or 112-pin TQFP packages; in addition to those  
two packages, the MC68HC711PH8 is available in a windowed 84-pin CERQUAD package, to  
allow full use of the EPROM.  
PW1/PH0 12  
PW2/PH1 13  
PW3/PH2 14  
PW4/PH3 15  
PH4 16  
74 PD2/MISO  
73 PD1/TXD1  
72 PD0/RXD1  
71 MODA/LIR  
70 RESET  
69 XFC  
PH5 17  
PH6 18  
PH7 19  
68 VDDSYN  
67 EXTAL  
MODB/VSTBY 20  
VPPE/XIRQ 21  
VDD 22  
66 XTAL  
65  
E
64 VDDR  
63 VSSR  
VDDL 23  
VSSL 24  
62 PC7/D7  
61 PC6/D6  
60 PC5/D5  
59 PC4/D4  
58 PC3/D3  
57 PC2/D2  
56 PC1/D1  
55 PC0/D0  
54 IRQ  
VSS 25  
R/W/PG7 26  
LCDBP/PG6 27  
SS2/PG5 28  
SCK2/PG4 29  
MOSI2/PG3 30  
MISO2/PG2 31  
TXD2/PG1 32  
13  
Figure B-1 84-pin PLCC/CERQUAD pinout  
TPG  
MC68HC11PH8  
MECHANICAL DATA AND ORDERING INFORMATION  
MOTOROLA  
B-1  
NC  
NC  
PW1/PH0  
PW2/PH1  
PW3/PH2  
PW4/PH3  
PH4  
1
2
3
4
5
6
7
8
9
84 NC  
83 PD2/MISO  
82 PD1/TXD  
81 PD0RXD  
80 MODA/LIR  
79 RESET  
78 XFC  
PH5  
PH6  
PH7 10  
NC 11  
77 VDDSYN  
76 NC  
75 NC  
74 NC  
MODB/VSTBY 12  
VPPE/XIRQ 13  
NC 14  
73 EXTAL  
72 XTAL  
71  
E
VDDL 15  
70 4XOUT  
69 VDDR  
68 VSSR  
67 PC7/D7  
66 PC6/D6  
65 PC5/D5  
64 PC4/D4  
63 PC3/D3  
62 PC2/D2  
61 PC1/D1  
60 PC0/D0  
59 IRQ  
VSSL 16  
NC 17  
NC 18  
R/W/PG7 19  
LCDBP/PG6 20  
SS2/PG5 21  
SCK2/PG4 22  
MOSI2/PG3 23  
MISO2/PG2 24  
TXD2/PG1 25  
NC 26  
NC 27  
NC 28  
58 NC  
57 NC  
Figure B-2 112-pin TQFP pinout  
13  
TPG  
MOTOROLA  
B-2  
MECHANICAL DATA AND ORDERING INFORMATION  
MC68HC11PH8  
B.2  
Package dimensions  
0.18 M T N  
S
ÐP  
S
L S ÐM S  
B
ÐNÐ  
Y brk  
ÐLÐ  
ÐMÐ  
Case No. 780-01  
84 lead PLCC  
G1  
W
Z1  
pin 84  
(Note 1)  
pin 1  
X
ÐPÐ  
V
U
0.18 M T N  
S
ÐP  
S
L
S ÐM S  
0.18 M  
0.18 M  
T
T
L
L
S
S
ÐM  
ÐM  
S
S
N
N
S
S
ÐP  
ÐP  
S
S
A
R
0.18 M  
T
L
S
ÐM  
ÐP  
S
S
N
L
S
S
ÐP  
S
Z
0.18 M T N  
S
ÐM S  
C
H
0.10  
K1  
G
Seating plane  
ÐTÐ  
J
E
G1  
K
0.25  
S T L S ÐM S N S ÐP S  
F
0.18 M  
T
L
S
S
ÐM  
ÐP  
S
S
N
L
S
S
ÐP  
S
0.18 M T N  
ÐM S  
Dim.  
Min.  
30.10  
30.10  
4.20  
Max.  
Notes  
Dim.  
U
Min.  
29.21  
1.07  
1.07  
1.07  
Ñ
Max.  
A
B
C
E
F
30.35  
30.35  
4.57  
29.36  
1.21  
1.21  
1.42  
0.50  
10°  
V
1. Due to space limitations, this case shall be represented by a  
general case outline, rather than one showing all the leads.  
2. Datums ÐLÐ, ÐMÐ, ÐNÐ and ÐPÐ are determined where top of lead  
shoulder exits plastic body at mould parting line.  
3. Dimension G1, true position to be measured at datum ÐTÐ (seating  
plane).  
4. Dimensions R and U do not include mould protrusion. Allowable  
mould protrusion is 0.25mm per side.  
5. Dimensions and tolerancing per ANSI Y 14.5M, 1982.  
6. All dimensions in mm.  
W
X
2.29  
2.79  
0.33  
0.48  
Y
G
H
J
1.27 BSC  
Z
2°  
0.66  
0.51  
0.81  
Ñ
G1  
K1  
Z1  
28.20  
1.02  
2°  
28.70  
Ñ
13  
K
R
0.64  
Ñ
10°  
29.21  
29.36  
Figure B-3 84-pin PLCC mechanical dimensions  
TPG  
MC68HC11PH8  
MECHANICAL DATA AND ORDERING INFORMATION  
MOTOROLA  
B-3  
0.18 M T N  
S
ÐP  
S
L S ÐM S  
B
ÐNÐ  
Y brk  
ÐLÐ  
ÐMÐ  
Case No. 780A-01  
84 lead CERQUAD  
G1  
W
Z1  
pin 84  
(Note 1)  
pin 1  
ÐPÐ  
X
V
U
0.18 M T N  
S
ÐP  
S
L
S ÐM S  
0.18 M  
0.18 M  
T
T
L
L
S
S
ÐM  
ÐM  
S
S
N
N
S
S
ÐP  
ÐP  
S
S
A
R
0.18 M  
T
L
S
ÐM  
ÐP  
S
S
N
L
S
S
ÐP  
S
Z
0.18 M T N  
S
ÐM S  
C
H
0.10  
K1  
G
Seating plane  
ÐTÐ  
J
E
G1  
K
0.25  
S T L S ÐM S N S ÐP S  
F
0.18 M  
T
L
S
S
ÐM  
ÐP  
S
S
N
L
S
S
ÐP  
S
0.18 M T N  
ÐM S  
Dim.  
A
Min.  
30.10  
30.10  
4.20  
Max.  
Notes  
Dim.  
U
Min.  
29.21  
1.07  
1.07  
1.07  
Ñ
Max.  
30.35  
30.35  
4.57  
29.36  
1.21  
1.21  
1.42  
0.50  
10°  
B
V
1. Due to space limitations, this case shall be represented by a  
general case outline, rather than one showing all the leads.  
2. Datums ÐLÐ, ÐMÐ, ÐNÐ and ÐPÐ are determined where top of lead  
shoulder exits package body at glass parting line.  
3. Dimension G1, true position to be measured at datum ÐTÐ (seating  
plane).  
4. Dimensions R and U do not include glass protrusion. Allowable  
glass protrusion is 0.25mm per side.  
5. Dimensions and tolerancing per ANSI Y 14.5M, 1982.  
6. All dimensions in mm.  
C
W
X
E
2.29  
2.79  
F
0.33  
0.53  
Y
G
H
1.27 BSC  
Z
2°  
0.66  
0.51  
0.81  
Ñ
G1  
K1  
Z1  
28.20  
1.02  
2°  
28.70  
Ñ
J
K
0.64  
Ñ
10°  
R
29.21  
29.36  
13  
Figure B-4 84-pin CERQUAD mechanical dimensions  
TPG  
MOTOROLA  
B-4  
MECHANICAL DATA AND ORDERING INFORMATION  
MC68HC11PH8  
Please contact your Motorola Sales Office  
for up-to-date information on the mechanical  
dimensions for this package type.  
13  
Figure B-5 112-pin TQFP mechanical dimensions  
TPG  
MC68HC11PH8  
MECHANICAL DATA AND ORDERING INFORMATION  
MOTOROLA  
B-5  
B.3  
Ordering Information  
Use the information in Table B-1 to specify the appropriate device type when placing an order.  
Table B-1 Ordering information  
Package Temperature  
Description  
Frequency  
MC order number  
3MHz  
4MHz  
MC68HC11PH8CFN3  
MC68HC11PH8CFN4  
Custom ROM  
84-pin  
PLCC  
3MHz  
4MHz  
MC68S11PH8CFN3  
MC68S11PH8CFN4  
Ð40 to +85°C Custom ROM, with security feature  
OTPROM (with security feature)  
3MHz  
4MHz  
MC68S711PH8CFN3  
MC68S711PH8CFN4  
3MHz  
4MHz  
MC68HC11PH8CPV3  
MC68HC11PH8CPV4  
Custom ROM  
112-pin  
TQFP  
3MHz  
4MHz  
MC68S11PH8CPV3  
MC68S11PH8CPV4  
Ð40 to +85°C Custom ROM, with security feature  
OTPROM (with security feature)  
3MHz  
4MHz  
MC68S711PH8CPV3  
MC68S711PH8CPV4  
84-pin  
CERQUAD  
3MHz  
4MHz  
MC68S711PH8CFS3  
MC68S711PH8CFS4  
Ð40 to +85°C  
EPROM (with security feature)  
13  
TPG  
MOTOROLA  
B-6  
MECHANICAL DATA AND ORDERING INFORMATION  
MC68HC11PH8  
C
DEVELOPMENT SUPPORT  
The following information provides a reference to development tools for the M68HC11 family of  
microcontrollers. For more detailed information please refer to the appropriate system manual.  
Table C-1 M68HC11 development tools  
Evaluation  
boards  
Evaluation  
modules  
Devices  
Evaluation systems/kits Programmer boards  
M68SPGMR11  
MC68HC11PH8,  
MC68HC711PH8  
Ñ
M68EM11PH8  
Ñ
Note:  
Target cables for the evaluation module should be ordered separately.  
C.1  
EVS — Evaluation system  
The EVS is an economical tool for designing, debugging and evaluating target systems based on  
the MC68HC11PH8 and MC68HC711PH8 device types. The two printed circuit boards that  
comprise the EVS are the M68EM11PH8 emulator module and the M68PFB11KIT platform board.  
The main features of the EVS are as follows:  
Monitor/debugger firmware  
Single-line assembler/disassembler  
Host computer download capability  
Dual memory maps:  
64Kbyte monitor map that includes 16Kbytes of monitor EPROM  
MC68HC711PH8 user map that includes 64Kbytes of emulation RAM  
MCU extension I/O port for single chip, expanded and special test operating modes  
RS-232C terminal and host I/O ports  
14  
Logic analyser connector  
TPG  
MC68HC11PH8  
DEVELOPMENT SUPPORT  
MOTOROLA  
C-1  
C.2  
MMDS11 — Motorola modular development system  
The MMDS11 is an emulator system that provides a bus state analyser and real-time memory  
windows. The unit’s integrated design environment includes an editor, an assembler, user  
interface and source-level debug. A complete MMDS11 consists of:  
A station module — the metal MMDS11 enclosure, containing the control board and the  
internal power supply. Most system cables connect to the MMDS11 station module. (The cable  
to an optional target system, however, runs through an aperture in the station module  
enclosure to connect directly to the emulator module).  
An emulator module (EM) — such as the EM11PH8: a printed circuit board that enables  
system functionality for a specific set of MCUs. The EM fits into the station module through a  
sliding panel in the enclosure top. The EM has a connector for the target cable.  
Two logic clip cable assemblies — twisted pair cables that connect the station module to your  
target system, a test fixture, a clock or any other circuitry useful for evaluation or analysis. One  
end of each cable assembly has a moulded connector, which fits into station module pod A or  
pod B. Leads at the other end of the cable terminate in female probe tips. Ball clips come with  
the cables.  
A 9-lead RS-232 serial cable — the cable that connects the station module to the host  
computer’s RS-232 port.  
C.3  
SPGMR11 — Serial programmer system  
The SPGMR11 is an economical tool for programming M68HC11 MCUs. The system consists of  
the M68SPGMR11 unit and a programming module which adapts the SPGMR11 to the  
appropriate MCU and package type. The programming module can be ordered as  
M68PA11PH8FN84 (for the 84-pin package) and M68PA11PH8PV112 (for the 112-pin package).  
14  
TPG  
MC68HC11PH8  
DEVELOPMENT SUPPORT  
MOTOROLA  
C-2  
GLOSSARY  
This section contains abbreviations and specialist words used in this data  
sheet and throughout the industry. Further information on many of the terms  
may be gleaned from Motorola’s M68HC11 Reference Manual,  
M68HC11RM/AD, or from a variety of standard electronics text books.  
$xxxx  
The digits following the ‘$’ are in hexadecimal format.  
The digits following the ‘%’ are in binary format.  
Analog-to-digital (converter).  
%xxxx  
A/D, ADC  
Bootstrap mode  
In this mode the device automatically loads its internal memory from an external  
source on reset and then allows this program to be executed.  
Byte  
Eight bits.  
CCR  
Condition codes register; an integral part of the CPU.  
A ceramic package type, principally used for EPROM and high temperature devices.  
‘0’ — the logic zero state; the opposite of ‘set’.  
CERQUAD  
Clear  
CMOS  
Complementary metal oxide semiconductor. A semiconductor technology chosen for  
its low power consumption and good noise immunity.  
COP  
Computer operating properly. aka ‘watchdog’. This circuit is used to detect device  
runaway and provide a means for restoring correct operation.  
CPU  
Central processing unit.  
D/A, DAC  
EEPROM  
EPROM  
Digital-to-analog (converter).  
Electrically erasable programmable read only memory. aka ‘EEROM’.  
Erasable programmable read only memory. This type of memory requires exposure  
to ultra-violet wavelengths in order to erase previous data. aka ‘PROM’.  
ESD  
Electrostatic discharge.  
Expanded mode  
In this mode the internal address and data bus lines are connected to external pins.  
This enables the device to be used in much more complex systems, where there is a  
need for external memory for example.  
EVS  
Evaluation system. One of the range of platforms provided by Motorola for evaluation  
and emulation of their devices.  
TPG  
MC68HC11PH8  
GLOSSARY  
MOTOROLA  
i
HCMOS  
High-density complementary metal oxide semiconductor. A semiconductor  
technology chosen for its low power consumption and good noise immunity.  
I/O  
Input/output; used to describe a bidirectional pin or function.  
Input capture  
(IC) This is a function provided by the timing system, whereby an external event is  
‘captured’ by storing the value of a counter at the instant the event is detected.  
Interrupt  
This refers to an asynchronous external event and the handling of it by the MCU.The  
external event is detected by the MCU and causes a predetermined action to occur.  
IRQ  
Interrupt request. The overline indicates that this is an active-low signal format.  
A kilo-byte (of memory); 1024 bytes.  
Liquid crystal display.  
K byte  
LCD  
LSB  
Least significant byte.  
M68HC11  
MCU  
Motorola’s family of advanced 8-bit MCUs.  
Microcontroller unit.  
MI BUS  
Motorola interconnect bus. A single wire, medium speed serial communications  
protocol.  
MSB  
Most significant byte.  
Half a byte; four bits.  
Non-return to zero.  
Nibble  
NRZ  
Opcode  
The opcode is a byte which identifies the particular instruction and operating mode to  
the CPU. See also: prebyte, operand.  
Operand  
The operand is a byte containing information the CPU needs to execute a particular  
instruction.There may be from 0 to 3 operands associated with an opcode. See also:  
opcode, prebyte.  
Output compare  
(OC) This is a function provided by the timing system, whereby an external event is  
generated when an internal counter value matches a predefined value.  
PLCC  
PLL  
Plastic leaded chip carrier package.  
Phase-locked loop circuit. This provides a method of frequency multiplication, to  
enable the use of a low frequency crystal in a high frequency circuit.  
Prebyte  
This byte is sometimes required to qualify an opcode, in order to fully specify a  
particular instruction. See also: opcode, operand.  
Pull-down, pull-up  
PWM  
These terms refer to resistors, sometimes internal to the device, which are  
permanently connected to either ground or V  
.
DD  
Pulse width modulation.This term is used to describe a technique where the width of  
the high and low periods of a waveform is varied, usually to enable a representation  
of an analog value.  
QFP  
Quad flat pack package.  
TPG  
MOTOROLA  
ii  
GLOSSARY  
MC68HC11PH8  
RAM  
Random access memory. Fast read and write, but contents are lost when the power  
is removed.  
RFI  
Radio frequency interference.  
Real-time interrupt.  
RTI  
ROM  
Read-only memory. This type of memory is programmed during device manufacture  
and cannot subsequently be altered.  
RS-232C  
SAR  
A standard serial communications protocol.  
Successive approximation register.  
SCI  
Serial communications interface.  
Set  
‘1’ — the logic one state; the opposite of ‘clear’.  
Silicon glen  
An area in the central belt of Scotland, so called because of the concentration of  
semiconductor manufacturers and users found there.  
Single chip mode  
In this mode the device functions as a self contained unit, requiring only I/O devices  
to complete a system.  
SPI  
Serial peripheral interface.  
Test mode  
TTL  
This mode is intended for factory testing.  
Transistor-transistor logic.  
UART  
Universal asynchronous receiver transmitter.  
Voltage controlled oscillator.  
see ‘COP’.  
VCO  
Watchdog  
Wired-OR  
A means of connecting outputs together such that the resulting composite output  
state is the logical OR of the state of the individual outputs.  
Word  
XIRQ  
Two bytes; 16 bits.  
Non-maskable interrupt request. The overline indicates that this has an active-low  
signal format.  
TPG  
MC68HC11PH8  
GLOSSARY  
MOTOROLA  
iii  
THIS PAGE INTENTIONALLY LEFT BLANK  
TPG  
MOTOROLA  
iv  
GLOSSARY  
MC68HC11PH8  
INDEX  
In this index numeric entries are placed first; page references in italics indicate that the reference  
is to a figure.  
16-bit PWM 8-28  
4XCLK 2-9 2-10  
4XOUT pin 2-6  
analog-to-digital converter - see A/D  
AUTO - bit in PLLCR 2-9  
,
8-bit modulus timers 8-35  
block diagram 8-36  
clock select 8-37  
interrupt source resolution 10-25  
reset 10-9  
T8ACR — 8-bit modulus timer A control reg. 8-38  
T8ADR — 8-bit modulus timer A data reg. 8-38  
T8BCR — 8-bit modulus timer B control reg. 8-39  
T8BDR — 8-bit modulus timer B data reg. 8-39  
T8CCR — 8-bit modulus timer C control reg. 8-40  
T8CDR — 8-bit modulus timer C data reg. 8-40  
B
baud rates  
bootloader 3-2  
SCI 5-6  
BCS - bit in PLLCR 2-9  
biphase coding 6-1  
block diagrams  
,
6-3  
8-bit modulus timers 8-36  
A/D 9-2  
MC68HC(7)11PH8 1-3  
MI BUS 6-5  
PLL 2-6  
pulse accumulator 8-24  
PWM 8-29  
A
A/D 9-1  
accuracy of conversion 4-6  
ADCTL — A/D control and status reg. 9-8  
ADR1–ADR4 — A/D converter results reg. 9-10  
block diagram 9-2  
SCI 5-3  
SCI baud rate 5-1  
SPI 7-2  
timer 8-7  
channels 9-7  
charge pump 9-3  
clocks 9-4  
conversion 9-3  
input pin 9-3  
multiple-channel operation 9-8  
multiplexer 9-2 9-7  
,
9-9  
timer clock divider chains 8-5 8-6  
,
bootloader 3-2  
boundary conditions, PWM 8-34  
BPPUE - bit in PPAR 4-11  
,
3-4 3-5  
,
,
9-4  
,
9-4,  
9-5  
,
9-8  
9-9  
BPROT — Block protect reg. 3-21  
BPRT[5:0] - bits in BPROT 3-21  
BRST - bit in SCBDH 5-6  
BSPL - bit in SCBDH 5-6  
,
,
OPTION — System configuration options reg. 1 9-5  
overview 9-1  
BTST - bit in SCBDH 5-6  
pins 9-1  
reset 10-10  
BULKP - bit in BPROT 3-21  
BWC - bit in PLLCR 2-10  
single-channel operation 9-7  
STOP mode 9-10  
bypassing 2-2 2-7  
BYTE - bit in PPROG 3-26  
,
synchronisation 9-4  
WAIT mode 9-10  
accumulators 11-2  
C
ADCTL — A/D control and status reg. 9-8  
addressing modes 11-7  
address-mark wakeup 5-4  
ADPU - bit in OPTION 9-5  
ADR1–ADR4 — A/D converter results reg. 9-10  
C-bit in CCR 11-5  
CCF - bit in ADCTL 9-8  
CCR — condition code reg. 11-4  
TPG  
MC68HC11PH8  
INDEX  
MOTOROLA  
v
CD–CA - bits in ADCTL 9-9  
CFORC — Timer compare force reg. 8-12  
charge pump, A/D 9-3  
D
DAC 9-3  
CLK4X - bit in CONFIG 3-13  
data format, SCI 5-2  
data types 11-6  
clock monitor 10-4  
clock rate, MI BUS 6-7  
clocks  
,
10-5  
6-9  
,
DDA[7:0] - bits in DDRA 4-2  
DDB[7:0] - bits in DDRB 4-3  
DDC[7:0] - bits in DDRC 4-4  
DDD[5:0] - bits in DDRD 4-5  
DDF[7:0] - bits in DDRF 4-7  
DDG[7:0] - bits in DDRG 4-8  
DDH[7:0] - bits in DDRH 4-9  
DDRA — Data direction reg. for port A 4-2  
DDRB — Data direction reg. for port B 4-3  
DDRC — Data direction reg. for port C 4-4  
DDRD — Data direction reg. for port D 4-5  
DDRF — Data direction reg. for port F 4-7  
DDRG — Data direction reg. for port G 4-8  
DDRH — Data direction reg. for port H 4-9  
development tools C-1  
4XCLK 2-9  
A/D 9-4  
,
2-10  
CMOS compatible 2-3  
2-3 3-19  
E
,
monitor reset 10-4  
PWM 8-30  
,
10-5  
SPI 7-4  
ST4XCK 6-7  
stretching 3-19  
timer divider chains 8-5  
CME - bit in OPTION 10-5  
coherency, timer 8-12  
,
8-6  
CON12 - bit in PWCLK 8-28  
CON34 - bit in PWCLK 8-28  
concatenation, of PWM 8-28  
DIR - direct addressing mode 11-7  
DISCP - bit in PWEN 8-32  
CONFIG — System configuration reg. 3-12  
programming 3-29  
configuration 3-12  
DISE - bit in OPT2 3-20  
DLY - bit in OPTION 3-17  
mask option 3-17  
duty cycle, PWM 8-34  
conversion, A/D 9-3  
COP 8-2 8-23  
,
9-4  
,
9-4 9-5  
,
,
DWOM - bit in SPCR 7-6  
CONFIG — Configuration control reg. 10-6  
COPRST — Arm/reset COP timer circuitry reg. 10-3  
enable 10-7  
OPTION — System configuration options reg. 1 10-4  
E
rates 10-3  
reset 10-2  
timeout 10-2  
,
10-5  
10-3  
E clock pin 2-5  
,
,
10-9  
EDGxA and EDGxB - bits in TCTL2 8-9  
EELAT - bit in PPROG 3-26  
EEON - bit in CONFIG 3-14  
EEPGM - bit in PPROG 3-26  
EEPROM 3-25  
erased state ($FF) 3-25  
erasing 3-27 3-28  
COPRST — Arm/reset COP timer circuitry reg. 10-3  
corruption  
of A/D 4-6  
of memory 2-3  
3-28  
CPHA - bit in SPCR 7-3  
CPOL - bit in SPCR 7-6  
CPU 11-1  
,
7-4 7-7  
,
PPROG — EEPROM programming control reg. 3-25  
security 3-30  
accumulators (A, B and D) 11-2  
architecture 11-1  
EEx - bits in INIT2 3-16  
eight bit modulus timers - see 8-bit modulus timers  
ELAT - bit in EPROG 3-23  
EPGM - bit in EPROG 3-24  
EPROG — EPROM programming control reg. 3-23  
CCR — condition code reg. 11-4  
index registers (IX, IY) 11-2  
program counter (PC) 11-4  
programming model 11-1  
registers 11-1  
EPROM 3-5  
,
3-23 3-25  
device 1-1  
reset 10-8  
EPROG — EPROM programming control reg. 3-23  
erased state ($FF) 3-23  
programming 3-24  
CR[1:0] - bits in OPTION 10-5  
CSA[2:0] - bits in T8ACR 8-38  
CSB[2:0] - bits in T8BCR 8-39  
CSC[2:0] - bits in T8CCR 8-40  
CSEL - bit in OPTION 9-6  
CWOM - bit in OPT2 4-12  
ERASE - bit in PPROG 3-26  
erased state  
EEPROM ($FF) 3-25  
EPROM ($FF) 3-23  
error detection, SCI 5-5  
ESD protection A-1  
EVEN - bit in PPROG 3-25  
event counter - see pulse accumulator  
TPG  
MOTOROLA  
vi  
INDEX  
MC68HC11PH8  
EVS — Evaluation system C-1  
EXCOL - bit in EPROG 3-24  
EXROW - bit in EPROG 3-24  
EXT4X - bit in OPT2 3-20  
EXTAL pin 2-3  
interrupts  
8-bit modulus timers 10-25  
I-bit 10-16 11-5  
,
illegal opcode trap 10-16  
IRQ 2-12  
maskable 10-17  
multiple sources 2-12  
non-maskable 10-16  
priorities 10-11  
F
priority resolution 10-21  
FCME - bit in OPTION 10-5  
FE - bit in SCSR1 5-11  
SCI 5-14 10-24  
,
sensitivity 2-12  
stacking 10-15  
SWI 10-16  
FE2 - bit in S2SR1 5-16  
FOC[1:5] - bits in CFORC 8-13  
FPPUE - bit in PPAR 4-11  
free-running counter 8-1  
FREEZ - bit in CONFIG 3-13  
triggering 2-12  
types 10-15  
wired-OR 2-12  
X-bit 10-16  
,
11-6  
10-16  
XIRQ 2-12  
,
IRQ pin 2-12  
G
IRQE - bit in OPTION 3-17  
IRVNE - bit in OPT2 3-19  
GPPUE - bit in PPAR 4-11  
GWOM - bit in SP2CR 2-17  
J
H
junction temperature, chip A-2  
H-bit in CCR 11-6  
HPPUE - bit in PPAR 4-11  
HPRIO — Highest priority I-bit interrupt & misc. reg. 3-11  
L
LCD driver interface 7-1  
LCD module 2-18  
I
clock source 8-23  
I/O, on reset 10-8  
LCDBP - LCD backplane 2-18  
LCDR — LCD control and data reg. 2-18  
reset 10-10  
I4/05 - bit in PACTL 8-10 8-25  
I4/O5F - bit in TFLG1 8-16  
I4/O5I - bit in TMSK1 8-15  
,
LCD[7:4] - bits in LCDR 2-18  
LCDBP - LCD backplane 2-18  
LCDCK - bit in LCDR 2-19  
LCDE - bit in LCDR 2-19  
LCDR — LCD control and data reg. 2-18  
LIR pin 2-13  
LIRDV - bit in OPT2 3-18  
LOOPS - bit in SCCR1 5-7  
LOPS2 - bit in S2CR1 5-16  
low power modes  
I-bit in CCR 10-16 11-5  
,
IC1F–IC3F - bits in TFLG1 8-16  
IC1I–IC3I - bits in TMSK1 8-15  
IDLE - bit in SCSR1 5-10  
IDLE2 - bit in S2SR1 5-16  
idle-line wakeup 5-4  
IEH[7:0] - bits in WOIEH 4-10  
ILIE - bit in SCCR2 5-9  
ILIE2 - bit in S2CR2 5-16  
illegal opcode trap 10-16  
ILT - bit in SCCR1 5-8  
RAM 3-5  
stand-by connections 2-13  
stand-by voltage 2-13  
STOP 10-18  
ILT2 - bit in S2CR1 5-16  
IMM - immediate addressing mode 11-7  
IND, X/Y - indexed addressing modes 11-8  
index registers (IX, IY) 11-2  
INH - inherent addressing mode 11-8  
INIT — RAM and I/O mapping reg. 3-14  
INIT2 — EEPROM mapping and MI BUS delay reg. 6-8  
initialization 3-12  
WAIT 10-17  
low voltage inhibit circuit 2-3  
LSBF - bit in OPT2 7-9  
LVI 2-3  
input capture 8-8  
instruction set 11-8  
internal oscillator 3-17  
,
9-4  
,
9-5 A-16  
,
TPG  
MC68HC11PH8  
INDEX  
MOTOROLA  
vii  
M
N
M - bit in SCCR1 5-8  
N-bit in CCR 11-5  
M2 - bit in S2CR1 5-16  
M2DL1:M2DL0 - bits in INIT2 6-8  
Manchester coding 6-1  
mask options 1-2  
NF - bit in SCSR1 5-11  
NF2 - bit in S2SR1 5-16 6-12  
,
,
6-2  
,
6-3  
NMI 2-12  
NOCOP - bit in CONFIG 10-7  
noise 2-2 2-4 2-5 2-7  
,
10-16  
oscillator buffer type 2-4  
PLL crystal frequency 2-7  
ROMON bit 3-14  
,
,
,
non-maskable interrupt 2-12  
NOSEC - bit in CONFIG 3-31  
security 3-30  
stabilization delay timing 3-17  
maximum ratings A-1  
MBE - bit in EPROG 3-23  
MC68HC711PH8 1-1  
MCS - bit in PLLCR 2-10  
MDA - bit in HPRIO 3-11  
memory  
O
OC1D — Output compare 1 data reg. 8-13  
OC1D[7:3] - bits in OC1D 8-13  
OC1F–OC4F - bits in TFLG1 8-16  
OC1I–OC4I - bits in TMSK1 8-15  
OC1M — Output compare 1 mask reg. 8-13  
OC1M[7:3] - bits in OC1M 8-13  
ODD - bit in PPROG 3-25  
OL[2:5] - bits in TCTL1 8-14  
OM[2:5] - bits in TCTL1 8-14  
operating modes 3-1  
corruption of 2-3  
EEPROM 3-25  
3-28  
EPROM 3-5  
map 3-3  
,
3-23 3-25  
mapping 3-4  
protection 3-21  
RAM 3-4  
,
3-14  
3-16  
,
3-30  
baud rates 3-2  
RAM stand-by connections 2-13  
register map 3-5  
ROM 3-5  
bootstrap 3-2  
expanded 3-1  
HPRIO register 3-11  
stretch external access 3-19  
memory map, on reset 10-8  
selection of 2-13  
single chip 3-1  
,
3-10  
MI BUS 1-2  
block diagram 6-5  
clock rate 6-7 6-9  
,
6-1  
STOP 3-5  
test 3-2  
,
10-18  
,
VSTBY 3-5  
WAIT 10-17  
error detection 6-4  
INIT2 — EEPROM mapping and MI BUS delay reg.  
OPT2 — System configuration options reg. 2 3-18  
OPTION — System configuration options reg. 1 9-5  
OR - bit in SCSR1 5-11  
OR2 - bit in S2SR1 5-16  
ordering information B-6  
oscillator 2-3  
6-8  
,
10-4  
interface 6-6  
Manchester coding 6-1  
pins 6-1  
,
6-3  
,
6-11  
pull field 6-3  
push field 6-2  
connections 2-4  
S2BDH, S2BDL — MI BUS clock rate control reg. 6-9  
S2CR1 — MI BUS control reg. 1 6-9  
S2CR2 — MI BUS2 control reg. 2 6-10  
S2DRL — MI BUS2 data reg. 6-12  
S2SR1 — MI BUS status reg. 1 6-11  
S2SR2 — MI BUS2 status reg. 2 6-12  
ST4XCK clock 6-7  
output compare 8-11  
overflow bit in CCR 11-5  
P
packages  
timing 6-2  
CERQUAD B-4  
options 2-1  
PLCC B-3  
thermal characteristics A-1  
TQFP B-5  
MIE2 - bit in S2CR1 5-16  
MISO 7-4  
,
6-9  
MODA/LIR pin 2-13  
MODB/VSTBY pin 2-13  
MODF - bit in SPSR 7-8  
modulus timers - see 8-bit modulus timers  
MOSI 7-4  
PACNT — Pulse accumulator count reg. 8-26  
PACTL — Pulse accumulator control reg. 8-25  
PAEN - bit in PACTL 8-25  
PAIF - bit in TFLG2 8-27  
PAII - bit in TMSK2 8-27  
MSTR - bit in SPCR 7-5  
MULT - bit in ADCTL 9-9  
multiplexer, A/D 9-2 9-7  
,
7-6  
,
PAMOD - bit in PACTL 8-25  
multiplication factor, PLL 2-11  
TPG  
MOTOROLA  
viii  
INDEX  
MC68HC11PH8  
PAOVF - bit in TFLG2 8-26  
PAOVI - bit in TMSK2 8-26  
PAREN - bit in CONFIG 4-13  
PCKA[2:1] - bits in PWCLK 8-30  
PCKB[3:1] - bits in PWCLK 8-30  
PCLK[2:1] - bits in PWPOL 8-31  
PCLK[4:3] - bits in PWPOL 8-31  
PE - bit in SCCR1 5-8  
PE2 - bit in S2CR1 5-16  
PEDGE - bit in PACTL 8-25  
PF - bit in SCSR1 5-11  
PF2 - bit in S2SR1 5-16  
phase-locked loop - see PLL  
pinouts  
PORTH — Port H data reg. 4-9  
ports  
A (Timer) 2-14  
B (A[15:8], LCD) 2-14  
C (D[7:0]) 2-16 4-4  
D (SCI1, SPI1) 2-16  
,
4-2  
,
4-3  
,
,
4-5  
DDRA — Data direction reg. for port A 4-2  
DDRB — Data direction reg. for port B 4-3  
DDRC — Data direction reg. for port C 4-4  
DDRD — Data direction reg. for port D 4-5  
DDRF — Data direction reg. for port F 4-7  
DDRG — Data direction reg. for port G 4-8  
DDRH — Data direction reg. for port H 4-9  
E (A/D) 2-17  
F (A[7:0]) 2-17  
G (R/W, SCI2, SPI2, LCD) 2-17  
,
4-6  
CERQUAD 2-1  
PLCC 2-1  
TQFP 2-2  
,
4-7  
,
4-8  
4-9  
H (PWM, modulus timers) 2-18  
PORTA — Port A data reg. 4-2  
PORTB — Port B data reg. 4-3  
PORTC — Port C data reg. 4-4  
PORTD — Port D data reg. 4-5  
PORTE — Port E data reg. 4-6  
PORTF — Port F data reg. 4-7  
PORTG — Port G data reg. 4-8  
PORTH — Port H data reg. 4-9  
signals 2-14  
,
pins  
4XOUT 2-6  
E clock 2-5  
EXTAL 2-3  
IRQ 2-12  
LIR 2-13  
MODA/LIR 2-13  
MODB/VSTBY 2-13  
OC1, special features 8-4  
R/W 2-13  
,
8-11  
power-on reset - see POR  
RESET 2-3  
VDD AD, VSS AD 2-2  
VDD, VSS 2-2  
,
10-2  
PPAR — Port pull-up assignment reg. 4-11  
PPOL[4:1] - bits in PWPOL 8-31  
PPROG — EEPROM programming control reg. 3-25  
VDDL, VDDR, VSSL, VSSR 2-2  
VDDSYN 2-6  
VPPE 2-12  
VRH, VRL 2-13  
VSTBY 2-13  
PR[1:0] - bits in TMSK2 3-22  
PRB - bit in T8BCR 8-39  
PRC - bit in T8CCR 8-40  
prebyte 11-7  
,
8-17  
prescaler, PWM 8-30  
XFC 2-6  
XIRQ/VPPE 2-12  
XTAL 2-3  
priorities, resets and interrupts 10-11  
program counter (PC) 11-4  
programming  
,
10-12  
PLL 2-6  
CONFIG 3-29  
bandwidth 2-7  
EEPROM 3-25  
block diagram 2-6  
EPROM 3-24  
changing frequency 2-8  
protection  
crystal frequency mask option 2-7  
multiplication factor 2-11  
PLLCR — PLL control reg. 2-9  
synchronisation 2-8  
SYNR — Synthesizer program reg. 2-11  
VCOOUT 2-9  
of memory 3-21  
registers 3-10  
,
3-30  
PSEL[4:0] - bits in HPRIO 10-12  
PT - bit in SCCR1 5-8  
PT2 - bit in S2CR1 6-10  
PTCON - bit in BPROT 3-21  
pull field 6-3  
PLLCR — PLL control reg. 2-9  
PLLCR — PLL control register 2-9  
PLLON - bit in PLLCR 2-9  
POR 10-1  
pull-ups 4-11  
pulse accumulator 8-1  
,
8-23  
block diagram 8-24  
stabilization delay 10-1  
PACNT — Pulse accumulator count reg. 8-26  
PACTL — Pulse accumulator control reg. 8-25  
reset 10-9  
PORTA — Port A data reg. 4-2  
PORTB — Port B data reg. 4-3  
PORTC — Port C data reg. 4-4  
PORTD — Port D data reg. 4-5  
PORTE — Port E data reg. 4-6  
PORTF — Port F data reg. 4-7  
PORTG — Port G data reg. 4-8  
TFLG2 — Timer interrupt flag 2 reg. 8-26  
TMSK2 — Timer interrupt mask 2 reg. 8-26  
pulse-width modulation - see PWM  
push field 6-2  
PWCLK — PWM clock prescaler and 16-bit select reg. 8-28  
TPG  
MC68HC11PH8  
INDEX  
MOTOROLA  
ix  
PWCNT1–4 — PWM timer counter reg. 1 to 4 8-33  
PWDTY1–4 — PWM timer duty cycle reg. 1 to 4 8-34  
PWEN — PWM timer enable reg. 8-32  
PWEN[4:1] - bits in PWEN 8-32  
PWM 8-27  
resets (continued)  
effect on LCD module 10-10  
effect on memory map 10-8  
effect on pulse accumulator 10-9  
effect on RTI 10-9  
16-bit operation 8-28  
effect on SCI 10-9  
block diagram 8-29  
effect on SPI 10-10  
boundary conditions 8-34  
clock select 8-30  
effect on system 10-10  
effect on timer 10-8  
duty cycle 8-27  
periods 8-27  
pins 8-27  
PWCLK — PWM clock prescaler and 16-bit select reg.  
8-28  
PWCNT1–4 — PWM timer counter reg. 1 to 4 8-33  
PWDTY1–4 — PWM timer duty cycle reg. 1 to 4 8-34  
PWEN — PWM timer enable reg. 8-32  
PWPER1–4 — PWM timer period reg. 1 to 4 8-33  
PWPOL — PWM timer polarity & clock source select  
reg. 8-31  
,
8-34  
effects of 10-7  
external 10-2  
HPRIO — Highest priority I-bit interrupt and misc. reg.  
10-12  
power-on, POR 10-1  
priorities 10-11  
processing flow 10-19  
RESET pin 10-2  
resetting the COP watchdog 10-3  
RFI 2-4 2-5  
,
RIE - bit in SCCR2 5-9  
RIE2 - bit in S2CR2 5-16  
ROM 3-5  
PWSCAL — PWM timer prescaler reg. 8-31  
PWPER1–4 — PWM timer period reg. 1 to 4 8-33  
PWPOL — PWM timer polarity & clock source select reg.  
8-31  
,
6-10  
ROMAD - bit in CONFIG 3-12  
ROMON - bit in CONFIG 3-14  
mask option 3-14  
PWSCAL — PWM timer prescaler reg. 8-31  
ROW - bit in PPROG 3-26  
RTI 8-2 8-19  
,
PACTL — Pulse accumulator control reg. 8-22  
rates 8-19  
reset 10-9  
R
R/T[7:0] - bits in S2DRL 5-17  
,
6-12  
TFLG2 — Timer interrupt flag reg. 2 8-21  
TMSK2 — Timer interrupt mask reg. 2 8-20  
RTIF - bit in TFLG2 8-21  
RTII - bit in TMSK2 8-20  
RTR[1:0] - bits in PACTL 8-22  
R/T[7:0] - bits in SCDRL 5-12  
R/W pin 2-13  
R8 - bit in SCDRH 5-12  
R8B - bit in S2DRH 5-17  
RAF - bit in SCSR2 5-12  
RWU - bit in SCCR2 5-4 5-9  
,
RAF2 - bit in S2SR2 5-17  
RAM 3-4  
,
6-12  
RWU2 - bit in S2CR2 5-16  
data retention 3-5  
security 3-30  
RAM[3:0] - bit in INIT 3-14  
ratiometric conversions 9-5  
RBOOT - bit in HPRIO 3-11  
RDRF - bit in SCSR1 5-10  
S
S2B[12:0] - bits in S2BDH/L 6-9  
S2BDH, S2BDL — MI BUS clock rate control reg. 6-9  
S2BDH, S2BDL — SCI2 baud rate control reg. 5-15  
S2CR1 — MI BUS control reg. 1 6-9  
S2CR1 — SCI2 control reg. 1 5-16  
S2CR2 — MI BUS2 control reg. 2 6-10  
S2CR2 — SCI2 control reg. 2 5-16  
S2DRH, S2DRL — SCI2 data high/low reg. 5-17  
S2DRL — MI BUS2 data reg. 6-12  
S2SR1 — MI BUS status reg. 1 6-11  
S2SR1 — SCI2 status reg. 1 5-16  
S2SR2 — MI BUS2 status reg. 2 6-12  
S2SR2 — SCI2 status reg. 2 5-17  
S-bit in CCr 11-6  
RDRF2 - bit in S2SR1 5-16  
RE - bit in SCCR2 5-9  
,
6-11  
RE2 - bit in S2CR2 5-16  
,
6-10  
real-time interrupt - see RTI  
receiver flags, SCI 5-13  
REG[3:0] - bit in INIT 3-15  
REL - relative addressing mode 11-8  
RESET pin 2-3  
resets  
circuit 2-3  
clock monitor 10-4  
COP 10-2 10-3  
effect on 8-bit modulus timers 10-9  
effect on A/D 10-10  
,
10-5  
,
SBK - bit in SCCR2 5-9  
SBK2 - bit in S2CR2 5-16 6-10  
,
effect on COP 10-9  
effect on CPU 10-8  
SBR[12:0] - bits in SCBDH/L 5-6  
SCAN - bit in ADCTL 9-8  
effect on I/O 10-8  
SCBDH, SCBDL — SCI baud rate control reg. 5-6  
TPG  
MOTOROLA  
INDEX  
MC68HC11PH8  
x
SCCR1 — SCI control reg. 1 5-7  
SCCR2 — SCI control reg. 2 5-9  
SCDRH, SCDRL — SCI data high/low reg. 5-12  
SCI 5-1  
SPI (continued)  
SPSR — Serial peripheral status reg. 7-7  
SS 7-4  
transfer formats 7-2 7-3  
,
baud rate 5-1  
,
5-6  
SPI2 - see also SPI 7-10  
block diagram 5-3  
data format 5-2  
SPIE - bit in SPCR 7-5  
SPIF - bit in SPSR 7-7  
,
7-6  
error detection 5-5  
interrupt source resolution 5-14  
pins 5-1  
receive operation 5-2  
reset 10-9  
SPR1 and SPR0 - bits in SPCR 7-7  
SPR2 - bit in OPT2 7-9  
SPSR — Serial peripheral status reg. 7-7  
ST4XCK clock 6-7  
,
10-24  
stack pointer (SP) 11-2  
SCBDH, SCBDL — SCI baud rate control reg. 5-6  
SCCR1 — SCI control reg. 1 5-7  
SCCR2 — SCI control reg. 2 5-9  
SCDRH, SCDRL — SCI data high/low reg. 5-12  
SCSR1 — SCI status reg. 1 5-10  
SCSR2 — SCI status reg. 2 5-12  
status flags 5-13  
stacking operations 11-3  
stand-by voltage 2-13  
status flags, SCI 5-13  
STOP mode 3-5 10-18  
,
disabling 11-6  
stabilization delay 3-17  
STRCH - bit in OPT2 3-19  
stretch, external access 3-19  
STRX - bit in INIT2 3-16  
SWI 10-16  
synchronisation, A/D 9-4  
SYNR — Synthesizer program reg. 2-11  
SYNX[1:0] - bits in SYNR 2-11  
SYNY[5:0] - bits in SYNR 2-11  
system reset 10-10  
transmit operation 5-2  
wakeup 5-4  
SCI2 - see also SCI 5-15  
SCK 7-4  
SCSR1 — SCI status reg. 1 5-10  
SCSR2 — SCI status reg. 2 5-12  
security 3-30  
mask option 3-30  
NOSEC bit 3-31  
sensitivity, of interrupts 2-12 3-17  
,
serial communications interface - see SCI  
serial peripheral interface - see SPI  
slave select (SS) 7-4  
T
T16EN - bit in PLLCR 8-4  
slow memory 3-19  
T8 - bit in SCDRH 5-12  
SMOD - bit in HPRIO 3-11  
software interrupt (SWI) 10-16  
SP2CR — SPI2 control reg. 7-11  
SP2DR — SPI2 data reg. 7-11  
SP2OPT — SPI2 control options reg. 7-11  
SP2SR — SPI2 status reg. 7-11  
SPCR — Serial peripheral control reg. 7-6  
SPDR — SPI data reg. 7-8  
SPE - bit in SPCR 7-6  
T8ACR — 8-bit modulus timer A control reg. 8-38  
T8ADR — 8-bit modulus timer A data reg. 8-38  
T8AF - bit in T8ACR 8-38  
T8AI - bit in T8ACR 8-38  
T8B - bit in S2DRL 5-17  
T8BCR — 8-bit modulus timer B control reg. 8-39  
T8BDR — 8-bit modulus timer B data reg. 8-39  
T8BF - bit in T8BCR 8-39  
T8BI - bit in T8BCR 8-39  
SPI 7-1  
T8CCR — 8-bit modulus timer C control reg. 8-40  
T8CDR — 8-bit modulus timer C data reg. 8-40  
T8CF - bit in T8CCR 8-40  
T8CI8 - bit in T8CCR 8-40  
TC - bit in SCSR1 5-10  
TC2 - bit in S2SR1 5-16  
TCIE - bit in SCCR2 5-9  
TCIE2 - bit in S2CR2 5-16  
TCNT — Timer counter reg. 8-14  
TCTL1 — Timer control reg. 1 8-14  
TCTL2 — Timer control reg. 2 8-9  
TDRE - bit in SCSR1 5-10  
TDRE2 - bit in S2SR1 5-16  
TE - bit in SCCR2 5-9  
block diagram 7-2  
buffering 7-1 7-8  
,
clock phase 7-3  
clock polarity 7-6  
clock rate 7-4  
errors 7-5  
,
7-7  
master mode 7-6  
MISO 7-4  
MOSI 7-4  
OPT2 — System configuration options reg. 2 7-9  
pins 7-1  
polarity 7-3  
reset 10-10  
SCK 7-4  
signals 7-3  
TE2 - bit in S2CR2 5-16  
test methods A-3  
,
6-10  
SPCR — Serial peripheral control reg. 7-6  
SPDR — SPI data reg. 7-8  
TFLG1 — Timer interrupt flag reg. 1 8-16  
TFLG2 — Timer interrupt flag reg. 2 8-18  
TPG  
MC68HC11PH8  
INDEX  
MOTOROLA  
xi  
TI4/O5 — Timer input capture 4/output compare 5 reg. 8-10  
TIC1–TIC3 — Timer input capture reg. 8-10  
TIE - bit in SCCR2 5-9  
TIE2 - bit in S2CR2 5-16  
time accumulation - see pulse accumulator  
timer 8-1  
W
WAIT mode 2-10 10-17  
,
WAKE - bit in SCCR1 5-8  
WAKE2 - bit in S2CR1 5-16  
wakeup, SCI 5-4  
block diagram 8-7  
CFORC — Timer compare force reg. 8-12  
watchdog - see COP  
WCOL - bit in SPSR 7-8  
WEN - bit in PLLCR 2-10  
wired_OR 2-17  
wired-OR 2-12  
wired-OR interrupt 4-10  
WOIEH — Wired-OR interrupt enable reg. 4-10  
WOMS - bit in SCCR1 5-7  
WOMS2 - bit in S2CR1 2-17  
clock divider chains 8-5  
coherency 8-12  
COP 8-23  
,
8-6  
,
2-16  
,
3-2 4-12  
,
free-running counter 8-1  
input capture 8-8  
OC1, special features 8-4 8-11  
,
OC1D — Output compare 1 data reg. 8-13  
OC1M — Output compare 1 mask reg. 8-13  
output compare 8-11  
,
5-16 6-9  
,
pins 8-4  
prescaler 8-1  
reset 10-8  
X
X-bit in CCR 10-16  
XFC pin 2-6  
,
11-6  
TCNT — Timer counter reg. 8-14  
TCTL1 — Timer control reg. 1 8-14  
TCTL2 — Timer control reg. 2 8-9  
TFLG1 — Timer interrupt flag reg. 1 8-16  
TFLG2 — Timer interrupt flag reg. 2 8-18  
TI4/O5 — Timer input capture 4/output compare 5 reg.  
8-10  
XIRQ 10-16  
XIRQ/VPPE 2-12  
xPPUE - bits in PPAR 4-11  
XTAL pin 2-3  
TIC1–TIC3 — Timer input capture reg. 8-10  
TMSK1 — Timer interrupt mask reg. 1 8-15  
Z
TMSK2 — Timer interrupt mask reg. 2 3-22 8-17  
,
Z-bit in CCR 11-5  
TOC1–TOC4 — Timer output compare reg. 8-12  
TMSK1 — Timer interrupt mask reg. 1 8-15  
TMSK2 — Timer interrupt mask reg. 2 3-22  
TOC1–TOC4 — Timer output compare reg. 8-12  
,
8-17  
TOF - bit in TFLG2 8-18  
TOI - bit in TMSK2 8-17  
,
8-21  
TPWSL - bit in PWEN 8-32  
U
UART 5-1  
V
V-bit in CCR 11-5  
VCOOUT 2-9  
VCOT - bit in PLLCR 2-10  
VDD AD, VSS AD pins 2-2  
VDD pin 2-2  
VDDL, VDDR, VSSL, VSSR pins 2-2  
VDDSYN pin 2-6  
VPPE pin 2-12  
VRH, VRL pins 2-13  
VSS pin 2-2  
VSTBY pin 2-13  
TPG  
MOTOROLA  
xii  
INDEX  
MC68HC11PH8  
INTRODUCTION  
PIN DESCRIPTIONS  
1
2
OPERATING MODES AND ON-CHIP MEMORY  
PARALLEL INPUT/OUTPUT  
3
4
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA INTERCONNECT BUS (MI BUS)  
SERIAL PERIPHERAL INTERFACE  
TIMING SYSTEM  
5
6
7
8
ANALOG-TO-DIGITAL CONVERTER  
RESETS AND INTERRUPTS  
9
10  
11  
A
B
C
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MECHANICAL DATA AND ORDERING INFORMATION  
DEVELOPMENT SUPPORT  
TPG  
INTRODUCTION  
1
2
PIN DESCRIPTIONS  
OPERATING MODES AND ON-CHIP MEMORY  
PARALLEL INPUT/OUTPUT  
3
4
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA INTERCONNECT BUS (MI BUS)  
SERIAL PERIPHERAL INTERFACE  
TIMING SYSTEM  
5
6
7
8
ANALOG-TO-DIGITAL CONVERTER  
RESETS AND INTERRUPTS  
9
10  
11  
A
B
C
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS (STANDARD)  
MECHANICAL DATA AND ORDERING INFORMATION  
DEVELOPMENT SUPPORT  
TPG  
1
2
3
4
5
6
7
8
9
10  
11  
12  
13  
14  
15  
1
2
3
4
5
6
7
8
9
10  
11  
12  
13  
14  
15  
How to reach us:  
Mfax™: RMFAX0@email.sps.mot.com – TOUCHTONE (602) 244-6609  
INTERNET: http://www.mot.com/SPS/  
USA/EUROPE: Motorola Literature Distribution; P.O. Box 5405; Denver, Colorado 80217. 303-675-2140  
JAPAN: Nippon Motorola Ltd.; Tatsumi-SPD-JLDC, Toshikatsu Otsuki, 6F Seibu-Butsuryu-Center,  
3-14-2 Tatsumi Koto-Ku, Tokyo 135, Japan. 81-3-3521-8315  
HONG KONG: Motorola Semiconductors H.K. Ltd.; 8B Tai Ping Industrial Park, 51 Ting Kok Road,  
Tai Po, N.T., Hong Kong. 852-26629298  

相关型号:

MC68S711PH8CPV4

High-density Complementary Metal Oxide Semiconductor (HCMOS) Microcomputer Unit
FREESCALE

MC68S711PH8CPV4

Microcontroller, 8-Bit, OTPROM, 6800 CPU, 4MHz, CMOS, PQFP112, TQFP-112
MOTOROLA

MC68SC302

Passive ISDN Protocol Engine
FREESCALE

MC68SC302PU20

Passive ISDN Protocol Engine
FREESCALE

MC68SEC000

M68000 USERS MANUAL ADDENDUM
MOTOROLA

MC68SEC000AA10

暂无描述
NXP

MC68SEC000AA16

8/16/32 BIT MPU, STATIC
NXP

MC68SEC000AA20

8/16/32 BIT MPU, STATIC
NXP

MC68SEC000AA20R2

8/16/32 BIT MPU, STATIC
NXP

MC68SEC000AE10

8/16/32 BIT MPU, STATIC
NXP

MC68SEC000AE16

8/16/32 BIT MPU, STATIC
NXP

MC68SEC000AE20

8/16/32 BIT MPU, STATIC
NXP