MC68HC705F32FU [FREESCALE]

a member of the M68HC05 family of HCMOS; M68HC05系列HCMOS的一员
MC68HC705F32FU
型号: MC68HC705F32FU
厂家: Freescale    Freescale
描述:

a member of the M68HC05 family of HCMOS
M68HC05系列HCMOS的一员

文件: 总198页 (文件大小:3039K)
中文:  中文翻译
下载:  下载PDF数据表文档文件
MC68HC05F32/D  
Freescale Semiconductor, Inc.  
HC05  
MC68HC05F32  
MC68HC705F32  
TECHNICAL  
DATA  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
INTRODUCTION  
1
2
3
4
5
MODES OF OPERATION AND PIN DESCRIPTIONS  
MEMORY AND REGISTERS  
PARALLEL INPUT/OUTPUT PORTS  
CORE TIMER  
16-BIT PROGRAMABLE TIMER  
DTMF/MELODY GENERATOR  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
A/D CONVERTER  
6
7
8
9
SERIAL PERIPHERAL INTERFACE  
SERIAL COMMUNICATIONS INTERFACE  
PULSE WIDTH MODULATOR  
32 KHZ CLOCK SYSTEM  
10  
11  
12  
13  
14  
15  
16  
17  
18  
A
RESETS AND INTERRUPTS  
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS  
MECHANICAL DATA  
ORDERING INFORMATION  
MC68HC705F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
INTRODUCTION  
1
2
3
4
5
MODES OF OPERATION AND PIN DESCRIPTIONS  
MEMORY AND REGISTERS  
PARALLEL INPUT/OUTPUT PORTS  
CORE TIMER  
16-BIT PROGRAMMABLE TIMER  
DTMF/MELODY GENERATOR  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
A/D CONVERTER  
6
7
8
9
SERIAL PERIPHERAL INTERFACE  
SERIAL COMMUNICATIONS INTERFACE  
PULSE WIDTH MODULATOR  
32 KHZ CLOCK SYSTEM  
10  
11  
12  
13  
14  
15  
16  
17  
18  
A
RESETS AND INTERRUPTS  
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS  
MECHANICAL DATA  
ORDERING INFORMATION  
MC68HC705F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
MC68HC05F32  
MC68HC705F32  
High-density complementary  
metal oxide semiconductor  
(HCMOS) microcontroller unit  
All Trade Marks recognized. This document contains information on new products. Specifications and information herein are  
subject to change without notice.  
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.  
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty,  
representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any  
liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including  
without limitation consequential or incidental damages. “Typical” parameters which may be provided in Motorola data sheets  
and/or specifications can and do vary in different applications and actual performance may vary over time. All operating  
parameters, including “Typicals”, must be validated for each customer application by customer’s technical experts. Motorola  
does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or  
authorized for use as components in systems intended for surgical implant into the body, or other applications intended to  
support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where  
personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or  
unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and  
distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly  
or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim  
alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and  
trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.  
are registered  
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., 1998  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Conventions  
Where abbreviations are used in the text, an explanation can be found in the  
glossary, at the back of this manual. Register and bit mnemonics are defined in the  
paragraphs describing them.  
An overbar is used to designate an active-low signal, eg: RESET.  
Unless otherwise stated, shaded cells in a register diagram indicate that the bit is  
either unused or reserved; ‘u’ is used to indicate an undefined state (on reset).  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
CUSTOMER FEEDBACK QUESTIONNAIRE (MC68HC05F32/D)  
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:  
Comments:  
e–  
❏ ❏ ❏ ❏  
v
4. How easy is it to find the information you are looking for?  
Easy Difficult  
❏ ❏ ❏ ❏  
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  
❏ ❏ ❏ ❏ ❏  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MEMORY AND REGISTERS  
PARALLEL INPUT/OUTPUT PORTS  
CORE TIMER  
–Cuaghslintremo  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
16-BIT PROGRAMMABLE TIMER  
DTMF/MELODY GENERATOR  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
A/D CONVERTER  
SECTION 10 SERIAL PERIPHERAL INTERFACE  
SECTION 11 SERIAL COMMUNICATIONS INTERFACE  
SECTION 12 PULSE WIDTH MODULATOR  
SECTION 13 32 KHZ CLOCK SYSTEM  
SECTION 14 RESETS AND INTERRUPTS  
SECTION 15 CPU CORE AND INSTRUCTION SET  
SECTION 16 ELECTRICAL SPECIFICATIONS  
SECTION 17 MECHANICAL DATA  
SECTION 18 ORDERING INFORMATION  
SECTION 19 APPENDICES  
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:  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
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  
By air mail  
Par avion  
IBRS NUMBER PHQ-B/207/G  
–Cugahslitnremo  
–Firsft  
CCRI NUMERO PHQ-B/207/G  
NO STAMP REQUIRED  
lodbac  
kagothsline–  
REPONSE PAYEE  
GRANDE-BRETAGNE  
v
e–  
Motorola Ltd.,  
Colvilles Road,  
Kelvin Industrial Estate,  
EAST KILBRIDE,  
G75 8BR.  
GREAT BRITAIN.  
Semiconductor Products Sector  
F.A.O. Technical Publications Manager  
(re: MC68HC05F32/D)  
– 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 Forbes, Technical Publications Manager, Motorola Ltd., Scotland.  
For More Information On This Product,  
Go to: www.freescale.com  
– Finally, tuck this edge into opposite flap –  
Freescale Semiconductor, Inc.  
TABLE OF CONTENTS  
Paragraph  
Number  
Page  
Number  
TITLE  
1
INTRODUCTION  
1.1  
1.2  
Features................................................................................................................... 1–2  
Mask options for the MC68HC05F32 ...................................................................... 1–2  
2
MODES OF OPERATION AND PIN DESCRIPTIONS  
2.1  
2.2  
2.2.1  
2.2.2  
2.2.3  
2.3  
Single-chip mode..................................................................................................... 2–1  
Low power modes.................................................................................................... 2–1  
STOP mode ....................................................................................................... 2–1  
WAIT mode ........................................................................................................ 2–2  
Data retention mode .......................................................................................... 2–2  
System options register (SOR)................................................................................ 2–4  
Pin descriptions ....................................................................................................... 2–5  
VDD and VSS .................................................................................................... 2–5  
IRQ .................................................................................................................... 2–5  
RESET............................................................................................................... 2–5  
PA7–PA0/keyboard interrupt, PB7–PB0............................................................. 2–5  
PC7/SS, PC6/SCK, PC5/MOSI, PC4/MISO, PC3/TDO, PC2/RDI, PC1/TCAP4,  
PC0/TCAP3 ....................................................................................................... 2–6  
PD7–PD0/AN7–AN0.......................................................................................... 2–6  
VRH ................................................................................................................... 2–6  
AVDD ................................................................................................................. 2–6  
AVSS.................................................................................................................. 2–6  
PE7/PWM3, PE6/PWM2, PE5/PWM1, PE4/REFRESH, PE3/TCMP2, PE2/TCAP2,  
PE1/TCMP1, PE0/TCAP1.................................................................................. 2–6  
BP3–BP0 ........................................................................................................... 2–7  
VLCD ................................................................................................................. 2–7  
Ports F, G, H, I, J/FP39–FP0.............................................................................. 2–7  
TNO and TNX .................................................................................................... 2–7  
OSC1 and OSC2 ............................................................................................... 2–7  
OSC3 and OSC4 ............................................................................................... 2–7  
2.4  
2.4.1  
2.4.2  
2.4.3  
2.4.4  
2.4.5  
2.4.6  
2.4.7  
2.4.8  
2.4.9  
2.4.10  
2.4.11  
2.4.12  
2.4.13  
2.4.14  
2.4.15  
2.4.16  
2.4.16.1  
Crystal.......................................................................................................... 2–8  
TPG  
MC68HC05F32  
TABLE OF CONTENTS  
MOTOROLA  
i
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Paragraph  
Number  
Page  
Number  
TITLE  
2.4.16.2  
External clock................................................................................................2–8  
2.5  
2.5.1  
2.5.2  
Alternative pin descriptions for the 80-pin QFP package .......................................2–10  
PC5, PC4, PC0/TACP3.....................................................................................2–10  
PD7–PD0..........................................................................................................2–10  
3
MEMORY AND REGISTERS  
3.1  
3.2  
3.3  
3.4  
Registers ..................................................................................................................3–1  
RAM .........................................................................................................................3–5  
ROM .........................................................................................................................3–5  
Bootloader ROM.......................................................................................................3–6  
EEPROM..................................................................................................................3–6  
EEPROM programming register .........................................................................3–6  
Programming and erasing procedures................................................................3–8  
Sample EEPROM programming sequence ........................................................3–8  
3.5  
3.5.1  
3.5.2  
3.5.3  
4
PARALLEL INPUT/OUTPUT PORTS  
4.1  
4.2  
4.2.1  
4.2.1.1  
4.3  
4.4  
4.5  
4.6  
4.7  
Input/output programming ........................................................................................4–1  
Port A........................................................................................................................4–2  
Keyboard interrupt ..............................................................................................4–2  
Key control register (KCR) ............................................................................4–3  
Port B........................................................................................................................4–4  
Port C .......................................................................................................................4–5  
Port D .......................................................................................................................4–5  
Port E........................................................................................................................4–6  
Ports F, G, H, I and J ................................................................................................4–6  
Port registers ............................................................................................................4–7  
Port data registers (Ports A, B, C, D, E, F, G, H, I and J)....................................4–7  
Data direction registers (DDRA, DDRB, DDRC, DDRD and DDRE) ..................4–7  
Port control registers...........................................................................................4–8  
4.8  
4.8.1  
4.8.2  
4.8.3  
5
CORE TIMER  
5.1  
5.2  
5.2.1  
5.2.2  
5.3  
Real time interrupts (RTI) .........................................................................................5–2  
Core timer registers..................................................................................................5–3  
Core timer control and status register (CTCSR).................................................5–3  
Core timer counter register (CTCR)....................................................................5–4  
Computer operating properly (COP) watchdog timer ...............................................5–5  
Core timer during WAIT............................................................................................5–5  
Core timer during STOP...........................................................................................5–5  
5.4  
5.5  
TPG  
MOTOROLA  
ii  
TABLE OF CONTENTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Paragraph  
Number  
Page  
Number  
TITLE  
6
16-BIT PROGRAMMABLE TIMER  
6.1  
6.1.1  
6.2  
6.2.1  
6.2.2  
6.3  
6.3.1  
6.3.2  
6.4  
6.4.1  
6.4.2  
6.5  
6.6  
6.7  
Counter.................................................................................................................... 6–1  
Counter register and alternate counter register ................................................. 6–3  
Timer control and status.......................................................................................... 6–4  
Timer control registers 1 and 2 (TCR1 and TCR2) ............................................ 6–4  
Timer status register (TSR)................................................................................ 6–7  
Input capture............................................................................................................ 6–9  
Input capture register 1 (ICR1) .......................................................................... 6–9  
Input capture register 2 (ICR2) ........................................................................ 6–10  
Output compare..................................................................................................... 6–11  
Output compare register 1 (OCR1).................................................................. 6–11  
Output compare register 2 (OCR2).................................................................. 6–12  
Timer during STOP mode...................................................................................... 6–13  
Timer during WAIT mode....................................................................................... 6–13  
Timer state diagrams............................................................................................. 6–13  
7
DTMF/MELODY GENERATOR  
7.1  
7.1.1  
7.2  
Introduction.............................................................................................................. 7–1  
Features............................................................................................................. 7–1  
Functional description.............................................................................................. 7–2  
DMG registers ......................................................................................................... 7–4  
Row and column frequency control registers..................................................... 7–4  
Tone control register (TNCR)............................................................................. 7–4  
Operation of the DMG.............................................................................................. 7–7  
DMG during WAIT mode.......................................................................................... 7–8  
DMG during STOP mode......................................................................................... 7–8  
7.3  
7.3.1  
7.3.2  
7.4  
7.5  
7.6  
8
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
8.1  
8.2  
8.3  
8.4  
8.5  
8.6  
LCD RAM ................................................................................................................ 8–2  
LCD operation.......................................................................................................... 8–3  
Timing signals and LCD voltage waveforms............................................................ 8–4  
LCD control register (LCD) ..................................................................................... 8–9  
LCD during WAIT mode......................................................................................... 8–10  
LCD during STOP mode........................................................................................ 8–10  
MC68HC05F32  
TABLE OF CONTENTS  
MOTOROLA  
iii  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Paragraph  
Number  
Page  
Number  
TITLE  
9
A/D CONVERTER  
9.1  
9.2  
9.2.1  
9.2.2  
9.3  
A/D converter operation............................................................................................9–1  
A/D registers.............................................................................................................9–3  
A/D status/control register (ADSCR) ..................................................................9–3  
A/D result data register (ADDATA)......................................................................9–5  
A/D converter during WAIT mode.............................................................................9–5  
A/D converter during STOP mode............................................................................9–5  
A/D analog input.......................................................................................................9–5  
9.4  
9.5  
10  
SERIAL PERIPHERAL INTERFACE  
10.1 Overview and features............................................................................................10–1  
10.2 SPI signal descriptions...........................................................................................10–2  
10.2.1  
10.2.2  
10.2.3  
10.2.4  
Master in slave out (MISO) ...............................................................................10–2  
Master out slave in (MOSI) ...............................................................................10–2  
Serial clock (SCK).............................................................................................10–2  
Slave select (SS) ..............................................................................................10–4  
10.3 Functional description ............................................................................................10–4  
10.4 SPI registers...........................................................................................................10–6  
10.4.1  
10.4.2  
10.4.3  
Control register (SPCR)....................................................................................10–6  
Status register (SPSR) .....................................................................................10–8  
SPI data I/O register (SPDAT) ..........................................................................10–9  
10.5 SPI during WAIT mode...........................................................................................10–9  
10.6 SPI during STOP mode..........................................................................................10–9  
11  
SERIAL COMMUNICATIONS INTERFACE  
11.1 SCI two-wire system features.................................................................................11–1  
11.2 SCI receiver features..............................................................................................11–3  
11.3 SCI transmitter features..........................................................................................11–3  
11.4 External connections..............................................................................................11–3  
11.5 Functional description ............................................................................................11–4  
11.6 Data format.............................................................................................................11–5  
11.7 Receiver wake-up operation...................................................................................11–5  
11.7.1  
11.7.2  
Idle line wake-up...............................................................................................11–6  
Address mark wake-up .....................................................................................11–6  
11.8 Receive data in (RDI) .............................................................................................11–6  
11.9 Start bit detection ...................................................................................................11–7  
11.10 Transmit data out (TDO).........................................................................................11–8  
11.11 SCI registers...........................................................................................................11–9  
11.11.1 Serial communications data register (SCDAT)..................................................11–9  
MOTOROLA  
iv  
TABLE OF CONTENTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Paragraph  
Number  
Page  
Number  
TITLE  
11.11.2 Serial communications control register 1 (SCCR1) ......................................... 11–9  
11.11.3 Serial communications control register 2 (SCCR2) ....................................... 11–11  
11.11.4 Serial communications status register (SCSR).............................................. 11–12  
11.11.5 Baud rate register (BAUD) ............................................................................. 11–14  
11.12 Baud rate selection.............................................................................................. 11–16  
11.13 SCI during STOP mode....................................................................................... 11–16  
11.14 SCI during WAIT mode........................................................................................ 11–16  
12  
PULSE WIDTH MODULATOR  
12.1 PWM introduction .................................................................................................. 12–1  
12.2 Functional description............................................................................................ 12–2  
12.3 Registers ............................................................................................................... 12–2  
12.3.1  
12.3.2  
PWM control (PWMCR)................................................................................... 12–3  
PWM data registers (PWMD)........................................................................... 12–4  
12.4 PWM during WAIT mode ....................................................................................... 12–4  
12.5 PWM during STOP mode ...................................................................................... 12–5  
12.6 PWM during reset.................................................................................................. 12–5  
13  
32 KHZ CLOCK SYSTEM  
13.1 32 kHz clock system.............................................................................................. 13–1  
13.1.1  
13.1.1.1  
Custom periodic interrupt control/status register (CPICSR) ............................ 13–1  
Refresh clock.............................................................................................. 13–2  
13.2 Operation during STOP mode ............................................................................... 13–2  
13.3 Operation during WAIT mode ................................................................................ 13–2  
14  
RESETS AND INTERRUPTS  
14.1 Resets ................................................................................................................... 14–1  
14.1.1  
14.1.2  
14.1.3  
14.1.4  
14.1.5  
Power-on reset................................................................................................. 14–1  
RESET pin ....................................................................................................... 14–1  
Illegal address reset......................................................................................... 14–1  
Computer operating properly (COP) reset....................................................... 14–2  
Low voltage reset............................................................................................. 14–2  
14.2 Interrupts ............................................................................................................... 14–3  
14.2.1  
14.2.2  
14.2.3  
14.2.3.1  
14.2.3.2  
Interrupt priorities............................................................................................. 14–4  
Non-maskable software interrupt (SWI)........................................................... 14–4  
Maskable hardware interrupts.......................................................................... 14–4  
Real time and core timer (CTIMER) interrupts........................................... 14–4  
Programmable 16-bit timer interrupt........................................................... 14–6  
MC68HC05F32  
TABLE OF CONTENTS  
MOTOROLA  
v
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Paragraph  
Number  
Page  
Number  
TITLE  
14.2.3.3  
14.2.3.4  
14.2.3.5  
14.2.3.6  
14.2.3.7  
14.2.4  
Keyboard interrupt.......................................................................................14–7  
Low voltage interrupt...................................................................................14–7  
Serial peripheral interface (SPI) interrupt....................................................14–7  
Serial communications interface (SCI) interrupt..........................................14–7  
Custom periodic interrupt (CPI) ..................................................................14–8  
Hardware controlled interrupt sequence...........................................................14–8  
15  
CPU CORE AND INSTRUCTION SET  
15.1 Registers ................................................................................................................15–1  
15.1.1  
15.1.2  
15.1.3  
15.1.4  
15.1.5  
Accumulator (A)................................................................................................15–1  
Index register (X) ..............................................................................................15–2  
Program counter (PC).......................................................................................15–2  
Stack pointer (SP).............................................................................................15–2  
Condition code register (CCR)..........................................................................15–2  
15.2 Instruction set.........................................................................................................15–3  
15.2.1  
15.2.2  
15.2.3  
15.2.4  
15.2.5  
15.2.6  
Register/memory Instructions...........................................................................15–4  
Branch instructions ...........................................................................................15–4  
Bit manipulation instructions.............................................................................15–4  
Read/modify/write instructions..........................................................................15–4  
Control instructions...........................................................................................15–4  
Tables................................................................................................................15–5  
15.3 Addressing modes..................................................................................................15–5  
15.3.1  
15.3.2  
15.3.3  
15.3.4  
15.3.5  
15.3.6  
15.3.7  
15.3.8  
15.3.9  
Inherent.............................................................................................................15–6  
Immediate.........................................................................................................15–6  
Direct ................................................................................................................15–7  
Extended.........................................................................................................15–12  
Indexed, no offset ...........................................................................................15–12  
Indexed, 8-bit offset ........................................................................................15–12  
Indexed, 16-bit offset ......................................................................................15–12  
Relative...........................................................................................................15–13  
Bit set/clear.....................................................................................................15–13  
15.3.10 Bit test and branch..........................................................................................15–13  
16  
ELECTRICAL SPECIFICATIONS  
16.1 Maximum ratings ....................................................................................................16–1  
16.2 Thermal characteristics and power considerations ................................................16–2  
16.3 DC electrical characteristics...................................................................................16–3  
16.4 Control timing .........................................................................................................16–5  
16.5 DC levels for low voltage RESET and LVI ..............................................................16–7  
16.6 Electrical specifications for DTMF/melody generator .............................................16–7  
16.7 EEPROM additional information.............................................................................16–8  
MOTOROLA  
vi  
TABLE OF CONTENTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Paragraph  
Number  
Page  
Number  
TITLE  
16.8 PWM timing ........................................................................................................... 16–8  
16.9 A/D converter characteristics................................................................................. 16–9  
17  
MECHANICAL DATA  
17.1 100-pin QFP pinout for the MC68HC05F32 .......................................................... 17–1  
17.2 100-pin QFP mechanical dimensions.................................................................... 17–2  
17.3 80-pin QFP pinout for the MC68HC05F32 ............................................................ 17–3  
17.4 80-pin QFP mechanical dimensions...................................................................... 17–4  
18  
ORDERING INFORMATION  
18.1 EPROMs................................................................................................................ 18–2  
18.2 Verification media .................................................................................................. 18–2  
18.3 ROM verification units(RVU).................................................................................. 18–2  
A
MC68HC705F32  
A.1  
A.2  
A.2.1  
A.3  
A.3.1  
A.3.2  
A.3.2.1  
A.3.2.2  
A.4  
A.4.1  
A.4.2  
A.5  
Features...................................................................................................................A–1  
Pin descriptions .......................................................................................................A–3  
IRQ/VPP ............................................................................................................A–3  
Memory and registers..............................................................................................A–3  
Registers............................................................................................................A–3  
EPROM.............................................................................................................A–8  
EPROM programming register (PROG) .......................................................A–8  
EPROM programming operation ..................................................................A–8  
Electrical specifications ...........................................................................................A–9  
EPROM characteristics......................................................................................A–9  
DC levels for low voltage reset and LVI..............................................................A–9  
Mechanical data ....................................................................................................A–10  
100-pin QFP pinout for the MC68HC705F32...................................................A–10  
80-pin QFP pinout for the MC68HC705F32.....................................................A–11  
A.5.1  
A.5.2  
GLOSSARY  
INDEX  
MC68HC05F32  
TABLE OF CONTENTS  
MOTOROLA  
vii  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
MOTOROLA  
viii  
TABLE OF CONTENTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
LIST OF FIGURES  
Figure  
Number  
Page  
Number  
TITLE  
1-1  
2-1  
2-2  
3-1  
4-1  
4-2  
5-1  
6-1  
6-2  
6-3  
6-4  
6-5  
7-1  
8-1  
8-2  
8-3  
MC68HC05F32 block diagram ...........................................................................1–3  
STOP and WAIT flowcharts................................................................................2–3  
Oscillator connections ........................................................................................2–9  
Memory map of the MC68HC05F32 ..................................................................3–2  
Structure of port with keyboard interrupt ............................................................4–3  
Standard I/O port structure.................................................................................4–4  
Core timer block diagram....................................................................................5–1  
16-bit programmable timer block diagram ..........................................................6–2  
Timer state timing diagram for reset.................................................................6–14  
Timer state timing diagram for input capture ....................................................6–14  
Timer state timing diagram for output compare................................................6–15  
Timer state timing diagram for timer overflow...................................................6–15  
DTMF/melody generator (DMG) block diagram..................................................7–3  
LCD system block diagram.................................................................................8–1  
Voltage level selection ........................................................................................8–4  
LCD waveform with 2 backplanes, 1/2 bias........................................................8–5  
LCD waveform with 2 backplanes, 1/3 bias........................................................8–6  
LCD waveform with 3 backplanes ......................................................................8–7  
LCD waveform with 4 backplanes ......................................................................8–8  
A/D converter block diagram ..............................................................................9–2  
Electrical model of an A/D input pin....................................................................9–6  
Data clock timing diagram ................................................................................10–3  
Serial peripheral interface block diagram .........................................................10–5  
Serial peripheral interface master–slave interconnection.................................10–6  
Serial communications interface block diagram ...............................................11–2  
SCI and port C..................................................................................................11–3  
Data format.......................................................................................................11–5  
SCI sampling technique used on all bits...........................................................11–6  
SCI examples of start bit sampling technique ..................................................11–7  
Artificial start following a framing error .............................................................11–8  
SCI start bit following a break...........................................................................11–8  
PWM block diagram..........................................................................................12–1  
PWM output waveforms (POL = 1, active high)................................................12–2  
8-4  
8-5  
8-6  
9-1  
9-2  
10-1  
10-2  
10-3  
11-1  
11-2  
11-3  
11-4  
11-5  
11-6  
11-7  
12-1  
12-2  
TPG  
MC68HC05F32  
LIST OF FIGURES  
MOTOROLA  
ix  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Figure  
Number  
Page  
Number  
TITLE  
12-3  
14-1  
15-1  
15-2  
17-1  
17-2  
17-3  
17-4  
A-1  
PWM waveforms (POL = 0, active low)............................................................12–3  
Interrupt flowchart ............................................................................................14–5  
Programming model.........................................................................................15–1  
Stacking order ..................................................................................................15–2  
100-pin QFP pinout for the MC68HC05F32.....................................................17–1  
100-pin QFP mechanical dimensions...............................................................17–2  
80-pin QFP pinout for the MC68HC05F32.......................................................17–3  
80-pin QFP mechanical dimensions.................................................................17–4  
MC68HC705F32 block diagram .........................................................................A–2  
Memory map of the MC68HC705F32 ................................................................A–4  
100-pin QFP pinout for the MC68HC705F32...................................................A–10  
80-pin QFP pinout for the MC68HC705F32.....................................................A–11  
A-2  
18-1  
18-2  
MOTOROLA  
x
LIST OF FIGURES  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
LIST OF TABLES  
Table  
Number  
Page  
Number  
TITLE  
1-1  
3-1  
3-2  
4-1  
5-1  
5-2  
7-1  
7-2  
7-3  
7-4  
8-1  
8-2  
8-3  
8-4  
9-1  
9-2  
10-1  
11-1  
11-2  
11-3  
12-1  
13-1  
14-1  
15-1  
15-2  
15-3  
15-4  
15-5  
15-6  
15-7  
15-8  
16-1  
16-2  
Data sheet appendices.......................................................................................1–1  
Register outline...................................................................................................3–3  
Erase modes ......................................................................................................3–7  
I/O pin states ......................................................................................................4–5  
Example RTI periods..........................................................................................5–4  
Minimum COP reset times..................................................................................5–5  
Bit description for DTMF generation...................................................................7–5  
Bit description for melody generator...................................................................7–6  
Mode of operation for DMG ................................................................................7–6  
Effect of tone generation on DMG......................................................................7–7  
LCD RAM organization.......................................................................................8–2  
LCD controller operating modes.........................................................................8–3  
Frequency selection............................................................................................8–9  
Multiplex ratio/backplane selection...................................................................8–10  
A/D clock selection .............................................................................................9–3  
A/D channel assignment.....................................................................................9–4  
SPI rate selection .............................................................................................10–8  
Method of receiver wake-up ...........................................................................11–10  
First prescaler stage.......................................................................................11–15  
Second prescaler stage..................................................................................11–15  
PWM clock rate ................................................................................................12–4  
Refresh clock (32.768 kHz crystal)...................................................................13–2  
Vector address for interrupts and reset.............................................................14–6  
MUL instruction.................................................................................................15–5  
Register/memory instructions...........................................................................15–6  
Branch instructions...........................................................................................15–7  
Bit manipulation instructions.............................................................................15–7  
Read/modify/write instructions .........................................................................15–8  
Control instructions...........................................................................................15–8  
Instruction set ...................................................................................................15–9  
M68HC05 opcode map...................................................................................15–11  
Maximum ratings ..............................................................................................16–1  
Package thermal characteristics.......................................................................16–2  
TPG  
MC68HC05F32  
LIST OF TABLES  
MOTOROLA  
xi  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table  
Number  
Page  
Number  
TITLE  
16-3  
16-4  
16-5  
16-6  
16-7  
16-8  
16-9  
DC electrical characteristics (VDD = 5.0 V)......................................................16–3  
DC electrical characteristics (VDD = 2.7 V)......................................................16–4  
Control timing (V = 5V) ................................................................................16–5  
DD  
Control timing (V = 2.7V)..............................................................................16–6  
DD  
DC levels for low voltage reset and LVI ............................................................16–7  
Sine wave tones at TNO...................................................................................16–7  
Square wave tones at TNO ..............................................................................16–7  
16-10 TONEX at TNX output......................................................................................16–8  
16-11 EEPROM additional information.......................................................................16–8  
16-12 PWM timing......................................................................................................16–8  
16-13 A/D converter characteristics ...........................................................................16–9  
18-1  
A-1  
A-2  
A-3  
MC order numbers ...........................................................................................18–1  
Register outline ..................................................................................................A–5  
EPROM characteristics ......................................................................................A–9  
DC levels for low voltage reset and LVI ..............................................................A–9  
MOTOROLA  
xii  
LIST OF TABLES  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
1
1
INTRODUCTION  
The MC68HC05F32 is a member of the M68HC05 family of HCMOS microcomputers. Its memory  
configuration comprises 32K bytes of ROM, 920 bytes of RAM and 256 bytes of EEPROM. The  
on-board features of this device make it particularly suitable for use in highly integrated telephone  
handsets; the timer and DTMF generator allow for both pulse and tone dialling and, in addition to  
telephone set-up parameters and features such as last number redial, the EEPROM can typically store  
up to 12 telephone numbers of 20 digits, even after power has been removed from the circuit. Other  
features of the device include the keyboard interrupt facility, which allows a direct interface to a  
telephone keypad, the LCD circuit, which can drive up to 160 segments of an LCD display, and the A/D  
converter which could be used, for example, as a volume control for a telephone in hands-free mode.  
A high level of integration has been achieved on the MC68HC05F32 and careful attention has been  
paid to its low-power and low-voltage performance, a major consideration in many telecommunications  
applications.  
The MC68HC05F32 is very well suited to automotive applications; with its 8 analog inputs and many  
general I/O lines, it is especially useful in applications such as car dashboards. Also, the voltage levels  
of the LCD driver can be varied using external resistors, and the timer system is capable of driving two  
stepper motors (e.g. speedometer and odometer), as well as controlling a real time clock. The SCI  
subsystem is ideal for interfacing to diagnostic equipment, for example, and the on-board EEPROM  
can be used to store data such as mileage or calibration information.  
This data sheet is structured such that devices similar to the MC68HC05F32 are described in a set of  
appendices.  
Table 1-1 Data sheet appendices  
Device  
Appendix  
Differences from MC68HC05F32  
MC68HC705F32  
A
32256 bytes EPROM; 496 bytes boot ROM  
TPG  
MC68HC05F32  
INTRODUCTION  
MOTOROLA  
1-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
1
1.1  
Features  
Fully static design featuring the industry-standard M68HC05 CPU core  
32512 bytes of user ROM, plus 16 bytes for vectors  
240 bytes of bootloader ROM  
920 bytes of RAM plus 20 bytes of LCD RAM  
256 bytes of user EEPROM  
DTMF/melody generator  
16-bit programmable timer with four input captures and four output compares (the outputs of  
two of the output compares are used internally and do not have external connections)  
15 stage multipurpose core timer with timer overflow, real time interrupt and COP watchdog  
LCD driver with 4 backplanes and 40 frontplanes  
8-channel, 8-bit analog-to-digital (A/D) converter  
Power saving STOP and WAIT modes  
I/O lines  
100 QFP configuration – total of 80 I/O pins configured as:  
16 dedicated bidirectional I/O  
64 shared with peripherals  
80 QFP configuration – total of 69 I/O pins configured as:  
16 dedicated bidirectional I/O  
53 shared with peripherals  
Keyboard interrupt facility on eight of the I/O lines, with high or low voltage level interrupt  
triggers  
Hardware interrupt with edge or edge-and-level sensitive interrupt trigger  
SCI and SPI subsystems  
On-chip oscillators  
Three PWM channels  
Two selectable bus frequencies  
32kHz independent clock system  
Power-on and power-off resets; low voltage detection circuitry (EEPROM)  
Available in 100-pin QFP and 80-pin QFP  
Note:  
The 80-pin version is only a bond option. Pins PE4, PD7–PD0, PC4, PC5 are shared  
with module functions which cannot work on the 80-pin package. These modules and  
their corresponding pin functions should not be enabled.  
TPG  
MOTOROLA  
1-2  
INTRODUCTION  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
1
1.2  
Mask options for the MC68HC05F32  
There are three mask options available on the MC68HC05F32: STOP instruction (enable/disable),  
COP watchdog timer (enable/disable) and low voltage reset (LVR – enable/disable).These options  
are programmed during fabrication and must be specified by the customer at the time of ordering.  
PA7  
PA6  
PA5  
PA4  
PA3  
PA2  
PA1  
PA0  
PWM3  
PWM2  
PWM1  
PE7  
PE6  
PE5  
PE4  
PE3  
PE2  
PE1  
PE0  
PWM  
Timer  
32512 bytes user ROM  
240 bytes bootstrap ROM  
16 bytes for vectors  
TCMP2  
TCAP2  
TCMP1  
TCAP1  
PB7  
PB6  
PB5  
PB4  
PB3  
PB2  
PB1  
PB0  
TCAP3  
TCAP4  
TDO  
PC0  
PC1  
PC2  
PC3  
PC4  
PC5  
PC6  
PC7  
256 bytes user EEPROM  
SCI  
SPI  
RDI  
920 bytes RAM  
MISO  
MOSI  
SCK  
SS  
20 bytes LCD RAM  
AVDD  
VRH  
VRL/AVSS  
PD7  
PD6  
PD5  
PD4  
PD3  
PD2  
PD1  
OSC1  
OSC2  
Oscillator and divider  
AD7  
AD6  
AD5  
AD4  
AD3  
AD2  
AD1  
AD0  
32 kHz independent clock  
system, oscillator and divider  
OSC3  
OSC4  
8-channel  
A/D  
converter  
REFRESH  
2
2
Core timer  
VDD  
VSS  
Periodic interrupt  
COP watchdog  
PD0  
IRQ  
RESET  
TNO  
TNX  
M68HC05 CPU  
DTMF/ melody generator  
VLCD  
BP3  
BP2  
BP1  
BP0  
LCD driver  
Port H  
Port G  
Port F  
Port I  
Port J  
Note: When not being used to output the LCD frontplanes, port G and port F pins are input only,  
while port H, port I and port J pins are output only.  
Figure 1-1 MC68HC05F32 block diagram  
TPG  
MC68HC05F32  
INTRODUCTION  
MOTOROLA  
1-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
1
THIS PAGE LEFT BLANK INTENTIONALLY  
TPG  
MOTOROLA  
1-4  
INTRODUCTION  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2
2
MODES OF OPERATION AND PIN  
DESCRIPTIONS  
The normal operating mode of the MC68HC05F32 is single chip mode.There is also a bootloader  
mode, primarily for factory test purposes. In addition to these modes, there are three low power  
modes which may be entered and exited at will from user mode: STOP, WAIT and data retention.  
2.1  
Single-chip mode  
This is the normal user operating mode, in which the device functions as a self-contained  
microcomputer unit, with all on-board peripherals and I/O ports available to the user. All address  
and data activity occurs within the MCU.  
2.2  
Low power modes  
STOP mode  
2.2.1  
The STOP instruction places the MCU in its lowest power consumption mode. In STOP mode, the  
internal oscillator is turned off, halting all internal processing, including timer (and COP watchdog  
timer) operation, 16-bit timers, SPI, SCI, PWM and A/D converter.  
During STOP mode, the core timer interrupt flags (CTOF and RTIF) and interrupt enable bits  
(TOFE and RTIE) in the CTCSR as well as the 16-bit timer flags in register TSR and interrupt  
enable bits in register TCR are cleared by internal hardware. The I-bit in the CCR is cleared to  
enable external interrupts. All other registers, the remaining bits in the CTCSR, and memory  
contents remain unaltered. All input/output lines remain unchanged. The processor can be  
brought out of STOP mode only by an interrupt (IRQ, Keyboard, LVI or CPI from the 32 kHz clock  
system) if enabled or RESET (external reset or low voltage reset – LVR). See Figure 2-1.  
The STOP instruction can be disables by a mask option. When disabled, the STOP instruction is  
executed as a NOP.  
TPG  
MC68HC05F32  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MOTOROLA  
2-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2.2.2  
WAIT mode  
2
The WAIT instruction places the MCU in a low power consumption mode, though it consumes  
more power than in STOP mode. All CPU action is suspended, but the Core timer, the first 16-bit  
timer (TCAP1, 2 and TCMP1, 2), the DMG and the LCD remain active. If bit 7 (WTLCDO) of the  
LCD control register, $1E, is reset, the SPI, the SCI, the second 16-bit timer (TCAP3, 4 and  
TCMP3, 4) and the A/D converter, also remain active in WAIT mode. If, however, WTLCDO is set  
they are turned off.  
An interrupt from the core timer, 16-bit timers, SPI, SCI, IRQ, keyboard, LVI, OR CPI from the 32  
kHz clock system, if enabled, will cause the MCU to exit the WAIT mode. An external reset, or LVR,  
causes the MCU to exit the wait mode.  
During WAIT mode, the I-bit in the CCR is cleared to enable interrupts. All other registers, memory  
and input/output lines remain in their previous state. See Figure 2-1.  
2.2.3  
Data retention mode  
The contents of the RAM and CPU registers are retained at supply voltages as low as 2.0Vdc.  
This is called the data retention mode, in which data is maintained but the device is not guaranteed  
to operate. If the voltage drops below V  
the low voltage reset circuit generates a reset.  
ROFF  
For lowest power consumption in data retention mode the device should be put into STOP mode  
before reducing the supply voltage, to ensure that all the clocks are stopped. If the device is not  
in STOP mode then it is recommended that RESET be held low whilst the power supply is outwith  
the normal operating range, to ensure that processing is suspended in an orderly manner.  
Recovery from data retention mode, after the power supply has been restored, is by an external  
interrupt, or by pulling the RESET line high.  
TPG  
MOTOROLA  
2-2  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2
STOP  
WAIT  
Stop oscillator  
and all clocks;  
clear I-mask  
Oscillator active;  
stop processing;  
clear I-mask  
No  
No  
RESET  
?
RESET  
?
Yes  
Yes  
Any  
interrupt  
?
Any  
interrupt  
?
No  
No  
Yes  
Yes  
Turn on oscillator;  
Restart  
processor  
clocks  
wait t  
for  
PORL  
stabilization  
Fetch  
interrupt or RESET  
vector  
Fetch  
interrupt or RESET  
vector  
Figure 2-1 STOP and WAIT flowcharts  
TPG  
MC68HC05F32  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MOTOROLA  
2-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2.3  
System options register (SOR)  
2
The MC68HC05F32 MCU contains a System Option Register which is located at address $4D.  
This register is used to control the LVI and the clock system.  
State  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
IRQ KEYMUXKEYCLR PUEN 0000 0000  
System options register (SOR)  
$004D LVIF LVIE LVION SC  
LVIF, LVIE, LVION — Low voltage interrupt bits  
The LVIF flag is set by the low voltage detection circuit, if the LVI is enabled and power supply VDD  
falls below V .  
lvi  
The low voltage interrupt must be enabled by first setting bit LVION Low Voltage Interrupt On and  
after that setting bit LVIE Low Voltage Interrupt Enable. After power on reset the LVI circuit is  
disabled.  
SC — System clock option  
After power on reset the internal bus frequency is f=3.58Mhz/2. If the bit SC System Clock is set  
the system speed is reduced to f=3.58Mhz/4, with the exception of the DTMF generator (Oscillator  
Frequency 3.58Mhz).  
IRQ — Interrupt sensitivity  
IRQ edge or level sensitivity  
1 (set)  
IRQ input edge and level sensitive  
0 (clear) – IRQ input edge sensitive  
KEYMUX — Multiplex bit for access of interrupt flag  
The KEYMUX bit switches between the port A data register and the interrupt status register  
IRSTATE, that both have the address $0000. If KEYMUX is cleared normal read and write access  
to port A is possible. If KEYMUX is set, a read or write operation at address $0000 accesses the  
8 interrupt status flags.  
KEYCLR — Keyboard interrupt clear  
The keyboard wake-up interrupt status flag (Bit 7, $1B) is cleared by writing a “1” to bit KEYCLR.  
A read access to this bit always returns “0”.  
PUEN — PORTC pull-up enable  
After power on reset the pull-up resistors in port C are disabled. If bit PUEN is set, the pull-up  
resistors in port C are enabled. Writing a “0” to PUEN disables the pull-up function.  
TPG  
MOTOROLA  
2-4  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2.4  
Pin descriptions  
VDD and VSS  
2
2.4.1  
Power is supplied to the microcomputer via these two pins.VDD is the positive supply pin and VSS is  
the ground pin.  
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.  
2.4.2  
IRQ  
This is an input-only pin for external interrupt sources. Interrupt triggering is selected using the  
IRQ bit in the SOR register, to be one of two options: either edge and level sensitive or edge  
sensitive only.  
The IRQ pin contains an internal Schmitt trigger as part of its input to improve noise immunity.  
2.4.3  
RESET  
This active low I/O pin is used to reset the MCU. Applying a logic zero to this pin forces the device  
to a known start-up state. An external RC-circuit can be connected to this pin to generate a  
power-on reset (POR) if required. In this case, the time constant must be great enough (at least  
100ms) to allow the oscillator circuit to stabilise. This input has an internal Schmitt trigger to  
improve noise immunity. When a low voltage reset condition occurs internally, the RESET pin  
provides an active-low open drain output signal that may be used to reset external hardware.  
Other internal reset conditions are not visible at the RESET pin.  
2.4.4  
PA7–PA0/keyboard interrupt, PB7–PB0  
These 16 I/O lines comprise the two 8-bit ports A and B. The state of any pin is software  
programmable, and on reset, the port pins are configured as inputs, with internal pull-up resistors.  
The eight I/O lines of port A are shared with the keyboard interrupt function.  
TPG  
MC68HC05F32  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MOTOROLA  
2-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2.4.5  
PC7/SS, PC6/SCK, PC5/MOSI, PC4/MISO, PC3/TDO,  
PC2/RDI, PC1/TCAP4, PC0/TCAP3  
2
These eight I/O lines comprise the 8-bit port C, and are shared with other functions to give added  
flexibility. During reset, these lines are configured as inputs. Port pins PC0 and PC1 are shared  
with the input timer capture TCAP3 and TCAP4. Pins PC2 and PC3 are connected to the SCI  
system (RDI, TDO), if the SCI is enabled. The remaining four pins, PC7–PC4, are connected to  
the SPI system (SS, SCK, MOSI, MISO), if the SPI is enabled. All eight lines have internal  
programmable pull-ups. If the PUEN bit in the system options register is cleared, the pull-ups are  
disabled after reset. Setting the PUEN bit enables all the pull-up resistors in port C.  
2.4.6  
PD7–PD0/AN7–AN0  
The eight I/O lines of port D are configured as inputs during power-on or reset. As all port D output  
are open-drain, an external pull-up resistor is needed when a pin is being used as an output.  
These port lines, PD7–PD0, are shared with the A/D converter, and are connected to it when the  
corresponding port D control register bit is set to 1.  
2.4.7  
VRH  
The VRH pin is the positive reference voltage for the A/D converter.  
2.4.8  
AVDD  
AVDD is the positive supply voltage for the A/D converter.  
2.4.9  
AVSS  
AVSS is the negative supply voltage and the negative reference voltage for the A/D converter.  
2.4.10  
PE7/PWM3, PE6/PWM2, PE5/PWM1, PE4/REFRESH,  
PE3/TCMP2, PE2/TCAP2, PE1/TCMP1, PE0/TCAP1  
The pins PE7–PE0 comprise port E, providing eight I/O lines when the port E control bits are set  
to 0. As these pins are open-drain, an external pull-up resistor is needed when a pin is being used  
as an output. These pins also share functions. When the corresponding port E register control bit  
is set to 1, pins PE3–PE0 are connected to the timer system (TCMP2, TCAP2, TCMP1, TCAP1),  
pin PE4 becomes REFRESH, and pins PE7–PE5 are connected to the PWM (PWM3–PWM1).  
TPG  
MOTOROLA  
2-6  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2.4.11  
BP3–BP0  
2
The LCD driver subsystem has a maximum of four backplanes and forty frontplanes configured  
under software control. The pins BP3–BP0 provide the backplane drive signals and the forty  
output lines FP39–FP0 provide the frontplane drive signals for the LCD unit. The forty frontplane  
lines are shared with ports F, G, H, I and J.  
2.4.12  
VLCD  
The analogue part of the LCD controller can be supplied with an external voltage, V  
, using the  
LCD  
VLCD pin. The value of V  
may not exceed the positive power supply voltage V When the  
DD.  
LCD  
INTVLCD bit in the LCD control register is set to 1, an internal voltage generator (approx. 3V, if  
>3V) is activated as the source of the analogue LCD supply voltage.  
V
DD  
2.4.13  
Ports F, G, H, I, J/FP39–FP0  
These five ports are shared with the frontplanes FP39–FP0. The default setting of the register  
control bits is 0, setting all the pins in ports F and G input only, and all the pins in ports H, I and J  
output only. The port J outputs are all open-drain. When a register control bit is set to 1, the  
corresponding pin is connected to the LCD frontplane driver.  
2.4.14  
TNO and TNX  
The TNO output provides dual tone DTMF or melody under program control.TNO is an open-drain  
output, and therefore requires an external pull-up resistor.The TNX output provides pacifier tones  
under program control.  
2.4.15  
OSC1 and OSC2  
These pins provide control input for an on-chip oscillator circuit. A crystal or external clock signal  
connected to these pins supplies the oscillator clock. The oscillator frequency of 3.579 MHz  
provides the time base for the real-time clock and the DTMF/melody generator.  
2.4.16  
OSC3 and OSC4  
These pins provide control input for an independent on-chip oscillator circuit. A 32 kHz crystal  
connected across these pins, or an external clock signal connected to OSC3 provides the  
TPG  
MC68HC05F32  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MOTOROLA  
2-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
separate clock. The oscillator frequency (f  
=32 kHz) provides the time base for the divider, the  
OSC  
2
real time custom periodic interrupt (CPI) and the clock system output (REFRESH).  
2.4.16.1 Crystal  
The circuit shown in Figure 2-2(a) is recommended when using either a crystal or a ceramic  
resonator. Figure 2-2(d) provides the recommended capacitance and feedback resistance values.  
The internal oscillator is designed to interface with an AT-cut parallel-resonant quartz crystal  
resonator in the frequency range specified for f  
(see Section 16.4). Use of an external CMOS  
OSC  
oscillator is recommended when crystals outside the specified ranges are to be used. The crystal  
and associated components should be mounted as close as possible to the input pins to minimize  
output distortion and start-up stabilization time. The manufacturer of the particular crystal being  
considered should be consulted for specific information.  
2.4.16.2 External clock  
An external clock should be applied to the OSC1 input, with the OSC2 pin left unconnected, as  
shown in Figure 2-2(c). The t  
specification (see Section 16.4) does not apply when using an  
OXOV  
external clock input. The equivalent specification of the external clock source should be used in  
lieu of t  
.
OXOV  
TPG  
MOTOROLA  
2-8  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2
L
C
R
S
1
OSC1  
OSC2  
MCU  
C
0
OSC1  
OSC2  
R
P
(b) Crystal equivalent circuit  
MCU  
C
C
OSC2  
OSC1  
OSC1  
OSC2  
NC  
(a) Crystal resonator  
oscillator connections  
External  
clock  
(c) External clock source connections  
Crystal  
2MHz 4MHz  
Unit  
R (max)  
400  
5
75  
7
S
C
pF  
0
C
8
12  
nF  
1
C
C
15 – 40 15 – 30  
15 – 30 15 – 25  
pF  
OSC1  
OSC2  
P
pF  
R
10  
10  
MΩ  
Q
30 000 40 000  
(d) Crystal resonator parameters  
Figure 2-2 Oscillator connections  
MC68HC05F32  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MOTOROLA  
2-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
2.5  
Alternative pin descriptions for the 80-pin QFP package  
2
There is also an 80-pin version of the MC68HC05F32. As it has fewer pins and fewer modules,  
some of the pin descriptions vary. The reduction of the I/O count means that there is no longer a  
port H and that port C has only three pins available for use, one of which is shared with the timer  
(TCAP3). Port D’s pins were shared with the A/D converter, but this can no longer be used.  
2.5.1  
PC5, PC4, PC0/TACP3  
The three I/O lines of port C are configured as inputs during reset and each one has an internal  
pull-up resistor. Pin PC0 is shared with one of the timer’s input captures (TCAP3).  
2.5.2  
PD7–PD0  
All eight port D lines are configured as inputs during reset. These pins are open drain outputs  
which means that each one requires an external pull-up resistor when it is used as an output.  
MOTOROLA  
2-10  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
3
3
MEMORY AND REGISTERS  
The MC68HC05F32 has a 64K byte memory map consisting of registers (for I/O, control and  
status), user RAM, user ROM, EEPROM, bootloader ROM and reset and interrupt vectors as  
shown in Figure 3-1.  
3.1  
Registers  
All the I/O, control and status registers of the MC68HC05F32 are contained within the first 80 byte  
block of the memory map, as detailed in Table 3-1.  
MC68HC05F32  
MEMORY AND REGISTERS  
MOTOROLA  
3-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
MC68HC05F32  
$0000  
$0050  
$28 Counter 1 high (CNTH/1)  
$00 Port A data (PORTA)  
$01 Port B data (PORTB)  
$02 Port C data (PORTC)  
$03 Port D data (PORTD)  
$04 Port A DDR (DDRA)  
$05 Port B DDR (DDRB)  
$06 Port C DDR (DDRC)  
$07 Port D DDR (DDRD)  
I/O  
(80 bytes)  
$29 Counter 1 low (CNTL/1)  
$2A Alt. counter high 1 (ACNTH/1)  
$2B Alt. counter low 1 (ACNTL/1)  
$2C Timer 1 control 1 (TCR1/1)  
$2D Timer 1 control 2 (TCR2/1)  
$2E Timer 1 status (TSR/1)  
3
Unused  
$0054  
$0068  
LCD RAM (20 bytes)  
RAM  
$08 Ctimer control/status (CTCSR) $30 Capture 3 high (ICR3H)  
(920 bytes)  
Stack  
$09 Ctimer counter (CTCR)  
$0A Port E data (PORTE)  
$0B Port E DDR (DDRE)  
$0C Port E control (PECR)  
$0D Row freq. control (FCR)  
$0E Column freq. control (FCC)  
$0F Tone control (TNCR)  
$10 Port F data (PORTF)  
$11 Port F control (PFCR)  
$12 Port G data (PORTG)  
$13 Port G control (PGCR)  
$14 Port H data (PORTH)(1)  
$15 Port H control (PHCR)(1)  
$16 Port I data (PORTI)  
$31 Capture 3 low (ICR3L)  
$0400  
$32 Compare 3 high (OCR3H)  
$33 Compare 3 low (OCR3L)  
$34 Capture 4 high (ICR4H)  
$35 Capture 4 low (ICR4L)  
$36 Compare 4 high (OCR4H)  
$37 Compare 4 low (OCR4L)  
$38 Counter 2 high (CNTH/2)  
$39 Counter 2 low (CNTL/2)  
$3A Alt. counter high 2 (ACNTH/2)  
$3B Alt. counter low 2 (ACNTL/2)  
EEPROM  
(256 bytes)  
$0500  
$8000  
Unused  
(1)  
$3C Timer 2 control 1 (TCR1/2)  
$3D Timer 2 control 2 (TCR2/2)  
$3E Timer 2 status (TSR/2)(1)  
(1)  
User ROM  
(32256 bytes)  
$17 Port I control (PICR)  
$18 Port J data (PORTJ)  
$19 Port J control (PJCR)  
$1A Port D control (PDCR)  
$1B Key control (KCR)  
$40 PWM control (PWMCR)  
$41 PWM data 1 (PWMD1)  
$42 PWM data 2 (PWMD2)  
$43 PWM data 3 (PWMD3)  
$44 SPI control (SPCR)(1)  
$45 SPI status (SPSR)(1)  
$1C EEPROM prog. (EEPROG)  
$FF00  
$1E LCD control (LCD)  
$46 SPI data I/O (SPDAT)(1)  
$47 SCI data (SCDAT)(1)  
$20 Capture 1 high (ICR1H)  
$21 Capture 1 low (ICR1L)  
$22 Compare 1 high (OCR1H)  
$23 Compare 1 low (OCR1L)  
$24 Capture 2 high (ICR2H)  
$25 Capture 2 low (ICR2L)  
$26 Compare 2 high (OCR2H)  
$27 Compare 2 low (OCR2L)  
$48 SCI control 1 (SCCR1)(1)  
$49 SCI control 2 (SCCR2)(1)  
$4A SCI status (SCSR)(1)  
$4B SCI baud rate (BAUD)(1)  
$4C CPI control/status (CPICSR)  
$4D System options (SOR)  
$4E A/D data (ADDATA) (1)  
$4F A/D status/control (ADSCR)(1)  
Bootloader ROM  
(496 bytes)  
$FFF0  
$FFFF  
User vectors  
(16 bytes)  
(1) Not applicable to 80-pin package.  
– reserved  
Figure 3-1 Memory map of the MC68HC05F32  
MOTOROLA  
3-2  
MEMORY AND REGISTERS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 3-1 Register outline  
State  
on reset  
Register Name  
Address bit 7 bit 6 bit 5 bit 4 bit 3  
bit 2  
PA2  
bit 1  
PA1  
bit 0  
Port A data (PORTA)  
Key interrupt status (KISR)  
Port B data (PORTB)  
$0000 PA7  
$0000  
PA6  
PA5  
PA4  
PA3  
PA0 undened  
0000 0000  
3
$0001 PB7 PB6 PB5 PB4 PB3  
PB2  
PB1  
PC1  
PD1  
PB0 undened  
PC0 undened  
PD0 undened  
Port C data (PORTC)  
$0002 PC7 PC6 PC5 PC4 PC3 PC2  
Port D data (PORTD)  
$0003 PD7 PD6 PD5 PD4 PD3 PD2  
Port A data direction (DDRA)  
Port B data direction (DDRB)  
Port C data direction (DDRC)  
Port D data direction ((DDRD)  
$0004  
$0005  
$0006  
$0007  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
Core timer control/status (CTCSR) $0008 TOF RTIF TOFE RTIE RTOF RRTIF RT1  
RT0 0000 0011  
0000 0000  
Core timer counter (CTCR)  
Port E data (PORTE)  
$0009  
$000A PE7 PE6 PE5 PE4 PE3  
PE2  
0
PE1  
PE0 undened  
0000 0000  
Port E data direction (DDRE)  
Port E control (PECR)  
$000B  
$000C  
0
0000 0000  
DTMF row freq. control (FCR)  
$000D  
0
0
0
0
0
0
FCR4 FCR3 FCR2 FCR1 FCR0 undefined  
FCC4 FCC3 FCC2 FCC1 FCC0 undefined  
DTMF column freq. control (FCC) $000E  
DTMF tone control (TNCR)  
Port F data (PORTF)  
Port F control (PFCR)  
Port G data (PORTG)  
Port G control (PGCR)  
Port H data (PORTH)  
Port H control (PHCR)  
Port I data (PORTI)  
$000F MS1 MS0 TGER TGEC TNOE  
0
0
0
0000 0000  
$0010 PF7  
$0011  
PF6  
PF5  
PF4  
PF3  
PF2  
PF1  
PF0 undened  
0000 0000  
$0012 PG7 PG6 PG5 PG4 PG3 PG2 PG1 PG0 undened  
$0013  
0000 0000  
$0014 PH7 PH6 PH5 PH4 PH3 PH2  
$0015  
PH1  
PH0 0000 0000  
0000 0000  
$0016  
$0017  
PI7  
PI6  
PI5  
PI4  
PI3  
PI2  
PI1  
PI0 0000 0000  
0000 0000  
Port I control (PICR)  
Port J data (PORTJ)  
Port J control (PJCR)  
Port D control (PDCR)  
Key control (KCR)  
$0018 PJ7  
$0019  
PJ6  
PJ5  
PJ4  
PJ3  
PJ2  
PJ1  
PJ0 0000 0000  
0000 0000  
$001A  
0000 0000  
$001B  
$001C  
KF  
0
KIE EDG5 EDG4 EDG3 EDG2 EDG1 EDG0 0000 0000  
CPEN ER1 ER0 LATCH EERC EEPGM 0000 0000  
EEPROM prog. (EEPROG)  
0
WTLCDO  
EXTVON  
0000 0000  
LCD control (LCD)  
$001E  
FSEL1 FSEL0 I NTVLCD FDISP MUX4 MUX3  
Capture 1 high (ICR1H)  
Capture 1 low (ICR1L)  
$0020 (bit 15)  
$0021  
(bit 8) undened  
undened  
MC68HC05F32  
MEMORY AND REGISTERS  
MOTOROLA  
3-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 3-1 Register outline  
State  
on reset  
Register Name  
Address bit 7 bit 6 bit 5 bit 4 bit 3  
bit 2  
bit 1  
bit 0  
Compare 1 high (OCR1H)  
Compare 1 low (OCR1L)  
Capture 2 high (ICR2H)  
Capture 2 low (ICR2L)  
Compare 2 high (OCR2H)  
Compare 2 low (OCR2L)  
Counter 1 high (CNTH/1)  
Counter 1 low (CNTL/1)  
$0022 (bit 15)  
$0023  
(bit 8) undened  
undened  
3
$0024 (bit 15)  
$0025  
(bit 8) undened  
undened  
$0026 (bit 15)  
$0027  
(bit 8) undend  
undened  
$0028 (bit 15)  
$0029  
(bit 8) 1111 1111  
1111 1100  
Alternate counter 1 high (ACNTH/1) $002A (bit 15)  
Alternate counter 1 low (ACNTL/1) $002B  
(bit 8) 1111 1111  
1111 1100  
Timer1 control 1 (TCR1/1)  
Timer1 control 2 (TCR2/1)  
Timer1 status (TSR/1)  
$002C ICI1E ICI2E OCI1E TOIE CO1E IEDG1 IEDG2 OLVL1 0000 0uu0  
$002D OCI2E CO2E OLVL2 0000 0000  
uuuu uuu0  
0
0
0
0
0
$002E IC1F IC2F OC1F TOF TCAP1 TCAP2 OC2F  
0
Capture 3 high (ICR3H)  
Capture 3 low (ICR3L)  
Compare 3 high (OCR3H)  
Compare 3 low (OCR3L)  
Capture 4 high (ICR4H)  
Capture 4 low (ICR4L)  
Compare 4 high (OCR4H)  
Compare 4 low (OCR4L)  
Counter 1 high (CNTH/1)  
Counter 1 low (CNTL/1)  
$0030 (bit 15)  
$0031  
(bit 8) undened  
undened  
$0032 (bit 15)  
$0033  
(bit 8) undened  
undened  
$0034 (bit 15)  
$0035  
undened  
undened  
$0036 (bit 15)  
$0037  
undened  
undened  
$0038 (bit 15)  
$0039  
(bit 8) 1111 1111  
1111 1100  
Alternate counter 2 high (ACNTH/1) $003A (bit 15)  
Alternate counter 2 low (ACNTL/1) $003B  
(bit 8) 1111 1111  
1111 1100  
Timer2 control 1 (TCR1/2)  
Timer2 control 2 (TCR2/2)  
Timer2 status (TSR/2)  
$003C ICI3E ICI4E OCI3E TOIE CO3E IEDG3 IEDG4  
$003D OCI4E CO4E  
$003E IC3F IC4F OC3F TOF TCAP3 TCAP4 OC4F  
0000 0uu0  
0
0
0
0
0
0000 0000  
0
uuuu uuu0  
PWM control (PWMCR)  
PWM data 1 (PWMD1)  
PWM data 2 (PWMD2)  
PWM data 3 (PWMD3)  
SPI control (SPCR)  
$0040  
$0041  
$0042  
$0043  
POL3 POL2 POL1 RA1  
RA0 0001 1100  
1000 0000  
1000 0000  
1000 0000  
$0044 SPIE SPE DOD MSTR CPOL CPHA SPR1 SPR0 0000 01uu  
MOTOROLA  
3-4  
MEMORY AND REGISTERS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 3-1 Register outline  
State  
on reset  
Register Name  
Address bit 7 bit 6 bit 5 bit 4 bit 3  
bit 2  
bit 1  
bit 0  
SPI status (SPSR)  
SPI data I/O (SPDAT)  
SCI data (SCDAT)  
$0045 SPIF WCOL  
0
MODF  
0
0
0
0
0000 0000  
undened  
undened  
uu00 0000  
3
$0046  
$0047  
SCI control 1 (SCCR1)  
SCI control 2 (SCCR2)  
SCI status (SCSR)  
$0048  
$0049  
R8  
T8  
0
M
WAKE  
TE  
0
0
0
TIE TCIE RIE  
ILIE  
RE  
RWU SBK 0000 0000  
FE 1100 0000  
$004A TDRE TC RDRF IDLE  
OR  
NF  
0
SCI baud rate (BAUD)  
CPI control status (CPICSR)  
System options (SOR)  
A/D data (ADDATA)  
$004B TCLR  
$004C  
0
SCP1 SCP0 RCKB SCR2 SCR1 SCR0 0000 0uuu  
CPIE RFQ1 RFQ0 0000 0000  
0
CPIF  
0
0
0
$004D LVIF LVIE LVION SC  
$004E  
IRQ KEYMUX KEYCLRPUEN 0000 0000  
undened  
A/D status/control (ADSCR)  
$004F COCO ADRC ADON  
0
CH3 CH2 CH1 CH0 0000 0000  
u = undened  
3.2  
RAM  
The user RAM consists of 920 bytes of memory, from $0068 to $03FF. This is shared with a  
64 byte stack area. The stack begins at $00FF, and may extend down to $00C0.  
Note:  
Using the stack area for data storage or temporary work locations requires care to  
prevent the data from being overwritten due to stacking from an interrupt or subroutine  
call.  
3.3  
ROM  
The user ROM occupies 32512 bytes of memory, from $8000 to $FEFF. In addition, there are 16  
bytes of user vectors, from $FFF0 to $FFFF.The Bootloader ROM is located from $FF00 to $FFEF.  
Note:  
For compatibility, unused bits (shaded) should always be cleared, when writing to them.  
MC68HC05F32  
MEMORY AND REGISTERS  
MOTOROLA  
3-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
3.4  
Bootloader ROM  
The MC68HC05F32 has 224 bytes of bootloader ROM plus 16 bytes of bootloader vectors, from  
$FF00 to $FFEF. These are included primarily for factory test purposes.  
3
3.5  
EEPROM  
256 bytes of user EEPROM reside at addresses $0400 to $04FF.  
Programming or erasing the EEPROM can be done by the user on a single byte basis; erasing  
may also be performed on a block or bulk basis. All programming or erasing is accomplished by  
manipulating the programming register (EEPROG), located at address $001C.  
Note:  
The erased state of an EEPROM byte is ‘$FF’. This means that a write forces zeros to  
the bits specified, whilst bits defined as ones are unchanged by a write operation.  
Caution: There is a restriction on the use of indexed addressing for EEPROM read operations.  
When the base address of an indexed read of an EEPROM location is within the  
EEPROM address range ($0400 to $04FF), the read may not be successful.  
e.g. LDA (BASE ADDRESS), X – may not give the correct result when the base  
address is in the range $0400 to $04FF. However if the base address is outwith the  
EEPROM address range, the read operation will be successful.This restriction applies  
to all operations capable of using indexed addressing.  
3.5.1  
EEPROM programming register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
EEPROM programming (EEPROG) $001C  
0
CPEN  
0
ER1 ER0 LATCH EERC EEPGM 0000 0000  
CPEN — Charge pump enable  
1 (set)  
Charge pump enabled.  
0 (clear) – Charge pump disabled.  
When set, CPEN enables the charge pump which produces the internal programming voltage.  
This bit should be set at the same time as the LATCH bit. The programming voltage will not be  
available until EEPGM is set. The charge pump should be disabled when not in use. CPEN is  
readable and writable and is cleared by reset.  
MOTOROLA  
3-6  
MEMORY AND REGISTERS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
ER1, ER0 — Erase select bits  
ER1 and ER0 are used to select either single byte programming or one of three erase modes:  
byte, block, or bulk. Table 3-2 shows the mode selected for each bit configuration. These bits are  
readable and writable and are cleared by reset.  
3
Table 3-2 Erase modes  
ER1  
0
ER0  
0
Mode  
Program  
0
1
Byte erase  
Block erase  
Bulk erase  
1
0
1
1
In byte erase mode, only the selected byte is erased.  
In block erase mode, a 32-byte block of EEPROM is erased.The EEPROM  
memory space is divided into four 64-byte blocks ($0400 – $043F, $0440 –  
$047F, $0480 – $04BF and $04C0 – $04FF) and performing a block erase  
on any address within a block will erase the entire block.  
In bulk erase mode, the entire 256 bytes of EEPROM are erased.  
LATCH — EEPROM latch bit  
1 (set) EEPROM address and data buses are configured for programming.  
0 (clear) – EEPROM address and data buses are configured for normal  
operation.  
When set, the LATCH bit configures the EEPROM address and data buses for programming. In  
addition, writes to the EEPROM array cause the address and data buses to be latched. This bit is  
readable and writable, but reads from the EEPROM array are inhibited if the LATCH bit is set and  
a write to the EEPROM space has taken place.When this bit is clear, address and data buses are  
configured for normal operation. Reset clears this bit.  
EERC — EEPROM RC oscillator control  
1 (set)  
Use internal RC oscillator for EEPROM.  
0 (clear) – Use CPU clock for EEPROM.  
When this bit is set, the EEPROM memory array uses the internal RC oscillator instead of the CPU  
clock. After setting the EERC bit, the user should wait a time t  
to allow the RC oscillator to  
RCON  
stabilize. This bit is readable and writable and should be set by the user when the internal bus  
frequency falls below 1.5MHz. Reset clears this bit.  
MC68HC05F32  
MEMORY AND REGISTERS  
MOTOROLA  
3-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
EEPGM — EEPROM programming power enable  
1 (set) Programming power connected to the EEPROM array.  
0 (clear) – Programming power switched off.  
3
EEPGM must be set to enable the EEPGM function.When set, EEPGM turns on the charge pump  
and enables the programming (or erasing) power to the EEPROM array.When clear, this power is  
switched off. This will enable pulsing of the programming voltage to be controlled internally. This  
bit can be read at any time, but can only be written to if LATCH = 1, i.e. if LATCH is not set, then  
EEPGM cannot be set. Reset clears this bit.  
3.5.2  
Programming and erasing procedures  
To program a byte of EEPROM, set LATCH = CPEN = 1, set ER1 = ER0 = 0, write data to the  
desired address and then set EEPGM for a time t  
.
EPGM  
There are three possibilities for erasing data from the EEPROM array, depending on how much  
data is affected.  
To erase a byte of EEPROM, set LATCH = CPEN = 1, set ER1 = 0 and ER0 = 1, write data to  
the desired address and then set EEPGM for a time t  
.
EBYTE  
To erase a block of EEPROM, set LATCH = CPEN = 1, set ER1 = 1 and ER0 = 0, write data  
to any address in the block and then set EEPGM for a time t  
.
EBLOCK  
To bulk erase the EEPROM, set LATCH = CPEN = 1, set ER1 = ER0 = 1, write data to any  
address in the array and then set EEPGM for a time t  
.
EBULK  
To terminate the programming or erase sequence, clear EEPGM, wait for a time t  
to allow the  
FPV  
programming voltage to fall, and then clear LATCH and CPEN to release the buses. Following  
each erase or programming sequence, clear all programming control bits.  
3.5.3  
Sample EEPROM programming sequence  
The following program is an example of the EEPROM programming sequence, using the timer to  
implement the required delay and assuming a 1 MHz bus frequency.  
MOTOROLA  
3-8  
MEMORY AND REGISTERS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
TCSR  
TCNT  
TOF  
PROG  
CPEN  
ER1  
ER0  
LATCH EQU  
EERC EQU  
EQU  
EQU  
EQU  
EQU  
EQU  
EQU  
EQU  
$0008  
$0009  
7
$001C  
6
4
3
2
1
0
TIMER CONTROL AND STATUS REGISTER  
TIMER COUNTER REGISTER  
TOF BIT OF TCSR  
EEPROM PROGRAM REGISTER  
CHARGE PUMP ENABLE BIT  
ERASE SELECT BIT 1  
ERASE SELECT BIT 0  
LATCH BIT  
RC/OSC SELECTOR BIT  
EEPROM PROGRAM BIT  
START ADDRESS OF EEPROM  
DUMMY DATA  
3
EEPGM EQU  
EESTARTEQU  
SUMPIN EQU  
$0400  
$FF  
ORG  
START EQU  
BSET  
$0680  
*
EERC, PROG  
DELAY  
SELECT RC OSCILLATOR  
BSR  
RC OSCILLATOR STABILIZATION  
TURN ON CHARGE PUMP  
ENABLE LATCH BIT  
SELECT PROGRAM (NOT ERASE)  
SELECT PROGRAM (NOT ERASE)  
BSET  
BSET  
BCLR  
BCLR  
CPEN, PROG  
LATCH, PROG  
ER1, PROG  
ER0, PROG  
LDA  
STA  
#SUMPIN  
EESTART  
GET DATA  
BSET  
JSR  
BCLR  
EEPGM, PROG  
DELAY  
EEPGM, PROG  
ENABLE PROGRAMMING POWER  
WAIT FOR PROGRAMMING TIME  
CLEAR EEPGM  
JSR  
DELAY  
WAIT FOR PROG VOLTAGE TO FALL  
CLEAR LATCH  
DISABLE CHARGE PUMP  
VERIFY  
BCLR  
BCLR  
CMP  
LATCH, PROG  
CPEN, PROG  
EESTART  
OUT1  
BNE  
CLC  
CLEAR CARRY BIT IF NO ERROR  
OUT  
RTS  
OUT1  
SEC  
RTS  
FLAG AN ERROR  
*THIS ROUTINE GIVES A 15MS (+/-1MS) DELAY AT 1 MHZ BUS. THE SAME DELAY  
* ROUTINE IS USED IN THIS EXAMPLE FOR SIMPLICITY, USING THE LONGEST DELAY  
* TIME. USERS WILL WANT TO WRITE SHORTER DELAY ROUTINES FOR APPLICATIONS  
*IN WHICH SPEED IS IMPORTANT.  
DELAY EQU  
LDX  
TIMLP BCLR  
*
#15  
TOF, TCSR  
COUNT OF 15  
CLEAR TOF  
BRCLR TOF, TCSR  
DECX  
WAIT FOR TOF FLAG  
BNE  
RTS  
TIMLP  
COUNT DOWN TO 0  
MC68HC05F32  
MEMORY AND REGISTERS  
MOTOROLA  
3-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
3
THIS PAGE LEFT BLANK INTENTIONALLY  
MOTOROLA  
3-10  
MEMORY AND REGISTERS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
4
4
PARALLEL INPUT/OUTPUT PORTS  
The MC68HC05F32 has a total of 80 I/O lines, arranged as ten 8-bit ports. The I/O lines are  
individually programmable as either input or output, under the software control of the data  
direction registers. Port A can also be configured to respond to keyboard interrupts.  
To avoid glitches on the output pins, data should be written to the I/O port data register before  
writing ones to the corresponding data direction register bits to set the pins in output mode.  
4.1  
Input/output programming  
The bidirectional port lines may be programmed as inputs or outputs under software control. The  
direction of each pin is determined by the state of the corresponding bit in the port data direction  
register (DDR). Each I/O port has an associated DDR. Any I/O port pin is configured as an output  
if its corresponding DDR bit is set to a logic one. A pin is configured as an input if its corresponding  
DDR bit is cleared.  
At power-on or reset, all DDRs are cleared, thus configuring all port pins as inputs. The data  
direction registers can be written to or read by the MCU. During the programmed output state, a  
read of the data register actually reads the value of the output data latch and not the I/O pin. The  
operation of the standard port hardware is shown schematically in Figure 4-2.  
This is further summarized in Table 4-1, which shows the effect of reading from, or writing to an  
I/O pin in various circumstances. Note that the read/write signal shown is internal and not available  
to the user.  
TPG  
MC68HC05F32  
PARALLEL INPUT/OUTPUT PORTS  
MOTOROLA  
4-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
4.2  
Port A  
Port A is an 8-bit bidirectional port which is equipped with a keyboard interrupt. All eight lines have  
internal pull-up resistors, which are required when the port is in input mode. On reset, this port is  
configured as a standard I/O port comprising a data register and a data direction register.  
Reset does not affect the state of the data register, but clears the data direction register, thereby  
returning all ports pins to input mode. Writing a 1 to any DDR bit sets the corresponding port pin  
to output mode. As every pin configured as an input contributes to the keyboard interrupt, it is  
possible to disable a single pin by configuring it as an output.  
4
4.2.1  
Keyboard interrupt  
Provided that the interrupt mask bit of the condition code register is cleared, the keyboard interrupt  
facility is enabled by setting the keyboard interrupt bit (KIE) in the key control register.  
On detection of a high-to-low transition, the interrupt inputs PA6 and PA7 are triggered.The trigger  
edges of the interrupt lines, PA0–PA5, can be programmed using the EDG0–EDG5 bits in the key  
control register. If one of these bits is cleared, after reset the corresponding interrupt is falling-edge  
sensitive. If, however, one of them is set, after reset the corresponding interrupt is rising-edge  
sensitive. The internal pull-up resistors of input lines, PA7–PA0, are disabled, if rising-edge  
sensitivity is selected.  
When a correct transition is detected, on any of this port’s pins, a keyboard interrupt request is  
generated, and the corresponding interrupt status flag of the interrupt status register, IRSTATE, is  
set. The interrupt status register is an 8-bit register which has the same address as PORTA,  
$0000. This register can be read if the KEYMUX bit in the system option register is set. If KIE is  
set, a keyboard interrupt is generated and the keyboard status flag, KF, is set by generating the  
logical OR of the eight interrupt state register outputs.  
The 8 interrupt state register flags can be reset in three ways:  
1) Completely, if the chip is reset.  
2) Completely, if a 1 is written to KEYCLR, in the system option register.  
3) Individually, if a 1 is written to the corresponding bit position of the interrupt  
state register ($00 with KEYMUX = 1, in the system option register).  
TPG  
MOTOROLA  
4-2  
PARALLEL INPUT/OUTPUT PORTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
KIE  
Bit 6, $1B  
KEYMUX and  
read PTAIO  
4
EDG0  
Internal data bit 0  
Bit 0, $1B  
VDD  
D
C
Q
KF and  
keyboard  
interrupt  
request  
Interrupt  
state 0  
R
8
DDR0  
IRST1 – IRST8  
Bit 0, $04  
Figure 4-1 Structure of port with keyboard interrupt  
4.2.1.1  
Key control register (KCR)  
This register contains eight bits, two of which are used to control the keyboard interrupt facility, the  
others determine the keyboard interrupt edges.  
State  
Address bit 7  
$001B KF  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
KIE EDG5 EDG4 EDG3 EDG2 EDG1 EDG0 0000 0000  
Key control register (KCR)  
KF — Keyboard interrupt status flag  
1 (set) A valid transition has occurred on one of the port pins.  
0 (clear) – No valid transition has occurred on any of the port pins.  
This bit is set when a valid transition is detected on any of the port A pins; a keyboard interrupt  
request will be generated, if keyboard interrupts are enabled (only if KIE is set). The KF flag is  
cleared by resetting the IRSTATE register, or by setting KEYCLR = 1 in the system option register.  
TPG  
MC68HC05F32  
PARALLEL INPUT/OUTPUT PORTS  
MOTOROLA  
4-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
KIE — keyboard interrupt enable  
1 (set) Keyboard interrupt enabled.  
0 (clear) – Keyboard interrupt disabled.  
An interrupt can only be generated if KIE and KF are both set and the I-bit in the CCR is clear.  
4
EDG5–EDG0 — trigger edge control  
1 (set)  
Sets the corresponding interrupt line to rising-edge sensitive.  
0 (clear) – Sets the corresponding interrupt line falling-edge sensitive.  
The trigger edges of the interrupt lines PA5–PA0 are programmable with the EDG5–EDG0 bits in  
the key control register.  
4.3  
Port B  
This port is a standard M68HC05 bidirectional I/O port, comprising a data register and a data  
direction register.  
Reset does not affect the state of the data register, but clears the data direction register, thereby  
returning all port pins to input mode. Writing a ‘1’ to any DDR bit sets the corresponding port pin  
to output mode. The port B lines have internal pull-up resistors.  
DDRn  
Data direction  
register bit  
DATA  
I/O  
pin  
Output  
buffer  
Latched data  
register bit  
DDRn DATA  
I/O  
0
O/P  
data  
buffer  
1
1
0
0
0
1
0
1
Output  
Input  
1
tristate  
tristate  
Input  
buffer  
Figure 4-2 Standard I/O port structure  
TPG  
MOTOROLA  
4-4  
PARALLEL INPUT/OUTPUT PORTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 4-1 I/O pin states  
R/W DDRn  
Action of MCU write to/read of data bit  
The I/O pin is in input mode. Data is written into the output data latch.  
Data is written into the output data latch, and output to the I/O pin.  
The state of the I/O pin is read.  
0
0
1
1
0
1
0
1
The I/O pin is in output mode. The output data latch is read.  
4
4.4  
Port C  
Port C is an 8-bit bidirectional port, which is shared with the SPI subsystem, the SCI subsystem  
and the timer system. If the SPI system is enabled, pins PC4–PC7 are connected to the functions  
MISO, MOSI, SCK and SS, respectively. It the SCI system is enabled, pins PC2 and PC3 are  
connected to RDI and TDO. PC0 and PC1 are connected to TCAP3 and TCAP4 in the timer  
system. (These lines must be set to input, by resetting the DDR, to enable the correct TCAP  
function).  
Reset does not affect the data register, but it clears the data direction register, returning the ports  
to inputs. Writing a 1 to a DDR bit, sets the corresponding port bit to output mode. All eight lines  
have internal pull-ups, which can be programmed using the PUEN bit in the system option register  
(SOR). The internal pull-ups are disabled after reset and when PUEN = 0, but are enabled by  
writing a 1 to PUEN.  
4.5  
Port D  
Port D is an 8-bit bidirectional port, which is shared with the A/D converter. A pin becomes  
connected to the A/D converter, when its corresponding bit in the control register is set to 1.  
Reset does not affect the data register, but it clears the data direction register and the control  
register. The default setting of the register control bits is 0, making the pins general purpose I/O  
lines. The direction of the pins is then determined by their corresponding bits in DDR (0 - input, 1  
- output). Write access to DDR or the I/O register is blocked to reduce digital noise. Read access  
to DDR or the I/O register returns 0. Port D has open-drain outputs, it therefore requires external  
pull-up resistors for each pin when they are used as outputs.  
Note:  
The maximum leakage current for I/O ports is 10µA. Thus, a high resistance from an  
analog source can limit the accuracy of the A/D converter. The analog source should  
therefore be less than 1 k.  
TPG  
MC68HC05F32  
PARALLEL INPUT/OUTPUT PORTS  
MOTOROLA  
4-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
4.6  
Port E  
Port E is an 8-bit bidirectional port which is shared with the timer system, the independent 32 kHz  
clock system and the PWM. When the corresponding bit in the port E control register is set to 1,  
the pins PE1 and PE3 are connected to TCMP1 and TCMP2 of the timer system, PE4 is  
connected to the independent clock system, it becomes REFRESH, and PE5 – PE7 become  
PWM1 – PWM3 of the PWM system. Pins PE0 and PE2 are always connected to the timer system  
(TCAP1 and TCAP2).These two lines must be set to input by resetting the DDR to enable correct  
TCAP function.  
4
Reset does not affect the data register, but it clears the data direction register and the control  
register. The default setting of the register control bits is 0, making the pins general purpose I/O  
lines. The direction of the pins is then determined by their corresponding bits in DDR (0 – input, 1  
– output). Port E has open-drain outputs, it therefore requires external pull-up resistors for each  
pin when they are used as outputs.  
Note:  
As the voltage at port D or port E is driven above V , the protection device will begin  
DD  
to conduct and tend to clamp the input voltage to protect the input buffer. The voltage  
at which this condition will occur varies significantly, from lot to lot, and over the  
temperature range. At room temperature, the pin typically does not draw any current  
until approximately 18V.  
4.7  
Ports F, G, H, I and J  
These five ports are shared with the frontplanes FP39 – FP0.The default setting of the port control  
bits, during reset, is 0, setting the pins in port F and port G to input only, and the pins in ports H,  
I and J, to output only. At power on or reset, the output only port data registers are cleared, so that  
these pins are driving logical 0. When the corresponding port control register bit is set to a 1, the  
pin is connected to the LCD frontplane driver. All port J outputs are open-drain.  
TPG  
MOTOROLA  
4-6  
PARALLEL INPUT/OUTPUT PORTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
4.8  
Port registers  
The following sections explain in detail the individual bits in the data and control registers  
associated with the ports.  
4.8.1  
Port data registers (Ports A, B, C, D, E, F, G, H, I and J)  
4
State  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
Port A data (PORTA)  
$0000 PA7  
$0001 PB7  
PA6  
PB6  
PA5  
PB5  
PA4  
PB4  
PA3  
PB3  
PA2  
PB2  
PA1  
PB1  
PA0 undened  
PB0 undened  
Port B data (PORTB)  
Port C data (PORTC)  
Port D data (PORTD)  
Port E data (PORTE)  
Port F data (PORTF)  
Port G data (PORTG)  
Port H data (PORTH)  
Port I data (PORTI)  
Port J data (PORTJ)  
$0002 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 undened  
$0003 PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 undened  
$000A PE7  
$0010 PF7  
PE6  
PF6  
PE5  
PF5  
PE4  
PF4  
PE3  
PF3  
PE2  
PF2  
PE1  
PF1  
PE0 undened  
PF0 undened  
$0012 PG7 PG6 PG5 PG4 PG3 PG2 PG1 PG0 undened  
$0014 PH7 PH6 PH5 PH4 PH3 PH2 PH1 PH0 0000 0000  
$0016  
PI7  
PI6  
PI5  
PI4  
PI3  
PI2  
PI1  
PI0 0000 0000  
PJ0 0000 0000  
$0018 PJ7  
PJ6  
PJ5  
PJ4  
PJ3  
PJ2  
PJ1  
Each bit of port A – port E can be configured as input or output via the corresponding data  
direction bit in the port data direction register (DDRx).  
Reset does not affect the state of the port A – port G data registers. However, port H, port I and  
port J data registers are reset to 0.  
4.8.2  
Data direction registers (DDRA, DDRB, DDRC, DDRD and  
DDRE)  
State  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
Port A data direction (DDRA)  
$0004  
$0005  
$0006  
$0007  
$000B  
Port B data direction (DDRB)  
Port C data direction (DDRC)  
Port D data direction (DDRD)  
Port E data direction (DDRE)  
Writing a ‘1’ to any bit configures the corresponding port pin as an output; conversely, writing any  
bit to ‘0’ configures the corresponding port pin as an input.  
Reset clears these registers, thus configuring all port pins as inputs.  
TPG  
MC68HC05F32  
PARALLEL INPUT/OUTPUT PORTS  
MOTOROLA  
4-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
4.8.3  
Port control registers  
State on  
reset$  
Address  
bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Port D control (PDCR) $001A  
Port E control (PECR) $000C  
Port F control (PFCR) $0011  
Port G control (PGCR) $0013  
Port H control (PHCR) $0015  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
4
Port I control (PICR)  
$0017  
Port J control (PJCR) $0019  
Writing a 1 to any bit configures the corresponding port pin as a special function port (timer, A/D,  
LCD, PWM, refresh clock). However, clearing any bit to 0, configures the corresponding port pin  
in port D and port E as general purpose I/O, port F and port G as input, and port H, port I and port  
J as output.  
TPG  
MOTOROLA  
4-8  
PARALLEL INPUT/OUTPUT PORTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
5
CORE TIMER  
5
The MC68HC05F32 has a 15-stage ripple counter called the core timer (CTIMER). Features of  
this timer are: timer overflow, power-on reset (POR), real time interrupt (RTI) with four selectable  
interrupt rates and a computer operating properly (COP) watchdog timer.  
Internal bus  
8
Internal processor clock  
f
OP  
$09 CTCR  
(Core timer counter)  
2
f
/ 2  
OP  
(÷ 4)  
8
10  
f
/ 2  
OP  
7-bit counter  
Overow  
detect  
circuit  
17  
14  
f
/ 2  
f
/ 2  
OP  
OP  
COP  
clear  
RTI select circuit  
$08 CTCSR  
(Core timer control and status)  
TOF RTIF TOFE  
RTIE RTOF RRTIF RT1 RT0  
COP watchdog  
timer  
8
(÷ 8)  
Interrupt circuit  
To  
reset  
logic  
To interrupt logic  
Figure 5-1 Core timer block diagram  
TPG  
MC68HC05F32  
CORE TIMER  
MOTOROLA  
5-1  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
As shown in Figure 5-1, the timer is driven by the internal bus clock divided by four with a fixed  
prescaler. This signal drives an 8-bit ripple counter. The value of this 8-bit ripple counter can be  
read by the CPU at any time, by accessing the CTIMER counter register (CTCR) at address $09.  
A timer overflow function is implemented on the last stage of this counter, giving a possible  
interrupt at the rate of f /1024. (The POR signal (t  
) is also derived from this register, at  
OP  
PORL  
f
/4064.) The counter register circuit is followed by four more stages, with the resulting clock  
OP  
(f /16384) driving the real time interrupt circuit. The RTI circuit consists of three divider stages  
OP  
with a 1-of-4 selector. The output of the RTI circuit is further divided by 8 to drive the COP  
watchdog timer circuit. The RTI rate selector bits, and the RTI and CTIMER overflow enable bits  
and flags, are located in the CTIMER control and status register (CTCSR) at location $08.  
5
CTOF (core timer overflow flag) is a clearable, read-only status bit and is set when the 8-bit ripple  
counter rolls over from $FF to $00. A CPU interrupt request will be generated if CTOFE is set.  
Clearing the CTOF is done by writing a0to it.Writing a1to CTOF has no effect on the bit’s value.  
Reset clears CTOF.  
When CTOFE (core timer overflow enable) is set, a CPU interrupt request is generated when the  
CTOF bit is set. Reset clears CTOFE.  
The core timer counter register (CTCR) is a read-only register that contains the current value of  
the 8-bit ripple counter at the beginning of the timer chain.This counter is clocked at fOP/4 and can  
be used for various functions including a software input capture. Extended time periods can be  
attained using the CTIMER overflow function to increment a temporary RAM storage location  
thereby simulating a 16-bit (or more) counter.  
The power-on cycle clears the entire counter chain and begins clocking the counter. After t  
PORL  
cycles, the power-on reset circuit is released, which again clears the counter chain and allows the  
device to come out of reset. At this point, if RESET is not asserted, the timer will start counting up  
from zero and normal device operation will begin. When RESET is asserted at any time during  
operation (other than POR), the counter chain will be cleared.  
5.1  
Real time interrupts (RTI)  
The real time interrupt circuit consists of a three stage divider and a 1-of-4 selector. The clock  
frequency that drives the RTI circuit is fOP/214 (or fOP/16384), with three additional divider stages,  
giving a maximum interrupt period of 4 seconds at a bus frequency (fOP) of 32kHz. Register details  
are given in Section 5.2.  
TPG  
MOTOROLA  
5-2  
CORE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
5.2  
Core timer registers  
5.2.1  
Core timer control and status register (CTCSR)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Core timer control/status (CTCSR) $0008 CTOF RTIF CTOFE RTIE RTOF RRTIF RT1  
RT0 0000 0011  
5
CTOF — Core timer overflow  
1 (set)  
Core timer overflow has occurred.  
0 (clear) – No core timer overflow interrupt has been generated.  
CTOF is a read-only status bit and is set when the core timer counter register rolls over from $FF  
to $00; an interrupt request will be generated if CTOFE is set.When set, CTOF may be cleared by  
writing a ‘1’ to RTOF.  
RTIF — Real time interrupt flag  
1 (set)  
A real time interrupt has occurred.  
0 (clear) – No real time interrupt has been generated.  
RTIF is a read-only status bit and is set when the output of the chosen stage becomes active; an  
interrupt request will be generated if RTIE is set. When set, the bit may be cleared by writing a ‘1’  
to RRTIF. Reset also clears this bit.  
CTOFE — Core timer overflow enable  
1 (set)  
Core timer overflow interrupt is enabled.  
0 (clear) – Core timer overflow interrupt is disabled.  
Setting this bit enables the core timer overflow Interrupt. A CPU interrupt request will then be  
generated whenever the CTOF bit becomes set and the I-bit in the CCR is clear. Clearing this bit  
disables the core timer overflow interrupt capability.  
RTIE — Real time interrupt enable  
1 (set)  
Real time interrupt is enabled.  
0 (clear) – Real time interrupt is disabled.  
Setting this bit enables the real time interrupt. A CPU interrupt request will then be generated  
whenever the RTIF bit becomes set and the I-bit in the CCR is clear. Clearing this bit disables the  
real time interrupt capability.  
TPG  
MC68HC05F32  
CORE TIMER  
MOTOROLA  
5-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
RT1, RT0 — Real time interrupt rate select  
These two bits select one of four taps from the real time interrupt circuitry. Reset sets both RT0  
and RT1 to one, selecting the lowest periodic rate and therefore the maximum time in which to alter  
them if necessary. The COP reset times are also determined by these two bits. Care should be  
taken when altering RT0 and RT1 if a timeout is imminent, or the timeout period is uncertain. If the  
selected tap is modified during a cycle in which the counter is switching, an RTIF could be missed  
or an additional one could be generated. To avoid problems, the COP should be cleared before  
changing the RTI taps. See Table 5-1 for some example RTI periods.  
5
Table 5-1 Example RTI periods  
RTI Rates at f Frequency Specied  
OP  
Division  
ratio  
RT1 RT0  
16.384 kHz 447 kHz  
895 kHz 1.789 MHz  
14  
0
0
1
1
0
1
0
1
2
1 s  
2 s  
4 s  
8 s  
36.7 ms  
73.4 ms  
146.8 ms  
293.6 ms  
18.35 ms  
36.7 ms  
73.4 ms  
146.8 ms  
9.17 ms  
18.35 ms  
36.7 ms  
73.4 ms  
15  
2
16  
2
17  
2
5.2.2  
Core timer counter register (CTCR)  
State  
on reset  
Address bit 7  
$0009  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Core timer counter (CTCR)  
0000 0000  
The core timer counter register is a read-only register, which contains the current value of the 8-bit  
ripple counter at the beginning of the timer chain. Reset clears this register.  
TPG  
MOTOROLA  
5-4  
CORE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
5.3  
Computer operating properly (COP) watchdog timer  
The COP watchdog timer function is implemented by taking the output of the RTI circuit and further  
dividing it by eight, as shown in Figure 5-1. Note that the minimum COP timeout period is seven  
times the RTI period. This is because the COP will be cleared asynchronously with respect to the  
value in the core timer counter register/RTI divider, hence the actual COP timeout period will vary  
between 7x and 8x the RTI period. The minimum COP reset rates are shown in Table 5-2.  
The COP function is a mask option, enabled or disabled during device manufacture.  
If the COP circuit times out, an internal reset is generated and the normal reset vector is fetched.  
A COP timeout is prevented by writing a ‘0’ to bit 0 of address $FFF0. When the COP is cleared,  
only the final divide-by-eight stage is cleared (see Figure 5-1).  
5
Table 5-2 Minimum COP reset times  
Minimum COP reset at f frequency specified  
OP  
RT1 RT0 16.384 kHz 447 kHz  
895 kHz  
1.789 MHz  
64.19 ms  
128.45 ms  
256.9 ms  
513.8 ms  
f
OP  
0
0
1
1
0
7 s  
256.9 ms 128.45 ms  
7 x RTI rate  
7 x RTI rate  
7 x RTI rate  
7 x RTI rate  
1
14 s  
28 s  
56 s  
513.8 ms  
1.03 s  
256.9 ms  
513.8 s  
1.03 s  
0
1
2.06 s  
5.4  
Core timer during WAIT  
The CPU clock halts during the WAIT mode, but the timer remains active. If the CTIMER interrupts  
are enabled, then a CTIMER interrupt will cause the processor to exit the WAIT mode.  
5.5  
Core timer during STOP  
The timer is cleared when going into STOP mode. When STOP is exited by an external interrupt  
or an external reset, the internal oscillator will restart, followed by an internal processor  
stabilization delay (tPORL). The timer is then cleared and operation resumes.  
TPG  
MC68HC05F32  
CORE TIMER  
MOTOROLA  
5-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
5
THIS PAGE LEFT BLANK INTENTIONALLY  
TPG  
MOTOROLA  
5-6  
CORE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6
16-BIT PROGRAMMABLE TIMER  
The MC68HC05F32 has two programmable 16-bit timers (TIMER1 and TIMER2), each with two  
channels. The output compare function in TIMER2 has no external output, and is therefore used  
for generating precision time intervals and interrupts only. The external connections are the only  
differences between the two timers. The internal operation is identical (each timer has its own set  
of registers), therefore only a complete description of TIMER1 is given.  
6
The timer consists of a 16-bit read-only free-running counter, with a fixed divide-by-four prescaler,  
plus the input capture/output compare circuitry.The timer can be used for many purposes including  
measuring pulse length of two input signals and generating two output signals. Pulse lengths for  
both input and output signals can vary from several microseconds to many seconds. The timer is  
also capable of generating periodic interrupts or indicating passage of an arbitrary multiple of four  
CPU cycles. A block diagram is shown in Figure 6-1, and timing diagrams are shown in Figure 6-2,  
Figure 6-3, Figure 6-4 and Figure 6-5.  
The timer has a 16-bit architecture, hence each specific functional segment is represented by two  
8-bit registers.These registers contain the high and low byte of that functional segment. Accessing  
the low byte of a specific timer function allows full control of that function; however, an access of  
the high byte inhibits that specific timer function until the low byte is also accessed.  
The 16-bit programmable timer is monitored and controlled by a group of fifteen registers, full  
details of which are contained in this section.  
Note:  
A problem may arise if an interrupt occurs in the time between the high and low bytes  
being accessed. To prevent this, the I-bit in the condition code register (CCR) should be  
set while manipulating both the high and low byte register of a specific timer function,  
ensuring that an interrupt does not occur.  
6.1  
Counter  
The key element in the programmable timer is a 16-bit, free-running counter or counter register,  
preceded by a prescaler that divides the internal processor clock by four. The prescaler gives the  
timer a resolution of 2µs if the internal bus clock is 2 MHz. The counter is incremented during the  
low portion of the internal bus clock. Software can read the counter at any time without affecting  
its value.  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Internal bus  
8
Internal  
processor  
clock  
8-bit  
buffer  
High  
byte  
Low  
byte  
High  
byte  
Low  
byte  
High  
byte  
Low  
byte  
High  
byte  
Low  
byte  
High  
byte  
Low  
byte  
4
÷
16-bit  
free-running  
counter  
Output  
compare  
register 2  
Output  
compare  
register 1  
$0028  
$0029  
$0024  
Input capture $0020 Input capture  
$0022  
$0023  
$0026  
$0027  
register 1  
register 2  
$0021  
$0025  
6
Counter  
alternate  
register  
$002A  
$002B  
COP watchdog  
counter input  
Internal timer bus  
Overow  
detect  
circuit  
Edge  
detect  
circuit 1  
Edge  
detect  
circuit 2  
Output  
compare  
circuit 1  
Output  
compare  
circuit 2  
TCAP2  
pin  
TCAP1  
pin  
TCMP2  
pin  
D
Q
CLK  
C
TCMP1  
pin  
D
CLK  
Q
C
OC2IE CO2E OLVL2  
TCR2 $002D  
TSR $002E  
IC1IE IC2IE OC1IE TOIE CO1E  
IC1F IC2F OC1F TOF OC2F  
IEDG1 IEDG2 OLVL1  
TCR1 $002C  
RESET  
Interrupt circuit  
Input capture  
interrupt vector  
$7FF4, 5  
Output compare  
interrupt vector interrupt vector  
$7FF4, 5  
$7FF4, 5  
Input capture  
Overow interrupt  
vector  
Output compare  
interrupt vector  
$7FF4, 5  
$7FF4, 5  
Figure 6-1 16-bit programmable timer block diagram  
TPG  
MOTOROLA  
6-2  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.1.1  
Counter register and alternate counter register  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
bit 0  
Timer counter high (CNTH)  
$0028  
$0029  
1111 1111  
1111 1100  
Timer counter low (CNTL)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
Alternate counter high (ACNTH)  
Alternate counter low (ACNTL)  
$002A  
$002B  
1111 1111  
1111 1100  
6
The double-byte, free-running counter can be read from either of two locations, $0028 – $0029  
(counter register) or $002A – $002B (counter alternate register). A read from only the less  
significant byte (LSB) of the free-running counter ($0029 or $002B) receives the count value at the  
time of the read. If a read of the free-running counter or alternate counter register first addresses  
the more significant byte (MSB) ($0028 or $002A), the LSB is transferred to a buffer. This buffer  
value remains fixed after the first MSB read, even if the user reads the MSB several times. This  
buffer is accessed when reading the free-running counter or alternate counter register LSB and  
thus completes a read sequence of the total counter value. In reading either the free-running  
counter or alternate counter register, if the MSB is read, the LSB must also be read to complete  
the sequence. If the timer overflow flag (TOF) is set when the counter register LSB is read then a  
read of the timer status register (TSR) will clear the flag.  
The counter alternate register differs from the counter register only in that a read of the LSB does  
not clear TOF. Therefore, where it is critical to avoid the possibility of missing timer overflow  
interrupts due to clearing of TOF, the alternate counter register should be used.  
The free-running counter is set to $FFFC during power-on and external reset and is always a  
read-only register. During a power-on reset, the counter begins running after the oscillator start-up  
delay. Because the free-running counter is 16 bits preceded by a fixed divide-by-4 prescaler, the  
value in the free-running counter repeats every 262,144 internal bus clock cycles.TOF is set when  
the counter overflows (from $FFFF to $0000); this will cause an interrupt if TOIE is set.  
The divide-by-4 prescaler is also reset and the counter resumes normal counting operation. All of  
the flags and enable bits remain unaltered by this operation. If access has previously been made  
to the high byte of the free-running counter ($0028 or $002A), then the reset counter operation  
terminates the access sequence.  
Caution: This operation may affect the function of the watchdog system (see Section 5.3).  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.2  
Timer control and status  
The various functions of the timer are monitored and controlled using the timer control and status  
registers described below.  
6.2.1  
Timer control registers 1 and 2 (TCR1 and TCR2)  
The two timer control registers TCR1 and TCR2 ($002C and $002D) are used to enable the input  
captures (IC1IE and IC2IE), output compares (OC1IE and OC2E), and timer overflow (TOIE)  
functions as well as enabling the compare outputs (CO1E and CO2E), selecting input edge  
sensitivity (IEDG1 and IEDG2) and levels of output polarity (OLVL1 and OLVL2).  
6
State  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
Timer control 1 (TCR1)  
Timer control 2 (TCR2)  
$002C IC1IE IC2IE OC1IE TOIE CO1E IEDG1 IEDG2 OLVL1 0000 0uu0  
State  
Address bit 7  
$002D  
bit 6  
0
bit 5  
bit 4  
0
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
OLVL2 0000 0000  
0
OC2IE  
CO2E  
0
0
TPG  
MOTOROLA  
6-4  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
IC1IE — Input capture 1 interrupt enable  
If this bit is set, a timer interrupt is enabled whenever the IC1F status flag (in the timer status  
register) is set.  
1 (set)  
Interrupt enabled.  
0 (clear) – Interrupt disabled.  
IC2IE — Input capture 2 interrupt enable  
If this bit is set, a timer interrupt is enabled whenever the IC2F status flag (in the timer status  
register) is set.  
1 (set)  
Interrupt enabled.  
6
0 (clear) – Interrupt disabled.  
OC1IE — Output compare 1 interrupt enable  
If this bit is set, a timer interrupt is enabled whenever the OC1F status flag (in the timer status  
register) is set.  
1 (set)  
Interrupt enabled.  
0 (clear) – Interrupt disabled.  
TOIE — Timer overflow interrupt enable  
If this bit is set, a timer interrupt is enabled whenever the TOF status flag (in the timer status  
register) is set.  
1 (set)  
Interrupt enabled.  
0 (clear) – Interrupt disabled.  
CO1E — Timer compare 1 output enable  
If this bit is set, the output from timer output compare 1 is enabled.  
1 (set)  
Output compare 1 enabled.  
0 (clear) – Output compare 1 disabled.  
IEDG1 — Input edge 1  
When IEDG1 is set, a positive-going edge on the TCAP1 pin will trigger a transfer of the  
free-running counter value to the input capture register 1. When clear, a negative-going edge  
triggers the transfer.  
1 (set)  
TCAP1 is positive-going edge sensitive.  
0 (clear) – TCAP1 is negative-going edge sensitive.  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
IEDG2 — Input edge 2  
When IEDG2 is set, a positive-going edge on the TCAP2 pin will trigger a transfer of the  
free-running counter value to the input capture register 2. When clear, a negative-going edge  
triggers the transfer.  
1 (set)  
TCAP2 is positive-going edge sensitive.  
0 (clear) – TCAP2 is negative-going edge sensitive.  
OLVL1 — Output level 1  
When OLV1 is set a high output level will be clocked into the output level register by the next  
successful output compare, and will appear on the TCMP1 pin. When clear, it will be a low level  
which will appear on the TCMP1 pin.  
6
1 (set)  
A high output level will appear on the TCMP1 pin.  
0 (clear) – A low output level will appear on the TCMP1 pin.  
OC2IE — Output compare 2 interrupt enable  
If this bit is set, a timer interrupt is enabled whenever the OC2F status flag (in the timer status  
register) is set.  
1 (set)  
Interrupt enabled.  
0 (clear) – Interrupt disabled.  
CO2E — Timer compare 2 output enable  
If this bit is set, the output from timer output compare 2 is enabled.  
1 (set)  
Output compare 2 enabled.  
0 (clear) – Output compare 2 disabled.  
OLVL2 — Output level 2  
When OLV2 is set a high output level will be clocked into the output level register by the next  
successful output compare, and will appear on the TCMP2 pin. When clear, it will be a low level  
which will appear on the TCMP2 pin.  
1 (set)  
A high output level will appear on the TCMP2 pin.  
0 (clear) – A low output level will appear on the TCMP2 pin.  
TPG  
MOTOROLA  
6-6  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.2.2  
Timer status register (TSR)  
The timer status register ($002E) contains the status bits corresponding to the timer interrupt  
conditions – IC1F, IC2F, OC1F, TOF, TCAP1, TCAP2 and OC2F.  
Accessing the timer status register satisfies the first condition required to clear the status bits.The  
remaining step is to access the register corresponding to the status bit.  
State  
on reset  
Undened  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Timer status (TSR)  
$002E IC1F IC2F OC1F TOF TCAP1 TCAP2 OC2F  
0
IC1F — Input capture 1 flag  
6
This bit is set when the selected polarity of edge is detected by the input capture edge detector 1  
at TCAP1; an input capture interrupt will be generated, if IC1IE is set. IC1F is cleared by reading  
the TSR and then the input capture 1 low register ($0021).  
1 (set)  
A valid input capture has occurred.  
0 (clear) – No input capture has occurred.  
IC2F — Input capture 2 flag  
This bit is set when the selected polarity of edge is detected by the input capture edge detector 2  
at TCAP2; an input capture interrupt will be generated if IC2IE is set. IC2F is cleared by reading  
the TSR and then the input capture 2 low register ($0025).  
1 (set)  
A valid input capture has occurred.  
0 (clear) – No input capture has occurred.  
OC1F — Output compare 1 flag  
This bit is set when the output compare register 1 contents match those of the free-running  
counter; an output compare interrupt will be generated if OC1IE is set. OC1F is cleared by reading  
the TSR and then the output compare 1 low register ($0023).  
1 (set)  
A valid output compare has occurred.  
0 (clear) – No output compare has occurred.  
TOF — Timer overflow status flag  
This bit is set when the free-running counter overflows from $FFFF to $0000; a timer overflow interrupt  
will occur if TOIE is set.TOF is cleared by reading the TSR and the counter low register ($0029).  
1 (set)  
Timer overflow has occurred.  
0 (clear) – No timer overflow has occurred.  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
When using the timer overflow function and reading the free-running counter at random times to  
measure an elapsed time, a problem may occur whereby the timer overflow flag is unintentionally  
cleared if:  
1
2
The timer status register is read or written when TOF is set, and  
The LSB of the free-running counter is read, but not for the purpose of  
servicing the flag.  
Reading the alternate counter register instead of the counter register will avoid this potential  
problem.  
TCAP1 — Timer capture 1 status flag  
6
This bit reflects the status of the timer capture 1 input.  
TCAP2 — Timer capture 2 status flag  
This bit reflects the status of the timer capture 2 input.  
OC2F — Output compare 2 flag  
This bit is set when the output compare register 2 contents match those of the free-running  
counter; an output compare interrupt will be generated if OC2IE is set. OC2F is cleared by reading  
the TSR and then the output compare 2 low register ($0027).  
1 (set)  
A valid output compare has occurred.  
0 (clear) – No output compare has occurred.  
TPG  
MOTOROLA  
6-8  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.3  
Input capture  
‘Input capture’ is a technique whereby an external signal is used to trigger a read of the free  
running counter. In this way it is possible to relate the timing of an external signal to the internal  
counter value, and hence to elapsed time.  
There are two input capture registers:input capture register 1 (ICR1) and input capture register 2 (ICR2).  
There are two input capture interrupt enable bits (IC1IE and IC2IE).  
6.3.1  
Input capture register 1 (ICR1)  
6
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Input capture 1 high (ICR1H)  
Input capture 1 low (ICR1L)  
$0020  
$0021  
Undened  
Undened  
The two 8-bit registers that make up the 16-bit input capture register 1 are read-only, and are used  
to latch the value of the free-running counter after the input capture edge detector circuit 1 senses  
a valid transition at TCAP1. The level transition that triggers the counter transfer is defined by the  
input edge bit (IEDG1).When an input capture 1 occurs, the corresponding flag IC1F inTSR is set.  
An interrupt can also accompany an input capture 1 provided the IC1IE bit in TCR1 is set. The 8  
most significant bits are stored in the input capture register 1 high at $0020, the 8 least significant  
bits in the input capture register 1 low at $0021.  
The result obtained from an input capture will be one greater than the value of the free-running  
counter on the rising edge of the internal bus clock preceding the external transition.This delay is  
required for internal synchronization. Resolution is one count of the free-running counter, which is  
four internal bus clock cycles. The free-running counter contents are transferred to the input  
capture register 1 on each valid signal transition whether the input capture 1 flag (IC1F) is set or  
clear.The input capture register 1 always contains the free-running counter value that corresponds  
to the most recent input capture 1. After a read of the input capture register 1 MSB ($0020), the  
counter transfer is inhibited until the LSB ($0021) is also read.This characteristic causes the time  
used in the input capture software routine and its interaction with the main program to determine  
the minimum pulse period. A read of the input capture register 1 LSB ($0021) does not inhibit the  
free-running counter transfer since the two actions occur on opposite edges of the internal bus  
clock.  
Reset does not affect the contents of the input capture register 1, except when exiting STOP mode  
(see Section 6.5).  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.3.2  
Input capture register 2 (ICR2)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Input capture 2 high (ICR2H)  
Input capture 2 low (ICR2L)  
$0024  
$0025  
Undened  
Undened  
The two 8-bit registers that make up the 16-bit input capture register 2 are read-only, and are used  
to latch the value of the free-running counter after the input capture edge detector circuit 2 senses  
a valid transition at pin TCAP2. When an input capture 2 occurs, the corresponding flag IC2F in  
TSR is set. An interrupt can also accompany an input capture 2 provided the IC2IE bit in TCR1 is  
set.The 8 most significant bits are stored in the input capture 2 high register at $0024, the 8 least  
significant bits in the input capture 2 low register at $0025.  
6
The result obtained from an input capture will be one greater than the value of the free-running  
counter on the rising edge of the internal bus clock preceding the external transition.This delay is  
required for internal synchronization. Resolution is one count of the free-running counter, which is  
four internal bus clock cycles. The free-running counter contents are transferred to the input  
capture register 2 on each valid signal transition whether the input capture 2 flag (IC2F) is set or  
clear.The input capture register 2 always contains the free-running counter value that corresponds  
to the most recent input capture 2. After a read of the input capture register 2 MSB ($0024), the  
counter transfer is inhibited until the LSB ($0025) is also read.This characteristic causes the time  
used in the input capture software routine and its interaction with the main program to determine  
the minimum pulse period. A read of the input capture register 2 LSB ($0024) does not inhibit the  
free-running counter transfer since the two actions occur on opposite edges of the internal bus  
clock.  
Reset does not affect the contents of the input capture register 2, except when exiting STOP mode  
(see Section 6.5).  
TPG  
MOTOROLA  
6-10  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.4  
Output compare  
‘Output compareis a technique which may be used, for example, to generate an output waveform,  
or to signal when a specific time period has elapsed, by presetting the output compare register to  
the appropriate value.  
There are two output compare registers: output compare register 1 (OCR1) and output compare  
register 2 (OCR2).  
There are two output compare interrupt enable bits (OC1IE and OC2IE).  
6.4.1  
Output compare register 1 (OCR1)  
6
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Output compare 1 high (OCR1H)  
Output compare 1 low (OCR1L)  
$0022  
$0023  
Undened  
Undened  
The 16-bit output compare register 1 is made up of two 8-bit registers at locations $0022 (MSB)  
and $0023 (LSB). The contents of the output compare register 1 are compared with the contents  
of the free-running counter continually and, if a match is found, the corresponding output compare  
flag (OC1F) in the timer status register is set. If the timer compare output enable bit (CO1E) is set,  
the output level (OLVL1) is transferred to pin TCMP1. The output compare register 1 values and  
the output level bit should be changed after each successful comparison to establish a new  
elapsed timeout. An interrupt can also accompany a successful output compare provided the  
corresponding interrupt enable bit (OC1IE) is set. (The free-running counter is updated every four  
internal bus clock cycles.)  
After a processor write cycle to the output compare register 1 containing the MSB ($0022), the  
output compare function is inhibited until the LSB ($0023) is also written.The user must write both  
bytes (locations) if the MSB is written first. A write made only to the LSB ($0023) will not inhibit the  
compare 1 function.The processor can write to either byte of the output compare register 1 without  
affecting the other byte. The output level (OLVL1) bit is clocked to the output level register and  
hence to the TCMP1 pin whether the output compare flag 1 (OC1F) is set or clear. The minimum  
time required to update the output compare register 1 is a function of the program rather than the  
internal hardware. Because the output compare flag 1 and the output compare register 1 are not  
defined at power on, and not affected by reset, care must be taken when initializing output compare  
functions with software. The following procedure is recommended:  
Write to output compare 1 high to inhibit further compares;  
Read the timer status register to clear OC1F (if set);  
Write to output compare 1 low to enable the output compare 1 function.  
The purpose of this procedure is to prevent the OC1F bit from being set between the time it is read  
and the write to the corresponding output compare register.  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-11  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
All bits of the output compare register are readable and writable and are not altered by the timer  
hardware or reset. If the compare function is not needed, the two bytes of the output compare  
register can be used as storage locations.  
6.4.2  
Output compare register 2 (OCR2)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Output compare 2 high (OCR2H)  
Output compare 2 low (OCR2L)  
$0026  
$0027  
Undened  
Undened  
6
The 16-bit output compare register 2 is made up of two 8-bit registers at locations $0026 (MSB)  
and $0027 (LSB). The contents of the output compare register 2 are compared with the contents  
of the free-running counter continually and, if a match is found, the corresponding output compare  
flag (OC2F) in the timer status register is set. If the timer compare 2 output enable bit (CO2E) is  
set, the output level (OLVL2) is transferred to pin TCMP2. The output compare register 2 values  
and the output level bit should be changed after each successful comparison to establish a new  
elapsed timeout. An interrupt can also accompany a successful output compare provided the  
corresponding interrupt enable bit (OC2IE) is set. (The free-running counter is updated every four  
internal bus clock cycles.)  
After a processor write cycle to the output compare register 2 containing the MSB ($0026), the  
output compare function is inhibited until the LSB ($0027) is also written.The user must write both  
bytes (locations) if the MSB is written first. A write made only to the LSB ($0027) will not inhibit the  
compare 2 function.The processor can write to either byte of the output compare register 2 without  
affecting the other byte. The output level (OLVL2) bit is clocked to the output level register and  
hence to the TCMP2 pin whether the output compare 2 flag (OC2F) is set or clear. The minimum  
time required to update the output compare register 2 is a function of the program rather than the  
internal hardware. Because the output compare 2 flag and the output compare register 2 are not  
defined at power on, and not affected by reset, care must be taken when initializing output compare  
functions with software. The following procedure is recommended:  
Write to output compare 2 high to inhibit further compares;  
Read the timer status register to clear OC2F (if set);  
Write to output compare 2 low to enable the output compare 2 function.  
The purpose of this procedure is to prevent the OC2F bit from being set between the time it is read  
and the write to the corresponding output compare register.  
All bits of the output compare register are readable and writable and are not altered by the timer  
hardware or reset. If the compare function is not needed, the two bytes of the output compare  
register can be used as storage locations.  
TPG  
MOTOROLA  
6-12  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6.5  
Timer during STOP mode  
When the MCU enters STOP mode, the timer counter stops counting and remains at that particular  
count value until STOP mode is exited by an interrupt. If STOP mode is exited by power-on or  
external reset, the counter is forced to $FFFC but if it is exited by external interrupt (IRQ) then the  
counter resumes from its stopped value.  
Another feature of the programmable timer is that if at least one valid input capture edge occurs at  
one of the TCAP pins while in STOP mode, the corresponding input capture detect circuitry is  
armed.This action does not wake the MCU or set any timer flags, but when the MCU does wake-up  
there will be an active input capture flag (and data) from that first valid edge which occurred during  
STOP mode.  
If STOP mode is exited by an external reset then no such input capture flag or data action takes  
place even if there was a valid input capture edge (at one of the TCAP pins) during STOP mode.  
6
6.6  
Timer during WAIT mode  
During WAIT mode, the CPU clock halts but timer1 keeps running. Timer2 is disabled, if bit 7  
(WTLCDO) of the LCD control register is set, however, if it is cleared, timer2 remains active. If  
interrupts are enabled, a timer interrupt will cause the processor to exit WAIT mode.  
6.7  
Timer state diagrams  
The relationships between the internal clock signals, the counter contents and the status of the  
flag bits are shown in the following figures. It should be noted that the signals labelled ‘internal’  
(processor clock, timer clocks and reset) are not available to the user.  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-13  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Internal  
processor clock  
Internal  
reset  
T00  
T01  
T10  
T11  
Internal  
timer clocks  
16-bit  
counter  
$FFFC  
$FFFD  
$FFFE  
$FFFF  
6
External reset  
or end of POR  
Note:  
The counter and timer control registers are the only ones affected by power-on or external reset.  
Figure 6-2 Timer state timing diagram for reset  
Internal  
processor clock  
T00  
T01  
T10  
T11  
Internal  
timer clocks  
16-bit  
counter  
$F123  
$F124  
$F125  
$F126  
Input  
edge  
Internal  
capture latch  
Input capture  
register  
$????  
$F124  
Input capture  
ag  
Note:  
If the input edge occurs in the shaded area from one timer state T10 to the next timer state T10, then  
the input capture ag will be set during the next T11 state.  
Figure 6-3 Timer state timing diagram for input capture  
TPG  
MOTOROLA  
6-14  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Internal  
processor clock  
T00  
T01  
T10  
T11  
Internal  
timer clocks  
16-bit  
counter  
$F456  
$F457  
$F458  
$F459  
(Note 1)  
Output compare  
register  
CPU writes $F457  
$F457  
6
(Note 1)  
Compare register  
latch  
(Note 2)  
Output compare  
ag and TCMP1,2  
Note:  
1
The CPU write to the compare registers may take place at any time, but a compare only occurs at timer state  
T01.Thus a four cycle difference may exist between the write to the compare register and the actual compare.  
2
The output compare ag is set at the timer state T11 that follows the comparison match ($F457 in this example).  
Figure 6-4 Timer state timing diagram for output compare  
Internal  
processor clock  
T00  
T01  
Internal  
timer clocks  
T10  
T11  
16-bit  
counter  
$FFFF  
$0000  
$0001  
$0002  
Timer overow  
ag  
Note:  
The timer overow ag is set at timer state T11 (transition of counter from $FFFF to $0000). It is cleared by  
a read of the timer status register during the internal processor clock high time, followed by a read of the  
counter low register.  
Figure 6-5 Timer state timing diagram for timer overflow  
TPG  
MC68HC05F32  
16-BIT PROGRAMMABLE TIMER  
MOTOROLA  
6-15  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
6
THIS PAGE LEFT BLANK INTENTIONALLY  
TPG  
MOTOROLA  
6-16  
16-BIT PROGRAMMABLE TIMER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
7
DTMF/MELODY GENERATOR  
7.1  
Introduction  
7
The DTMF/melody generator (DMG) is a multi-functional tone generator built into the  
MC68HC05F32 MCU which supports DTMF dialling, melody-on-hold and pacifier tone functions.  
7.1.1  
Features  
4 row and 4 column frequencies for DTMF dialling  
24 row and 24 column frequencies for dual tone melody  
28 frequencies for pacifier tone to acknowledge button pressed for pulse dialling  
Power saving mechanism for output disable condition  
3.579MHz/2 operation  
6-bit D/A converter and 28 time steps for sine wave generation  
Sine wave or square wave selectable output for melody (or DTMF)  
Single or dual tone capability for melody (or DTMF)  
TPG  
MC68HC05F32  
DTMF/MELODY GENERATOR  
MOTOROLA  
7-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
7.2  
Functional description  
As shown in Figure 7-1, the DMG consists of 2 tone generation paths (the column and row paths).  
One path generates the row tone and the other the column tone, whose frequencies are  
determined by the values in the frequency control registers FCR and FCC respectively.The tones  
allowed at the TNO output are single/dual sine/square wave tones of DTMF and melody  
frequencies, whereas at the TNX output, only single square wave tones are allowed. The method  
of tone generation for the two paths is almost the same, and is described as follows.  
To generate a sine wave tone with programmable frequency in a path, the internal clock (i.e. the  
3.58MHz/2) is first divided by a frequency divider according to a number on the register (FCR or  
FCC). The output of the divider is a periodic pulse train whose frequency is the sampling rate of  
the desired ‘staircase sine wave’. This pulse train, in turn, clocks a divide-by-28 binary counter  
(PLA scanner) whose 28 decoded outputs scan sequentially 28 memory locations of a 28x6 sine  
wave generator (PLA) in 28 time steps (M). The six resulting digital sine wave bits are then fed  
separately to a 6-bit resistor ladder to produce a current signal.  
7
The method for generating a square wave tone in a path is similar to that of a sine wave tone  
except that only the most significant bit of a sine wave PLA is fed to the 6-bit resistor ladder to  
produce a current signal (the other 5 least significant bits are masked by the sine/square wave  
select). Using this method, a square wave tone can be produced which has exactly the same  
frequency and phase as a sine wave tone, and uses the same frequency control register value.  
After obtaining the current signals from the row and column paths, the row current signal is first  
attenuated by 2dB. It is then summed with the column current signal, and is finally fed to an active  
7 KHz low pass filter to reduce harmonic distortion (note that square wave tones are also passed  
through this filter). The resulting DTMF or melody signal is output through the TNO pin which is  
normally connected to a speech circuit.  
The generator provides not only DTMF and melody but also a square wave pacifier tone (ToneX).  
This signal is also extracted from the most significant bit of the sine wave PLA of the row path, but  
is not passed through the filter. The ToneX signal is output through the TNX pin which is normally  
connected to a loudspeaker.  
TPG  
MOTOROLA  
7-2  
DTMF/MELODY GENERATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
3.58 MHz/2  
msb  
6
TNX  
Row  
frequency  
divider  
Sine wave  
PLA  
28 x 6 bit  
Sine/square  
wave  
select  
MUX  
PLA  
scanner  
lsb  
6-bit  
resistor  
ladder  
5
Current summer  
+
active low pass  
filter  
FCR register  
FCC register  
TGER  
TGEC  
MS1  
Data  
validator  
7
TNO  
+
MS0  
TNOE  
Tristate  
control  
5
STOP  
6
6
Sine wave  
PLA  
28 x 6 bit  
Sine/square  
wave  
select  
Row  
frequency  
divider  
6-bit  
resistor  
ladder  
High group  
pre-emphasis  
PLA  
scanner  
Figure 7-1 DTMF/melody generator (DMG) block diagram  
TPG  
MC68HC05F32  
DTMF/MELODY GENERATOR  
MOTOROLA  
7-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
7.3  
DMG registers  
The DMG has two registers (row frequency control register and column frequency control register)  
for row and column frequency selection respectively, and one register (tone control register) for  
tone output control and mode selection.  
7.3.1  
Row and column frequency control registers  
State  
on reset  
Address bit 7  
$000D  
bit 6  
0
bit 5  
0
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Row frequency control  
0
FCR4 FCR3 FCR2 FCR1 FCR0 undefined  
register (FCR)  
7
State  
on reset  
Address bit 7  
bit 6  
0
bit 5  
0
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Column frequency control  
register (FCC)  
$000E  
0
FCC4 FCC3 FCC2 FCC1 FCC0 undened  
FCR4–FCR0 and FCC4–FCC0 control the frequency of the tone signals on the row and the  
column paths respectively. The row and column paths are not exactly identical owing to the  
presence of the high group pre-emphasis in the column path. In order to avoid the entry of the row  
DTMF tone values to the column, and vice versa, the above cases are treated as illegal.The data  
validator will disable all outputs when an illegal value is detected.The bit description for DTMF and  
melody tone generation are shown in Table 7-1 and Table 7-2 respectively. It is the user’s  
responsibility to ensure good programming practice by initialising all registers to contain legal  
values for the desired function.  
7.3.2  
Tone control register (TNCR)  
This register controls the internal configuration and tone output timing of the DTMF/melody  
generator.  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
Tone control register  
(TNCR)  
$000F MS1 MS0 TGER TGEC TNOE  
0
0
0
0000 0000  
MS1, MS0 — Melody select for operation  
The MS0 and MS1 bits control the mode of operation of the DTMF/melody generator. There are  
sine wave, square wave 1, square wave 2 and square wave 3 modes.They are specified as shown  
in Table 7-3.  
TPG  
MOTOROLA  
7-4  
DTMF/MELODY GENERATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
When square wave 2 or square wave 3 mode is selected, the TNX pin is activated. The idle state  
for TNX is a logic high. The final state of the TNX pin is still dependent on the values of TGER,  
TGEC (see Table 7-4), FCR and FCC bits (when illegal values are input).  
The state of the TNO pin depends on the value of the TNOE bit. After a RESET, the TNOE is  
cleared and the TNO pin is tristate. When TNOE is set, the TNO output is activated. If the TGER  
and TGEC bits are held low and TNOE is set, the dc offset of V /2 appears at TNO pin. In STOP  
DD  
mode, the TNX pin is high and the TNO pin is tristate.  
When both MS1 and MS0 are set (square wave 3), the generator can generate both single tone  
melody at the column path, and ToneX at the row path simultaneously.  
TGER — Tone generator enable row path  
1 (set)  
Row path on  
0 (clear) – Row path off  
7
TGEC — Tone generator enable column path  
1 (set)  
Column path on  
0 (clear) – Column path off  
TNOE — Tone output enable  
1 (set)  
TNO on  
0 (clear) – TNO off  
Table 7-1 Bit description for DTMF generation  
Standard  
frequency  
(Hz)  
FCR  
register  
FCC  
register  
Tone output Frequency  
frequency(Hz) deviation  
Tone  
$00  
$01  
$02  
$03  
f
697.0  
770.0  
694.8  
770.1  
–0.32  
0.02  
R1  
f
R2  
f
852.0  
854.2  
0.03  
R3  
f
941.0  
940.0  
–0.11  
–0.244  
–0.324  
0.645  
0.367  
R4  
$10  
$11  
$12  
$13  
f
1209.0  
1336.0  
1477.0  
1633.0  
1206.0  
1331.7  
1486.5  
1639.0  
C1  
f
C2  
f
C3  
f
C4  
Note:The legal values in the FCR register column are illegal to the FCC register,  
and vice versa. An input of illegal values to these registers will produce a  
high at TNX output and V /2 at TNO output (TNOE = 1)  
DD  
TPG  
MC68HC05F32  
DTMF/MELODY GENERATOR  
MOTOROLA  
7-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
.
Table 7-2 Bit description for melody generator  
Standard Tone output Frequency  
Tone frequency frequency deviation  
FCR/FCC  
register  
(Hz)  
622.3  
(Hz)  
620.6  
(%)  
–0.28  
–0.05  
–0.53  
0.44  
$04  
$05  
$06  
$07  
$08  
$09  
$0A  
$0B  
$0C  
$0D  
$0E  
$0F  
$14  
$15  
$16  
$17  
$18  
$19  
$1A  
$1B  
$1C  
$1D  
$1E  
$1F  
D#5  
E5  
659.3  
659.0  
F5  
698.5  
694.8  
F#5  
G5  
740.0  
743.3  
784.0  
779.5  
–0.57  
–0.06  
–0.50  
–0.64  
–0.45  
0.13  
G#5  
A5  
830.6  
830.1  
880.0  
875.6  
7
A#5  
B5  
932.0  
926.4  
987.8  
983.4  
C6  
1046.5  
1108.7  
1174.7  
1244.5  
1318.5  
1396.9  
1480.0  
1568.0  
1661.2  
1760.0  
1864.7  
1975.5  
2093.0  
2217.5  
2349.3  
1047.9  
1102.1  
1183.7  
1253.3  
1331.7  
1389.6  
1486.5  
1559.0  
1682.1  
1775.6  
1880.0  
1997.5  
2062.0  
2204.2  
2367.4  
C#6  
D6  
–0.60  
0.77  
D#6  
E6  
0.71  
1.00  
F6  
–0.52  
0.44  
F#6  
G6  
–0.57  
1.26  
G#6  
A6  
0.89  
A#6  
B6  
0.82  
1.11  
C7  
–1.49  
–0.60  
0.771  
C#7  
D7  
Table 7-3 Mode of operation for DMG  
MS1  
MS0  
Mode  
TNX output  
TNO output  
sine wave row and  
column frequency  
0
0
sine wave  
high  
square wave row and  
column frequency  
0
1
1
1
0
1
square wave 1  
high  
square wave row and  
column frequency  
square wave 2 row frequency  
square wave 3 row frequency  
square wave column  
frequency  
TPG  
MOTOROLA  
7-6  
DTMF/MELODY GENERATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
TGER,TGEC — Tone generation enable for row and column paths  
When both bits are held low, the DMG is disabled by forcing the two frequency counters and the  
two PLA scanning counters to their reset states. The DMG should then consume zero dynamic  
power, if the TNOE bit is also cleared.  
When a TGE bit for a path is held high (provided that the value in the frequency control register  
for that path is legal), the generator is enabled. All the counters associated with that path are then  
run from their reset states.  
The reset state of a frequency counter defines the time=0 state of the time step, whereas at their  
reset state, the PLA scanning counters, scanning the memory location, contain the dc values of  
the staircase sine wave.  
In DTMF dialling, the row and column tone values are first entered to the FCR and FCC registers.  
The TGER and TGEC bits are then set or reset simultaneously to achieve dual tone multiple  
frequency. Similarly, in melody generation, one path is chosen as the high part, and the other as  
the low part.The TGER and TGEC bits are then set and reset according to the rhythm required by  
the musical piece. One can exhibit only single tone melody by disabling either TGER or TGEC  
permanently.The DTMF column and row frequency tones can also be output separately for testing  
by enabling just the one path.  
7
Table 7-4 Effect of tone generation on DMG  
Column  
TGER TGEC RowPath  
Path  
0
0
1
1
0
1
0
1
off  
off  
off  
active  
off  
active  
active  
active  
7.4  
Operation of the DMG  
The DMG is recommended to be operated using the following procedures:  
To operate melody generation, the choice of sine wave or square wave output mode is totally up  
to the user’s taste. The sine wave melody has a sound like a flute, whereas the square wave  
melody possesses much richer harmonics.The required tones are selected through the FCR and  
FCC registers.The selected tone is output when the corresponding TGER or TGEC bit and TNOE  
bit are set.The FCR register should contain the value representing the tone output frequency and  
the FCC register should contain a value of $03 or greater to ensure the output is not blocked by  
the data validator.  
TPG  
MC68HC05F32  
DTMF/MELODY GENERATOR  
MOTOROLA  
7-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
7.5  
DMG during WAIT mode  
The DMG is still active during the WAIT mode.  
7.6  
DMG during STOP mode  
In STOP mode the oscillator is stopped causing the DMG to cease function.  
7
TPG  
MOTOROLA  
7-8  
DTMF/MELODY GENERATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
8
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
The LCD driver module on the MC68HC05F32 supports 40 frontplanes and 4 backplanes,  
allowing a maximum of 160 LCD segments. Each segment is controlled by a corresponding bit in  
the LCD RAM. The mode of operation is determined by the values set in the LCD control register  
at $1E.  
After reset and on leaving standby, the drivers are configured in the default duplex mode, 1/2 bias  
with 2 backplanes. At power-up or after reset, the ON/OFF control bits for the internal and external  
V
voltage (INTVLCD and EXTVON) are cleared, disabling the LCD drivers. Figure 8-1 shows  
LCD  
8
a block diagram of the LCD system. At power-up or after reset the LCD port’s control bits are  
cleared, which disables the LCD frontplane drivers.  
Internal data bus  
8
Internal address bus  
13  
BP3  
BP2  
BP1  
BP0  
LCD  
RAM  
Backplane  
driver  
Internal  
signals  
Control  
logic  
Segment  
driver  
Voltage  
generator  
VLCD  
FP17  
FP0  
Figure 8-1 LCD system block diagram  
TPG  
MC68HC05F32  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MOTOROLA  
8-1  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
8.1  
LCD RAM  
Data to be displayed on the LCD must be written into the LCD RAM. The LCD RAM is comprised  
of 20 bytes of RAM (in the MC68HC05F32’s memory map) at $0054 – $0067. The 160 bits in the  
LCD RAM correspond to the 160 segments that can be driven by the frontplane/backplane drivers.  
Table 8-1 shows how the LCD RAM is organized. Writing a ‘1’ to a given location will result in the  
corresponding display segment being activated when the EXTVON or INTVLCD bit is set. The  
LCD RAM is a dual port RAM that interfaces with the internal address and data buses of the MCU.  
It is possible to read from LCD RAM locations for scrolling purposes.  
Table 8-1 LCD RAM organization  
LCD RAM  
Address  
$54  
Data  
bit 7  
bit 6  
bit 5  
FP1-BP1  
FP3-BP1  
FP5-BP1  
FP7-BP1  
FP9-BP1  
FP11-BP1  
FP13-BP1  
FP15-BP1  
FP17-BP1  
FP19-BP1  
FP21-BP1  
FP23-BP1  
FP25-BP1  
FP27-BP1  
FP29-BP1  
FP31-BP1  
FP33-BP1  
FP35-BP1  
FP37-BP1  
FP39-BP1  
bit 4  
FP1-BP0  
bit 3  
bit 2  
FP0-BP2  
bit 1  
FP0-BP1  
FP2-BP1  
FP4-BP1  
FP6-BP1  
FP8-BP1  
bit 0  
FP1-BP3  
FP3-BP3  
FP5-BP3  
FP7-BP3  
FP9-BP3  
FP11-BP3  
FP13-BP3  
FP15-BP3  
FP17-BP3  
FP19-BP3  
FP21-BP3  
FP23-BP3  
FP25-BP3  
FP27-BP3  
FP29-BP3  
FP31-BP3  
FP33-BP3  
FP35-BP3  
FP37-BP3  
FP39-BP3  
FP1-BP2  
FP3-BP2  
FP5-BP2  
FP7-BP2  
FP9-BP2  
FP11-BP2  
FP13-BP2  
FP15-BP2  
FP17-BP2  
FP19-BP2  
FP21-BP2  
FP23-BP2  
FP25-BP2  
FP27-BP2  
FP29-BP2  
FP31-BP2  
FP33-BP2  
FP35-BP2  
FP37-BP2  
FP39-BP2  
FP0-BP3  
FP0-BP0  
$55  
FP3-BP0  
FP2-BP3  
FP4-BP3  
FP2-BP2  
FP2-BP0  
FP4-BP0  
FP6-BP0  
FP8-BP0  
8
$56  
FP5-BP0  
FP4-BP2  
$57  
FP7-BP0  
FP6-BP3  
FP6-BP2  
$58  
FP9-BP0  
FP8-BP3  
FP8-BP2  
$59  
FP11-BP0  
FP13-BP0  
FP15-BP0  
FP17-BP0  
FP19-BP0  
FP21-BP0  
FP23-BP0  
FP25-BP0  
FP27-BP0  
FP29-BP0  
FP31-BP0  
FP33-BP0  
FP35-BP0  
FP37-BP0  
FP39-BP0  
FP10-BP3  
FP12-BP3  
FP14-BP3  
FP16-BP3  
FP18-BP3  
FP20-BP3  
FP22-BP3  
FP24-BP3  
FP26-BP3  
FP28-BP3  
FP30-BP3  
FP32-BP3  
FP34-BP3  
FP36-BP3  
FP38-BP3  
FP10-BP2  
FP12-BP2  
FP14-BP2  
FP16-BP2  
FP18-BP2  
FP20-BP2  
FP22-BP2  
FP24-BP2  
FP26-BP2  
FP28-BP2  
FP30-BP2  
FP32-BP2  
FP34-BP2  
FP36-BP2  
FP38-BP2  
FP10-BP1 FP10-BP0  
FP12-BP1 FP12-BP0  
FP14-BP1 FP14-BP0  
FP16-BP1 FP16-BP0  
FP18-BP1 FP18-BP0  
FP20-BP1 FP20-BP0  
FP22-BP1 FP22-BP0  
$5A  
$5B  
$5C  
$5D  
$5E  
$5F  
$60  
FP24-BP1  
FP26-BP1  
FP28-BP1  
FP30-BP1  
FP32-BP1  
FP34-BP1  
FP36-BP1  
FP38-BP1  
FP24-BP0  
FP26-BP0  
FP28-BP0  
FP30-BP0  
FP32-BP0  
FP34-BP0  
FP36-BP0  
FP38-BP0  
$61  
$62  
$63  
$64  
$65  
$66  
$67  
TPG  
MOTOROLA  
8-2  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
8.2  
LCD operation  
The LCD driver module can operate in four modes providing different multiplex ratios and number  
of backplanes as follows:  
1/2 bias, 2 backplanes  
1/3 bias, 2 backplanes  
1/3 bias, 3 backplanes  
1/4 bias, 4 backplanes  
The operating mode is selected at power on using the multiplex ratio bits (MUX3 and MUX4) in  
the LCD control register as shown in Table 8-4.  
It is recommended that the EXTVON and INTVLCD bits in the LCD register are not set (display is  
disabled) until the multiplex rate is selected. The voltage levels required for the different multiplex  
rates are generated internally by a resistive divider chain between V  
and V  
.
LCD  
SS  
The 2-way multiplex with 1/3 bias and the three and four-way multiplex options require four voltage  
levels, whereas the two-way multiplex with 1/2 bias needs only three levels. Resistors R1, R2 and  
R3 are valued at 20kΩ ±40%. Figure 8-2 shows the resistive divider chain network that is used to  
produce the various LCD waveforms outlined in Section 8.3.  
8
The LCD drivers can operate with an externalV  
supply when EXTVON = 1, or with an internally  
LCD  
generated LCD voltage when INTVLCD = 1. The EXTVON option is useful when a display with  
particular thresholds is being used. The LCD controller is enabled if the EXTVON bit or the  
INTVLCD bit is set. Table 8-2 shows the different modes of operation depending on the bits  
EXTVON and INTVLCD of the LCD control register.  
Table 8-2 LCD controller operating modes  
LCD  
controller  
Internal voltage Resistor chain  
EXTVON INTVLCD  
generator  
connected with  
0
0
1
1
0
1
0
1
off  
on  
on  
on  
off  
on  
off  
on  
internal V  
LCD  
VLCD pin  
both (for test)  
Note:  
Note:  
The external voltage V  
may not exceed the positive power supply voltage, V  
.
LCD  
DD  
If both bits INTVLCD and EXTVON are set, an externally applied voltage source can  
cause damage to the LCD drivers.  
.
TPG  
MC68HC05F32  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MOTOROLA  
8-3  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
V
int. gen. V  
LCD  
LCD  
EXTVON  
INTVLCD  
VLCD  
R3  
R2  
V2  
V1  
2 BP, 1/2 Bias  
R1  
V
SS  
8
Figure 8-2 Voltage level selection  
8.3  
Timing signals and LCD voltage waveforms  
16  
The LCD timing signals are all derived from the main system clock.The frame rate will be f  
/2 ,  
OSC  
therefore, if f  
= 3.579 MHz, the frame rate will be 54.6 Hz for two and four-way multiplexing and  
OSC  
72.8 Hz for three-way multiplexing (see Table 8-4). An extra divide-by-two stage can be included  
in the LCD clock generator by setting FDISP in the LCD register. This will result in the frame rate  
being halved. For example, when three-way multiplexing is used, a frame rate of 36.4 Hz instead  
of 72.8 Hz can be obtained. See Section 8.4.  
Figure 8-3 to Figure 8-6 show the backplane waveforms and some examples of frontplane  
waveforms for each of the operating modes.  
The backplane waveforms are continuous and repetitive (every frame); they are fixed within each  
operating mode and are not affected by the data in the LCD RAM.  
The frontplane waveforms are dependent on the LCD segments to be driven as defined in the LCD  
RAM. Eachonsegment must have a differential driving voltage (BP–FP) applied to it once in each  
frame; the LCD driver module hardware uses the data in the LCD RAM to construct the frontplane  
waveform to meet this criterion.  
TPG  
MOTOROLA  
8-4  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
V
DD/V  
LCD  
BP0  
V2  
V0  
VDD/V  
LCD  
BP1  
V2  
V0  
ON  
OFF  
VDD/V  
LCD  
1 Frame  
FPx, example 1  
FPx, example 2  
FPx, example 3  
FPx, example 4  
V2  
V0  
VDD/V  
LCD  
V2  
8
V0  
VDD/V  
LCD  
V2  
V0  
VDD/V  
LCD  
V2  
V0  
Note:  
In this mode V1=V2  
Figure 8-3 LCD waveform with 2 backplanes, 1/2 bias  
TPG  
MC68HC05F32  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MOTOROLA  
8-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
VDD/V  
LCD  
V2  
V1  
V0  
BP0  
BP1  
VDD/V  
LCD  
V2  
V1  
V0  
ON  
OFF  
1 Frame  
V2  
V1  
FPx, example 1  
FPx, example 2  
VDD/V  
LCD  
8
V2  
V1  
V0  
V
DD/V  
LCD  
V2  
FPx, example 3  
FPx, example 4  
V1  
V0  
VDD/V  
LCD  
V2  
V1  
V0  
Figure 8-4 LCD waveform with 2 backplanes, 1/3 bias  
TPG  
MOTOROLA  
8-6  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
VDD/V  
LCD  
V2  
V1  
V0  
BP0  
BP1  
VDD/V  
LCD  
V2  
V1  
V0  
ON  
OFF  
VDD/V  
LCD  
V2  
1 Frame  
BP2  
V1  
V0  
8
VDD/V  
LCD  
V2  
FPx, example 1  
FPx, example 2  
FPx, example 3  
V1  
V0  
VDD/V  
LCD  
V2  
V1  
V0  
VDD/V  
LCD  
V2  
V1  
V0  
Figure 8-5 LCD waveform with 3 backplanes  
TPG  
MC68HC05F32  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MOTOROLA  
8-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
VDD/V  
LCD  
V2  
BP0  
V1  
V0  
VDD/V  
LCD  
V2  
ON  
BP1  
BP2  
V1  
V0  
OFF  
1 Frame  
V
DD/V  
LCD  
V2  
V1  
V0  
VDD/V  
LCD  
8
V2  
V1  
V0  
BP3  
VDD/V  
LCD  
V2  
FPx, example 1  
V1  
V0  
V
DD/V  
LCD  
V2  
FPx, example 2  
V1  
V0  
V
DD/V  
LCD  
V2  
V1  
V0  
FPx, example 3  
Figure 8-6 LCD waveform with 4 backplanes  
TPG  
MOTOROLA  
8-8  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
8.4  
LCD control register (LCD)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
LCD control register (LCD)  
$001E WTLCDO FSEL1 FSEL0 INTVLCD FDISP MUX4 MUX3 EXTVON 0000 0000  
WTLCDO — WAIT mode LCD only  
1 (set)  
The SPI, the SCI, the second 16-bit timer and the A/D converter are  
turned off in WAIT mode.  
0 (clear) – The SPI, the SCI, the second 16-bit timer and the A/D converter  
remain active during WAIT mode.  
If this bit is set, the SPI, the SCI, the second 16-bit timer and the A/D converter are turned off in  
WAIT mode, reducing the power consumption, as only the core timer, the first 16-bit timer (timerA),  
the DMG and the LCD controller remain active.  
FSEL1, FSEL0 — LCD operation frequency  
8
These bits select the LCD operation frequency according to Table 8-3.The frequency shown in the  
right columns are calculated for an external frequency of 3.579 MHz.  
Table 8-3 Frequency selection  
Framefrequency Frame frequency Frequency for  
(2, 4 backplanes) (3 backplanes) 2,4 backplanes  
Frequency for  
3 backplanes  
FSEL1: FSEL0  
16  
16  
0 0  
1 0  
0 1  
1 1  
F
/2  
4F  
4F  
4F  
/(3X2 )  
54.6 Hz  
109.2 Hz  
218.4 Hz  
6990 Hz  
72.8 Hz  
145.6 Hz  
291.3 Hz  
9320 Hz  
OSC  
OSC  
OSC  
OSC  
15  
15  
F
/2  
/(3X2 )  
OSC  
14  
14  
F
/2  
/(3X2 )  
OSC  
9
9
F
/2  
4F  
/(3X2 )  
OSC  
OSC  
INTVLCD — Internal voltage generator ON/OFF  
1 (set) The display is on and an internal voltage generator is activated.  
0 (clear) – The internal voltage generator is turned off.  
When the INTVLCD bit is set, the display controller is on and an internal voltage generator is  
activated and connected to the resistor chain (V  
= 3V approx., if V > 3V). See Table 8-2.  
DD  
LCD  
TPG  
MC68HC05F32  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MOTOROLA  
8-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
FDISP — Display frequency  
1 (set)  
Extra divide by two stage is included in the LCD clock generator  
when this bit is set, giving a reduced frame rate.  
0 (clear) – Default frame rate is used.  
For example, in the 3-way multiplexing mode, a frame rate of 36.8 Hz instead of 72.8 Hz can be  
achieved.  
MUX4, MUX3 — Multiplex ratio  
These two bits select the multiplex ratio to be 2, 3 or 4 backplanes. See Table 8-4.  
Table 8-4 Multiplex ratio/backplane selection  
MUX4 MUX3  
Backplanes  
Bias  
1/2  
1/3  
1/3  
1/3  
Frequency  
54.6 Hz  
72.8 Hz  
54.6 Hz  
54.6 Hz  
0
0
1
1
0
1
0
1
2
3
4
2
8
EXTVON — External LCD voltage ON/OFF  
1 (set) External LCD voltage is connected.  
0 (clear) – External LCD voltage is disconnected.  
Clearing this bit disconnects the voltage generator resistor chain from the external V  
Table 8-2.  
. See  
LCD  
8.5  
LCD during WAIT mode  
The LCD drivers function normally during WAIT mode and will keep the display active if the  
EXTVON bit or the INTVLCD bit is set.  
8.6  
LCD during STOP mode  
During STOP mode the LCD controller is disabled. The driver outputs are discharged by the  
resistor chain.  
TPG  
MOTOROLA  
8-10  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
9
A/D CONVERTER  
The analog to digital converter system consists of a 12-channel, multiplexed input to a successive  
approximation A/D converter. Eight of the A/D input channels are connected to pins PD0–PD7 and  
the particular input to be selected is determined by the setting/clearing of the CHx bits in the A/D  
status/control register at $4F. A further four channels are available internally for test purposes. In  
addition to the A/D status/control register (ADSCR) there is one 8-bit result data register at  
address $4E.  
The A/D converter is ratiometric and a dedicated pin, VREFH, is used to supply the upper  
reference voltage level of each analog input.The lower voltage reference point, V  
, is internally  
REFL  
connected to the AVSS pin. An input voltage equal to or greater than V converts to $FF (full  
RH  
9
scale) with no overflow indication. For ratiometric conversions, the source of each analog input  
should use V  
as the supply voltage and be referenced to AV  
.
REFH  
SS  
The A/D converter can operate from either the bus clock or an internal RC type oscillator. The  
internal RC type oscillator is activated by the ADRC bit in the A/D status/control register (ADRC)  
and can be used to give a sufficiently high clock rate to the A/D converter when the bus speed is  
too low to provide accurate results (see Section 9.2.1). When the A/D converter is not being used  
it can be disconnected using the ADON bit in the ADSCR register, in order to save power (see  
Section 9.2.1).  
9.1  
A/D converter operation  
The A/D converter consists of an analog multiplexer, an 8-bit digital-to-analog capacitor array, a  
comparator and a successive approximation register (SAR). See Figure 9-1.  
The A/D reference inputs is applied to a precision internal digital-to-analog converter. Control logic  
drives this D/A converter and the analog output is successively compared with the analog input  
sampled at the beginning of the conversion. The conversion is monotonic with no missing codes.  
The result of each successive comparison is stored in the SAR and, when the conversion is  
complete, the contents of the SAR are transferred to the read-only result data register ($4E), and  
the conversion complete flag, COCO, is set in the A/D status/control register ($4F).  
TPG  
MC68HC05F32  
A/D CONVERTER  
MOTOROLA  
9-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
PD7/AN7  
PD6/AN6  
PD5/AN5  
PD4/AN4  
PD3/AN3  
PD2/AN2  
PD1/AN1  
PD0/AN0  
VRH  
VRL = AVSS  
8-bit capacitive DAC  
with sample and hold  
Successive approximation  
register and control  
VRH  
Result  
A/D status/control register (ADSCR) $4F  
(VRH+VRL)/2  
VRL = AVSS  
CH0 CH1 CH2 CH3  
0
ADON ADRC COCO  
A/D result register (ADDATA) $4E  
9
Figure 9-1 A/D converter block diagram  
Caution: Any write to the A/D status/control register will abort the current conversion, reset the  
conversion complete flag and start a new conversion on the selected channel.  
At power-on or external reset, both the ADRC and ADON bits are cleared, thus the A/D is disabled.  
TPG  
MOTOROLA  
9-2  
A/D CONVERTER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
9.2  
A/D registers  
9.2.1  
A/D status/control register (ADSCR)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
A/D status/control (ADSCR)  
$004F COCO ADRC ADON  
0
CH3 CH2 CH1 CH0 0000 0000  
COCO — Conversion complete flag  
Each channel conversion takes 32 clock cycles at f , where f is equal to or greater than 1MHz.  
OP  
OP  
1 (set)  
COCO flag is set each time a conversion is complete, allowing the  
new result to be read from the A/D result data register ($4E). The  
converter then starts a new conversion.  
0 (clear) – COCO is cleared by reading the result data register or writing to the  
status/control register.  
Reset clears the COCO flag.  
9
ADRC — A/D RC oscillator control  
If the MCU bus frequency is less than 1MHz, an internal RC oscillator must be used for the A/D  
conversion clock.This selection is made by setting the ADRC bit in ADSCR.The ADRC bit allows  
the user to control the A/D RC oscillator.  
1 (set)  
The A/D RC oscillator is turned on and, if ADON is set, the A/D runs  
from the internal RC oscillator clock (see Table 9-1).  
0 (clear) – The A/D RC oscillator is turned off and, if ADON is set, the A/D runs  
from the CPU clock.  
When the A/D RC oscillator is turned on, it takes a time t  
this time A/D conversion results may be inaccurate.  
to stabilize (see Table 16-5). During  
RCON  
Table 9-1 A/D clock selection  
RC  
A/D  
ADRC  
ADON  
Comments  
A/D switched off.  
oscillator converter  
0
0
1
1
0
1
0
1
OFF  
OFF  
ON  
OFF  
ON  
A/D using CPU clock.  
OFF  
ON  
Allows the RC oscillator to stabilize.  
A/D using RC oscillator clock.  
ON  
TPG  
MC68HC05F32  
A/D CONVERTER  
MOTOROLA  
9-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
When the internal RC oscillator is being used as the conversion clock, the following limitations  
apply.  
1) Due to the frequency tolerance of the RC oscillator and its asynchronism  
with regard to the MCU bus clock, the conversion complete flag (COCO)  
must be used to determine when a conversion sequence has been  
completed.  
2) The conversion process runs at the nominal 1.5MHz rate but the conversion  
results must be transferred to the MCU result registers synchronously with  
the MCU bus clock in order that conversion time is limited to a maximum of  
one channel per bus clock cycle.  
3) If the system clock is running faster than the RC oscillator, the RC oscillator  
should be switched off and the system clock used as the conversion clock.  
ADON — A/D converter on  
The ADON bit allows the user to enable/disable the A/D converter.  
1 (set)  
A/D converter is switched on.  
0 (clear) – A/D converter is switched off.  
9
When the A/D converter is switched on, it takes a time t  
(see Table 16-5). During this time A/D conversion results may be inaccurate.  
for the current sources to stabilize  
ADON  
Power-on or external reset will clear the ADON bit, thus disabling the A/D converter.  
CH3 – CH0 — A/D channel selection  
The CH3–CH0 bits allow the user to determine which channel of the A/D converter multiplexer is  
selected (see Table 9-2).  
Table 9-2 A/D channel assignment  
CH3  
0
CH2  
0
CH1  
0
CH0 Channel  
Signal  
0
1
0
1
0
1
0
1
0
1
0
1
0
1
AD0/PD0  
AD1/PD1  
AD2/PD2  
AD3/PD3  
AD4/PD4  
AD5/PD5  
AD6/PD6  
AD7/PD7  
0
0
0
0
0
1
2
0
0
1
3
0
1
0
4
0
1
0
5
0
1
1
6
0
1
1
7
1
1
0
8
V
REFH  
1
1
0
9
(V  
+V  
)/2  
REFH REFL  
1
1
1
10  
11  
V
REFL  
1
1
1
Factory test  
TPG  
MOTOROLA  
9-4  
A/D CONVERTER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
9.2.2  
A/D result data register (ADDATA)  
State  
on reset  
Address bit 7  
$004E  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
A/D data register  
Undened  
The A/D data register is a read-only register which is used to store the result of an A/D conversion.  
The result is loaded into the register from the SAR and the conversion complete flag (COCO) in  
the ADSCR register is set.  
Caution: Performing a digital read of port D with levels other than V or V on the pins will  
DD  
SS  
result in greater power dissipation during the read cycles.  
9.3  
A/D converter during WAIT mode  
The A/D converter continues to operate normally during WAIT mode. To decrease power  
consumption during WAIT, it is recommended that both the ADON and ADRC bits in the ADSTAT  
register are cleared, if the A/D converter is not being used. If the A/D converter is being used and  
the system clock frequency is above 1MHz, the ADRC bit should be cleared to disable the internal  
RC oscillator.  
9
9.4  
A/D converter during STOP mode  
In STOP mode the comparator and charge pump are turned off and the A/D converter ceases to  
operate. Any pending conversion is aborted. When the clock begins oscillation upon leaving the  
STOP mode, a finite amount of time passes before the A/D circuits stabilize enough to provide  
conversions to the specified accuracy. Normally, the delays built into the MC68HC05F32 are  
sufficient for this purpose, therefore no explicit delays need to be built into the software.  
9.5  
A/D analog input  
The external analog voltage value to be processed by the A/D converter is sampled on an internal  
capacitor through a resistive path, provided by input-selection switches and a sampling aperture  
time switch, as shown in Figure 9-2.Sampling time is limited to 12 bus clock cycles.After sampling,  
the analog value is stored on the capacitor and held until the end of conversion. During this hold  
time, the analog input is disconnected from the internal A/D system and the external voltage  
source sees a high impedance input.  
TPG  
MC68HC05F32  
A/D CONVERTER  
MOTOROLA  
9-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
The equivalent analog input during sampling is an RC low-pass filter with a minimum resistance  
of 50 kand a capacitance of at least 10pF. (It should be noted that these are typical values  
measured at room temperature).  
Input protection device  
50kΩ  
Analog  
input  
pin  
(AD0AD7)  
+ 20V  
– 0.7V  
< 2pF  
10 µA  
junction  
leakage  
10pF  
DAC  
capacitance  
V
= AV  
SS  
REFL  
Note:  
The analog switch is closed during the 12 cycle sample  
time only.  
Figure 9-2 Electrical model of an A/D input pin  
9
TPG  
MOTOROLA  
9-6  
A/D CONVERTER  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
10  
SERIAL PERIPHERAL INTERFACE  
10.1  
Overview and features  
The SPI is a synchronous interface which allows several SPI microcontrollers or SPI-type  
peripherals to be interconnected. In a serial peripheral interface, separate wires (signals) are  
required for data and clock. In the SPI format, the clock is not included in the data stream and must  
be furnished as a separate signal.The high-end SPI system may be configured either as a master  
or as a slave.  
Features,  
Full-duplex, 3-wire synchronous transfers  
Master or slave operation  
10  
Master bit frequency, f /2  
OP  
Slave bit frequency, f  
OP  
Four programmable master bit rates  
Programmable clock polarity and phase  
End-of-transmission interrupt flag  
Write collision flag protection  
Master-master mode fault protection  
Easy interface to simple expansion parts (PLLs, D/As, latches, display drivers, etc.)  
TPG  
MC68HC05F32  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
10-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
10.2  
SPI signal descriptions  
Four I/O pins located at port C (PC4 - PC7) are associated with the SPI data transfers. They are  
the serial clock (SCK), the master in/slave out data line (MISO), the master out / slave in data line  
(MOSI), and the active-low slave select (SS).When the SPI system is not utilized (SPE bit cleared  
in the serial peripheral control register), the four pins (MISO, MOSI, SCK, and SS) are configured  
as general-purpose I/O pins. The four SPI signals are discussed in the following paragraphs for  
both master mode and slave mode of operation.  
10.2.1  
Master in slave out (MISO)  
The MISO line is configured as an input, in a master device, and as an output in a slave device. It  
is one of the two lines that transfer serial data in one direction. The MISO line of a slave device is  
placed in the high-impedance state if the slave is not selected.  
10.2.2  
Master out slave in (MOSI)  
The MOSI line is configured as an output in a master device, and as an input in a slave device. It  
is one of the two lines that transfer serial data in one direction.  
10  
10.2.3  
Serial clock (SCK)  
The serial clock is used to synchronize data movement both in and out of the device through its  
MOSI and MISO lines. The master and slave devices are capable of exchanging a byte of  
information during a sequence of eight clock cycles. Since SCK is generated by the master device,  
this line becomes an input on a slave device.  
As shown in Figure 10-1, four different timing relationships may be selected by control bits CPOL  
and CPHA in the serial peripheral control register (SPCR). Both master and slave devices must  
operate with the same timing.The master device always places data on the MOSI line a half cycle  
before the clock edge (SCK), in order for the slave device to latch the data.  
Two bits (SPR0 and SPR1) in the SPI control register (SPCR) of the master device select the clock  
rate. In a slave device, SPR0 and SPR1 have no effect on the operation of the SPI.  
TPG  
MOTOROLA  
10-2  
SERIAL PERIPHERAL INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
SS  
SS  
SCK  
(CPOL = 0, CPHA = 0)  
(CPOL = 0, CPHA = 1)  
SCK  
SCK  
(CPOL = 1, CPHA = 0)  
(CPOL = 1, CPHA = 1)  
SCK  
MISO/  
MOSI  
10  
MSB  
6
5
4
3
2
1
LSB  
Internal strobe for data capture (DOD = 0)  
Figure 10-1 Data clock timing diagram  
TPG  
MC68HC05F32  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
10-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
10.2.4  
Slave select (SS)  
The slave select (SS) input line is used to select a slave device. It must be in the active low state  
prior to data transactions and must stay low for the duration of the transaction.The SS line on the  
master must be tied high.If it goes low, a mode fault error flag (MODF) is set in the serial peripheral  
status register (SPSR). When CPHA = 0, the shift clock is the logical OR of SS and SCK. In this  
clock phase mode, SS must go high between successive characters in an SPI message. When  
CPHA = 1, SS may be left low for several SPI characters. If there is only one SPI slave MCU, its  
SS line may be tied to V provided CPHA = 1 clock modes are used.  
SS,  
10.3  
Functional description  
Figure 10-2 shows a block diagram of the serial peripheral interface circuitry. When a master  
device transmits data to a slave device via the MOSI line, the slave device responds by sending  
data to the master device via the master’s MISO line. This implies full duplex transmission with  
both data out and data in synchronized to the same clock signal. Thus, the byte transmitted is  
replaced by the byte received, eliminating the need for separate transmitter-empty and  
receiver-full status bits. A single status bit (SPIF) is used to signify that the I/O operation has been  
completed.  
The SPI is double buffered on read, but not on write. If a write is performed during data transfer,  
the transfer is not interrupted, and the write will be unsuccessful.This condition will cause the write  
collision status bit (WCOL) in the SPSR to be set. After a data byte is shifted, the SPIF flag in the  
SPSR is set.  
10  
In master mode, the SCK pin is an output. It idles high or low, depending on the CPOL bit in the  
SPCR, until data is written to the shift register. Eight clocks are then generated to shift the eight  
bits of data, after which SCK goes idle again.  
In slave mode, the slave start logic receives a logic low on the SS pin and a clock input at the SCK  
pin, thus synchronizing the slave to the master. Data from the master is received serially via the  
slave MOSI line and is loaded into the 8-bit shift register. The data is then transferred, in parallel,  
from the 8-bit shift register to the read buffer. During a write cycle, data is written into the shift  
register, then the slave waits for a clock train from the master to shift the data out on the slave’s  
MISO line.  
TPG  
MOTOROLA  
10-4  
SERIAL PERIPHERAL INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Internal MCU clock  
S
MISO/  
PC4  
M
Divider  
/2/4/16/32  
msb  
lsb  
M
S
8-bit shift register  
Read data buffer  
MOSI/  
PC5  
Control  
logic  
SCK/  
PC6  
S
M
Clock logic  
Select  
SS/  
PC7  
SPI control  
10  
SPI  
status  
register  
SPIF WCOL MODF  
SPIE SPE DOD MSTR CPOL CPHA SPR1 SPR0  
SPI control register  
SPI interrupt  
request  
Internal  
data bus  
Figure 10-2 Serial peripheral interface block diagram  
TPG  
MC68HC05F32  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
10-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Master  
Slave  
MISO  
MOSI  
MISO  
MOSI  
8-bit shift register  
8-bit shift register  
SCK  
SS  
SCK  
SS  
SPI clock generator  
V
DD  
Figure 10-3 Serial peripheral interface master–slave interconnection  
10  
10.4  
SPI registers  
There are three registers in the serial peripheral interface which provide control, status and data  
storage functions. These registers are called: the serial peripheral control register (SPCR), the  
serial peripheral status register (SPSR) and the serial peripheral data I/O register (SPDAT).  
10.4.1  
Control register (SPCR)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SPI control register (SPCR)  
$0044 SPIE SPE DOD MSTR CPOL CPHA SPR1 SPR0 0000 01uu  
SPIE — SPI interrupt enable  
1 (set) SPI interrupts enabled.  
0 (clear) – SPI interrupts disabled.  
When this bit is set to one, a hardware interrupt sequence is requested each time the SPIF or  
MODF status flag is set. SPI interrupts are inhibited if this bit is clear or if the I bit in the CC register  
is set.  
TPG  
MOTOROLA  
10-6  
SERIAL PERIPHERAL INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
SPE — SPI system enable  
1 (set) SPI system on.  
0 (clear) – SPI system off.  
When the SPE bit is set, port C pins 4, 5, 6, and 7 are dedicated to the SPI function.  
DOD — Direction of data  
This bit determines the direction of the data flow in or out of the serial shift register.  
1 (set)  
data is transferred LSB first.  
0 (clear) – data is transferred MSB first (default state).  
MSTR — Master/slave mode select  
1 (set)  
master mode is selected.  
0 (clear) – slave mode is selected.  
CPOL — Clock polarity  
When the clock polarity bit is cleared and data is not being transferred, a steady state low value  
is produced at the SCK pin of the master device. Conversely, if this bit is set, the SCK pin will idle  
high. This bit is also used in conjunction with the clock phase control bit to produce the desired  
clock-data relationship between master and slave. See Figure 10-1.  
10  
CPHA — Clock phase  
The clock phase bit, in conjunction with the CPOL bit, controls the clock-data relationship between  
master and slave. The CPOL bit can be thought of simply as inserting an inverter in series with  
the SCK line. The CPHA bit selects one of two fundamentally different clocking protocols. When  
CPHA = 0, the shift clock is the logical OR of SCK and SS.As soon as SS goes low, the transaction  
begins and the first edge on SCK invokes the first data sample. When CPHA = 1, the SS pin may  
be thought of as a simple output enable control. Refer to Figure 10-1.  
SPR1, SPR0 — SPI clock (SCK) rate select bits  
If the device is a master, the two serial peripheral rate bits select one of four division ratios of the  
E-clock to be used as SCK (See Table 10-1). These bits have no effect in slave mode.  
TPG  
MC68HC05F32  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
10-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 10-1 SPI rate selection  
E clock  
divided by  
SPR1  
SPR0  
0
0
1
1
0
1
0
1
2
4
16  
32  
10.4.2  
Status register (SPSR)  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SPI status register (SPSR)  
$0045 SPIF WCOL  
0
MODF  
0
0
0
0
0000 0000  
SPIF — SPI interrupt request flag  
The serial peripheral data transfer flag bit is set after the eighth SCK cycle in a data transfer and  
it is cleared by reading the SPSR register (with SPIF set) followed by reading from or writing to the  
SPI data register (SPDAT).  
WCOL — Write collision  
10  
The write collision bit is used to indicate that a serial transfer was in progress when the MCU tried  
to write new data into the SPDAT data register.The MCU write is disabled to avoid writing over the  
data being transmitted. No interrupt is generated because the error status flag can be read upon  
completion of the transfer that was in progress at the time of the error. This flag is automatically  
cleared by a read of the SPSR (with WCOL set) followed by an access (read or write) to the SPDAT  
register.  
MODF — SPI mode error interrupt status flag  
This flag is set if the SS signal goes to its active-low level while the SPI is configured as a master  
(MSTR = 1). This condition is not permitted in normal operation. This flag is automatically cleared  
by a read of the SPSR (with MODF set) followed by a write to the SPCR register.  
TPG  
MOTOROLA  
10-8  
SERIAL PERIPHERAL INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
10.4.3  
SPI data I/O register (SPDAT)  
State  
on reset  
Address bit 7  
$0046  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SPI data/IO register (SPDAT)  
uuuu uuuu  
The serial peripheral data I/O register is used to transmit and receive data on the serial bus. Only  
a write to this register will initiate transmission/reception of another byte, and this will only occur  
in the master device. At the completion of transmitting a byte of data, the SPIF status bit is set in  
both the master and slave devices.  
When the user reads the serial peripheral data I/O register, a buffer is actually being read.The first  
SPIF must be cleared by the time a second transfer of data from the shift register to the read buffer  
is initiated or an overrun condition will exist. In cases of overrun, the byte which causes the overrun  
is lost. A write to the serial peripheral data I/O register is not buffered and places data directly into  
the shift register for transmission.  
10.5  
SPI during WAIT mode  
When the MCU enters wait mode, the CPU clock is halted. All CPU action is suspended; however,  
the SPI system remains active. In fact an interrupt from the SPI causes the processor to exit the  
wait mode.  
10  
10.6  
SPI during STOP mode  
When the MCU enters the stop mode, the internal oscillator is turned off, and the baud rate  
generator which drives the SPI shuts down.This essentially stops all master mode SPI operation,  
thus transfer is halted until the MCU exits the stop mode. If the stop mode is exited by a reset, then  
the appropriate control/status bits are cleared and the SPI is disabled. If the device is in the slave  
mode when the stop instruction is executed, the slave SPI will still operate. It can still accept data  
and clock information in addition to transmitting its own data back to a master device.  
At the end of a possible transmission with a slave SPI in the stop mode, no flags are set until the  
MCU is “waked up” by an interrupt (IRQ, keyboard, LVI or CPI). Caution should be observed when  
operating the SPI (as a slave) during the stop mode because none of the protection circuitry (write  
collision, mode fault, etc.) is active.  
TPG  
MC68HC05F32  
SERIAL PERIPHERAL INTERFACE  
MOTOROLA  
10-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
10  
TPG  
MOTOROLA  
10-10  
SERIAL PERIPHERAL INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
11  
SERIAL COMMUNICATIONS INTERFACE  
A full-duplex asynchronous serial communications interface (SCI) is provided with a standard  
non-return-to-zero (NRZ) format and a variety of baud rates.The SCI transmitter and receiver are  
functionally independent and have their own baud rate generator; however they use the same  
baud rate and data format.  
The serial data format is standard mark/space (NRZ) and provides one start bit, eight or nine data  
bits, and one stop bit.  
Any SCI bidirectional communication requires a two-wire system: receive data in (RDI) and  
transmit data out (TDO).  
‘Baud’ and ‘bit rate’ are used synonymously in the following description.  
11.1  
SCI two-wire system features  
11  
Standard NRZ (mark/space) format  
Advanced error detection method with noise detection for noise duration of up to 1/16th bit time  
Full-duplex operation (simultaneous transmit and receive)  
32 software selectable baud rates  
Software selectable word length (eight or nine bits)  
Separate transmitter and receiver enable bits  
Interrupt drive capability  
Four separate enable bits for interrupt control  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Internal bus  
SCI interrupt  
+
Transmit  
data register  
$0047  
(See note)  
$0047  
(See note)  
Receive  
data register  
&
&
&
&
$0049  
SCCR2  
TIE  
TCIE  
RIE  
ILIE  
TE  
RE  
SBK  
RWU  
7
6
5
4
3
2
1
0
Transmit  
data shift  
register  
TDO/  
PC3  
pin  
Receive  
data shift  
register  
RDI/  
PC2  
pin  
+
SCSR  
$004A  
1
7
6
5
4
3
2
TRDE  
TC  
RDRF IDLE  
OR  
NF  
FE  
Wake up  
unit  
7
TE  
SBK  
Flag  
control  
Transmitter  
control  
Receiver  
control  
Transmitter  
clock  
Receiver  
clock  
Rate generator  
11  
TCLR  
0
SCP1  
SCP0 RCKB SCR2 SCR1 SCR0  
BAUD, $004B  
7
R8  
6
5
4
M
3
2
0
1
0
0
0
SCCR1  
$0048  
T8  
WAKE  
Note:  
The serial communications data register (SCDAT) is controlled by  
the internal R/W signal. It is the transmit data register when written  
to and the receive data register when read.  
Figure 11-1 Serial communications interface block diagram  
TPG  
MOTOROLA  
11-2  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
11.2  
SCI receiver features  
Receiver wake-up function (idle line or address bit)  
Idle line detection  
Framing error detection  
Noise detection  
Overrun detection  
Receiver data register full flag  
11.3  
SCI transmitter features  
Transmit data register empty flag  
Transmit complete flag  
Send break  
11.4  
External connections  
The external operation of the SCI block is routed through bits 2 and 3 of port C. Bits PC2 and PC3  
are the receive and transmit pins for the SCI (RDI, TDO). Refer to Section 4 for a full description  
of port C.  
11  
SCI  
TCLR  
0
SCP1  
SCP0 RCKB SCR2 SCR1 SCR0  
TDO  
SCCR2, $0049  
RDI  
6
5
1
0
7
4
3
2
Port C  
PC2/RDI  
PC3/TDO  
Figure 11-2 SCI and port C  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
11.5  
Functional description  
A block diagram of the SCI is shown in Figure 11-1. Option bits in serial control register1 (SCCR1)  
select the ‘wake-up’ method (WAKE bit) and data word length (M bit) of the SCI. SCCR2 provides  
control bits that individually enable the transmitter and receiver, enable system interrupts and  
provide the wake-up enable bit (RWU) and the send break code bit (SBK). Control bits in the baud  
rate register (BAUD) allow the user to select one of 32 different baud rates for the transmitter and  
receiver (see Section 11.11.5).  
Data transmission is initiated by writing to the serial communications data register (SCDR).  
Provided the transmitter is enabled, data stored in the SCDR is transferred to the transmit data  
shift register. This transfer of data sets the transmit data register empty flag (TDRE) in the SCI  
status register (SCSR) and generates an interrupt (if transmitter interrupts are enabled). The  
transfer of data to the transmit data shift register is synchronized with the bit rate clock. All data is  
transmitted least significant bit first. Upon completion of data transmission, the transmission  
complete flag (TC) in the SCSR is set (provided no pending data, preamble or break is to be sent)  
and an interrupt is generated (if the transmit complete interrupt is enabled). If the transmitter is  
disabled, and the data, preamble or break (in the transmit data shift register) has been sent, the  
TC bit will also be set. This will also generate an interrupt if the transmission complete interrupt  
enable bit (TCIE) is set. If the transmitter is disabled during a transmission, the character being  
transmitted will be completed before the transmitter gives up control of the TDO pin.  
When SCDR is read, it contains the last data byte received, provided that the receiver is enabled.  
The receive data register full flag bit (RDRF) in the SCSR is set to indicate that a data byte has  
been transferred from the input serial shift register to the SCDR; this will cause an interrupt if the  
receiver interrupt is enabled. The data transfer from the input serial shift register to the SCDR is  
synchronized by the receiver bit rate clock. The OR (overrun), NF (noise), or FE (framing) error  
flags in the SCSR may be set if data reception errors occurred.  
11  
An idle line interrupt is generated if the idle line interrupt is enabled and the IDLE bit (which detects  
idle line transmission) in SCSR is set. This allows a receiver that is not in the wake-up mode to  
detect the end of a message or the preamble of a new message, or to resynchronize with the  
transmitter. A valid character must be received before the idle line condition or the IDLE bit will not  
be set and idle line interrupt will not be generated.  
TPG  
MOTOROLA  
11-4  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
11.6  
Data format  
Receive data or transmit data is the serial data that is transferred to the internal data bus from the  
receive data input pin (RDI) or from the internal bus to the transmit data output pin (TDO). The  
non-return-to-zero (NRZ) data format shown in Figure 11-3 is used and must meet the following  
criteria:  
The idle line is brought to a logic one state prior to transmission/reception of  
a character.  
A start bit (logic zero) is used to indicate the start of a frame.  
The data is transmitted and received least significant bit first.  
A stop bit (logic one) is used to indicate the end of a frame. A frame consists  
of a start bit, a character of eight or nine data bits, and a stop bit.  
A break is defined as the transmission or reception of a low (logic zero) for at  
least one complete frame time (10 zeros for 8-bit format, 11 zeros for 9-bit).  
Control bit M selects  
8 or 9 bit data  
Idle line  
0
1
2
3
4
5
6
7
8
0
Start  
Stop Start  
Figure 11-3 Data format  
11  
11.7  
Receiver wake-up operation  
The receiver logic hardware also supports a receiver wake-up function which is intended for  
systems having more than one receiver.With this function a transmitting device directs messages  
to an individual receiver or group of receivers by passing addressing information as the initial  
byte(s) of each message. The wake-up function allows receivers not addressed to remain in a  
dormant state for the remainder of the unwanted message. This eliminates any further software  
overhead to service the remaining characters of the unwanted message and thus improves system  
performance.  
The receiver is placed in wake-up mode by setting the receiver wake-up bit (RWU) in the SCCR2  
register. While RWU is set, all of the receiver related status flags (RDRF, IDLE, OR, NF, and FE)  
are inhibited (cannot become set). Note that the idle line detect function is inhibited while the RWU  
bit is set. Although RWU may be cleared by a software write to SCCR2, it would be unusual to do  
so. Normally RWU is set by software and is cleared automatically in hardware by one of the two  
methods described below.  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-5  
For More Information On This Product,  
Go to: www.freescale.com  
 
 
Freescale Semiconductor, Inc.  
11.7.1  
Idle line wake-up  
In idle line wake-up mode, a dormant receiver wakes up as soon as the RDI line becomes idle. Idle  
is defined as a continuous logic high level on the RDI line for ten (or eleven) full bit times. Systems  
using this type of wake-up must provide at least one character time of idle between messages to  
wake up sleeping receivers, but must not allow any idle time between characters within a message.  
11.7.2  
Address mark wake-up  
In address mark wake-up, the most significant bit (MSB) in a character is used to indicate whether  
it is an address (1) or data (0) character. Sleeping receivers will wake up whenever an address  
character is received. Systems using this method for wake-up would set the MSB of the first  
character of each message and leave it clear for all other characters in the message. Idle periods  
may be present within messages and no idle time is required between messages for this wake-up  
method.  
11.8  
Receive data in (RDI)  
Receive data is the serial data that is applied through the input line and the SCI to the internal bus.  
The receiver circuitry clocks the input at a rate equal to 16 times the baud rate.This time is referred  
to as the RT rate in Figure 11-5.  
11 The receiver clock generator is controlled by the baud rate register, as shown in Figure 11-1;  
however, the SCI is synchronized by the start bit, independent of the transmitter.  
Once a valid start bit is detected, the start bit, each data bit and the stop bit are sampled three  
times at RT intervals 8 RT, 9 RT and 10 RT (1 RT is the position where the bit is expected to start),  
as shown in Figure 11-4. The value of the bit is determined by voting logic which takes the value  
of the majority of the samples. A noise flag is set when all three samples on a valid start bit or data  
bit or the stop bit do not agree  
.
Previous bit  
Present bit  
Samples  
Next bit  
RDI  
16RT1RT  
8RT 9RT 10RT  
16RT1RT  
Figure 11-4 SCI sampling technique used on all bits  
TPG  
MOTOROLA  
11-6  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
16X internal sampling clock  
1RT 2RT 3RT 4RT 5RT 6RT 7RT 8RT  
RT clock edges for all three examples  
Idle  
Start  
RDI  
RDI  
RDI  
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
Start  
Start edge  
qualiers  
verication samples  
Start  
0
Noise  
1
1
1
1
1
0
0
Noise  
0
Start  
0
1
0
0
0
Figure 11-5 SCI examples of start bit sampling technique  
11.9  
Start bit detection  
When the input (idle) line is detected low, it is tested for three more sample times (referred to as  
the start edge verification samples in Figure 11-5). If at least two of these three verification  
samples detect a logic zero, a valid start bit has been detected, otherwise the line is assumed to  
be idle. A noise flag is set if one of the three verification samples detect a logic one, thus a valid  
start bit could be assumed with a set noise flag present.  
11  
If there has been a framing error without detection of a break (10 zeros for 8 bit format or 11 zeros  
for 9 bit format), the circuit continues to operate as if there actually was a stop bit, and the start  
edge will be placed artificially. The last bit received in the data shift register is inverted to a logic  
one, and the three logic one start qualifiers (shown in Figure 11-5) are forced into the sample shift  
register during the interval when detection of a start bit is anticipated (see Figure 11-6); therefore,  
the start bit will be accepted no sooner than it is anticipated.  
If the receiver detects that a break (RDRF = 1, FE = 1, receiver data register = $00) produced the  
framing error, the start bit will not be artificially induced and the receiver must actually detect a logic  
one before the start bit can be recognised (see Figure 11-7).  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-7  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
Data  
Expected stop  
Artificial edge  
Data  
RDI  
Start bit  
Data samples  
a) Case 1: receive line low during articial edge  
Data  
Expected stop  
Start edge  
Data  
RDI  
Start bit  
Data samples  
b) Case 2: receive line high during expected start edge  
Figure 11-6 Artificial start following a framing error  
Expected stop  
Break  
Detected as valid start edge  
Start bit  
RDI  
11  
Start  
qualiers  
Start edge  
verication  
samples  
Data samples  
Figure 11-7 SCI start bit following a break  
11.10  
Transmit data out (TDO)  
Transmit data is the serial data from the internal data bus that is applied through the SCI to the  
output line. Data format is as discussed in Section 11.6 and shown in Figure 11-3.The transmitter  
generates a bit time by using a derivative of the RT clock, thus producing a transmission rate equal  
to 1/16th that of the receiver sample clock.  
TPG  
MOTOROLA  
11-8  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
11.11  
SCI registers  
The SCI system is configured and controlled by five registers: SCDAT, SCCR1, SCCR2, SCSR,  
and BAUD.  
11.11.1 Serial communications data register (SCDAT)  
State  
on reset  
Address bit 7  
$0047  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
SCI data (SCDAT)  
undened  
The SCDAT is controlled by the internal R/W signal and performs two functions in the SCI. It acts  
as the receive data register (RDR) when it is read and as the transmit data register (TDR) when it  
is written. Figure 11-1 shows this register as two separate registers, RDR and TDR. The RDR  
provides the interface from the receive shift register to the internal data bus and the TDR provides  
the parallel interface from the internal data bus to the transmit shift register.  
The receive data register is a read-only register containing the last byte of data received from the  
shift register for the internal data bus.The RDR full bit (RDRF) in the serial communications status  
register is set to indicate that a byte has been transferred from the input serial shift register to the  
SCDAT. The transfer is synchronized with the receiver bit rate clock (from the receiver control) as  
shown in Figure 11-1. All data is received with the least significant bit first.  
The transmit data register (TDR) is a write-only register containing the next byte of data to be  
applied to the transmit shift register from the internal data bus. As long as the transmitter is  
enabled, data stored in the SCDAT is transferred to the transmit shift register (after the current byte  
in the shift register has been transmitted).  
11  
The transfer is synchronized with the transmitter bit rate clock (from the transmitter control) as  
shown in Figure 11-1. All data is received with the least significant bit first.  
11.11.2 Serial communications control register 1 (SCCR1)  
State  
on reset  
Address bit 7  
$0048 R8  
bit 6  
T8  
bit 5  
0
bit 4  
M
bit 3  
bit 2  
bit 1  
bit 0  
SCI control 1 (SCCR1)  
WAKE  
0
0
0
0000 0000  
The SCI control register 1 (SCCR1) contains control bits related to the nine data bit character  
format and the receiver wake-up feature.  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
R8 — Receive data bit 8  
This read-only bit is the ninth serial data bit received when the SCI system is configured for nine  
data bit operation (M = 1). The most significant bit (bit 8) of the received character is transferred  
into this bit at the same time as the remaining eight bits (bits 7–0) are transferred from the serial  
receive shift register to the SCI receive data register.  
T8 — Transmit data bit 8  
This read/write bit is the ninth data bit to be transmitted when the SCI system is configured for nine  
data bit operation (M = 1). When the eight low order bits (bits 7–0) of a transmit character are  
transferred from the SCI data register to the serial transmit shift register, this bit (bit 8) is transferred  
to the ninth bit position of the shift register.  
M — Mode (select character format)  
The read/write M-bit controls the character length for both the transmitter and receiver at the same  
time.The 9th data bit is most commonly used as an extra stop bit or it can also be used as a parity  
bit (see Table 11-1).  
1 (set)  
Start bit, 9 data bits, 1 stop bit.  
0 (clear) – Start bit, 8 data bits, 1 stop bit.  
Table 11-1 Method of receiver wake-up  
WAKE  
M
Method of receiver wake-up  
11  
Detection of an idle line allows the next data type received to cause the receive  
data register to ll and produce an RDRF flag.  
0
x
Detection of a received one in the eighth data bit allows an RDRF ag and  
associated error ags.  
1
0
1
Detection of a received one in the ninth data bit allows an RDRF flag and  
associated error ags.  
1
x = Don’t care  
WAKE — Wake-up mode select  
This bit allows the user to select the method for receiver wake-up. The WAKE bit can be read or  
written to any time. See Table 11-1.  
1 (set)  
Wake-up on address mark; if RWU is set, SCI will wake-up if the 8th  
(if M = 0) or the 9th (if M = 1) bit received on the Rx line is set.  
0 (clear) – Wake-up on idle line; if RWU is set, SCI will wake-up after 11 (if M =  
0) or 12 (if M = 1) consecutive ‘1’s on the Rx line.  
TPG  
MOTOROLA  
11-10  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
11.11.3 Serial communications control register 2 (SCCR2)  
The SCI control register 2 (SCCR2) provides the control bits that enable/disable individual SCI  
functions.  
State  
Address bit 7  
$0049 TIE  
bit 6  
bit 5  
bit 4  
ILIE  
bit 3  
TE  
bit 2  
bit 1  
bit 0  
on reset  
RE RWU SBK 0000 0000  
SCI control (SCCR2)  
TCIE RIE  
TIE — Transmit interrupt enable  
1 (set) TDRE interrupts enabled.  
0 (clear) – TDRE interrupts disabled.  
TCIE — Transmit complete interrupt enable  
1 (set)  
TC interrupts enabled.  
0 (clear) – TC interrupts disabled.  
RIE — Receiver interrupt enable  
1 (set)  
RDRF and OR interrupts enabled.  
0 (clear) – RDRF and OR interrupts disabled.  
ILIE — Idle line interrupt enable  
11  
1 (set)  
IDLE interrupts enabled.  
0 (clear) – IDLE interrupts disabled.  
TE — Transmitter enable  
When the transmit enable bit is set, the transmit shift register output is applied to the TDO line.  
Depending on the state of control bit M (SCCR1), a preamble of 10 (M = 0) or 11 (M = 1)  
consecutive ones is transmitted when software sets the TE bit from a cleared state.  
After loading the last byte in the serial communications data register and receiving the TDRE flag,  
the user should clearTE.Transmission of the last byte will then be completed before the transmitter  
gives up control of the TDO pin. While the transmitter is active, PC3 is forced to be an output.  
1 (set)  
Transmitter enabled.  
0 (clear) Transmitter disabled.  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-11  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
RE — Receiver enable  
1 (set) Receiver enabled.  
0 (clear) – Receiver disabled.  
When RE is clear (receiver disabled) all the status bits associated with the receiver (RDRF, IDLE,  
OR, NF and FE) are inhibited. While the receiver is enabled, PC2 is forced to be an input.  
RWU — Receiver wake-up  
When the receiver wake-up bit is set by the user software, it puts the receiver to sleep and enables  
the wake-up function. The type of wake-up mode for the receiver is determined by the WAKE bit  
discussed above (in SCCR1). When the RWU bit is set, no status flags will be set. Flags which  
were set previously will not be cleared when RWU is set.  
If the WAKE bit is cleared, RWU is cleared by the SCI logic after receiving 10 (M = 0) or 11 (M =1)  
consecutive ones. Under these conditions, RWU cannot be set if the line is idle. If the WAKE bit is  
set, RWU is cleared after receiving an address bit.The RDRF flag will then be set and the address  
byte stored in the receiver data register.  
SBK — Send break  
If the send break bit is toggled set and cleared, the transmitter sends 10 (M = 0) or 11 (M = 1) zeros  
and then reverts to idle sending data. If SBK remains set, the transmitter will continually send  
whole blocks of zeros (sets of 10 or 11) until cleared. At the completion of the break code, the  
transmitter sends at least one high bit to guarantee recognition of a valid start bit. If the transmitter  
is currently empty and idle, setting and clearing SBK is likely to queue two character times of break  
because the first break transfers almost immediately to the shift register and the second is then  
queued into the parallel transmit buffer.  
11  
11.11.4 Serial communications status register (SCSR)  
State  
on reset  
1100 0000  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
OR  
bit 2  
NF  
bit 1  
FE  
bit 0  
SCI status (SCSR)  
$004A TDRE TC RDRF IDLE  
0
The serial communications status register (SCSR) provides inputs to the interrupt logic circuits for  
generation of the SCI system interrupt. In addition, a noise flag bit and a framing error bit are also  
contained in the SCSR.  
TPG  
MOTOROLA  
11-12  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
TDRE — Transmit data register empty flag  
This bit is set when the contents of the transmit data register are transferred to the serial shift  
register. New data will not be transmitted unless the SCSR register is read before writing to the  
transmit data register to clear the TDRE flag.  
If the TDRE bit is clear, this indicates that the transfer has not yet occurred and a write to the serial  
communications data register will overwrite the previous value. The TDRE bit is cleared by  
accessing the serial communications status register (with TDRE set) followed by writing to the  
serial communications data register.  
TC — Transmit complete flag  
This bit is set to indicate that the SCI transmitter has no meaningful information to transmit (no data  
in shift register, no preamble, no break). When TC is set the serial line will go idle (continuous  
MARK). The TC bit is cleared by accessing the serial communications data register (with TC set)  
followed by writing to the serial communications data register. It does not inhibit the transmitter  
function in any way.  
RDRF — Receive data register full flag  
This bit is set when the contents of the receiver serial shift register are transferred to the receiver  
data register.  
If multiple errors are detected in any one received word, the NF and RDRF bits will be affected as  
appropriate during the same clock cycle.The RDRF bit is cleared when the serial communications  
status register is accessed (with RDRF set) followed by a read of the serial communications data  
register.  
11  
IDLE — Idle line detected flag  
This bit is set when a receiver idle line is detected (the receipt of a minimum of ten/eleven  
consecutive ‘1’s). This bit will not be set by the idle line condition when the RWU bit is set. This  
allows a receiver that is not in the wake-up mode to detect the end of a message, detect the  
preamble of a new message or resynchronize with the transmitter. The IDLE bit is cleared by  
accessing the serial communications status register (with IDLE set) followed by a read of the serial  
communications data register. Once cleared, IDLE will not be set again until after RDRF has been  
set, (i.e. until after the line has been active and becomes idle again).  
OR — Overrun error flag  
This bit is set when a new byte is ready to be transferred from the receiver shift register to the  
receiver data register and the receive data register is already full (RDRF bit is set). Data transfer  
is inhibited until the RDRF bit is cleared. Data in the serial communications data register is valid in  
this case, but additional data received during an overrun condition (including the byte causing the  
overrun) will be lost.  
The OR bit is cleared when the serial communications status register is accessed (with OR set)  
followed by a read of the serial communications data register.  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-13  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
NF — Noise error flag  
This bit is set if there is noise on a ‘valid’ start bit, any of the data bits or on the stop bit.The NF bit  
is not set by noise on the idle line nor by invalid start bits. If there is noise, the NF bit is not set until  
the RDRF flag is set. Each data bit is sampled three times as described in Section 11.8.  
The NF bit represents the status of the byte in the serial communications data register.For the byte  
being received (shifted in) there will be also a ‘working’ noise flag, the value of which will be  
transferred to the NF bit when the serial data is loaded into the serial communications data  
register.The NF bit does not generate an interrupt because the RDRF bit gets set with NF and can  
be used to generate the interrupt.  
The NF bit is cleared when the serial communications status register is accessed (with NF set)  
followed by a read of the serial communications data register.  
FE — Framing error flag  
This bit is set when the word boundaries in the bit stream are not synchronized with the receiver  
bit counter (generated by the reception of a logic zero bit where a stop bit was expected). The FE  
bit reflects the status of the byte in the receive data register and the transfer from the receive shift  
register to the receive data register is inhibited by an overrun. The FE bit is set during the same  
cycle as the RDRF bit but does not get set in the case of an overrun (OR). The framing error flag  
inhibits further transfer of data into the receive data register until it is cleared.  
The FE bit is cleared when the serial communications status register is accessed (with FE set)  
followed by a read of the serial communications data register.  
11  
11.11.5 Baud rate register (BAUD)  
The baud rate register (BAUD) is used to set the bit rate for the SCI system. Normally this register  
is written once, during initialization, to set the baud rate for SCI communications. Both the receiver  
and the transmitter use the same baud rate which is derived from the MCU bus rate clock. A two  
stage divider is used to develop custom baud rates from normal MCU crystal frequencies,  
therefore it is not necessary to use special baud rate crystal frequencies.  
State  
Address bit 7  
$004B TCLR  
bit 6  
0
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
on reset  
SCP1 SCP0 RCKB SCR2 SCR1 SCR0 0000 0uuu  
SCI baud rate (BAUD)  
TCLR — Clear baud rate counters (test purposes only)  
This bit is disabled and remains low in any mode other than test or bootstrap. Reset clears this bit.  
While in test or bootstrap mode, setting this bit causes the baud rate counter chains to be reset.  
The logic one state of this bit is transitory, reads always a return a logic zero.This control bit is only  
intended for factory testing of the MCU  
TPG  
MOTOROLA  
11-14  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
SCP1, SCP0 — Serial prescaler select bits  
These read/write bits determine the prescale factor by which the internal processor clock is divided  
before it is applied to the transmitter and receiver rate control dividers. This common prescaled  
output is used as the input to a divider that is controlled by the SCR0–SCR2 bits for the SCI  
receiver and transmitter.  
Table 11-2 First prescaler stage  
Prescaler  
division ratio (PRS1)  
SCP1  
SCP0  
0
0
1
1
0
1
0
1
1
3
4
13  
SCR2, SCR1, SCR0 — SCI rate select bits  
These three read/write bits select the baud rates for the transmitter and the receiver.The prescaler  
output is divided by the factors shown in Table 11-3.  
Table 11-3 Second prescaler stage  
Prescaler  
division ratio (PRS2)  
SCR2  
SCR1  
SCR0  
11  
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
2
4
8
16  
32  
64  
128  
RCKB — SCI receive baud rate clock test  
This bit is disabled and remains low in any mode other than test or bootstrap. Reset clears this bit.  
While in test or bootstrap mode, this bit may be written but not read (reads always return a logic  
zero). Setting this bit enables a baud rate counter test mode, where the exclusive-or of the receiver  
clock (16 times the baud rate) is driven out of the PC3/TDO pin. This control bit is intended only  
for factory testing of the MCU.  
TPG  
MC68HC05F32  
SERIAL COMMUNICATIONS INTERFACE  
MOTOROLA  
11-15  
For More Information On This Product,  
Go to: www.freescale.com  
 
 
Freescale Semiconductor, Inc.  
11.12  
Baud rate selection  
The flexibility of the baud rate generator allows many different baud rates to be selected,  
depending on the CPU clock frequency. A particular baud rate may be generated by manipulating  
the various prescaler and division ratio bits.  
The SCI baud rate can be calculated from the internal bus clock and the two prescaler factors,  
PRS1 and PRS2. The first prescaler factor, PRS1, is selected with SCP0 and SCP1, as shown in  
Table 11-2. The second prescaler factor, PRS2, is selected with SCR0, SCR1 and SCR2, as  
shown in Table 11-3. The SCI baud rate B equals the internal bus clock E, divided by 16, divided  
by PRS1, divided by PRS2 (B = E/16/PRS1/PRS2).  
Note:  
For the receiver, the internal clock frequency is 16 times higher than the selected baud  
rate.  
11.13  
SCI during STOP mode  
When the MCU enters STOP mode, the baud rate generator driving the receiver and transmitter  
is shut down.This stops all SCI activity.Both the receiver and the transmitter are unable to operate.  
If the STOP instruction is executed during a transmitter transfer, that transfer is halted.When STOP  
mode is exited as a result of an external interrupt, that particular transmission resumes.  
If the receiver is receiving data when the STOP instruction is executed, received data sampling is  
stopped (baud generator stops) and the rest of the data is lost.  
11  
Warning: For the above reasons, all SCI transactions should be in the idle state when the STOP  
instruction is executed.  
11.14  
SCI during WAIT mode  
The SCI system is not affected by WAIT mode and continues normal operation. Any valid SCI  
interrupt will wake-up the system. If required, the SCI system can be disabled prior to entering  
WAIT mode by writing a zero to the transmitter and receiver enable bits in the serial communication  
control register 2 at $0049.This action will result in a reduction of power consumption during WAIT  
mode.  
TPG  
MOTOROLA  
11-16  
SERIAL COMMUNICATIONS INTERFACE  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
12  
PULSE WIDTH MODULATOR  
12.1  
PWM introduction  
The pulse width modulator (PWM) system has three 8-bit channels (PWM1, PWM2, and PWM3).  
The PWM has a programmable period of 256xT, where T can be E/2, E/4, and E/8 for an output  
frequency of 4 KHz, 2KHz, and 1 KHz respectively with E = 2MHz. E is the internal bus frequency  
fixed to half of the external oscillator frequency.  
PWM control  
register  
($0040)  
0
0
0
POL3 POL2 POL1 RA1 RA0  
PWM3/PE7  
PWM2/PE6  
PWM1PE5  
PWM3 data ($0043)  
PWM2 data ($0042)  
PWM1 data ($0041)  
12  
PWM 8-bit counter  
Clock  
E
Figure 12-1 PWM block diagram  
TPG  
MC68HC05F32  
PULSE WIDTH MODULATOR  
MOTOROLA  
12-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
12.2  
Functional description  
The PWM is capable of generating signals from 0% to 100% duty cycle. A $00 in the PWM data  
register yields an ‘OFF’ output (0%), but an $FF yields a duty of 255/256. To achieve the 100%  
duty (‘ON’ output), the polarity control bit is set to active low (POL = 0) for that channel (i.e. PWM0  
and PWM1) while the data register has $00 in it.  
When not in use, the PWM system can be shut off to save power by clearing the clock rate select  
bits RA0 and RA1 in the PWM control register (PWCR). The PWM starts conversion immediately  
after programming bits RA0 and RA1 in the PWM control register. The PWM outputs are  
connected to port E if the corresponding bit in the port E control register is set.  
The PWM output can have an active high or an active low pulse under software control.  
256 T  
$00  
$01  
255 T  
T
$50  
176 T  
$80  
128 T  
12  
$FF  
255 T  
T
Figure 12-2 PWM output waveforms (POL = 1, active high)  
12.3  
Registers  
There are three PWM data registers and a control register associated with the PWM system.  
These registers can be written to and read at any time.  
After reset the user should write to the data registers and to the polarity select bits prior to enabling  
the PWM system (i.e. prior to setting RA1 and/or RA0 for PWM input clock rate).This will avoid an  
erroneous duty cycle being driven.  
TPG  
MOTOROLA  
12-2  
PULSE WIDTH MODULATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
$00  
$01  
256 T  
T
255 T  
$50  
$80  
$FF  
80 T  
128 T  
255 T  
T
Figure 12-3 PWM waveforms (POL = 0, active low)  
12.3.1  
PWM control (PWMCR)  
State  
on reset  
Address bit 7  
$0040  
bit 6  
0
bit 5  
0
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
PWM control (PWMCR)  
0
POL3 POL2 POL1 RA1 RA0 0001 1100  
12  
POL1 — PWM1 polarity  
1 (set)  
makes the PWM1 pulse active high  
0 (clear) – makes the PWM1 pulse active low  
POL2 — PWM2 polarity  
1 (set) makes the PWM2 pulse active high  
0 (clear) – makes the PWM2 pulse active low  
POL3 — PWM3 polarity  
1 (set) makes the PWM3 pulse active high  
0 (clear) – makes the PWM3 pulse active low  
TPG  
MC68HC05F32  
PULSE WIDTH MODULATOR  
MOTOROLA  
12-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
RA1, RA0 — PWM clock rate bits  
These bits select the input clock rate and determine the period.  
Note:  
The polarity bits and the PWM clock rate bits are not latched until the end of conversion.  
They affect the PWM output immediately. For proper operation these control bits must  
not be changed during conversion.  
Table 12-1 PWM clock rate  
RA1:RA0  
0 0  
PWM input clock  
OFF  
E/2  
E/4  
E/8  
0 1  
1 0  
1 1  
12.3.2  
PWM data registers (PWMD)  
The PWM system has three 8-bit data registers which hold the duty cycle for each PWM output.  
PWM data1, PWM data2, and PWM data3 are the data registers located at $41-$43 respectively.  
Note:  
These registers are affected by RESET  
State  
on reset  
Address bit 7  
bit 6  
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
bit 0  
12  
PWM data1 (PWMD1)  
PWM data2 (PWMD2)  
PWM data3 (PWMD3)  
$0041  
$0042  
$0043  
1000 0000  
1000 0000  
1000 0000  
12.4  
PWM during WAIT mode  
The PWM continues normal operation during WAIT mode.To decrease power consumption during  
WAIT, it is recommended that the rate select bits in the PWM control register are cleared if the  
PWM D/A converter is not used.  
TPG  
MOTOROLA  
12-4  
PULSE WIDTH MODULATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
12.5  
PWM during STOP mode  
In STOP mode the oscillator is stopped causing the PWM to cease operation. Any signal in  
process is aborted in whatever phase the signal happens to be in.  
12.6  
PWM during reset  
Upon RESET the RA0 and RA1 bits in the PWM control register are cleared, the port E control  
register is cleared, the data registers are written with $80 and the polarity bits are set.This in effect  
disables the PWM system. The user should write to the data registers prior to enabling the PWM  
system (i.e. prior to setting RA1 or RA0). This will avoid an erroneous duty cycle being driven.  
12  
TPG  
MC68HC05F32  
PULSE WIDTH MODULATOR  
MOTOROLA  
12-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
12  
TPG  
MOTOROLA  
12-6  
PULSE WIDTH MODULATOR  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
13  
32 KHZ CLOCK SYSTEM  
13.1  
32 kHz clock system  
The 32 kHz clock system is mostly independent from the rest of the MCU. WAIT mode and STOP  
mode do not affect the work of the 32 kHz clock system. For the reason of power saving the  
oscillator and the divider can be stopped if the oscillator input pin OSC3 is held on fixed potential.  
The 32 kHz clock system is provided to generate a refresh signal at port E pin 4 and an custom  
periodic interrupt (CPI) with a period of 0.5s. The refresh frequency and the periodic interrupt are  
under the control of the custom periodic interrupt control/status register located at $4C.  
13.1.1  
Custom periodic interrupt control/status register (CPICSR)  
The CPICSR contains the interrupt flag CPIF, the interrupt enable bit CPIE and refresh frequency  
select bits RFQ1, RFQ0.  
State  
Address bit 7  
$004C  
bit 6  
bit 5  
0
bit 4  
bit 3  
0
bit 2  
bit 1  
bit 0  
on reset  
RFQ1 RFQ0 0000 0000  
CPI control/status (CPICSR)  
0
CPIF  
CPIE  
0
13  
CPIF — Custom periodic interrupt flag  
CPIF is a clearable, read-only status bit and is set when the 14-bit counter changes from $3FFF  
to $0000. A CPU interrupt request will be generated if CPIE is set. Clearing the CPIF is done by  
writing a ‘0’ to it. Writing a ‘1’ to CPIF has no effect on the bit’s value. Reset clears CPIF.  
CPIE — Custom periodic interrupt enable  
When this bit is cleared, the CPI interrupts are disabled. When this bit is set, a CPU interrupt  
request is generated when the CPIF bit is set. Reset clears this bit.  
TPG  
MC68HC05F32  
32 KHZ CLOCK SYSTEM  
MOTOROLA  
13-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
RFQ1–RFQ0 — Refresh frequency select  
These two read/write bits select one of four taps from the 14-stage counter to provide a refresh  
clock with a frequency according to Table 13-1. Reset clears these bits, selecting the highest  
frequency.  
Table 13-1 Refresh clock (32.768 kHz crystal)  
RFQ1 RFQ0  
Refresh clock frequency  
8.192 kHz (reset condition)  
4.096 kHz  
0
0
1
1
0
1
0
1
2.048 kHz  
1.024 kHz  
13.1.1.1 Refresh clock  
If bit 4 in the control register of port E is set, the output of the 32 kHz clock system is connected  
to the pin PE4/REFRESH. The refresh clock rate is under software control and is specified in  
Table 13-1.  
13.2  
Operation during STOP mode  
Stop mode does not affect the work of the 32 kHz clock system. If the CPI interrupt is enabled, a  
custom periodic interrupt will cause the processor to wake up from the STOP mode.  
13  
13.3  
Operation during WAIT mode  
The CPU clock halts during the WAIT mode, but the 32 kHz clock system remains active. If the  
CPI interrupt is enabled, a custom periodic interrupt will cause the processor to exit the WAIT  
mode.  
TPG  
MOTOROLA  
13-2  
32 KHZ CLOCK SYSTEM  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
14  
RESETS AND INTERRUPTS  
14.1  
Resets  
The MC68HC05F32 can be reset in five ways: by the initial power-on reset function, by an active  
low input to the RESET pin, by an on-chip low voltage reset, by an opcode fetch from an illegal  
address, and by a COP watchdog timer reset. Any of these resets will cause the program to return  
to its starting address, specified by the contents of memory locations $FFFE and $FFFF, and  
cause the interrupt mask of the CCR to be set.  
14.1.1  
Power-on reset  
A power-on reset occurs when a positive transition is detected on VDD. The power-on reset  
function is strictly for power turn-on conditions and should not be used to detect drops in the power  
supply voltage. The power-on circuitry provides a stabilization delay (tPORL) from when the  
oscillator becomes active. If the external RESET pin is low at the end of this delay then the  
processor remains in the reset state until RESET goes high.  
14.1.2  
RESET pin  
When the oscillator is running in a stable state, the MCU is reset when a logic zero is applied to  
the RESET input for a minimum period of 1.5 machine cycles (tCYC). This pin contains an internal  
Schmitt trigger as part of its input to improve noise immunity. When the reset pin goes high, the  
MCU will resume operation on the following cycle.The RESET pin is also an output device for the  
internal low voltage reset.  
14  
14.1.3  
Illegal address reset  
When an opcode fetch occurs from an address which is not part of the RAM ($0068 – $03FF) or  
of the ROM ($8000 – $FFFF) or EEPROM ($0400 – $04FF), the device is automatically reset.  
TPG  
MC68HC05F32  
RESETS AND INTERRUPTS  
MOTOROLA  
14-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Note:  
No RTS or RTI instruction should be placed at the end of a memory block since this  
could result in an illegal address reset.  
14.1.4  
Computer operating properly (COP) reset  
The MCU contains a watchdog timer that automatically times out if not reset (cleared) within a  
specific time by a program reset sequence.  
If the COP watchdog timer is allowed to timeout, an internal reset is generated to reset the MCU.  
Because the internal reset signal is used, the MCU comes out of a COP reset in the same  
operating mode it was in when the COP timeout was generated.  
The COP function is a mask option, enabled or disabled during device manufacture. See  
Section 1.2.  
Refer to Section 5.3 for more information on the COP watchdog timer.  
14.1.5  
Low voltage reset  
The MCU contains a low voltage detection circuit which drives the external reset.  
For a positive transition of supply voltage v , the low voltage reset occurs as long asV is below  
DD  
DD  
the V  
level. In this case the external reset pin is pulled down. If the supply voltage drops off  
RON  
above theV  
level, the reset is released. If the supply voltage falls off below theV  
level, the  
RON  
ROFF  
RESET pin is pulled down.  
14  
TPG  
MOTOROLA  
14-2  
RESETS AND INTERRUPTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
14.2  
Interrupts  
The MCU can be interrupted by nine different sources, eight maskable hardware interrupts and  
one nonmaskable software interrupt:  
External signal on the IRQ pin; IRQ is mask selectable as edge or edge-and-level sensitive  
Keyboard interrupt  
Core timer interrupt  
16-bit programmable timer interrupt  
Low voltage interrupt (LVI) – EEPROM  
Serial peripheral interface (SPI) interrupt  
Serial communications interface (SCI) interrupt  
32 kHz clock system interrupt  
Software interrupt instruction (SWI)  
Interrupts cause the processor to save the register contents on the stack and to set the interrupt  
mask (I-bit) to prevent additional interrupts. The RTI instruction (return from interrupt) causes the  
register contents to be recovered from the stack and normal processing to resume. While  
executing the RTI instruction, the interrupt mask bit (I-bit) will be cleared providing the  
corresponding enable bit stored on the stack is zero, i.e. the interrupt is disabled.  
Unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but  
are considered pending until the current instruction is complete.The current instruction is the one  
already fetched and being operated on. When the current instruction is complete, the processor  
checks all pending hardware interrupts. If interrupts are not masked (CCR I-bit clear) and the  
corresponding interrupt enable bit is set, the processor proceeds with interrupt processing;  
otherwise, the next instruction is fetched and executed.Figure 14-1 shows the interrupt processing  
flow.  
Note:  
Power-on or external reset clears all interrupt enable bits thus preventing interrupts  
during the reset sequence.  
14  
TPG  
MC68HC05F32  
RESETS AND INTERRUPTS  
MOTOROLA  
14-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
14.2.1  
Interrupt priorities  
Each potential interrupt source is assigned a priority which means that if more than one interrupt  
is pending at the same time, the processor will service the one with the highest priority first. For  
example, if both an external interrupt and a timer interrupt are pending after an instruction  
execution, the external interrupt is serviced first.  
14.2.2  
Non-maskable software interrupt (SWI)  
The software interrupt (SWI) is an executable instruction and a nonmaskable interrupt: it is  
executed regardless of the state of the I-bit in the CCR. If the I-bit is zero (interrupts enabled), SWI  
is executed after interrupts that were pending when the SWI was fetched, but before interrupts  
generated after the SWI was fetched.The SWI interrupt service routine address is specified by the  
contents of memory locations $FFFC and $FFFD.  
14.2.3  
Maskable hardware interrupts  
If the interrupt mask bit (I-bit) of the CCR is set, all maskable interrupts (internal and external) are  
masked. Clearing the I-bit allows interrupt processing to occur. IRQ is software selectable as either  
edge or edge-and-level sensitive (bit 3 of the system option register).  
Note:  
The internal interrupt latch is cleared in the first part of the interrupt service routine;  
therefore, one external interrupt pulse could be latched and serviced as soon as the I-bit  
is cleared.  
14.2.3.1 Real time and core timer (CTIMER) interrupts  
There are two different core timer interrupt flags that cause a CTIMER interrupt whenever an  
interrupt is enabled and its flag becomes set, namely RTIF and CTOF. The interrupt flags and  
enable bits are located in the CTIMER control and status register (CTCSR). These interrupts will  
vector to the same interrupt service routine, whose start address is contained in memory locations  
$FFF8 and $FFF9 (see Section 5.2.1 and Figure 5-1).  
14  
To make use of the real time interrupt the RTIE bit must first be set. The RTIF bit will then be set  
after the specified number of counts.  
To make use of the core timer overflow interrupt, the CTOFE bit must first be set.The CTOF bit will  
then be set when the core timer counter register overflows from $FF to $00.  
TPG  
MOTOROLA  
14-4  
RESETS AND INTERRUPTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
From  
RESET  
Yes  
Yes  
Yes  
Is  
I-bit set  
?
No  
IRQ/Key  
external interrupt  
?
Clear relevant  
interrupt request  
latch  
No  
Core timer  
or CPI interrupt  
?
Stack:  
PC, X, A, CC  
No  
Yes  
Yes  
Yes  
Timer1, 2, 3, 4  
interrupt  
Set I-bit  
?
Load PC from:  
No  
SWI:  
$FFFC, $FFFD  
$FFFA, $FFFB  
$FFF8, $FFF9  
$FFF8, $FFF9  
$FFF6, $FFF7  
$FFF4, $FFF5  
$FFF2, $FFF3  
$FFF0, $FFF1  
IRQ/Key:  
CTIMER:  
CPI:  
LVI  
interrupt  
TIMER:  
LVI:  
SPI:  
SCI:  
?
No  
SPI  
interrupt  
?
Fetch next instruction  
No  
Yes  
SWI  
instruction  
SCI  
interrupt  
?
?
14  
No  
No  
RTI  
instruction  
?
Yes  
No  
Restore registers  
from stack:  
CC, A, X, PC  
Execute  
instruction  
Figure 14-1 Interrupt flowchart  
TPG  
MC68HC05F32  
RESETS AND INTERRUPTS  
MOTOROLA  
14-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 14-1 Vector address for interrupts and reset  
CPU  
Register Flagname  
Interrupts  
Vector address  
interrupt  
RESET  
SWI  
Reset  
$FFFE–$FFFF  
$FFFC–$FFFD  
$FFFA$FFFB  
Software interrupt  
External interrupt  
IRQ  
CTCSR  
CTCSR  
CPICSR  
TSR  
CTOF  
RTIF  
CPIF  
ICF1  
OCF1  
ICF2  
OCF2  
ICF3  
OCF3  
ICF4  
OCF4  
TOF  
TOF  
KSF  
Core timer overflow  
Real time interrupt  
Custom periodic interrupt  
Timer input capture1  
Timer output compare1  
Timer input capture2  
Timer output compare2  
Timer input capture3  
Timer output compare3  
Timer input capture4  
Timer output compare4  
Timer1 overow  
CTIMER $FFF8–$FFF9  
CTIMER $FFF8–$FFF9  
CPI  
TIMER  
TIMER  
TIMER  
TIMER  
TIMER  
TIMER  
TIMER  
TIMER  
TIMER  
TIMER  
KEYF  
LVI  
$FFF8–$FFF9  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFF6–$FFF7  
$FFFA$FFFB  
$FFF4–$FFF5  
$FFF2–$FFF3  
$FFF2–$FFF3  
$FFF0–$FFF1  
$FFF0–$FFF1  
$FFF0–$FFF1  
$FFF0–$FFF1  
$FFF0–$FFF1  
TSR  
TSR  
TSR  
TSR2  
TSR2  
TSR2  
TSR2  
TSR  
TSR2  
KEY  
Timer2 overow  
Keyboard interrupt  
Low voltage interrupt  
SPI request interrupt  
SPI mode error  
SOR  
LVI  
SPSR  
SPSR  
SCSR  
SCSR  
SCSR  
SCSR  
SCSR  
SPIF  
MODF  
TDRE  
TC  
SPI  
SPI  
SCI transmit interrupt  
SCI transmit complete  
SCI receive interrupt  
SCI idle line interrupt  
SCI overrun error  
SCI  
SCI  
RDRF  
IDLE  
OR  
SCI  
SCI  
SCI  
14.2.3.2 Programmable 16-bit timer interrupt  
There are ten different timer interrupt flags that cause a timer interrupt whenever they are set and  
enabled.The timer interrupt enable bits are located in the timer control register (TCR) and the timer  
interrupt flags are located in the timer status registers (TSR1, TSR2). All three interrupts will vector  
to the same service routine, whose start address is contained in memory locations $FFF6 and  
$FFF7.  
14  
TPG  
MOTOROLA  
14-6  
RESETS AND INTERRUPTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
14.2.3.3 Keyboard interrupt  
When configured as input pins, all eight port A lines provide a wired-OR keyboard interrupt facility  
and will generate an interrupt, provided that the keyboard interrupt enable bit (KIE) in the  
keyboard/timer register (KEY/TIM) is set. The address of the interrupt service routine is specified  
by the contents of memory locations $0FFA and $0FFB. Since this interrupt vector is shared with  
the IRQ external interrupt function the interrupt service routine should check KSF to determine the  
interrupt source. KSF should be cleared by software in the interrupt service routine. Care must be  
taken to allow adequate time for switch debounce before clearing the flag.  
14.2.3.4 Low voltage interrupt  
There is a low voltage interrupt flag that causes an interrupt whenever it is set and enabled. The  
low voltage interrupt enable bit and the interrupt flag are located in the system option register  
(SOR). This interrupt will vector to the service routine, located at the address specified by the  
contents of memory locations $FFF4 and $FFF5.  
14.2.3.5 Serial peripheral interface (SPI) interrupt  
An interrupt in the serial peripheral interface (SPI) occurs when one of the interrupt flag bits in the  
SPI status register SPSR is set, provided the I-bit in the condition code register is clear and the  
enable bit SPIE in the SPI control register is enabled. The SPI interrupt causes the program to  
vector to memory location $FFF2 and $FFF3 which contains the starting address of the interrupt  
service routine. Software in the SPI service routine must determine the priority and cause of the  
SPI interrupt by examined the interrupt flag bits located in the SPI status register.  
14.2.3.6 Serial communications interface (SCI) interrupt  
There are five different interrupt flags (TDRE, TC, OR, RDRE, IDLE) that will cause an SCI  
interrupt whenever they are set and enabled. These five interrupt flags are found in the five most  
significant bits of the SCI status register SCSR.The actual processor interrupt is generated only if  
the I-bit in the condition code register is clear and the enable bit in the serial communication control  
register 2 (SCCR2) is enabled. The SCI interrupt causes the program counter to vector to the  
address pointed to by memory locations $FFF0–$FFF1 which contain the start address of the  
interrupt service routine. Software in the SCI interrupt service routine must determine the priority  
and cause of the SCI interrupt by examining the interrupt flags and the status bits in the serial  
communications status register SCSR.  
14  
TPG  
MC68HC05F32  
RESETS AND INTERRUPTS  
MOTOROLA  
14-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
14.2.3.7 Custom periodic interrupt (CPI)  
There is a timer interrupt flag that causes a CPI interrupt from the 32 kHz clock system whenever  
set and enabled. The interrupt flag and enable bits are located in the CPI control and status  
register (CPICSR). An interrupt will vector to the same interrupt service routine as the core timer  
interrupts, located at the address specified by the contents of memory location $FFF8 and $FFF9.  
14.2.4  
Hardware controlled interrupt sequence  
The following three functions (RESET, STOP, and WAIT) are not in the strictest sense interrupts.  
However, they are acted upon in a similar manner. Flowcharts for STOP and WAIT are shown in  
Figure 2-1.  
RESET: A reset condition causes the program to vector to its starting address, which is contained  
in memory locations $FFFE (MSB) and $FFFF (LSB). The I-bit in the condition code register is  
also set, to disable interrupts.  
STOP:The STOP instruction causes the oscillator to be turned off and the processor tosleepuntil  
an external interrupt (IRQ), a low voltage interrupt (LVI), a custom periodic interrupt (CPI), or a  
keyboard interrupt occurs, or the device is reset.  
WAIT: The WAIT instruction causes all processor clocks to stop, but leaves the timer clocks  
running. This ‘rest’ state of the processor can be cleared by reset, an external interrupt (IRQ), a  
keyboard interrupt, a timer interrupt (core or 16-bit), or a CPI, SPI, SCI, LVI interrupt.There are no  
special WAIT vectors for these interrupts.  
14  
TPG  
MOTOROLA  
14-8  
RESETS AND INTERRUPTS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
15  
CPU CORE AND INSTRUCTION SET  
This section provides a description of the CPU core registers, the instruction set and the  
addressing modes of the MC68HC05F32.  
15.1  
Registers  
The MCU contains five registers, as shown in the programming model of Figure 15-1.The interrupt  
stacking order is shown in Figure 15-2.  
7
7
7
7
0
0
0
0
0
Accumulator  
Index register  
15  
15  
Program counter  
Stack pointer  
0 0 0 0 0 0 0 0 1 1  
7
1 1 1 H I N Z C  
Condition code register  
Carry / borrow  
Zero  
Negative  
Interrupt mask  
Half carry  
Figure 15-1 Programming model  
15  
15.1.1  
Accumulator (A)  
The accumulator is a general purpose 8-bit register used to hold operands and results of  
arithmetic calculations or data manipulations.  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-1  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
Stack  
7
0
Condition code register  
Accumulator  
Increasing  
memory  
address  
Decreasing  
memory  
address  
Index register  
Program counter high  
Program counter low  
Unstack  
Figure 15-2 Stacking order  
15.1.2  
Index register (X)  
The index register is an 8-bit register, which can contain the indexed addressing value used to  
create an effective address. The index register may also be used as a temporary storage area.  
15.1.3  
Program counter (PC)  
The program counter is a 16-bit register, which contains the address of the next byte to be fetched.  
15.1.4  
Stack pointer (SP)  
The stack pointer is a 16-bit register, which contains the address of the next free location on the  
stack. During an MCU reset or the reset stack pointer (RSP) instruction, the stack pointer is set to  
location $00FF. The stack pointer is then decremented as data is pushed onto the stack and  
incremented as data is pulled from the stack.  
When accessing memory, the ten most significant bits are permanently set to 0000000011.These  
ten bits are appended to the six least significant register bits to produce an address within the  
range of $00C0 to $00FF. Subroutines and interrupts may use up to 64 (decimal) locations. If 64  
locations are exceeded, the stack pointer wraps around and overwrites the previously stored  
information. A subroutine call occupies two locations on the stack; an interrupt uses five locations.  
15.1.5  
Condition code register (CCR)  
15  
The CCR is a 5-bit register in which four bits are used to indicate the results of the instruction just  
executed, and the fifth bit indicates whether interrupts are masked. These bits can be individually  
tested by a program, and specific actions can be taken as a result of their state. Each bit is  
explained in the following paragraphs.  
TPG  
MOTOROLA  
15-2  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Half carry (H)  
This bit is set during ADD and ADC operations to indicate that a carry occurred between bits 3  
and 4.  
Interrupt (I)  
When this bit is set, all maskable interrupts are masked. If an interrupt occurs while this bit is set,  
the interrupt is latched and remains pending until the interrupt bit is cleared.  
Negative (N)  
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was  
negative.  
Zero (Z)  
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was  
zero.  
Carry/borrow (C)  
When set, this bit indicates that a carry or borrow out of the arithmetic logical unit (ALU) occurred  
during the last arithmetic operation.This bit is also affected during bit test and branch instructions  
and during shifts and rotates.  
15.2  
Instruction set  
The MCU has a set of 62 basic instructions. They can be grouped into five different types as  
follows:  
Register/memory  
Read/modify/write  
Branch  
Bit manipulation  
Control  
15  
The following paragraphs briefly explain each type. All the instructions within a given type are  
presented in individual tables.  
This MCU uses all the instructions available in the M146805 CMOS family plus one more: the  
unsigned multiply (MUL) instruction. This instruction allows unsigned multiplication of the contents  
of the accumulator (A) and the index register (X). The high-order product is then stored in the  
index register and the low-order product is stored in the accumulator. A detailed definition of the  
MUL instruction is shown in Table 15-1.  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
15.2.1  
Register/memory Instructions  
Most of these instructions use two operands. The first operand is either the accumulator or the  
index register.The second operand is obtained from memory using one of the addressing modes.  
The jump unconditional (JMP) and jump to subroutine (JSR) instructions have no register  
operand. Refer to Table 15-2 for a complete list of register/memory instructions.  
15.2.2  
Branch instructions  
These instructions cause the program to branch if a particular condition is met; otherwise, no  
operation is performed. Branch instructions are two-byte instructions. Refer to Table 15-3.  
15.2.3  
Bit manipulation instructions  
The MCU can set or clear any writable bit that resides in the first 256 bytes of the memory space  
(page 0). All port data and data direction registers, timer and serial interface registers,  
control/status registers and a portion of the on-chip RAM reside in page 0. An additional feature  
allows the software to test and branch on the state of any bit within these locations.The bit set, bit  
clear, bit test and branch functions are all implemented with single instructions. For the test and  
branch instructions, the value of the bit tested is also placed in the carry bit of the condition code  
register. Refer to Table 15-4.  
15.2.4  
Read/modify/write instructions  
These instructions read a memory location or a register, modify or test its contents, and write the  
modified value back to memory or to the register.The test for negative or zero (TST) instruction is  
an exception to this sequence of reading, modifying and writing, since it does not modify the value.  
Refer to Table 15-5 for a complete list of read/modify/write instructions.  
15.2.5  
Control instructions  
15  
These instructions are register reference instructions and are used to control processor operation  
during program execution. Refer to Table 15-6 for a complete list of control instructions.  
TPG  
MOTOROLA  
15-4  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
15.2.6  
Tables  
Tables for all the instruction types listed above follow. In addition there is a complete alphabetical  
listing of all the instructions (see Table 15-7), and an opcode map for the instruction set of the  
M68HC05 MCU family (see Table 15-8).  
Table 15-1 MUL instruction  
Operation  
X:A X*A  
Multiplies the eight bits in the index register by the eight  
Description bits in the accumulator and places the 16-bit result in the  
concatenated accumulator and index register.  
H : Cleared  
I : Not affected  
N : Not affected  
Z : Not affected  
Condition  
codes  
C : Cleared  
Source  
Form  
MUL  
Cycles  
11  
Addressing mode  
Inherent  
Bytes Opcode  
$42  
1
15.3  
Addressing modes  
Ten different addressing modes provide programmers with the flexibility to optimize their code for  
all situations. The various indexed addressing modes make it possible to locate data tables, code  
conversion tables and scaling tables anywhere in the memory space. Short indexed accesses are  
single byte instructions; the longest instructions (three bytes) enable access to tables throughout  
memory. Short absolute (direct) and long absolute (extended) addressing are also included. One  
or two byte direct addressing instructions access all data bytes in most applications. Extended  
addressing permits jump instructions to reach all memory locations.  
The term ‘effective address’ (EA) is used in describing the various addressing modes. The  
effective address is defined as the address from which the argument for an instruction is fetched  
or stored.The ten addressing modes of the processor are described below. Parentheses are used  
to indicate ‘contents of’ the location or register referred to. For example, (PC) indicates the  
contents of the location pointed to by the PC (program counter). An arrow indicates ‘is replaced  
by’ and a colon indicates concatenation of two bytes. For additional details and graphical  
illustrations, refer to the M6805 HMOS/M146805 CMOS Family Microcomputer/  
Microprocessor User's Manual or to the M68HC05 Applications Guide.  
15  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 15-2 Register/memory instructions  
Addressing modes  
Indexed  
(no  
offset)  
Indexed  
(8-bit  
offset)  
Indexed  
(16-bit  
offset)  
Immediate  
Direct  
Extended  
Function  
Load A from memory  
Load X from memory  
Store A in memory  
Store X in memory  
Add memory to A  
LDA A6  
LDX AE  
STA  
2
2
2
2
B6  
2
2
2
2
2
2
2
3
3
C6  
CE  
C7  
CF  
CB  
3
3
4
F6  
1
1
3
E6  
2
2
4
D6  
3
3
5
5
BE  
4
FE  
3
EE  
4
DE  
B7  
BF  
BB  
4
3
5
F7  
FF  
FB  
1
4
E7  
EF  
EB  
2
5
D7  
DF  
DB  
3
6
STX  
4
3
5
1
4
2
5
3
6
ADD AB  
ADC A9  
SUB A0  
2
2
2
2
2
2
3
3
4
1
3
2
4
3
5
Add memory and carry to A  
Subtract memory  
B9  
B0  
3
3
C9  
C0  
3
3
4
4
F9  
F0  
1
1
3
3
E9  
E0  
2
4
D9  
D0  
3
5
2
4
3
5
Subtract memory from A  
with borrow  
SBC A2  
2
2
B2  
2
3
C2  
3
4
F2  
1
3
E2  
2
4
D2  
3
5
AND memory with A  
AND A4  
ORA AA  
EOR A8  
2
2
2
2
2
2
B4  
BA  
B8  
2
2
2
3
3
3
C4  
CA  
C8  
3
3
3
4
4
4
F4  
FA  
F8  
1
1
1
3
3
3
E4  
EA  
E8  
2
2
2
4
4
4
D4  
DA  
D8  
3
3
3
5
5
5
OR memory with A  
Exclusive OR memory with A  
Arithmetic compare A  
with memory  
CMP A1  
CPX A3  
BIT A5  
2
2
2
2
2
2
B1  
B3  
B5  
2
2
2
3
3
3
C1  
C3  
C5  
3
3
3
4
4
4
F1  
F3  
F5  
1
1
1
3
3
3
E1  
E3  
E5  
2
2
2
4
4
4
D1  
D3  
D5  
3
3
3
5
5
5
Arithmetic compare X  
with memory  
Bit test memory with A  
(logical compare)  
Jump unconditional  
Jump to subroutine  
JMP  
JSR  
BC  
BD  
2
2
2
5
CC  
CD  
3
3
3
6
FC  
FD  
1
1
2
5
EC  
ED  
2
2
3
6
DC  
DD  
3
3
4
7
15.3.1  
Inherent  
In the inherent addressing mode, all the information necessary to execute the instruction is  
contained in the opcode. Operations specifying only the index register or accumulator, as well as  
the control instruction, with no other arguments are included in this mode. These instructions are  
one byte long.  
15  
15.3.2  
Immediate  
In the immediate addressing mode, the operand is contained in the byte immediately following the  
opcode. The immediate addressing mode is used to access constants that do not change during  
program execution (e.g. a constant used to initialize a loop counter).  
EA = PC+1; PC PC+2  
TPG  
MOTOROLA  
15-6  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 15-3 Branch instructions  
Relative addressing mode  
Mnemonic Opcode # Bytes # Cycles  
Function  
Branch always  
Branch never  
Branch if higher  
BRA  
BRN  
BHI  
20  
21  
22  
23  
24  
24  
25  
25  
26  
27  
28  
29  
2A  
2B  
2C  
2D  
2E  
2F  
AD  
2
2
3
3
2
3
Branch if lower or same  
Branch if carry clear  
BLS  
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
BCC  
(BHS)  
BCS  
(BLO)  
BNE  
BEQ  
BHCC  
BHCS  
BPL  
BMI  
(Branch if higher or same)  
Branch if carry set  
(Branch if lower)  
Branch if not equal  
Branch if equal  
Branch if half carry clear  
Branch if half carry set  
Branch if plus  
Branch if minus  
Branch if interrupt mask bit is clear  
Branch if interrupt mask bit is set  
Branch if interrupt line is low  
Branch if interrupt line is high  
Branch to subroutine  
BMC  
BMS  
BIL  
2
3
BIH  
2
3
BSR  
2
6
Table 15-4 Bit manipulation instructions  
Addressing modes  
Bit set/clear Bit test and branch  
Opcode # Bytes # Cycles Opcode # Bytes # Cycles  
Function  
Branch if bit n is set  
Branch if bit n is clear  
Set bit n  
Mnemonic  
BRSET n (n=0–7)  
BRCLR n (n=0–7)  
BSET n (n=0–7)  
BCLR n (n=0–7)  
2•n  
3
3
5
5
01+2•n  
10+2•n  
11+2•n  
2
2
5
5
Clear bit n  
15  
15.3.3  
Direct  
In the direct addressing mode, the effective address of the argument is contained in a single byte  
following the opcode byte. Direct addressing allows the user to directly address the lowest 256  
bytes in memory with a single two-byte instruction.  
EA = (PC+1); PC PC+2  
Address bus high 0; Address bus low (PC+1)  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 15-5 Read/modify/write instructions  
Addressing modes  
Indexed  
Indexed  
(8-bit  
offset)  
Inherent  
(A)  
Inherent  
(X)  
Direct  
(no  
offset)  
Function  
Increment  
INC 4C  
DEC 4A  
CLR 4F  
COM 43  
NEG 40  
ROL 49  
ROR 46  
LSL 48  
LSR 44  
ASR 47  
TST 4D  
MUL 42  
1
3
5C  
5A  
5F  
53  
50  
59  
56  
58  
54  
57  
5D  
1
3
3C  
3A  
3F  
33  
30  
39  
36  
38  
34  
37  
3D  
2
2
2
2
2
2
2
2
2
2
2
5
5
5
5
5
7C  
7A  
7F  
73  
70  
79  
76  
78  
74  
77  
7D  
1
1
1
1
1
5
6C  
6A  
6F  
63  
60  
69  
66  
68  
64  
67  
6D  
2
2
2
2
2
6
Decrement  
1
3
1
3
5
6
Clear  
1
3
1
3
5
6
Complement  
1
3
3
1
3
3
5
5
6
6
Negate (twos complement)  
Rotate left through carry  
Rotate right through carry  
Logical shift left  
1
1
1
3
1
3
5
1
5
2
6
1
3
1
3
5
1
5
2
6
1
3
1
3
5
1
5
2
6
Logical shift right  
Arithmetic shift right  
Test for negative or zero  
Multiply  
1
1
3
3
1
1
3
3
5
5
1
1
5
5
2
2
6
6
1
3
1
3
4
1
4
2
5
1
11  
Table 15-6 Control instructions  
Inherent addressing mode  
Function  
Transfer A to X  
Mnemonic Opcode # Bytes # Cycles  
TAX  
TXA  
SEC  
CLC  
SEI  
97  
9F  
99  
98  
9B  
9A  
83  
81  
80  
9C  
9D  
8E  
8F  
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
10  
6
9
2
2
2
2
Transfer X to A  
Set carry bit  
Clear carry bit  
Set interrupt mask bit  
Clear interrupt mask bit  
Software interrupt  
Return from subroutine  
Return from interrupt  
Reset stack pointer  
No-operation  
CLI  
SWI  
RTS  
RTI  
15  
RSP  
NOP  
STOP  
WAIT  
Stop  
Wait  
TPG  
MOTOROLA  
15-8  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 15-7 Instruction set  
Addressing modes  
Condition codes  
Mnemonic  
INH IMM DIR EXT REL IX IX1 IX2 BSC BTB  
H
I
N
Z
C
ADC  
ADD  
AND  
ASL  
ASR  
BCC  
BCLR  
BCS  
BEQ  
BHCC  
BHCS  
BHI  
0
0
1
0
BHS  
BIH  
BIL  
BIT  
BLO  
BLS  
BMC  
BMI  
BMS  
BNE  
BPL  
BRA  
BRN  
BRCLR  
BRSET  
BSET  
BSR  
CLC  
CLI  
CLR  
CMP  
15  
Condition code symbols  
Address mode abbreviations  
Tested and set if true,  
cleared otherwise  
H
Half carry (from bit 3)  
BSC Bit set/clear  
BTB Bit test & branch  
DIR Direct  
IMM Immediate  
IX  
IX1  
IX2  
Indexed (no offset)  
I
Interrupt mask  
Negate (sign bit)  
Zero  
?
Not affected  
Load CCR from stack  
Cleared  
Indexed, 1 byte offset  
Indexed, 2 byte offset  
N
Z
C
EXT Extended  
INH Inherent  
0
1
REL Relative  
Carry/borrow  
Set  
Not implemented  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 15-7 Instruction set (Continued)  
Addressing modes  
Condition codes  
Mnemonic  
INH IMM DIR EXT REL IX IX1 IX2 BSC BTB  
H
I
N
Z
C
COM  
CPX  
DEC  
EOR  
INC  
0
?
?
1
0
1
0
1
0
?
1
JMP  
JSR  
LDA  
LDX  
LSL  
LSR  
MUL  
NEG  
NOP  
ORA  
ROL  
ROR  
RSP  
RTI  
0
?
?
RTS  
SBC  
SEC  
SEI  
STA  
STOP  
STX  
SUB  
SWI  
TAX  
TST  
TXA  
WAIT  
15  
Condition code symbols  
Address mode abbreviations  
Tested and set if true,  
cleared otherwise  
H
Half carry (from bit 3)  
BSC Bit set/clear  
BTB Bit test & branch  
DIR Direct  
IMM Immediate  
IX  
IX1  
IX2  
Indexed (no offset)  
I
Interrupt mask  
Negate (sign bit)  
Zero  
?
Not affected  
Load CCR from stack  
Cleared  
Indexed, 1 byte offset  
Indexed, 2 byte offset  
N
Z
C
EXT Extended  
INH Inherent  
0
1
REL Relative  
Carry/borrow  
Set  
Not implemented  
TPG  
MOTOROLA  
15-10  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 15-8 M68HC05 opcode map  
15  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-11  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
15.3.4  
Extended  
In the extended addressing mode, the effective address of the argument is contained in the two  
bytes following the opcode byte. Instructions with extended addressing mode are capable of  
referencing arguments anywhere in memory with a single three-byte instruction. When using the  
Motorola assembler, the user need not specify whether an instruction uses direct or extended  
addressing. The assembler automatically selects the short form of the instruction.  
EA = (PC+1):(PC+2); PC PC+3  
Address bus high (PC+1); Address bus low (PC+2)  
15.3.5  
Indexed, no offset  
In the indexed, no offset addressing mode, the effective address of the argument is contained in  
the 8-bit index register. This addressing mode can access the first 256 memory locations. These  
instructions are only one byte long. This mode is often used to move a pointer through a table or  
to hold the address of a frequently referenced RAM or I/O location.  
EA = X; PC PC+1  
Address bus high 0; Address bus low X  
15.3.6  
Indexed, 8-bit offset  
In the indexed, 8-bit offset addressing mode, the effective address is the sum of the contents of  
the unsigned 8-bit index register and the unsigned byte following the opcode. Therefore the  
operand can be located anywhere within the lowest 511 memory locations.This addressing mode  
is useful for selecting the mth element in an n element table.  
EA = X+(PC+1); PC PC+2  
Address bus high K; Address bus low X+(PC+1)  
where K = the carry from the addition of X and (PC+1)  
15.3.7  
Indexed, 16-bit offset  
15  
In the indexed, 16-bit offset addressing mode, the effective address is the sum of the contents of  
the unsigned 8-bit index register and the two unsigned bytes following the opcode. This address  
mode can be used in a manner similar to indexed, 8-bit offset except that this three-byte instruction  
allows tables to be anywhere in memory. As with direct and extended addressing, the Motorola  
assembler determines the shortest form of indexed addressing.  
EA = X+[(PC+1):(PC+2)]; PC PC+3  
Address bus high (PC+1)+K; Address bus low X+(PC+2)  
where K = the carry from the addition of X and (PC+2)  
TPG  
MOTOROLA  
15-12  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
15.3.8  
Relative  
The relative addressing mode is only used in branch instructions. In relative addressing, the  
contents of the 8-bit signed byte (the offset) following the opcode are added to the PC if, and only  
if, the branch conditions are true. Otherwise, control proceeds to the next instruction. The span of  
relative addressing is from –126 to +129 from the opcode address. The programmer need not  
calculate the offset when using the Motorola assembler, since it calculates the proper offset and  
checks to see that it is within the span of the branch.  
EA = PC+2+(PC+1); PC EA if branch taken;  
otherwise EA = PC PC+2  
15.3.9  
Bit set/clear  
In the bit set/clear addressing mode, the bit to be set or cleared is part of the opcode. The byte  
following the opcode specifies the address of the byte in which the specified bit is to be set or  
cleared. Any read/write bit in the first 256 locations of memory, including I/O, can be selectively  
set or cleared with a single two-byte instruction.  
EA = (PC+1); PC PC+2  
Address bus high 0; Address bus low (PC+1)  
15.3.10 Bit test and branch  
The bit test and branch addressing mode is a combination of direct addressing and relative  
addressing. The bit to be tested and its condition (set or clear) is included in the opcode. The  
address of the byte to be tested is in the single byte immediately following the opcode byte (EA1).  
The signed relative 8-bit offset in the third byte (EA2) is added to the PC if the specified bit is set  
or cleared in the specified memory location. This single three-byte instruction allows the program  
to branch based on the condition of any readable bit in the first 256 locations of memory.The span  
of branch is from –125 to +130 from the opcode address. The state of the tested bit is also  
transferred to the carry bit of the condition code register.  
EA1 = (PC+1); PC PC+2  
Address bus high 0; Address bus low (PC+1)  
EA2 = PC+3+(PC+2); PC EA2 if branch taken;  
otherwise PC PC+3  
15  
TPG  
MC68HC05F32  
CPU CORE AND INSTRUCTION SET  
MOTOROLA  
15-13  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
15  
TPG  
MOTOROLA  
15-14  
CPU CORE AND INSTRUCTION SET  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
16  
ELECTRICAL SPECIFICATIONS  
This section contains the electrical specifications and associated timing information for the  
MC68HC05F32.  
16.1  
Maximum ratings  
Table 16-1 Maximum ratings  
(1)  
Rating  
Supply voltage  
Input voltage  
Symbol  
Value  
Unit  
V
V
– 0.3 to + 0.7  
DD  
V
V
– 0.3 to V + 0.3  
V
IN  
SS  
SS  
Bootloader mode (IRQ pin  
only)  
V
V
– 0.3 to 2 x V + 0.3  
V
IN  
SS  
DD  
(2)  
Current drain per pin  
I
25  
mA  
— excluding VDD and VSS  
Operating temperature range  
— standard  
— extended  
T to T  
0 to + 70  
–40 to + 85  
L
H
T
°C  
°C  
A
Storage temperature range  
T
– 65 to + 150  
STG  
(1) All voltages are with respect to V .  
SS  
(2) Maximum current drain per pin is for one pin at a time, limited by an external resistor.  
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  
16  
unused inputs should be tied to either V or V  
.
SS  
DD  
TPG  
MC68HC05F32  
ELECTRICAL SPECIFICATIONS  
MOTOROLA  
16-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
16.2  
Thermal characteristics and power considerations  
Table 16-2 Package thermal characteristics  
Characteristics  
Thermal resistance  
— 100-pin QFP package  
— 80-pin QFP package  
Symbol Value  
55  
Unit  
θ
°C/W  
JA  
The average chip junction temperature, T , in degrees Celsius can be obtained from the following  
J
equation:  
TJ = TA + (PD • θJA  
)
where:  
T = Ambient Temperature (°C)  
A
θ
= Package Thermal Resistance,  
JA  
Junction-to-ambient (°C/W)  
P = 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  
=
----------------------  
TJ + 273  
Solving equations [1] and [2] for K gives:  
2
K = PD • (TA + 273) + θJA PD  
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
A
D
J
by solving the above equations. The package thermal characteristics are shown in Table 16-2.  
16  
TPG  
MOTOROLA  
16-2  
ELECTRICAL SPECIFICATIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
16.3  
DC electrical characteristics  
Table 16-3 DC electrical characteristics (V = 5.0 V)  
DD  
(V = 5.0V ± 10%, V = 0 V , T = –40°C to +85°C, unless otherwise stated)  
DD  
DC  
SS  
DC A  
(1)  
Characteristic  
Symbol  
Min.  
Typ.  
Max.  
Unit  
Output voltage  
= –10 µA  
I
V
V
– 0.1  
0.1  
V
V
LOAD  
OH  
DD  
I
= +10 µA  
V
LOAD  
OL  
Output high voltage (I  
= –0.8 mA)  
LOAD  
V
V
– 0.8  
V
V
V
V
OH  
DD  
Ports (PA0–7, PB0–7, PC0–7, PH0–7, PI7–0)  
Output low voltage (I = +1.6 mA)  
LOAD  
Ports(PA0–7, PB0–7, PC4–7, PD4–7, PE4–7,  
PH0–7, PI0–7, PJ0–7)  
V
0.4  
OL  
Input high voltage  
Ports (PD0–7, PE0–7)  
Input high voltage  
V
0.7V  
15.0  
IH  
DD  
Ports (PA0–7, PB0–7, PC0–7, PF0–7, PG0–7)  
IRQ, RESET,OSC1, OSC3  
V
0.7V  
V
DD  
IH  
DD  
Input low voltage  
Ports (PA0–7, PB0–7, PC0–7, PF0–7, PG0–7)  
V
0.2V  
V
IL  
DD  
IRQ, RESET, OSC1, OSC3  
(2)  
Supply Current  
I
DD  
RUN  
WAIT  
STOP  
5
0.6  
10  
1.2  
80  
mA  
mA  
µA  
I/O ports hi-Z leakage current  
I
10  
1
µA  
µA  
OZ  
Ports (PA0–7, PB0–7, PC0–7, PD0–7, PE0–7)  
Input current  
I
IN  
RESET, IRQ, OSC1  
Capacitance  
Ports (as input or output)  
RESET, IRQ  
C
C
12  
8
pF  
pF  
OUT  
IN  
Input current low  
I
– 30  
– 90  
20  
– 170  
µA  
kΩ  
IL  
Ports (PA0–7, PB0–7, PC0–7), RESET  
LCD step down resistor  
R
LCDSD  
(1) Typical values are at midpoint of voltage range and at 25°C only.  
(2) All I measurements taken with suitable decoupling capacitors across the power supply to suppress the  
DD  
transient switching currents inherent in CMOS designs. RUN and WAIT I : measured using an external  
DD  
square-wave clock source (f  
= 3.58 MHz); all inputs0.2V from rail; no DC loads; maximum load on outputs  
OSC  
50pF (20pF on OSC2). WAIT I : only the timer system active; current varies linearly with the OSC2  
DD  
16  
capacitance. STOP and WAIT I : all ports congured as inputs, V = 0.2 V, V = V 0.2 V. STOP I :  
DD  
IL  
IH  
DD  
DD  
measured with OSC1 = V  
.
SS  
TPG  
MC68HC05F32  
ELECTRICAL SPECIFICATIONS  
MOTOROLA  
16-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 16-4 DC electrical characteristics (V = 2.7 V)  
DD  
(V = 2.7V min, V = 0 V , T = –40°C to +85°C, unless otherwise stated)  
DD  
DC  
SS  
DC  
A
(1)  
Characteristic  
Symbol  
Min.  
Typ.  
Max.  
Unit  
Output voltage  
= –10 µA  
I
V
V
– 0.1  
0.1  
V
V
LOAD  
OH  
DD  
I
= +10 µA  
V
LOAD  
OL  
Output high voltage (I  
= –0.8 mA)  
LOAD  
V
V
– 0.3  
V
V
V
V
OH  
DD  
Ports (PA0–7, PB0–7, PC0–7, PH0–7, PI7–0)  
Output low voltage (I = +1.6 mA)  
LOAD  
Ports(PA0–7, PB0–7, PC4–7, PD4–7, PE4–7,  
PH0–7, PI0–7, PJ0–7)  
V
0.3  
OL  
Input high voltage  
Ports (PD0–7, PE0–7)  
Input high voltage  
V
0.7V  
15.0  
IH  
DD  
Ports (PA0–7, PB0–7, PC0–7, PF0–7, PG0–7)  
IRQ, RESET,OSC1, OSC3  
V
0.7V  
V
DD  
IH  
DD  
Input low voltage  
Ports (PA0–7, PB0–7, PC0–7, PF0–7, PG0–7)  
V
0.2V  
V
IL  
DD  
IRQ, RESET, OSC1, OSC3  
(2)  
Supply Current  
I
DD  
RUN  
WAIT  
STOP  
1.8  
0.2  
3.0  
1.0  
40  
mA  
mA  
µA  
I/O ports hi-Z leakage current  
I
10  
1
µA  
µA  
OZ  
Ports (PA0–7, PB0–7, PC0–7, PD0–7, PE0–7)  
Input current  
I
IN  
RESET, IRQ, OSC1  
Capacitance  
Ports (as input or output)  
RESET, IRQ  
C
C
12  
8
pF  
pF  
OUT  
IN  
Input current low  
I
– 5  
– 15  
20  
40  
µA  
kΩ  
IL  
Ports (PA0–7, PB0–7, PC0–7), RESET  
LCD step down resistor  
R
LCDSD  
(1) Typical values are at midpoint of voltage range and at 25°C only.  
(2) All I measurements taken with suitable decoupling capacitors across the power supply to suppress the  
DD  
transient switching currents inherent in CMOS designs. RUN and WAIT I : measured using an external  
DD  
square-wave clock source (f  
= 3.58 MHz); all inputs0.2V from rail; no DC loads; maximum load on outputs  
OSC  
50pF (20pF on OSC2). WAIT I : only the timer system active; current varies linearly with the OSC2  
DD  
capacitance. STOP and WAIT I : all ports congured as inputs, V = 0.2 V, V = V 0.2 V. STOP I :  
DD  
IL  
IH  
DD  
DD  
measured with OSC1 = V  
.
SS  
16  
TPG  
MOTOROLA  
16-4  
ELECTRICAL SPECIFICATIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
16.4  
Control timing  
Table 16-5 Control timing (V = 5V)  
DD  
(V = 5.0 V ± 10%, V = 0 V , T = T to T )  
DD  
DC  
SS  
DC  
A
L
H
Characteristic  
Symbol  
Min.  
Max.  
Unit  
Frequency of operation:  
Crystal  
f
DC  
3.579  
3.579  
MHz  
OSC  
External clock  
Internal operating frequency:  
Crystal  
f
DC  
1.789  
1.789  
MHz  
OP  
External clock  
Processor cycle time  
t
550.0  
20.0  
20.0  
ns  
ms  
ms  
CYC  
Stop recovery start-up time  
Crystal oscillator start-up time  
RESET pulse width  
t
ILCH  
t
OXOV  
t
1.5  
t
RL  
CYC  
Interrupt pulse width low (edge-triggered)  
Interrupt pulse period  
t
250.0  
(1)  
ns  
ILIH  
t
t
ILIL  
CYC  
OSC1 pulse width  
t
, t  
100.0  
ns  
OH OL  
RC oscillator stabilization time  
A/D on current stabilization time  
EEPROM byte programming time  
EEPROM byte erase time  
t
5.0  
µs  
µs  
RCON  
t
100.0  
15.0  
15.0  
100.0  
300.0  
10.0  
ADON  
t
t
ms  
ms  
ms  
ms  
µs  
V
EPGM  
EBYTE  
EEPROM block erase time  
t
EBLOCK  
EEPROM bulk erase time  
t
EBULK  
EEPROM programming voltage fall time  
EEPROM minimum programming voltage  
t
FPV  
V
2.7  
CCMIN  
(1) The minimum period T should not be less than the number of cycle times it takes to execute  
ILIL  
the interrupt service routine plus 21 t  
.
CYC  
16  
TPG  
MC68HC05F32  
ELECTRICAL SPECIFICATIONS  
MOTOROLA  
16-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 16-6 Control timing (V = 2.7V)  
DD  
(V = 2.7 V min, V = 0 V , T = T to T )  
DD  
DC  
SS  
DC  
A
L
H
Characteristic  
Symbol  
Min.  
Max.  
Unit  
Frequency of operation:  
Crystal  
f
DC  
3.579  
3.579  
MHz  
OSC  
External clock  
Internal operating frequency:  
Crystal  
f
DC  
1.789  
1.789  
MHz  
OP  
External clock  
Processor cycle time  
t
550.0  
20.0  
20.0  
ns  
ms  
ms  
CYC  
Stop recovery start-up time  
Crystal oscillator start-up time  
RESET pulse width  
t
ILCH  
t
OXOV  
t
1.5  
t
RL  
CYC  
Interrupt pulse width low (edge-triggered)  
Interrupt pulse period  
t
250.0  
(1)  
ns  
ILIH  
t
t
ILIL  
CYC  
OSC1 pulse width  
t
, t  
100.0  
ns  
OH OL  
RC oscillator stabilization time  
A/D on current stabilization time  
EEPROM byte programming time  
EEPROM byte erase time  
t
10.0  
200.0  
15.0  
15.0  
100.0  
300.0  
10.0  
µs  
µs  
RCON  
t
ADON  
t
t
ms  
ms  
ms  
ms  
µs  
V
EPGM  
EBYTE  
EEPROM block erase time  
t
EBLOCK  
EEPROM bulk erase time  
t
EBULK  
EEPROM programming voltage fall time  
EEPROM minimum programming voltage  
t
FPV  
V
2.7  
CCMIN  
(1) The minimum period T should not be less than the number of cycle times it takes to execute  
ILIL  
the interrupt service routine plus 21 t  
.
CYC  
16  
TPG  
MOTOROLA  
16-6  
ELECTRICAL SPECIFICATIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
16.5  
DC levels for low voltage RESET and LVI  
Table 16-7 DC levels for low voltage reset and LVI  
(TA = 40°C to +85°C, unless otherwise stated)  
Characteristic  
Power-on reset voltage  
Power-off reset voltage  
Low voltage interrupt  
Symbol  
Min.  
2.55  
2.45  
2.75  
Typ.  
2.8  
Max.  
3.05  
2.95  
3.25  
Unit  
V
V
RON  
V
2.7  
V
ROFF  
V
3.0  
V
LVI  
16.6  
Electrical specifications for DTMF/melody generator  
Table 16-8 Sine wave tones at TNO  
Characteristic  
Operating voltage  
Min.  
Typ.  
Max.  
Unit  
2.7  
5.5  
V
Tone output level:  
Low group – row  
High group – column  
V
rms  
0.120  
0.160  
0.160  
0.205  
0.210  
0.280  
V
rms  
Frequency deviation (DTMF)  
Frequency deviation (Melody)  
Tone output DC level  
– 0.65  
– 1.5  
0.45  
1
+ 0.65  
+ 1.5  
0.55  
3
%
%
Vdd  
dB  
0.50  
2.15  
–25  
High group pre-emphasis  
Total harmonic distortion  
dB  
Table 16-9 Square wave tones at TNO  
Characteristic  
Operating voltage  
Min.  
Typ.  
Max.  
Unit  
2.7  
5.5  
V
Tone output level:  
Low group – row  
High group – column  
V
p-p  
0.270  
0.360  
V
p-p  
Frequency deviation (Melody)  
– 1.5  
0.45  
+ 1.5  
0.55  
%
Tone output DC level (+ 1/2 V value)  
0.50  
Vdd  
p-p  
16  
TPG  
MC68HC05F32  
ELECTRICAL SPECIFICATIONS  
MOTOROLA  
16-7  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table 16-10 TONEX at TNX output  
Characteristic  
Operating voltage  
Min.  
Typ.  
Max.  
Unit  
2.7  
5.5  
V
Tone output level (square wave)  
Frequency deviation  
V
V
p-p  
DD  
– 1.5  
+ 1.5  
%
16.7  
EEPROM additional information  
Table 16-11 EEPROM additional information  
Read/write  
Temperature  
Remarks  
cycles  
10 000  
35 000  
100 000  
0 °C – 85 °C  
50 °C  
The value is regularly tested and monitored  
This value is predicted from the tested ones  
This value is predicted from the tested ones  
25 °C  
16.8  
PWM timing  
Table 16-12 PWM timing  
Characteristic  
Symbol  
Min.  
15.0  
15.0  
Max.  
35.0  
35.0  
Unit  
ns  
PWM rise time  
PWM fall time  
t
PWMR  
t
ns  
PWMF  
16  
MOTOROLA  
16-8  
ELECTRICAL SPECIFICATIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
16.9  
A/D converter characteristics  
Table 16-13 A/D converter characteristics  
(V = 5.0 V ± 10%, V = 0 V , T = –40°C to +85°C, unless otherwise stated)  
DD  
DC  
SS  
DC A  
Characteristic  
Parameter  
Min.  
Max.  
Unit  
Resolution  
Number of bits resolved by the A/D  
8
bit  
Maximum deviation from the best straight  
line through A/D transfer characteristics  
Non-linearity  
±1/2  
±1/2  
±1  
LSB  
LSB  
LSB  
(AV =V = V , AV = V )  
SS  
SS  
RH  
DD  
SS  
Quantization error  
Absolute accuracy  
Conversion range  
Uncertainty due to converter resolution  
Difference between the actual input  
voltage and the full scale equivalent of  
the binary output code for all errors  
Analog input voltage range  
Maximum analog reference voltage  
Analog supply voltage  
AV  
§
V
V
V
V
SS  
RH  
V
AV  
V
+ 0.1  
RH  
SS  
DD  
AV  
V
– 0.1  
SS  
SS  
Total time to perform a single analog to  
digital conversion  
Conversion time  
a. External clock  
32  
32  
t
CYC  
µs  
b. internal RC oscillator  
Conversion result never decreases with  
an increase in input voltage and has no  
missing codes  
Monotinicity  
GUARANTEED  
FF  
Zero input reading  
Full scale reading  
Conversion result when V = AV  
00  
Hex  
Hex  
IN  
SS  
Conversion result when V = V  
IN  
Analog input acquisition sampling  
a. External clock  
RH  
(1)  
Sample acquisition time  
12  
12  
t
CYC  
µs  
b. Internal RC oscillator  
Sample/hold capacitance  
Input leakage  
Input capacitance on AN0AN7  
Input leakage on AN0AN7  
12  
pF  
10  
1
µA  
µA  
Input leakage on V  
RH  
AV  
Analog supply voltage  
1.125V  
V
DD  
RH  
(1) Source impedances greater than 10 kwill adversely affect internal RC charging time during input  
sampling.  
(2) The external system error caused by input leakage current is approximately equal to the product of R  
source and input current.  
(3) A/D accuracy may decrease as V is reduced below 4V.  
RH  
16  
MC68HC05F32  
ELECTRICAL SPECIFICATIONS  
MOTOROLA  
16-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
16  
MOTOROLA  
16-10  
ELECTRICAL SPECIFICATIONS  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
17  
MECHANICAL DATA  
17.1  
100-pin QFP pinout for the MC68HC05F32  
AVDD  
PD0/AN0  
PD1/AN1  
PD2/AN2  
PD3/AN3  
PD4/AN4  
PD5/AN5  
PD6/AN6  
PD7/AN7  
1
2
3
4
5
6
7
8
75  
74  
73  
72  
71  
70  
69  
68  
67  
66  
65  
64  
63  
62  
61  
60  
59  
58  
57  
56  
55  
54  
53  
52  
51  
PH1/FP33  
PH0/FP32  
PG7/FP31  
PG6/FP30  
PG5/FP29  
PG4/FP28  
PG3/FP27  
PG2/FP26  
PG1/FP25  
PG0/FP24  
PH5/FP37  
PH4/FP36  
PH3/FP35  
PH2/FP34  
PF7/FP23  
PF6/FP22  
PF5/FP21  
PF4/FP20  
PF3/FP19  
PF2/FP18  
PF1/FP17  
PF0/FP16  
PI7/FP15  
PI6/FP14  
PI5/FP13  
9
AVSS  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
PE0/TCAP1  
PE1/TCMP1  
PE2/TCAP2  
PE3/TCMP2  
PE4/REFRESH  
PE5/PWM1  
PE6/PWM2  
PE7/PWM3  
PC0/TCAP3  
PC1/TCAP4  
PC2/RDI  
PC3/TDO  
PC4/MISO  
VDD  
VSS  
17  
Figure 17-1 100-pin QFP pinout for the MC68HC05F32  
TPG  
MC68HC05F32  
MECHANICAL DATA  
MOTOROLA  
17-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
17.2  
100-pin QFP mechanical dimensions  
NOTES:  
1. DIMENSIONING AND TOLERANCING PER ANSI  
Y14.5M, 1982.  
2. CONTROLLING DIMENSION: MILLIMETER.  
3. DATUM -H- IS LOCATED AT BOTTOM OF LEAD  
AND IS COINCIDENT WITH THE LEAD WHERE THE  
LEAD EXITS THE PLASTIC BODY AT THE BOTTOM  
OF THE PARTING LINE.  
0.20 (0.008) H L-M  
N
4X  
0.20 (0.008) T L-M  
N
4X 25 TIPS  
76  
100  
4. DATUMS -L-, -M- AND -N- TO BE DETERMINED  
AT DATUM -H-.  
1
75  
5. DIMENSIONS S AND V TO BE DETERMINED AT  
SEATING PLANE -T-.  
6. DIMENSIONS A AND B DO NOT INCLUDE MOLD  
PROTRUSION. ALLOWABLE PROTRUSION IS  
0.250 (0.100) PER SIDE. DIMENSIONS A AND B DO  
INCLUDE MOLD MISMATCH AND ARE  
DETERMINED AT DATUM -H-.  
7. DIMENSION D DOES NOT INCLUDE DAMBAR  
PROTRUSION. DAMBAR PROTRUSION SHALL  
NOT CAUSE THE LEAD WIDTH TO EXCEED 0.350  
(0.014). MINIMUM SPACE BETWEEN PROTRUSION  
AND ADJACENT LEAD OR PROTRUSION 0.070  
(0.003).  
–L–  
–M–  
B
V
3X VIEW Y  
B1  
V1  
MILLIMETERS  
DIM MIN MAX  
14.00 BSC  
INCHES  
MIN MAX  
A
A1  
B
0.551 BSC  
0.276 BSC  
0.551 BSC  
0.276 BSC  
7.00 BSC  
14.00 BSC  
7.00 BSC  
25  
51  
B1  
C
1.60  
0.063  
C1  
C2  
D
0.05  
1.35  
0.17  
0.45  
0.17  
0.15  
1.45  
0.27  
0.75  
0.23  
0.002  
0.053  
0.007  
0.018  
0.007  
0.006  
0.057  
0.011  
0.030  
0.009  
26  
50  
–N–  
A1  
S1  
E
F
G
0.50 BSC  
0.20 BSC  
A
J
0.09  
0.20  
0.004  
0.008  
K
0.50 REF  
0.020 REF  
S
R1  
S
0.10  
0.20  
0.004  
0.008  
16.00 BSC  
8.00 BSC  
0.09 0.16  
0.630 BSC  
0.315 BSC  
0.004 0.006  
S1  
U
V
16.00 BSC  
8.00 BSC  
0.20 REF  
1.00 REF  
0.630 BSC  
0.315 BSC  
0.008 REF  
0.039 REF  
2X 02  
V1  
W
Z
C
0.08 (0.003)  
T
–H–  
θ
0
7
0
7
_
_
_
_
_
_
0
0
θ1  
θ2  
θ3  
_
_
12  
12  
_
_
5
13  
5
13  
_
_
–T–  
SEATING  
PLANE  
2X 03  
VIEW AA  
S
0.05 (0.002)  
BASE METAL  
W
F
2XR R1  
0.25 (0.010)  
G
Θ1  
J
U
C2  
D
C
L
PLATING  
GAGE PLANE  
–X–  
X=L, M, N  
M
S
S
N
0.08 (0.003)  
T
L-M  
AB  
AB  
K
E
C1  
Θ
SECTION AB–AB  
ROTATED 90°CLOCKWISE  
Z
VIEW Y  
VIEW AA  
CASE983-01  
17  
Figure 17-2 100-pin QFP mechanical dimensions  
TPG  
MOTOROLA  
17-2  
MECHANICAL DATA  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
17.3  
80-pin QFP pinout for the MC68HC05F32  
60  
PB0  
PA7  
PD0  
PD1  
PD2  
PD3  
PD4  
PD5  
PD6  
PD7  
1
2
3
4
5
6
7
8
59  
58  
57  
56  
55  
54  
53  
52  
51  
50  
49  
48  
47  
46  
45  
44  
43  
42  
41  
PG7/FP31  
PG6/FP30  
PG5/FP29  
PG4/FP28  
PG3/FP27  
PG2/FP26  
PG1/FP25  
PG0/FP24  
PF7/FP23  
PF6/FP22  
PF5/FP21  
PF4/FP20  
PF3/FP19  
PF2/FP18  
PF1/FP17  
PF0/FP16  
PI7/FP15  
PI6/FP14  
PI5/FP13  
9
PE0/TCAP1  
PE1/TCMP1  
PE2/TCAP2  
PE3/TCMP2  
PE4  
PE5/PWM1  
PE6/PWM2  
PE7/PWM3  
PC0/TCAP3  
PC4  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
VDD  
Figure 17-3 80-pin QFP pinout for the MC68HC05F32  
Note:  
The 80-pin version is only a bond option. Pins PE4, PD7–PD0, PC4, PC5 are shared  
with module functions which cannot work on the 80-pin package. These modules and  
their corresponding pin functions should not be enabled.  
17  
TPG  
MC68HC05F32  
MECHANICAL DATA  
MOTOROLA  
17-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
17.4  
80-pin QFP mechanical dimensions  
L
Case No. 841B - 01  
80 QFP  
B
B
60  
41  
P
61  
40  
- A, B, D -  
- A -  
L
- B -  
Detail A”  
B
V
F
Detail A”  
21  
N
80  
J
1
20  
- D -  
Base  
D
metal  
A
Section B–B  
0.20  
C A – B  
D
M
S
S
S
S
0.20  
C A – B  
D
S S  
M
0.05 A – B  
S
U
T
0.20  
H A – B  
D
M
Detail C”  
Datum  
R
M
Q
E
C
K
X
-H-  
plane  
W
-C-  
G
H
M
Seating  
plane  
Detail C”  
Dim.  
Min.  
13.90  
13.90  
2.15  
0.22  
2.00  
0.22  
Max.  
14.10  
14.10  
2.45  
Notes  
Dim.  
M
N
Min.  
5°  
Max.  
10°  
A
B
C
D
E
F
1. Datum plane –H– is located at bottom of lead and is coincident with  
the lead where the lead exits the plastic body at the bottom of the  
parting line.  
0.130  
0 °  
0.170  
7°  
Q
2. Datums AB and –D to be determined at datum plane –H–.  
3. Dimensions S and V to be determined at seating plane –C–.  
4. Dimensions A and B do not include mould protrusion. Allowable  
mould protrusion is 0.25mm per side. Dimensions A and B do  
include mould mismatch and are determined at datum plane –H–.  
5. Dimension D does not include dambar protrusion. Allowable  
dambar protrusion shall be 0.08 total in excess of the D dimension  
at maximum material condition. Dambar cannot be located on the  
lower radius or the foot.  
0.38  
R
0.13  
16.95  
0.13  
0 °  
0.30  
17.45  
2.40  
S
0.33  
T
G
H
J
0.65 BSC  
U
0.250  
0.230  
0.95  
V
16.95  
0.35  
17.45  
0.45  
0.130  
0.65  
W
X
K
L
1.6 REF  
6. Dimensions and tolerancing per ANSI Y 14.5M, 1982.  
7. All dimensions in mm.  
12.35 REF  
17  
Figure 17-4 80-pin QFP mechanical dimensions  
TPG  
MOTOROLA  
17-4  
MECHANICAL DATA  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
18  
ORDERING INFORMATION  
This section describes the information needed to order the MC68HC05F32.  
To initiate a ROM pattern for the MCU, it is necessary to first contact your local field service office,  
local sales person or Motorola representative. Please note that you will need to supply details such  
as: mask option selections; temperature range; oscillator frequency; package type; electrical test  
requirements; and device marking details so that an order can be processed, and a customer  
specific part number allocated. Refer to Table 18-1 for appropriate part numbers.  
Table 18-1 MC order numbers  
Device title  
Package type  
100-pin QFP  
80-pin QFP  
100-pin QFP  
80-pin QFP  
100-pin QFP  
80-pin QFP  
100-pin QFP  
80-pin QFP  
Temperature  
Part number  
MC68HC05F32PU  
MC68HC05F32FU  
MC68HC705F32PU  
MC68HC705F32FU  
MC68HC05F32CPU  
MC68HC05F32CFU  
MC68HC705F32CPU  
MC68HC705F32CFU  
MC68HC05F32  
0 to 70 °C  
MC68HC705F32  
MC68HC05F32  
MC68HC705F32  
0 to 70 °C  
–40 to 85 °C  
–40 to 85 °C  
18  
TPG  
MC68HC05F32  
ORDERING INFORMATION  
MOTOROLA  
18-1  
For More Information On This Product,  
Go to: www.freescale.com  
 
Freescale Semiconductor, Inc.  
18.1  
EPROMs  
For the MC68HC05F32, a 64K byte EPROM programmed with the customer’s software (positive  
logic for address and data) should be submitted for pattern generation. All unused bytes should  
be programmed to $00.  
The EPROM should be clearly labelled, placed in a conductive IC carrier and securely packed.  
18.2  
Verification media  
All original pattern media (EPROMs) are filed for contractual purposes and are not returned. A  
computer listing of the ROM code will be generated and returned with a listing verification form.  
The listing should be thoroughly checked and the verification form completed, signed and returned  
to Motorola. The signed verification form constitutes the contractual agreement for creation of the  
custom mask. If desired, Motorola will program blank EPROMs (supplied by the customer) from  
the data file used to create the custom mask, to aid in the verification process.  
18.3  
ROM verification units(RVU)  
Ten MCUs containing the customer’s ROM pattern will be provided for program verification.These  
units will have been made using the custom mask but are for ROM verification only. For  
expediency, they are usually unmarked and are tested only at room temperature (25°C) and at  
5 Volts. These RVUs are included in the mask charge and are not production parts. They are  
neither backed nor guaranteed by Motorola Quality Assurance.  
18  
TPG  
MOTOROLA  
18-2  
ORDERING INFORMATION  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
A
MC68HC705F32  
The MC68HC705F32 is a device very similar to the MC68HC05F32 but has 32256 bytes of user  
EPROM with 496 bytes of bootloader ROM. It does have the same amount of RAM, LCD RAM,  
EEPROM, I/O, and user vectors. It also has the same on-board peripherals as the  
MC68HC05F32.  
There is also an 80-pin version of the MC68HC705F32, this has a reduced I/O count and reduced  
functionality. It has no 32 kHz clock system, SPI, SCI or A/D converter. The timer has three input  
captures (no TCAP4) and the LCD driver only has 32 frontplanes.  
Note:  
The 80-pin version is only a bond option. Pins PE4, PD7–PD0, PC4, PC5 are shared  
with module functions which cannot work on the 80-pin package. These modules and  
their corresponding pin functions should not be enabled.  
A.1  
Features  
32256 bytes of user EPROM plus 16 bytes of user vectors  
496 bytes of bootloader ROM  
TPG  
A
MC68HC05F32  
MC68HC705F32  
MOTOROLA  
A-1  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
PA7  
PA6  
PA5  
PA4  
PA3  
PA2  
PA1  
PA0  
PWM3  
PWM2  
PWM1  
PE7  
PE6  
PE5  
PE4  
PE3  
PE2  
PE1  
PE0  
PWM  
Timer  
32256 bytes user EPROM  
496 bytes bootloader ROM  
16 bytes for vectors  
OC2  
IC2  
OC1  
IC1  
PB7  
PB6  
PB5  
PB4  
PB3  
PB2  
PB1  
PB0  
IC3  
IC4  
TDO  
RDI  
MISO  
MOSI  
SCK  
SS  
PC0  
PC1  
PC2  
PC3  
PC4  
PC5  
PC6  
PC7  
256 bytes user EEPROM  
SCI3  
SPI3  
920 bytes RAM  
20 bytes LCD RAM  
AVDD  
VRH  
VRL/AVSS  
PD7  
PD6  
PD5  
PD4  
PD3  
PD2  
PD1  
OSC1  
OSC2  
Oscillator and divider  
32 kHz independent clock  
AD7  
AD6  
AD5  
AD4  
AD3  
AD2  
AD1  
AD0  
OSC3  
OSC4  
8-channel  
A/D  
REFRESH  
3
system, oscillator and divider  
converter3  
2
2
Core timer  
VDD  
VSS  
Periodic interrupt  
COP watchdog  
PD0  
IRQ/VPP  
RESET  
TNO  
TNX  
M68HC05 CPU  
DTMF/ melody generator  
VLCD  
BP3  
BP2  
BP1  
BP0  
LCD driver4  
1
Port H1, 2  
Port G1  
Port F1  
Port I  
Port J1  
1. When not being used to output the LCD frontplanes, port G and port F are input only, while port H, port I and port J are output only.  
2. In the 80-pin package there is no port H and only pins PC0, PC4 and PC5 are available on port C.  
3. These modules are not available in the 80-pin package.  
4. In the 80-pin package there are only 32 frontplanes.  
Figure A-1 MC68HC705F32 block diagram  
TPG  
A
MOTOROLA  
A-2  
MC68HC705F32  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
A.2  
Pin descriptions  
IRQ/VPP  
A.2.1  
As for the MC68HC05F32, this is an input-only pin for external interrupt sources. It also serves as  
the EPROM programming voltage input pin (VPP) on the MC68HC705F32.  
A.3  
Memory and registers  
The MC68HC705F32 has a 64K byte memory map consisting of registers (for I/O, control and  
status), user RAM, user ROM, EEPROM, bootloader ROM and reset and interrupt vectors as  
shown in Figure A-2.  
A.3.1  
Registers  
All the I/O, control and status registers of the MC68HC705F32 are contained within the first 80  
byte block of the memory map, as detailed in Table A-1.  
TPG  
A
MC68HC05F32  
MC68HC705F32  
MOTOROLA  
A-3  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
MC68HC705F32  
$0000  
$0050  
$28 Counter 1 high (CNTH/1)  
$00 Port A data (PORTA)  
$01 Port B data (PORTB)  
$02 Port C data (PORTC)  
$03 Port D data (PORTD)  
$04 Port A DDR (DDRA)  
$05 Port B DDR (DDRB)  
$06 Port C DDR (DDRC)  
$07 Port D DDR (DDRD)  
I/O  
(80 bytes)  
$29 Counter 1 low (CNTL/1)  
$2A Alt. counter high 1 (ACNTH/1)  
$2B Alt. counter low 1 (ACNTL/1)  
$2C Timer 1 control 1 (TCR1/1)  
$2D Timer 1 control 2 (TCR2/1)  
$2E Timer 1 status (TSR/1)  
Unused  
$0054  
$0068  
LCD RAM (20 bytes)  
RAM  
$08 Ctimer control/status (CTCSR) $30 Capture 3 high (ICR3H)  
(920 bytes)  
Stack  
$09 Ctimer counter (CTCR)  
$0A Port E data (PORTE)  
$0B Port E DDR (DDRE)  
$0C Port E control (PECR)  
$0D Row freq. control (FCR)  
$0E Column freq. control (FCC)  
$0F Tone control (TNCR)  
$10 Port F data (PORTF)  
$11 Port F control (PFCR)  
$12 Port G data (PORTG)  
$13 Port G control (PGCR)  
$14 Port H data (PORTH)(1)  
$15 Port H control (PHCR)(1)  
$16 Port I data (PORTI)  
$17 Port I control (PICR)  
$18 Port J data (PORTJ)  
$19 Port J control (PJCR)  
$1A Port D control (PDCR)  
$1B Key control (KCR)  
$1C EEPROM prog. (EEPROG)  
$1D EPROM prog. (PROG)  
$1E LCD control (LCD)  
$31 Capture 3 low (ICR3L)  
$0400  
$32 Compare 3 high (OCR3H)  
$33 Compare 3 low (OCR3L)  
$34 Capture 4 high (ICR4H)  
$35 Capture 4 low (ICR4L)  
$36 Compare 4 high (OCR4H)  
$37 Compare 4 low (OCR4L)  
$38 Counter 2 high (CNTH/2)  
$39 Counter 2 low (CNTL/2)  
$3A Alt. counter high 2 (ACNTH/2)  
$3B Alt. counter low 2 (ACNTL/2)  
EEPROM  
(256 bytes)  
$0500  
$8000  
Unused  
(1)  
$3C Timer 2 control 1 (TCR1/2)  
$3D Timer 2 control 2 (TCR2/2)  
$3E Timer 2 status (TSR/2)(1)  
(1)  
User EPROM  
(32256 bytes)  
$40 PWM control (PWMCR)  
$41 PWM data 1 (PWMD1)  
$42 PWM data 2 (PWMD2)  
$43 PWM data 3 (PWMD3)  
$44 SPI control (SPCR)(1)  
$45 SPI status (SPSR)(1)  
$FF00  
$46 SPI data I/O (SPDAT)(1)  
$47 SCI data (SCDAT)(1)  
$20 Capture 1 high (ICR1H)  
$21 Capture 1 low (ICR1L)  
$22 Compare 1 high (OCR1H)  
$23 Compare 1 low (OCR1L)  
$24 Capture 2 high (ICR2H)  
$25 Capture 2 low (ICR2L)  
$26 Compare 2 high (OCR2H)  
$27 Compare 2 low (OCR2L)  
$48 SCI control 1 (SCCR1)(1)  
$49 SCI control 2 (SCCR2)(1)  
$4A SCI status (SCSR)(1)  
$4B SCI baud rate (BAUD)(1)  
$4C CPI control/status (CPICSR)  
$4D System options (SOR)  
$4E A/D data (ADDATA) (1)  
$4F A/D status/control (ADSCR)(1)  
Bootloader ROM  
(496 bytes)  
$FFF0  
$FFFF  
User vectors  
(16 bytes)  
(1) Not applicable to 80-pin package.  
Figure A-2 Memory map of the MC68HC705F32  
TPG  
A
MOTOROLA  
A-4  
MC68HC705F32  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table A-1 Register outline  
State  
on reset  
Register Name  
Address bit 7 bit 6 bit 5 bit 4 bit 3  
bit 2  
PA2  
bit 1  
PA1  
bit 0  
Port A data (PORTA)  
Key interrupt status (KISR)  
Port B data (PORTB)  
$0000 PA7  
$0000  
PA6  
PA5  
PA4  
PA3  
PA0 undened  
0000 0000  
$0001 PB7 PB6 PB5 PB4 PB3  
PB2  
PB1  
PC1  
PD1  
PB0 undened  
PC0 undened  
PD0 undened  
Port C data (PORTC)  
$0002 PC7 PC6 PC5 PC4 PC3 PC2  
Port D data (PORTD)  
$0003 PD7 PD6 PD5 PD4 PD3 PD2  
Port A data direction (DDRA)  
Port B data direction (DDRB)  
Port C data direction (DDRC)  
Port D data direction ((DDRD)  
$0004  
$0005  
$0006  
$0007  
0000 0000  
0000 0000  
0000 0000  
0000 0000  
Core timer control/status (CTCSR) $0008 TOF RTIF TOFE RTIE RTOF RRTIF RT1  
RT0 0000 0011  
0000 0000  
Core timer counter (CTCR)  
Port E data (PORTE)  
$0009  
$000A PE7 PE6 PE5 PE4 PE3  
PE2  
0
PE1  
PE0 undened  
0000 0000  
Port E data direction (DDRE)  
Port E control (PECR)  
$000B  
$000C  
0
0000 0000  
DTMF row freq. control (FCR)  
$000D  
0
0
0
0
0
0
FCR4 FCR3 FCR2 FCR1 FCR0 undefined  
FCC4 FCC3 FCC2 FCC1 FCC0 undefined  
DTMF column freq. control (FCC) $000E  
DTMF tone control (TNCR)  
Port F data (PORTF)  
Port F control (PFCR)  
Port G data (PORTG)  
Port G control (PGCR)  
Port H data (PORTH)  
Port H control (PHCR)  
Port I data (PORTI)  
$000F MS1 MS0 TGER TGEC TNOE  
0
0
0
0000 0000  
$0010 PF7  
$0011  
PF6  
PF5  
PF4  
PF3  
PF2  
PF1  
PF0 undened  
0000 0000  
$0012 PG7 PG6 PG5 PG4 PG3 PG2 PG1 PG0 undened  
$0013  
0000 0000  
$0014 PH7 PH6 PH5 PH4 PH3 PH2  
$0015  
PH1  
PH0 0000 0000  
0000 0000  
$0016  
$0017  
PI7  
PI6  
PI5  
PI4  
PI3  
PI2  
PI1  
PI0 0000 0000  
0000 0000  
Port I control (PICR)  
Port J data (PORTJ)  
Port J control (PJCR)  
Port D control (PDCR)  
Key control (KCR)  
$0018 PJ7  
$0019  
PJ6  
PJ5  
PJ4  
PJ3  
PJ2  
PJ1  
PJ0 0000 0000  
0000 0000  
$001A  
0000 0000  
$001B  
$001C  
$001D  
$001E  
KF  
KIE EDG5 EDG4 EDG3 EDG2 EDG1 EDG0 0000 0000  
EEPROM prog. (EEPROG)  
EPROM prog. (PROG)  
LCD control (LCD)  
0
CPEN  
0
0
ER1 ER0 LATCH EERC EEPGM 0000 0000  
TS1 TS0 ELATCH EPGM 0000 0000  
0
0
0
WTLCDO  
EXTVON  
0000 0000  
FSEL1 FSEL0 I NTVLCD FDISP MUX4 MUX3  
Capture 1 high (ICR1H)  
Capture 1 low (ICR1L)  
$0020 (bit 15)  
$0021  
(bit 8) undened  
undened  
TPG  
A
MC68HC05F32  
MC68HC705F32  
MOTOROLA  
A-5  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table A-1 Register outline  
State  
on reset  
Register Name  
Address bit 7 bit 6 bit 5 bit 4 bit 3  
bit 2  
bit 1  
bit 0  
Compare 1 high (OCR1H)  
Compare 1 low (OCR1L)  
Capture 2 high (ICR2H)  
Capture 2 low (ICR2L)  
Compare 2 high (OCR2H)  
Compare 2 low (OCR2L)  
Counter 1 high (CNTH/1)  
Counter 1 low (CNTL/1)  
$0022 (bit 15)  
$0023  
(bit 8) undened  
undened  
$0024 (bit 15)  
$0025  
(bit 8) undened  
undened  
$0026 (bit 15)  
$0027  
(bit 8) undend  
undened  
$0028 (bit 15)  
$0029  
(bit 8) 1111 1111  
1111 1100  
Alternate counter 1 high (ACNTH/1) $002A (bit 15)  
Alternate counter 1 low (ACNTL/1) $002B  
(bit 8) 1111 1111  
1111 1100  
Timer1 control 1 (TCR1/1)  
Timer1 control 2 (TCR2/1)  
Timer1 status (TSR/1)  
$002C ICI1E ICI2E OCI1E TOIE CO1E IEDG1 IEDG2 OLVL1 0000 0uu0  
$002D OCI2E CO2E OLVL2 0000 0000  
uuuu uuu0  
0
0
0
0
0
$002E IC1F IC2F OC1F TOF TCAP1 TCAP2 OC2F  
0
Capture 3 high (ICR3H)  
Capture 3 low (ICR3L)  
Compare 3 high (OCR3H)  
Compare 3 low (OCR3L)  
Capture 4 high (ICR4H)  
Capture 4 low (ICR4L)  
Compare 4 high (OCR4H)  
Compare 4 low (OCR4L)  
Counter 1 high (CNTH/1)  
Counter 1 low (CNTL/1)  
$0030 (bit 15)  
$0031  
(bit 8) undened  
undened  
$0032 (bit 15)  
$0033  
(bit 8) undened  
undened  
$0034 (bit 15)  
$0035  
undened  
undened  
$0036 (bit 15)  
$0037  
undened  
undened  
$0038 (bit 15)  
$0039  
(bit 8) 1111 1111  
1111 1100  
Alternate counter 2 high (ACNTH/1) $003A (bit 15)  
Alternate counter 2 low (ACNTL/1) $003B  
(bit 8) 1111 1111  
1111 1100  
Timer2 control 1 (TCR1/2)  
Timer2 control 2 (TCR2/2)  
Timer2 status (TSR/2)  
$003C ICI3E ICI4E OCI3E TOIE CO3E IEDG3 IEDG4  
$003D OCI4E CO4E  
$003E IC3F IC4F OC3F TOF TCAP3 TCAP4 OC4F  
0000 0uu0  
0
0
0
0
0
0000 0000  
0
uuuu uuu0  
PWM control (PWMCR)  
PWM data 1 (PWMD1)  
PWM data 2 (PWMD2)  
PWM data 3 (PWMD3)  
SPI control (SPCR)  
$0040  
$0041  
$0042  
$0043  
POL3 POL2 POL1 RA1  
RA0 0001 1100  
1000 0000  
1000 0000  
1000 0000  
$0044 SPIE SPE DOD MSTR CPOL CPHA SPR1 SPR0 0000 01uu  
TPG  
A
MOTOROLA  
A-6  
MC68HC705F32  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Table A-1 Register outline  
State  
on reset  
Register Name  
Address bit 7 bit 6 bit 5 bit 4 bit 3  
bit 2  
bit 1  
bit 0  
SPI status (SPSR)  
SPI data I/O (SPDAT)  
SCI data (SCDAT)  
$0045 SPIF WCOL  
0
MODF  
0
0
0
0
0000 0000  
undened  
undened  
uu00 0000  
$0046  
$0047  
SCI control 1 (SCCR1)  
SCI control 2 (SCCR2)  
SCI status (SCSR)  
$0048  
$0049  
R8  
T8  
0
M
WAKE  
TE  
0
0
0
TIE TCIE RIE  
ILIE  
RE  
RWU SBK 0000 0000  
FE 1100 0000  
$004A TDRE TC RDRF IDLE  
OR  
NF  
0
SCI baud rate (BAUD)  
CPI control status (CPICSR)  
System options (SOR)  
A/D data (ADDATA)  
$004B TCLR  
$004C  
0
SCP1 SCP0 RCKB SCR2 SCR1 SCR0 0000 0uuu  
CPIE RFQ1 RFQ0 0000 0000  
0
CPIF  
0
0
0
$004D LVIF LVIE LVION SC  
$004E  
IRQ KEYMUX KEYCLRPUEN 0000 0000  
undened  
A/D status/control (ADSCR)  
$004F COCO ADRC ADON  
0
CH3 CH2 CH1 CH0 0000 0000  
u = undened  
TPG  
A
MC68HC05F32  
MC68HC705F32  
MOTOROLA  
For More Information On This Product,  
Go to: www.freescale.com  
A-7  
Freescale Semiconductor, Inc.  
A.3.2  
EPROM  
The MC68HC705F32 has 32256 bytes of EPROM located from $8000 to $FDFF, plus 16 bytes of  
user vectors from $FFF0 to $FFFF. Up to 16 bytes of EPROM can be programmed simultaneously  
by correctly manipulating the bits in the EPROM programming register.  
A.3.2.1  
EPROM programming register (PROG)  
State  
on reset  
Address bit 7  
$001D  
bit 6  
0
bit 5  
bit 4  
bit 3  
bit 2  
bit 1  
0
bit 0  
ELATCH  
EPROM programming (PROG)  
0
0
0
0
EPGM 0000 0000  
EPGM — EPROM program control  
1 (set) Programming power connected to the EPROM array.  
0 (clear) – Programming power disconnected from the EPROM array.  
ELATCH and EPGM cannot be set on the same write operation. EPGM can only be set if ELATCH  
is set. EPGM is automatically cleared when ELATCH is cleared.  
ELATCH — EPROM latch control  
1 (set)  
EPROM address and data buses configured for programming.  
0 (clear) – EPROM address and data buses configured for normal reads  
ELATCH causes address and data buses to be latched when a write to EPROM is carried out.The  
EPROM cannot be read if ELATCH = 1. This bit should not be set unless a programming voltage  
is applied to the VPP pin.  
A.3.2.2  
EPROM programming operation  
The following steps should be taken to program a byte of EPROM:  
1) Apply the programming voltage V to the IRQ pin.  
PP  
2) Set the ELATCH bit.  
3) Write to the EPROM address.  
4) Set the EPGM bit for a time t  
5) Clear the ELATCH bit.  
to apply the programming voltage.  
EPGM  
If the address bytes A15–A4 do not change, i.e. all bytes are located within the same 16 byte  
address block, then multibyte programming is permitted.The multibyte programming facility allows  
up to 16 bytes of data to be written to the desired addresses after the ELATCH bit has been set.  
TPG  
A
MOTOROLA  
A-8  
MC68HC705F32  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
A.4  
Electrical specifications  
This section gives the electrical specifications for the MC68HC705F32, the EPROM version of the  
MC68HC05F32. Contained in this section is the information specific to the MC68HC705F32 which  
differs from that detailed in Section 16.  
A.4.1  
EPROM characteristics  
Table A-2 EPROM characteristics  
Characteristic  
EPROM programming voltage rate  
EPROM programming voltage  
EPROM programming time  
Symbol  
Value  
Unit  
V
V
V
V
- 0.3 to +17 + 0.5  
typ. 17.0  
PP  
PP  
SS  
V
t
min. 4.0  
ms  
EPGM  
A.4.2  
DC levels for low voltage reset and LVI  
Table A-3 DC levels for low voltage reset and LVI  
(TA = 0C to 60°C, unless otherwise stated)  
Characteristic  
Power-on reset voltage  
Power-off reset voltage  
Low voltage interrupt  
Symbol  
Min.  
2.55  
2.45  
2.75  
Typ.  
2.8  
Max.  
3.05  
2.95  
3.25  
Unit  
V
V
RON  
V
2.7  
V
ROFF  
V
3.0  
V
LVI  
TPG  
A
MC68HC05F32  
MC68HC705F32  
MOTOROLA  
A-9  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
A.5  
Mechanical data  
A.5.1  
100-pin QFP pinout for the MC68HC705F32  
AVDD  
PD0/AN0  
PD1/AN1  
PD2/AN2  
PD3/AN3  
PD4/AN4  
PD5/AN5  
PD6/AN6  
PD7/AN7  
1
2
3
4
5
6
7
8
75  
74  
73  
72  
71  
70  
69  
68  
67  
66  
65  
64  
63  
62  
61  
60  
59  
58  
57  
56  
55  
54  
53  
52  
51  
PH1/FP33  
PH0/FP32  
PG7/FP31  
PG6/FP30  
PG5/FP29  
PG4/FP28  
PG3/FP27  
PG2/FP26  
PG1/FP25  
PG0/FP24  
PH5/FP37  
PH4/FP36  
PH3/FP35  
PH2/FP34  
PF7/FP23  
PF6/FP22  
PF5/FP21  
PF4/FP20  
PF3/FP19  
PF2/FP18  
PF1/FP17  
PF0/FP16  
PI7/FP15  
PI6/FP14  
PI5/FP13  
9
AVSS  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
PE0/TCAP1  
PE1/TCMP1  
PE2/TCAP2  
PE3/TCMP2  
PE4/REFRESH  
PE5/PWM1  
PE6/PWM2  
PE7/PWM3  
PC0/TCAP3  
PC1/TCAP4  
PC2/RDI  
PC3/TDO  
PC4/MISO  
VDD  
VSS  
Figure 18-1 100-pin QFP pinout for the MC68HC705F32  
For package dimensions, refer to Section 17.2.  
A
MOTOROLA  
A-10  
MC68HC705F32  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
A.5.2  
80-pin QFP pinout for the MC68HC705F32  
60  
PB0  
PA7  
PD0  
PD1  
PD2  
PD3  
PD4  
PD5  
PD6  
PD7  
1
2
3
4
5
6
7
8
59  
58  
57  
56  
55  
54  
53  
52  
51  
50  
49  
48  
47  
46  
45  
44  
43  
42  
41  
PG7/FP31  
PG6/FP30  
PG5/FP29  
PG4/FP28  
PG3/FP27  
PG2/FP26  
PG1/FP25  
PG0/FP24  
PF7/FP23  
PF6/FP22  
PF5/FP21  
PF4/FP20  
PF3/FP19  
PF2/FP18  
PF1/FP17  
PF0/FP16  
PI7/FP15  
PI6/FP14  
PI5/FP13  
9
PE0/TCAP1  
PE1/TCMP1  
PE2/TCAP2  
PE3/TCMP2  
PE4  
PE5/PWM1  
PE6/PWM2  
PE7/PWM3  
PC0/TCAP3  
PC4  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
VDD  
Figure 18-2 80-pin QFP pinout for the MC68HC705F32  
Note:  
The 80-pin version is only a bond option. Pins PE4, PD7–PD0, PC4, PC5 are shared  
with module functions which cannot work on the 80-pin package. These modules and  
their corresponding pin functions should not be enabled.  
For package dimensions, refer to Section 17.4.  
A
MC68HC05F32  
MC68HC705F32  
MOTOROLA  
A-11  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
A
MOTOROLA  
A-12  
MC68HC705F32  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
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.  
CERQUAD  
A ceramic package type, principally used for EPROM and high temperature  
devices.  
Clear  
‘0’ — the logic zero state; the opposite of ‘set’.  
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.  
TPG  
MC68HC05F32  
GLOSSARY  
MOTOROLA  
xiii  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
EVS  
Evaluation system. One of the range of platforms provided by Motorola for  
evaluation and emulation of their devices.  
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  
IRQ  
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.  
Interrupt request. The overline indicates that this is an active-low signal  
format.  
K byte  
LCD  
A kilo-byte (of memory); 1024 bytes.  
Liquid crystal display.  
LSB  
Least significant byte.  
M68HC05  
MCU  
Motorola’s family of 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.  
TPG  
MOTOROLA  
xiv  
GLOSSARY  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
Pull-down, pull-up These terms refer to resistors, sometimes internal to the device, which are  
permanently connected to either ground or V  
.
DD  
PWM  
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.  
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  
MC68HC05F32  
GLOSSARY  
MOTOROLA  
xv  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
THIS PAGE LEFT BLANK INTENTIONALLY  
MOTOROLA  
xvi  
GLOSSARY  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
INDEX  
In this index numeric entries are placed first; page references in italics indicate that the reference  
is to a figure.  
100-pin QFP  
B
MC68HC05F32 pinout 17–1  
MC68HC705F32 pinout A–10  
mechanical dimensions 17–2  
BAUD — baud rate register 11–14  
SCP1, SCP0 – serial prescaler select bits 11–15  
SCT2, SCT1, SCT0 – SCI rate select bits 11–15  
32 kHz clock system  
during STOP mode 13–2  
during WAIT mode 13–2  
refresh clock 13–2  
baud rate selection 11–16  
bit set/clear addressing mode 15–13  
bit test and branch addressing mode 15–13  
block diagrams  
80-pin QFP  
MC68HC05F32 pinout 17–3  
MC68HC705F32 pinout A–11  
core timer 5–1  
mechanical dimensions 17–4  
A/D converter 9–2  
LCD 8–1  
MC68HC05F32 1–3  
MC68HC705F32 A–2  
programmable timer 6–2  
PWM 12–1  
SCI 11–2  
SPI 10–5  
A
A – accumulator 15–1  
A/D converter  
ADDATA 9–5  
BP3–PB0 2–7  
ADSCR 9–3  
AN7–AN0 2–6  
analog input 9–5  
block diagram 9–2  
channel selection 9–1  
conversion 9–3  
during STOP mode 9–5  
during WAIT mode 9–5  
operation 9–1  
C
,
9–4  
C-bit in CCR 15–3  
CCR – condition code register 15–2  
CH2–CH0 bits in ADSCR 9–4  
clocks – see oscillator clock  
CO1E bit in TCR1 6–5  
CO2E bit in TCR2 6–6  
COCO bit in ADSCR 9–3  
control timing 16–5  
COP 14–2  
COP watchdog timer 5–5  
COP reset times 5–5  
RC oscillator 9–3  
stabilization 9–4  
successive approximation (SAR) 9–1  
ADDATA — A/D result data register 9–5  
addressing modes 15–5 15–13  
ADON bit in ADSCR 9–4  
ADRC bit in ADSCR 9–3  
core timer  
ADSCR — A/D status/control register  
ADON – A/D converter on bit 9–4  
ADRC – A/D RC oscillator flag 9–3  
CH2–CH0 – A/D channel selection bits 9–4  
COCO – conversion complete flag 9–3  
alternate counter register 6–3  
AN7–AN0 2–6  
block diagram 5–1  
CTCR — counter register 5–4  
CTCSR — control/status register 5–3  
during STOP mode 5–5  
during WAIT mode 5–5  
interrupts 5–2  
counter  
alternate counter register 6–3  
,
14–4  
AVDD 2–6  
AVSS 2–6  
TPG  
MC68HC05F32  
INDEX  
MOTOROLA  
xvii  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
counter register 6–3  
erasing procedures 3–8  
programmable timer 6–1  
CPEN-bit in EPROG 3–6  
CPHA bit in SPCR 10–7  
CPICSR  
CPIE – custom periodic interrupt enable 13–1  
CPIF – custom periodic interrupt flag 13–1  
RFQ1, RFQ0 – refresh frequency select 13–2  
CPICSR — custom periodic interrupt control/status register  
13–1  
LATCH - latch bit 3–7  
programming procedures 3–8  
sample programming sequence 3–8  
EERC-bit in EPROG 3–7  
ELATCH bit in PROG A–8  
electrical specifications  
A/D converter 16–9  
control timing (5V) 16–5  
DC characteristics (5V) 16–3  
DTMF/melody generator 16–7  
EPROM characteristics A–9  
maximum ratings 16–1  
CPIE bit in CPICSR 13–1  
CPIF bit in CPICSR 13–1  
CPOL 10–7  
CPOL bit in SCCR1 11–11  
CPOL bit in SPCR 10–7  
CPU  
PWM timing 16–8  
thermal characteristics 16–2  
EPGM bit in PROG A–8  
A – accumulator 15–1  
EPROG – EEPROM programing register 3–6  
EPROM  
addressing modes 15–5  
CCR – condition code register 15–2  
instruction set 15–3 15–11  
15–13  
multibyte programming A–8  
PROG — EPROM programming register A–8  
programming A–8  
PC – program counter 15–2  
programming model 15–1  
SP – stack pointer 15–2  
stacking order 15–2  
ER1, ER0 bits in EPROG 3–7  
extended addressing mode 15–12  
external clock 2–8  
X – index register 15–2  
EXTVON bit in LCD 8–10  
crystal 2–8  
CTCR — core timer counter register 5–4  
CTCSR — core timer control/status register  
CTOF – core timer overflow 5–3  
F
CTOFE– core timer overflow enable 5–3  
RT1, RT0 real time interrupt rate select 5–4  
RTIE – real time interrupt enable 5–3  
RTIF – real time interrupt flag 5–3  
FCC — column frequency control register 7–4  
FCR — row frequency control register 7–4  
FDISP bit in LCD 8–10  
FE bit in SCSR 11–14  
features  
MC68HC05F32 1–2  
MC68HC705F32 A–1  
flowcharts  
interrupt 14–5  
STOP and WAIT 2–3  
FP39–FP0 2–7  
D
data retention mode 2–2  
DC characteristics 16–3  
direct addressing mode 15–7  
DMG registers  
frontplane pins 2–7  
FCC — column frequency control register 7–4  
FCR — row frequency control register 7–4  
TNCR — tone control register 7–4  
DOD bit in SPCR 10–7  
DTMF/melody generator (DMG)  
during STOP mode 7–8  
during WAIT mode 7–8  
H
H-bit in CCR 15–3  
features 7–1  
operation 7–7  
I
I/O port structure 4–4  
I/O ports  
I/O port structure 4–4  
port A 4–2  
port B 4–4  
port C 4–5  
port D 4–5  
E
EDG0–EDG5 – trigger edge control 4–4  
EEPGM-bit in EPROG 3–8  
EEPROM 3–6  
EPROG – EEPROM programing register 3–6  
erase modes 3–7  
port E 4–6  
ports F, G, H, I, J 4–6  
MOTOROLA  
xviii  
INDEX  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
programming 4–1  
I-bit in CCR 15–3  
IC1F, IC2F bits in TSR 6–7  
IC1IE bit in TCR 6–5  
MUX4, MUX3 – multiplex ratio 8–10  
WTLCDO – WAIT mode LCD only 8–9  
low power modes 2–1  
data retention 2–2  
IC2IE bit in TCR1 6–5  
RESET, STOP, WAIT – as interrupt sequence 14–8  
STOP 2–1  
WAIT 2–2  
ICR1 — input capture register 6–9  
IDLE bit in SCSR 11–13  
IEDG1 bit in TCR1 6–5  
LVIF, LVIE, LVION bits in SOR 2–4  
IEDG2 bit in TCR1 6–6  
ILIE bit in SCCR2 11–11  
illegal address reset 14–1  
immediate addressing mode 15–6  
indexed addressing modes 15–12  
inherent addressing mode 15–6  
input capture 6–9  
M
M bit in SCCR1 11–10  
mask options 1–2  
maximum ratings 16–1  
MC68HC05F32  
instruction set 15–3  
tables of instructions 15–5  
interrupts 14–3  
15–11  
15–11  
block diagram 1–3  
features 1–2  
mask options 1–2  
MC68HC705F32  
block diagram A–2  
features A–1  
core timer 14–4  
hardware 14–4  
interrupt flowchart 14–5  
keyboard 14–7  
maskable 14–4  
memory  
nonmaskable 14–4  
priorities 14–4  
programmable timer 14–6  
bootloader ROM 3–6  
EEPROM 3–6  
EPROM A–8  
real-time 5–2 14–4  
,
memory map 3–2  
RAM 3–5  
,
A–4  
software (SWI) 14–4  
INTVLCD bit in LCD 8–9  
IRQ 2–5  
ROM 3–5  
MISO 2–6  
modes of operation  
IRQ bit in SOR 2–4  
low power modes 2–1  
single-chip 2–1  
MODF bit in SPSR 10–8  
MOSI 2–6  
MSTR 10–7  
K
key control register  
EDG0–EDG5 – trigger edge control 4–4  
KF – keyboard interrupt status flag 4–3  
KIE – keyboard interrupt enable 4–4  
MSTR bit in SPCR 10–7  
MUX4, MUX3 bits in LCD 8–10  
keyboard interrupt 2–5  
KEYCLR bit in SOR 2–4  
,
4–2 14–7  
,
N
KEYMUX bit in SOR 2–4  
N-bit in CCR 15–3  
NF bit in SCSR 11–14  
L
LATCH-bit in EPROG 3–7  
LCD  
O
block diagram 8–1  
OC1IE bit in TCR1 6–5  
OC2IE bit in TCR2 6–6  
OCR1, OCR2 — output compare registers 6–11  
OLVL1 bit in TCR1 6–6  
OLVL2 bit in TCR2 6–6  
OR bit in SCSR 11–13  
OSC1, OSC2 pins 2–7  
OSC3, OSC4 pins 2–7  
oscillator clock  
during STOP mode 8–10  
during WAIT mode 8–10  
RAM 8–2  
timing diagrams 8–4  
timing signals 8–4  
8–8  
voltage level selection 8–4  
LCD — LCD control register  
EXTVON – external LCD voltage ON/OFF 8–10  
FDISP – display frequency 8–10  
INTVLCD - internal voltage generator ON/OFF 8–9  
connections 2–9  
crystal 2–8  
MC68HC05F32  
INDEX  
MOTOROLA  
xix  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
external clock 2–8  
port B 4–4  
output compare 6–11  
port C 4–5  
port D 4–5  
port E 4–6  
port registers  
P
data direction registers 4–7  
port data registers 4–7  
ports F, G, H, I, J 4–6  
ports F, G, H, I, J pins 2–7  
power-on reset 14–1  
PROG — EPROM programming register A–8  
ELATCH – EPROM latch control A–8  
EPGM – EPROM program control A–8  
programmable timer  
block diagram 6–2  
PA7–PA0 2–5  
packages  
MC68HC05F32 100-pin QFP 17–1  
MC68HC05F32 80-pin QFP 17–3  
MC68HC705F32 100-pin QFP A–10  
MC68HC705F32 80-pin QFP A–11  
PB7–PB0 2–5  
PC – program counter 15–2  
PC7–PC0 2–6  
PD7–PD0 2–6  
PE7–PE0 2–6  
pins  
counter 6–1  
during STOP mode 6–13  
during WAIT mode 6–13  
ICR1 6–9  
AN7–AN0 2–6  
AVDD 2–6  
interrupts 14–6  
OCR1, OCR2 6–11  
TCR1, TCR2 6–4  
timing diagrams 6–13  
TSR 6–7  
AVSS 2–6  
BP3–BP0 2–7  
FP39–FP0 2–7  
IRQ 2–5  
keyboard interrupt 2–5  
MISO 2–6  
programming  
EEPROM 3–8  
EPROM A–8  
MOSI 2–6  
PUEN bit in SOR 2–4  
PWM 12–4  
OSC1, OSC2 2–7  
OSC3, OSC4 2–7  
PA7–PA0 2–5  
PB7–PB0 2–5  
PC7–PC0 2–6  
PD7–PD0 2–6  
PE7–PE0 2–6  
ports F, G, H, I, J 2–7  
PWM1 2–6  
block diagram 12–1  
control register 12–3  
during reset 12–5  
during STOP mode 12–5  
during WAIT mode 12–4  
waveforms 12–2 12–3  
,
PWM control register  
POL1 – PWM1 polarity 12–3  
POL2 – PWM2 polarity 12–3  
POL3 – PWM3 polarity 12–3  
PWM timing 16–8  
PWM1 2–6  
PWM2 2–6  
PWM2 2–6  
PWM3 2–6  
RDI 2–6  
REFRESH 2–6  
,
11–6  
RESET 2–5  
SCK 2–6  
SS 2–6  
,
14–1  
PWM3 2–6  
TCAP1 2–6  
TCAP2 2–6  
TCAP3 2–6  
TCAP4 2–6  
TCMP1 2–6  
TCMP2 2–6  
TDO 2–6  
R
R8 bit in SCCR1 11–10  
RC oscillator  
stabilization 9–3  
TNO, TNX 2–7  
RDI 2–6  
VDD, VSS 2–5  
VLCD 2–7  
VRH 2–6  
RDI – receive data in 11–6  
RDRF bit in SCSR 11–13  
RE bit in SCCR2 11–12  
POL1 bit in the PWM control register 12–3  
POL2 bit in the PWM control register 12–3  
POL3 bit in the PWM control register 12–3  
POR – see power-on reset  
port A 4–2  
real-time interrupts 5–2 14–4  
,
example RTI periods 5–4  
receiver wake-up 11–5  
REFRESH 2–6  
register summary 3–3  
relative addressing mode 15–13  
,
A–5  
keyboard interrupt 4–2  
MOTOROLA  
xx  
INDEX  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
RESET 2–5  
resets 14–1  
SPCR  
CPHA – clock phase 10–7  
CPOL – clock polarity 10–7  
COP 14–2  
illegal address 14–1  
power-on reset 14–1  
DOD – direction of data 10–7  
MSTR – master/slave mode select 10–7  
SPE – SPI system enable 10–7  
SPIE – SPI interrupt enable 10–6  
SPR1, SPR0 – SPI clock select bits 10–7  
RESET pin 2–5 14–1  
,
RFQ1, RFQ0 bits in CPICSR 13–2  
RIE bit in SCCR2 11–11  
RT1, RT0 bits in CTCSR 5–4  
RTIE bit in CTCSR 5–3  
SPI 10–9  
block diagram 10–5  
during STOP mode 10–9  
during WAIT mode 10–9  
features 10–1  
RTIF bit in CTCSR 5–3  
RWU bit in SCCR2 11–12  
rate selection 10–8  
registers 10–6  
SPI registers  
SPCR — SPI control register 10–6  
SPDAT — SPI data I/O register 10–9  
SPSR — SPI status register 10–8  
SPI signal descriptions  
S
SBK bit in SCCR2 11–12  
SC bit in SOR 2–4  
SCCR1 — serial communications control register 1 11–9  
CPOL – clock polarity bit 11–11  
M – mode (select character format) 11–10  
R8 – receive data bit 8 11–10  
T8 – transmit data bit 8 11–10  
WAKE – wake-up mode select bit 11–10  
SCCR2 — serial communications control register 2 11–11  
ILIE – idle line interrupt enable 11–11  
RE – receiver enable 11–12  
master in slave out (MISO) 10–2  
master out slave in (MOSI) 10–2  
serial clock (SCK) 10–2  
slave select (SS) 10–4  
SPIE 10–6  
SPSR  
MODF – SPI mode error interrupt status flag 10–8  
SPIF – SPI interrupt request flag 10–8  
WCOL – write collision 10–8  
SS 2–6  
STOP mode 2–1  
successive approximation (SAR) - see A/D converter  
SWI – see interrupts  
RIE – receiver interrupt enable 11–11  
RWU – receiver wake-up 11–12  
SBK – send break 11–12  
TCIE – transmit complete interrupt enable 11–11  
TE – transmitter enable 11–11  
TIE – transmit interrupt enable 11–11  
SCDR — serial communications data register 11–9  
SCI  
system options register 2–4  
baud rate selection 11–16  
block diagram 11–2  
data format 11–5  
receiver wake-up 11–5  
T
T8 bit in SCCR1 11–10  
start bit detection 11–7  
TC bit in SCSR 11–13  
SCK 2–6  
TCAP1 2–6  
SCP1, SCP0 bits in BAUD 11–15  
SCSR — serial communications status register 11–12  
FE – framing error flag 11–14  
IDLE – idle line detected flag 11–13  
NF – noise error flag 11–14  
TCAP1, TCAP2 bits in TSR 6–8  
TCAP2 2–6  
TCAP3 2–6  
TCAP4 2–6  
TCIE bit in SCCR2 11–11  
OR – overrun error flag 11–13  
RDRF – receive data register full flag 11–13  
TC – transmit complete flag 11–13  
TDRE – transmit data register empty flag 11–13  
SCT2, SCT1, SCT0 bits in BAUD 11–15  
SOR 2–4  
TCMP1 2–6  
TCMP2 2–6  
TCR1 — timer control register 1 6–4  
CO1E – compare output enable bit 1 6–5  
IC1IE – input capture interrupt enable 1 6–5  
IC2IE – input capture interrupt enable 2 6–5  
IEDG1 – input edge bit 1 6–5  
IEDG2 – input edge bit 2 6–6  
OC1IE – output compare interrupt enable 1 6–5  
OLVL1 – output level bit 1 6–6  
TOIE – timer overflow interrupt enable 6–5  
TCR2 — timer control register 2 6–4  
CO2E – compare output enable bit 2 6–6  
OC2IE – output compare interrupt enable 2 6–6  
IRQ — interrupt sensitivity 2–4  
KEYCLR — keyboard interrupt clear 2–4  
KEYMUX — multiplex bit for access of interrupt flag  
2–4  
LVIF, LVIE, LVION — low voltage interrupt bits 2–4  
PUEN — PORTC pull-up enable 2–4  
SC — system clock option 2–4  
SP – stack pointer 15–2  
MC68HC05F32  
INDEX  
MOTOROLA  
For More Information On This Product,  
Go to: www.freescale.com  
xxi  
Freescale Semiconductor, Inc.  
OLVL2 – output level bit 2 6–6  
TDO 2–6  
SCI transmit data out 11–8  
TDRE bit in SCSR 11–13  
TE bit in SCCR2 11–11  
thermal characteristics 16–2  
TIE bit in SCCR2 11–11  
timing diagrams  
programmable timer 6–13  
TNCR — tone control register  
MS1, MS0 – melody select for operation 7–4  
TGEC – tone generator enable column path 7–5  
TGER – tone generator enable row path 7–5  
TNOE – tone output enable 7–5  
TNO, TNX pins 2–7  
TNOE bit in TNCR 7–5  
TOF bit in TSR 6–7  
TOIE bit in TCR1 6–5  
TSR — timer status register 6–7  
IC1F, IC2F – input capture flags 6–7  
OC1F, OC2F – output compare flags 6–7  
TACP1, TCAP2 – input capture status flags 6–8  
TOF – timer overflow status flag 6–7  
V
VDD 2–5  
VLCD 2–7  
VRH 2–6  
VSS 2–5  
W
WAIT mode 2–2  
WAKE bit in SCCR1 11–10  
watchdog timer 14–2  
WCOL 10–8  
WCOL bit in SPSR 10–8  
WTLCDO bit in LCD 8–9  
X
X – index register 15–2  
Z
Z-bit in CCR 15–3  
MOTOROLA  
xxii  
INDEX  
MC68HC05F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
CUSTOMER FEEDBACK QUESTIONNAIRE (MC68HC05F32/D)  
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:  
Comments:  
e–  
❏ ❏ ❏ ❏  
v
4. How easy is it to find the information you are looking for?  
Easy Difficult  
❏ ❏ ❏ ❏  
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  
❏ ❏ ❏ ❏ ❏  
MODES OF OPERATION AND PIN DESCRIPTIONS  
MEMORY AND REGISTERS  
PARALLEL INPUT/OUTPUT PORTS  
CORE TIMER  
–Cuaghslintremo  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
❏ ❏ ❏ ❏ ❏  
16-BIT PROGRAMMABLE TIMER  
DTMF/MELODY GENERATOR  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
A/D CONVERTER  
SECTION 10 SERIAL PERIPHERAL INTERFACE  
SECTION 11 SERIAL COMMUNICATIONS INTERFACE  
SECTION 12 PULSE WIDTH MODULATOR  
SECTION 13 32 KHZ CLOCK SYSTEM  
SECTION 14 RESETS AND INTERRUPTS  
SECTION 15 CPU CORE AND INSTRUCTION SET  
SECTION 16 ELECTRICAL SPECIFICATIONS  
SECTION 17 MECHANICAL DATA  
SECTION 18 ORDERING INFORMATION  
SECTION 19 APPENDICES  
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:  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
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  
By air mail  
Par avion  
IBRS NUMBER PHQ-B/207/G  
–Cugahslitnremo  
–Firsft  
CCRI NUMERO PHQ-B/207/G  
NO STAMP REQUIRED  
lodbac  
kagothsline–  
REPONSE PAYEE  
GRANDE-BRETAGNE  
v
e–  
Motorola Ltd.,  
Colvilles Road,  
Kelvin Industrial Estate,  
EAST KILBRIDE,  
G75 8BR.  
GREAT BRITAIN.  
Semiconductor Products Sector  
F.A.O. Technical Publications Manager  
(re: MC68HC05F32/D)  
– 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 Forbes, Technical Publications Manager, Motorola Ltd., Scotland.  
For More Information On This Product,  
Go to: www.freescale.com  
– Finally, tuck this edge into opposite flap –  
Freescale Semiconductor, Inc.  
INTRODUCTION  
1
2
3
4
5
MODES OF OPERATION AND PIN DESCRIPTIONS  
MEMORY AND REGISTERS  
PARALLEL INPUT/OUTPUT PORTS  
CORE TIMER  
16-BIT PROGRAMMABLE TIMER  
DTMF/MELODY GENERATOR  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
A/D CONVERTER  
6
7
8
9
SERIAL PERIPHERAL INTERFACE  
SERIAL COMMUNICATIONS INTERFACE  
PULSE WIDTH MODULATOR  
32 KHZ CLOCK SYSTEM  
10  
11  
12  
13  
14  
15  
16  
17  
18  
A
RESETS AND INTERRUPTS  
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS  
MECHANICAL DATA  
ORDERING INFORMATION  
MC68HC705F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
INTRODUCTION  
1
2
3
4
5
MODES OF OPERATION AND PIN DESCRIPTIONS  
MEMORY AND REGISTERS  
PARALLEL INPUT/OUTPUT PORTS  
CORE TIMER  
16-BIT PROGRAMMABLE TIMER  
DTMF/MELODY GENERATOR  
LIQUID CRYSTAL DISPLAY DRIVER MODULE  
A/D CONVERTER  
6
7
8
9
SERIAL PERIPHERAL INTERFACE  
SERIAL COMMUNICATIONS INTERFACE  
PULSE WIDTH MODULATOR  
32 KHZ CLOCK SYSTEM  
10  
11  
12  
13  
14  
15  
16  
17  
18  
A
RESETS AND INTERRUPTS  
CPU CORE AND INSTRUCTION SET  
ELECTRICAL SPECIFICATIONS  
MECHANICAL DATA  
ORDERING INFORMATION  
MC68HC705F32  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
1
2
3
4
5
6
7
8
9
10  
11  
12  
13  
14  
15  
For More Information On This Product,  
Go to: www.freescale.com  
Freescale Semiconductor, Inc.  
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  
For More Information On This Product,  
Go to: www.freescale.com  

相关型号:

MC68HC705F32PU

a member of the M68HC05 family of HCMOS
FREESCALE

MC68HC705F4FB

8-BIT, OTPROM, 1.789MHz, MICROCONTROLLER, PQFP44, PLASTIC, QFP-44
NXP

MC68HC705F6

MCU with DTMF/melody generator
MOTOROLA

MC68HC705F6B/K

Microcontroller, 8-Bit, OTPROM, HCMOS, PDIP42, SDIP-42
MOTOROLA

MC68HC705F6FU

暂无描述
MOTOROLA

MC68HC705F6P

8-Bit Microcontroller
ETC

MC68HC705F8

High-density complementary metal oxide semiconductor(HCMOS) microcontroller unit
FREESCALE

MC68HC705G4

8-BIT, OTPROM, 2MHz, MICROCONTROLLER, PQFP80, QFP-80
NXP

MC68HC705H12

Microcontroller, 8-Bit, EEPROM, 2MHz, CMOS, PQCC52, PLASTIC, LCC-52
MOTOROLA

MC68HC705H12

8-BIT, EEPROM, 2.1MHz, MICROCONTROLLER, PQCC52, PLASTIC, LCC-52
NXP

MC68HC705H12CFN

Microcontroller, 8-Bit, UVPROM, 6805 CPU, 2.1MHz, CMOS, PQCC52
MOTOROLA

MC68HC705J

Microcontrollers
MOTOROLA