![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... MC68HC05L25 Technical Data M68HC05 Microcontrollers MC68HC05L25/D Rev. 3, 5/2002 WWW.MOTOROLA.COM/SEMICONDUCTORS For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC05L25 Freescale Semiconductor, Inc... Technical Data To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://www.motorola.com/semiconductors/ The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location. Motorola and the Stylized M Logo are registered trademarks of Motorola, Inc. DigitalDNA is a trademark of Motorola, Inc. (c) Motorola, Inc., 2002 MC68HC05L25 -- Rev. 3.0 MOTOROLA Technical Data 3 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Revision History Revision History Date May, 2002 Revision Level 3.0 Description Reformatted to add additional page references and correct World Wide Web address Page Number(s) N/A Freescale Semiconductor, Inc... Technical Data 4 MC68HC05L25 -- Rev. 3.0 MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 List of Sections Section 1. General Description . . . . . . . . . . . . . . . . . . . . 23 Section 2. Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Freescale Semiconductor, Inc... Section 3. Operating Modes. . . . . . . . . . . . . . . . . . . . . . . 45 Section 4. Central Processor Unit (CPU) Core . . . . . . . . 49 Section 5. Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Section 6. Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Section 7. Input/Output Ports (I/O) . . . . . . . . . . . . . . . . . 69 Section 8. Oscillators and Clock . . . . . . . . . . . . . . . . . . 105 Section 9. Time Base . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Section 10. Serial Peripheral Interface . . . . . . . . . . . . . 129 Section 11. LCD Driver . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Section 12. Analog Subsystem . . . . . . . . . . . . . . . . . . . 161 Section 13. Event Counter . . . . . . . . . . . . . . . . . . . . . . . 169 Section 14. Instruction Set . . . . . . . . . . . . . . . . . . . . . . . 177 Section 15. Electrical Specifications. . . . . . . . . . . . . . . 195 Section 16. Mechanical Specifications . . . . . . . . . . . . . 205 Section 17. Ordering Information . . . . . . . . . . . . . . . . . 207 MC68HC05L25 -- Rev. 3.0 MOTOROLA List of Sections For More Information On This Product, Go to: www.freescale.com Technical Data 5 Freescale Semiconductor, Inc. List of Sections Freescale Semiconductor, Inc... Technical Data 6 List of Sections For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Table of Contents Section 1. General Description 1.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Mask Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 MCU Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Freescale Semiconductor, Inc... 1.2 1.3 1.4 1.5 1.6 Functional Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.1 VDD and VSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.2 VLCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.3 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.4 OSC1 and OSC2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.4.1 Crystal or Ceramic Resonator . . . . . . . . . . . . . . . . . . . . . 32 1.6.4.2 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 1.6.5 XOSC1 and XOSC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.6.5.1 Crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.6.5.2 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 1.6.5.3 XOSC Not Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1.6.6 PA0-PA2/KWI0-KWI2, PA3/KWI3/BZ, PA4/AD0/EVI, PA5/ADI, PA6/RMO, and PA7 . . . . . . . . . . . . . . . . . . . . 34 1.6.7 PB0-PB7/FP24-FP17. . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 1.6.8 PC0/SCK, PC1/SDO, PC2/SDI, and PC3/IRQ . . . . . . . . . .34 1.6.9 BP3/FP0, FP1-FP18, and PB0-PB7/FP24-FP17 . . . . . . . 35 1.6.10 BP0-BP2 and BP3/FP0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 MC68HC05L25 -- Rev. 3.0 MOTOROLA Table of Contents For More Information On This Product, Go to: www.freescale.com Technical Data 7 Freescale Semiconductor, Inc. Table of Contents Section 2. Memory Map 2.1 2.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Freescale Semiconductor, Inc... 2.3 Input/Output and Control Registers . . . . . . . . . . . . . . . . . . . . . 38 2.3.1 Read/Write Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 2.3.2 Read-Only Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.3 Write-Only Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.4 Reserved Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.5 Reset Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.3.6 Option Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.3.7 Random-Access Memory (RAM). . . . . . . . . . . . . . . . . . . . . 40 2.4 Read-Only Memory (ROM). . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Section 3. Operating Modes 3.1 3.2 3.3 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Single-Chip Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.4 Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4.1 STOP Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4.2 WAIT Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.5 COP Watchdog Timer Considerations . . . . . . . . . . . . . . . . . . .48 Section 4. Central Processor Unit (CPU) Core 4.1 4.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.3 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.3.1 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.3.2 Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.3.3 Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3.4 Program Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3.5 Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Technical Data 8 Table of Contents For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Table of Contents Section 5. Resets 5.1 5.2 5.3 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 External Reset (RESET). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.4 Internal Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.4.1 Power-On Delay (POD). . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.4.2 Computer Operating Properly Reset (COPR) . . . . . . . . . . . 57 Freescale Semiconductor, Inc... Section 6. Interrupts 6.1 6.2 6.3 6.4 6.5 6.6 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 CPU Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 Reset Interrupt Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Software Interrupt (SWI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Hardware Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 6.7 External Interrupt (IRQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.7.1 External Interrupt Trigger Condition . . . . . . . . . . . . . . . . . . 62 6.7.2 Interrupt Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.7.3 Interrupt Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.8 6.9 6.10 6.11 6.12 Serial Peripheral Interface Interrupt (SPII) . . . . . . . . . . . . . . . . 66 Event Counter Interrupt (EVI) . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Time Base Interrupt (TBI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 Key Wakeup Interrupt (KWI). . . . . . . . . . . . . . . . . . . . . . . . . . . 67 IRQ/KWI Software Consideration . . . . . . . . . . . . . . . . . . . . . . . 67 MC68HC05L25 -- Rev. 3.0 MOTOROLA Table of Contents For More Information On This Product, Go to: www.freescale.com Technical Data 9 Freescale Semiconductor, Inc. Table of Contents Section 7. Input/Output Ports (I/O) 7.1 7.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Freescale Semiconductor, Inc... 7.3 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.3.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.3.2 Port A Data Direction Register . . . . . . . . . . . . . . . . . . . . . . 75 7.3.3 Port A Pullup Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 7.3.4 Port A Wired-OR Mode Register . . . . . . . . . . . . . . . . . . . . . 76 7.3.5 Key Wakeup Interrupt (KWI) . . . . . . . . . . . . . . . . . . . . . . . .76 7.3.6 I/O Pin Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.4 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.4.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 7.4.2 Port B Data Direction Register . . . . . . . . . . . . . . . . . . . . . . 85 7.4.3 Port B Pullup Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 7.4.4 Port B Wire-ORed Mode Register . . . . . . . . . . . . . . . . . . . .86 7.4.5 I/O Pin Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.5 Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7.5.1 Port C Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 7.5.2 Port C Data Direction Register . . . . . . . . . . . . . . . . . . . . . . 93 7.5.3 Port C Pullup Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 7.5.4 Port C Wired-OR Mode Register. . . . . . . . . . . . . . . . . . . . . 94 7.5.5 I/O Pin Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.6 I/O Port Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.6.1 Pin Data Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.6.2 Output Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 7.6.3 Input Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.6.4 I/O Pin Transitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.6.5 I/O Pins with Subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.6.6 Resistor Control Register 1 . . . . . . . . . . . . . . . . . . . . . . 101 7.6.7 Resistor Control Register 2 . . . . . . . . . . . . . . . . . . . . . . .102 7.6.8 Open Drain Output Control Register . . . . . . . . . . . . . . . . 103 Technical Data 10 Table of Contents For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Table of Contents Section 8. Oscillators and Clock 8.1 8.2 8.3 8.4 8.5 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 OSC Clock Divider and POR Counter . . . . . . . . . . . . . . . . . .106 System Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 OSC and XOSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 OSC On Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 Freescale Semiconductor, Inc... 8.6 8.7 XOSC On Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 8.7.1 XOSC with FOSCE = 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 8.7.2 XOSC with FOSCE = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.7.3 XOSC with FOSCE = 0 and STOP . . . . . . . . . . . . . . . . . . 109 8.7.4 Unused XOSC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.8 8.9 8.10 8.11 8.12 8.13 Stop and Wait Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 XOSC Clock Divider and POD Counter . . . . . . . . . . . . . . . . . 112 System Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 XOSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Stop and Wait Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Miscellaneous Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Section 9. Time Base 9.1 9.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 9.3 Time Base Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.3.1 LCDCLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.3.2 STUP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.3.3 TBI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 9.3.4 COP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 9.3.5 Remote Control Carrier Generator . . . . . . . . . . . . . . . . . .121 9.3.6 Buzzer Tone Generator. . . . . . . . . . . . . . . . . . . . . . . . . . . 123 MC68HC05L25 -- Rev. 3.0 MOTOROLA Table of Contents For More Information On This Product, Go to: www.freescale.com Technical Data 11 Freescale Semiconductor, Inc. Table of Contents 9.4 9.5 9.6 Time Base Control Register 1. . . . . . . . . . . . . . . . . . . . . . . . . 124 Time Base Control Register 2 . . . . . . . . . . . . . . . . . . . . . . . . 125 Time Base Control Register 3 . . . . . . . . . . . . . . . . . . . . . . . . 127 Section 10. Serial Peripheral Interface 10.1 10.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Freescale Semiconductor, Inc... 10.3 10.4 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 10.4.1 Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 10.4.2 SPDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 10.4.3 SPCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 10.4.4 Clock Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 10.4.5 Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.4.6 Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.4.7 Serial Data Out (SDO). . . . . . . . . . . . . . . . . . . . . . . . . . . .132 10.4.8 Serial Data In (SDI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.4.9 Serial Clock (SCK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.5 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 10.6 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 10.6.1 Serial Peripheral Control Register . . . . . . . . . . . . . . . . . .135 10.6.2 Serial Peripheral Status Register . . . . . . . . . . . . . . . . . . . 137 10.6.3 SPI Data Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 10.6.4 Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 10.6.5 Stop/Wait Condition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.6.6 Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 10.6.7 Wait Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 Section 11. LCD Driver 11.1 11.2 11.3 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Technical Data 12 Table of Contents For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Table of Contents 11.4 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 11.4.1 LCD Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 11.4.2 Fast Change Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 11.4.3 LCD Data Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 11.5 Terminal Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.5.1 VLCD Bias Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.5.2 Backplane Drivers (BP0-BP3) . . . . . . . . . . . . . . . . . . . . . 149 11.5.3 Frontplane Drivers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Freescale Semiconductor, Inc... 11.6 LCD Connection and LCD Driver Operation. . . . . . . . . . . . . .154 11.7 LCD Waveform Base Clock and LCD Cycle Frame . . . . . . . . 157 11.7.1 Time Base Control Register 1 . . . . . . . . . . . . . . . . . . . . . . 158 11.7.2 LCD Cycle Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 11.8 Simplified LCD Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Section 12. Analog Subsystem 12.1 12.2 12.3 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Analog Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.4 Ratiometric Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.4.1 VREFH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.4.2 Accuracy and Precision. . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.5 Conversion Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 12.6 Digital Section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163 12.6.1 Conversion Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 12.6.2 Internal versus External Oscillator. . . . . . . . . . . . . . . . . . .163 12.6.3 Multi-Channel Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 164 12.7 12.8 12.9 A/D Subsystem Operation during Wait Modes . . . . . . . . . . . . 164 A/D Subsystem Operation during Stop Modes . . . . . . . . . . . . 164 A/D Status and Control Register. . . . . . . . . . . . . . . . . . . . . . .165 12.10 A/D Conversion Data Register . . . . . . . . . . . . . . . . . . . . . . . . 167 MC68HC05L25 -- Rev. 3.0 MOTOROLA Table of Contents For More Information On This Product, Go to: www.freescale.com Technical Data 13 Freescale Semiconductor, Inc. Table of Contents Section 13. Event Counter 13.1 13.2 13.3 13.4 13.5 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Event Counter Status/Control Register. . . . . . . . . . . . . . . . . . 171 Event Counter Timing Register . . . . . . . . . . . . . . . . . . . . . . .172 Event Counter Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Event Counter During Wait Mode . . . . . . . . . . . . . . . . . . . . . . 175 Event Counter During Stop Mode. . . . . . . . . . . . . . . . . . . . . . 176 Event Counter Data Registers . . . . . . . . . . . . . . . . . . . . . . . . 176 Freescale Semiconductor, Inc... 13.6 13.7 13.8 13.9 Section 14. Instruction Set 14.1 14.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 14.3 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 14.3.1 Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 14.3.2 Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179 14.3.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 14.3.4 Extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 14.3.5 Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 14.3.6 Indexed, 8-Bit Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 14.3.7 Indexed,16-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 14.3.8 Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 14.4 Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 14.4.1 Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . 182 14.4.2 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . 183 14.4.3 Jump/Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . 184 14.4.4 Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . .186 14.4.5 Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 14.5 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Technical Data 14 Table of Contents For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Table of Contents Section 15. Electrical Specifications 15.1 15.2 15.3 15.4 15.5 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Operating Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 DC Operating Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 197 DC Electrical Characteristics (VDD = 3.3 V) . . . . . . . . . . . . . . 198 DC Electrical Characteristics (VDD = 5.0 V) . . . . . . . . . . . . . . 199 LCD DC Electrical Characteristics (VDD = 3.0 V, VLCD = 0 V) . . . . . . . . . . . . . . . . . . . . . . . . . 200 Freescale Semiconductor, Inc... 15.6 15.7 15.8 15.9 15.10 LCD DC Electrical Characteristics (VDD = 5.0 V, VLCD = 2.0 V). . . . . . . . . . . . . . . . . . . . . . . . 201 15.11 A/D Converter Characteristics . . . . . . . . . . . . . . . . . . . . . . . . 202 15.12 Control Timing (VDD = 3.3 V) . . . . . . . . . . . . . . . . . . . . . . . . . 203 15.13 Control Timing (VDD = 5.0 V) . . . . . . . . . . . . . . . . . . . . . . . . . 204 Section 16. Mechanical Specifications Section 17. Ordering Information 17.1 17.2 17.3 17.4 17.5 17.6 17.7 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 MCU Ordering Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Application Program Media. . . . . . . . . . . . . . . . . . . . . . . . . . . 208 ROM Program Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 ROM Verification Units (RVUs). . . . . . . . . . . . . . . . . . . . . . . . 210 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210 MC68HC05L25 -- Rev. 3.0 MOTOROLA Table of Contents For More Information On This Product, Go to: www.freescale.com Technical Data 15 Freescale Semiconductor, Inc. Table of Contents Freescale Semiconductor, Inc... Technical Data 16 Table of Contents For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 List of Figures Figure 1-1 1-2 1-3 1-4 1-5 2-1 2-2 2-3 2-4 3-1 4-1 5-1 6-1 6-2 6-3 6-4 6-5 6-6 7-1 7-2 7-3 7-4 7-5 Title Page Freescale Semiconductor, Inc... MC68HC05L25 Block Diagram. . . . . . . . . . . . . . . . . . . . . . . . . 26 48-Pin VQFP Single-Chip Mode Pinout . . . . . . . . . . . . . . . . . . 27 52-Pin TQFP Single-Chip Mode Pinout . . . . . . . . . . . . . . . . . . 29 Oscillator Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Oscillator Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 MC68HC05L25 Single-Chip Mode Memory Map . . . . . . . . . . . 38 Register Description Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 I/O Register Memory Map Summary . . . . . . . . . . . . . . . . . . . . 41 I/O Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Stop/Wait Flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 M68HC05 Programming Model . . . . . . . . . . . . . . . . . . . . . . . .50 Reset Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Interrupt Processing Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . 63 Interrupt Control Register (INTCR) . . . . . . . . . . . . . . . . . . . . . . 64 Interrupt Status Register (INSTR). . . . . . . . . . . . . . . . . . . . . . . 65 Timer Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 IRQ Timing Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Software Patch for IRQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Port A0:A2/KWI0:KWI2 I/O Circuitry . . . . . . . . . . . . . . . . . . . . 71 Port A3/KWI3/BZ I/O Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . 71 Port A4/AD0/EVI I/O Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Port A5/AD1 I/O Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Port A6/RMO I/O Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 MC68HC05L25 -- Rev. 3.0 MOTOROLA List of Figures For More Information On This Product, Go to: www.freescale.com Technical Data 17 Freescale Semiconductor, Inc. List of Figures Figure Title Page Freescale Semiconductor, Inc... 7-6 Port A7 I/O Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 7-7 Port A Data Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7-8 Port A Data Direction Register . . . . . . . . . . . . . . . . . . . . . . . . . 75 7-9 Key Wakeup Interrupt (KWI). . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7-10 Port B0:B7/FP24:FP17 I/O Circuitry . . . . . . . . . . . . . . . . . . . . . 84 7-11 Port B Data Register (PORTB) . . . . . . . . . . . . . . . . . . . . . . . . . 85 7-12 Port B Data Direction Register (DDRB) . . . . . . . . . . . . . . . . . . 85 7-13 Port PC0/SCK Circuitry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 7-14 PC1/SDO Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7-15 PC2/SDI Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7-16 PC3/IRQ Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 7-17 Port C Data Register (PORTC). . . . . . . . . . . . . . . . . . . . . . . . . 93 7-18 Port C Data Direction Register (DDRC) . . . . . . . . . . . . . . . . . . 93 7-19 Resistor Control Register 1 (RCR1) . . . . . . . . . . . . . . . . . . . . 101 7-20 Resistor Control Register 2 (RCR2) . . . . . . . . . . . . . . . . . . . . 102 7-21 Wired-OR Mode Register (WOM). . . . . . . . . . . . . . . . . . . . . . 103 8-1 8-2 8-3 8-4 8-5 9-1 9-2 9-3 9-4 9-5 9-6 9-7 10-1 10-2 10-3 10-4 10-5 Technical Data 18 List of Figures For More Information On This Product, Go to: www.freescale.com OSC1, OSC2, XOSC1, and XOSC2 Mask Options . . . . . . . . 108 Unused XOSC1 Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 Clock Signal Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Miscellaneous Register (MISC) . . . . . . . . . . . . . . . . . . . . . . .113 Clock State and STOP/POD Delay Diagram . . . . . . . . . . . . . 115 Remote Control Carrier Output Port Control (RPOL = 1) . . . . 122 Remote Control Carrier Output Port Control (RPOL = 0) . . . . 122 Remote Control Carrier Duty Control . . . . . . . . . . . . . . . . . . . 122 Buzzer Tone Output Control . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Time Base Control Register 1 (TBCR1) . . . . . . . . . . . . . . . . . 124 Time Base Control Register 2 (TBCR2) . . . . . . . . . . . . . . . . . 125 Time Base Control Register 3 (TBCR3) . . . . . . . . . . . . . . . . . 127 SPI Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 SPI Control Register (SPCR) . . . . . . . . . . . . . . . . . . . . . . . . . 135 SPI Status Register (SPSR) . . . . . . . . . . . . . . . . . . . . . . . . . . 137 SPI Data Register (SPDR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Clock/Data Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. List of Figures Figure 11-1 11-2 11-3 11-4 11-5 11-6 11-7 11-8 11-9 11-10 11-11 11-12 11-13 11-14 11-15 Title Page Freescale Semiconductor, Inc... LCD Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 LCD Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 BP0/FC Clock Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 LCD Data Registers (LDAT1-LDAT13) . . . . . . . . . . . . . . . . . 148 1/3 Duty LCD Backplane Driver Waveforms. . . . . . . . . . . . . .150 1/4 Duty LCD Backplane Driver Waveforms. . . . . . . . . . . . . .151 1/3 Duty LCD Frontplane Driver Waveforms . . . . . . . . . . . . . 152 1/4 Duty LCD Frontplane Driver Waveforms . . . . . . . . . . . . . 153 1/3 Duty Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 BP0-BP2 and FP0-FP2 Output Waveforms . . . . . . . . . . . . . 155 F Segment Potential Waveform . . . . . . . . . . . . . . . . . . . . . . .156 E Segment Electric Potential Waveform. . . . . . . . . . . . . . . . . 156 Waveform Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Time Base Control Register 1 (TBCR1) . . . . . . . . . . . . . . . . . 158 Simplified LCD Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 12-1 A/D Status and Control Register (ADSC) . . . . . . . . . . . . . . . . 165 12-2 A/D Conversion Value Data Register (ADDR) . . . . . . . . . . . . 167 13-1 13-2 13-3 13-4 13-5 13-6 13-7 Event Counter Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . 170 Event Counter Status/Control Register (EVSC) . . . . . . . . . . . 171 Event Counter Timing Register (EVTR) . . . . . . . . . . . . . . . . . 172 Event Counter Input Timing Example . . . . . . . . . . . . . . . . . . .172 Event Counter Gate Signal Timing Example . . . . . . . . . . . . . 174 Event Counter Data High Register (EVDH) . . . . . . . . . . . . . . 176 Event Counter Data Low Register (EVDL) . . . . . . . . . . . . . . . 176 MC68HC05L25 -- Rev. 3.0 MOTOROLA List of Figures For More Information On This Product, Go to: www.freescale.com Technical Data 19 Freescale Semiconductor, Inc. List of Figures Freescale Semiconductor, Inc... Technical Data 20 List of Figures For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 List of Tables Table 1-1 1-2 1-3 6-1 7-1 7-2 7-3 7-4 7-5 7-6 7-7 7-8 7-9 7-10 7-11 7-12 7-13 8-1 8-2 8-3 8-4 9-1 9-2 9-3 9-4 9-5 Title Page Freescale Semiconductor, Inc... Mask Option Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 48-Pin VQFP Pin Configurations . . . . . . . . . . . . . . . . . . . . . . . 28 52-Pin TQFT Pin Configurations. . . . . . . . . . . . . . . . . . . . . . . .30 Vector Address for Interrupts and Reset . . . . . . . . . . . . . . . . . 61 PA0-PA2/KWI0-KWI2 I/O Pin Functions . . . . . . . . . . . . . . . . . 78 PA3/KWI3/BZ I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . .79 PA4/AD0/EVI I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . .80 PA5/AD1 I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 PA6/RMO I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 PA7 I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 PB0-PB3/FP24-FP21 I/O Pin Functions . . . . . . . . . . . . . . . . . 87 PB4-PB7/FP20-FP17 I/O Pin Functions . . . . . . . . . . . . . . . . . 87 PC0/SCK I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 PC1/SDO I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 PC2/SDI I/O Pin Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 PC3/IRQ I/O Pin Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Port Control Register Bits Summary. . . . . . . . . . . . . . . . . . . . 100 System Bus Frequency Selection. . . . . . . . . . . . . . . . . . . . . . 106 CPU Startup Time Requirements . . . . . . . . . . . . . . . . . . . . . . 110 Recovery Time Requirements . . . . . . . . . . . . . . . . . . . . . . . . 113 System Bus Frequency Selection. . . . . . . . . . . . . . . . . . . . . . 114 LCD Clock Frequency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Time Base Interrupt Frequency . . . . . . . . . . . . . . . . . . . . . . .119 COP Timeout Period. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Remote Carrier Frequency Selection . . . . . . . . . . . . . . . . . . .121 Buzzer Frequency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 MC68HC05L25 -- Rev. 3.0 MOTOROLA List of Tables For More Information On This Product, Go to: www.freescale.com Technical Data 21 Freescale Semiconductor, Inc. List of Tables Table Title Page 11-1 RLCD Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 11-2 LCD Waveform Base Clock Frequency . . . . . . . . . . . . . . . . . 158 12-1 13-1 13-2 A/D Multiplexer Input Channel Assignments . . . . . . . . . . . . . 166 Measurement Time Nibble . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Wait Time Nibble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . 182 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . .183 Jump and Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . 185 Bit Manipulation Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . 186 Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Opcode Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Freescale Semiconductor, Inc... 14-1 14-2 14-3 14-4 14-5 14-6 14-7 Technical Data 22 List of Tables For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 1. General Description 1.1 Contents 1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Mask Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 MCU Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Freescale Semiconductor, Inc... 1.3 1.4 1.5 1.6 Functional Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.1 VDD and VSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.2 VLCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.3 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.4 OSC1 and OSC2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.6.4.1 Crystal or Ceramic Resonator . . . . . . . . . . . . . . . . . . . . . 32 1.6.4.2 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 1.6.5 XOSC1 and XOSC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.6.5.1 Crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.6.5.2 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 1.6.5.3 XOSC Not Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1.6.6 PA0-PA2/KWI0-KWI2, PA3/KWI3/BZ, PA4/AD0/EVI, PA5/ADI, PA6/RMO, and PA7 . . . . . . . . 34 1.6.7 PB0-PB7/FP24-FP17. . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 1.6.8 PC0/SCK, PC1/SDO, PC2/SDI, and PC3/IRQ . . . . . . . . . .35 1.6.9 BP3/FP0, FP1-FP18, and PB0-PB7/FP24-FP17 . . . . . . . 35 1.6.10 BP0-BP2 and BP3/FP0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 1.2 Introduction The Motorola MC68HC05L25 is a member of M68HC05 Family of low-cost microcontroller units (MCUs). A functional block diagram of the MC68HC05L25 is shown in Figure 1-1. MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 23 Freescale Semiconductor, Inc. General Description 1.3 Features * * * * * Low-Cost, HC05 Core 48-Pin Quad Flat Pack (VQFP) and 52-Pin Quad Flat Pack (TQFP) 6160 Bytes of User ROM, Including 16 Bytes of User Vectors 176 Bytes of User RAM 24 x 4 or 25 x 3 Multiplexed Liquid Crystal Display (LCD) Driver Serial Peripheral Interface (SPI) Two-Channel Analog-to-Digital (A/D) Converter 16-Bit Event Counter Time Base Timer Computer Operating Properly (COP) Watchdog Timer Infrared (IR) Remote Carrier Output (Software Selectable 33-to-67 Percent or 50-to-50 Percent Duty) Buzzer Output (Software-Selectable Frequencies) 20 Bidirectional Input/Output (I/O) Lines, Including: - Four Key Wakeup Input Lines - Software-Programmable Pullups - Software-Programmable Open-Drain Lines - High-Current (20 mA) Lines Software-Selectable Sensitivity on IRQ Interrupt (Edge- and Level-Sensitive or Edge-Sensitive Only) STOP Instruction Disable Option On-Chip Dual 4-MHz/32-kHz (Typical) Oscillator Circuits Single-Chip, Self-Check, and Test Modes Power-Saving Stop and Wait Modes Freescale Semiconductor, Inc... * * * * * * * * * * * * * Technical Data 24 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. General Description Mask Options 1.4 Mask Options Table 1-1 shows the mask programmable options available on the MC68HC05L25. Table 1-1. Mask Option Selection Name Selection Description RESET pin pullup resistor RSTR RE RD RESET pullup resistor enable (connected) RESET pullup resistor disable (not connected) OSC feedback resistor OSCR OE OD OSC feedback resistor enable (connected) OSC feedback resistor disable (not connected) XOSC feedback/ damping resistor XOSCR XE XD XOSC feedback and damping resistor enable (both connected) XOSC feedback and damping resistor disable (both not connected) STOP instruction STOPE SE SD STOP instruction enable (STOP instruction operates normally) STOP instruction disable (executing STOP will not halt OSC clock) Freescale Semiconductor, Inc... 1.5 MCU Structure The overall block diagram of the MC68HC05L25 is shown in Figure 1-1. MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 25 Freescale Semiconductor, Inc. General Description OSC1 OSC2 KEY WAKEUP OSCILLATOR SEL /2 INTERNAL PROCESSOR CLOCK TIME BASE SYSTEM (RMO/BZ) PA0/KWI0 DATA DIRECTION REGISTER PA1/KWI1 PA2/KWI2 PORT A PA3/KWI3/BZ PA4/AD0/EVI PA5/AD1 PA6/RMO PA7 XOSC1 XOSC2 OSCILLATOR COP SYSTEM Freescale Semiconductor, Inc... PORT C CPU CONTROL M68HC05 CPU CPU REGISTERS ALU SPI DATA DIR REG RESET ADC EVI PC0/SCK PC1/SDO PC2/SDI PC3/IRQ ACCUMULATOR INDEX REGISTER DATA DIRCTION REGISTER STACK POINTER PB0/FP24 PB1/FP23 PB2/FP22 PORT B PB3/FP21 PB4/FP20 PB5/FP19 PB6/FP18 PB7/FP17 SRAM -- 176 BYTES 16 SELF-CHECK ROM 240 BYTES LCD DRIVERS ROM 6160 BYTES 4 PROGRAM COUNTER CONDITION CODE REG V DD V SS FP1-FP16 BP 0-BP3 V LCD Figure 1-1. MC68HC05L25 Block Diagram Technical Data 26 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. General Description Functional Pin Description 1.6 Functional Pin Description NOTE: A line over a signal name indicates an active low signal. For example, RESET is active high and RESET is active low. Any reference to voltage, current, resistance, capacitance, time, or frequency specified in the following paragraphs will refer to the nominal values. The exact values and their tolerance or limits are specified in Section 15. Electrical Specifications. The MC68HC05L25 is available in the 48-pin VQFP and 52-pin TQFP. The pin assignments for the 48-pin VQFP are shown in Figure 1-2 and Table 1-2. Freescale Semiconductor, Inc... FP10 FP11 FP12 FP13 FP14 FP15 FP16 48 47 46 45 44 43 42 41 40 39 38 37 FP4 FP3 FP2 FP1 BP3/FP0 BP2 BP1 BP0 VLCD OSC1 OSC2 VDD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 36 35 34 33 PB7/FP17 PB6/FP18 PB5/FP19 PB4/FP20 PB3/FP21 PB2/FP22 PB1/FP23 PB0/FP24 PC3/IRQ PC2/SDI PC1/SDO PC0/SCK Figure 1-2. 48-Pin VQFP Single-Chip Mode Pinout FP5 XOSC2 FP6 XOSC1 FP7 VSS MC68HC05L25 48-PIN VQFP FP8 RESET FP9 PA0/KWI0 32 31 30 29 28 27 26 25 PA1/KWI1 PA3/KWI3/BZ PA4/AD0/EVI PA5/AD1 PA6/RMO PA7 PA2/KWI2 MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 27 Freescale Semiconductor, Inc. General Description Table 1-2 summarizes the 48-pin VQFP pin configurations. Table 1-2. 48-Pin VQFP Pin Configurations Pin No. 10 11 12 13 Pin Name OSC1 OSC2 VDD XOSC2 XOSC1 VSS RESET PA0/KWI0 PA1/KWI1 PA2/KWI2 PA3/KWI3/BZ PA4/AD0/EVI PA5/AD1 PA6/RMO PA7 PC0/SCK PC1/SDO PC2/SDI PC3/IRQ I/O I O DC O I DC I I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O Pin No. 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 1 2 3 4 5 6 7 8 9 Pin Name PB0/FP24 PB1/FP23 PB2/FP22 PB3/FP21 PB4/FP20 PB5/FP19 PB6/FP18 PB7/FP17 FP16 FP15 FP14 FP13 FP12 FP11 FP10 FP9 FP8 FP7 FP6 FP5 FP4 FP3 FP2 FP1 BP3/FP0 BP2 BP1 BP0 VLCD I/O I/O I/O I/O I/O I/O I/O I/O I/O O O O O O O O O O O O O O O O O O O O O DC Freescale Semiconductor, Inc... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Technical Data 28 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. General Description Functional Pin Description The pin assignments for the 52-pin TQFP are shown in Figure 1-3 and Table 1-3. FP10 FP11 FP12 FP13 FP14 FP15 FP16 52 51 50 49 48 47 46 45 44 43 42 41 40 FP4 FP3 FP2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 39 38 37 36 35 N.C. PB7/FP17 PB6/FP18 PB5/FP19 PB4/FP20 PB3/FP21 PB2/FP22 PB1/FP23 PB0/FP24 PC3/IRQ PC2/SDI PC1/SDO PC0/SCK N.C. FP5 FP6 FP7 FP8 FP9 Freescale Semiconductor, Inc... FP1 BP3/FP0 BP2 BP1 BP0 VLCD OSC1 OSC2 VDD N.C. MC68HC05L25 52-PIN TQFP 34 33 32 31 30 29 28 27 Figure 1-3. 52-Pin TQFP Single-Chip Mode Pinout XOSC2 XOSC1 VSS RESET PA0/KWI0 PA1/KWI1 PA3/KWI3/BZ PA4/AD0/EVI PA5/AD1 PA6/RMO PA7 N.C. PA2/KWI2 MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 29 Freescale Semiconductor, Inc. General Description Table 1-3 summarizes the 52-pin VQFP pin configurations. Table 1-3. 52-Pin TQFT Pin Configurations Pin No. 10 11 12 14 Pin Name OSC1 OSC2 VDD XOSC2 XOSC1 VSS RESET PA0/KWI0 PA1/KWI1 PA2/KWI2 PA3/KWI3/BZ PA4/AD0/EVI PA5/AD1 PA6/RMO PA7 PC0/SCK PC1/SDO PC2/SDI PC3/IRQ I/O I O DC O I DC I I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O Pin No. 31 32 33 34 35 36 37 38 40 41 42 43 44 45 46 47 48 49 50 51 1 2 3 4 5 13 26 39 52 N.C. N.C. N.C. N.C. 6 7 8 9 Pin Name PB0/FP24 PB1/FP23 PB2/FP22 PB3/FP21 PB4/FP20 PB5/FP19 PB6/FP18 PB7/FP17 FP16 FP15 FP14 FP13 FP12 FP11 FP10 FP9 FP8 FP7 FP6 FP5 FP4 FP3 FP2 FP1 BP3/FP0 BP2 BP1 BP0 VLCD I/O I/O I/O I/O I/O I/O I/O I/O I/O O O O O O O O O O O O O O O O O O O O O DC Freescale Semiconductor, Inc... 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 Technical Data 30 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. General Description Functional Pin Description The following paragraphs describe the general function of each pin. 1.6.1 VDD and VSS Power is supplied to the MCU through VDD and VSS. VDD is the positive supply, and VSS is ground. The MCU operates from a single power supply. Very fast signal transitions occur on the MCU pins. The short rise and fall times place very high short-duration current demands on the power supply. To prevent noise problems, special care should be taken to provide good power supply bypassing at the MCU by using bypass capacitors with good high-frequency characteristics that are positioned as close to the MCU as possible. Bypassing requirements vary, depending on how heavily the MCU pins are loaded. Freescale Semiconductor, Inc... 1.6.2 VLCD This pin provides an offset to the LCD driver bias for adjusting the contrast of LCD. See Section 11. LCD Driver for additional information. 1.6.3 RESET This pin can be used as an input to reset the MCU to a known startup state by pulling it to the low state. The RESET pin contains a steering diode to discharge any voltage on the pin to VDD when the power is removed. The RESET pin contains an internal Schmitt trigger to improve its noise immunity as an input. Refer to Section 5. Resets. 1.6.4 OSC1 and OSC2 The OSC1 and OSC2 pins are the connections for the 2-pin on-chip oscillator. The OSC1 and OSC2 pins can accept these sets of components: 1. A crystal or ceramic resonator as shown in Figure 1-4(a) 2. An external clock signal as shown in Figure 1-4(b) MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 31 Freescale Semiconductor, Inc. General Description MCU MASK OPTION ROF MCU OSC1 OSC2 4 MHz (TYPICAL) OSC1 OSC2 UNCONNECTED CO1 CO2 EXTERNAL CLOCK (a) Crystal Connections (b) External Clock Source Connection Freescale Semiconductor, Inc... Figure 1-4. Oscillator Connections The frequency, fOSC, of the oscillator or external clock source is divided by two to produce the internal operating frequency, fOP, by default. 1.6.4.1 Crystal or Ceramic Resonator The circuit in Figure 1-4(a) shows a typical 2-pin oscillator circuit for an AT-cut, parallel, resonant crystal. The crystal manufacturer's recommendations should be followed, since the crystal parameters determine the external component values required to provide maximum stability and reliable startup. The load capacitance values used in the oscillator circuit design should include all stray capacitances. The crystal and components should be mounted as close as possible to the pins for startup stabilization and to minimize output distortion. An internal startup feedback resistor of ROF between OSC1 and OSC2 can be selected as a mask option. 1.6.4.2 External Clock An external clock from another CMOS-compatible device can be connected to the OSC1 input, with the OSC2 output not connected, as shown in Figure 1-4(b). This configuration is possible regardless of the oscillator setup. Technical Data 32 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. General Description Functional Pin Description 1.6.5 XOSC1 and XOSC2 The XOSC1 and XOSC2 pins are the connections for the 2-pin on-chip oscillator. The XOSC1 and XOSC2 pins can accept these sets of components: 1. A crystal as shown in Figure 1-5(a) 2. An external clock signal as shown in Figure 1-5(b) MCU Freescale Semiconductor, Inc... MASK OPTION RXOF MCU RXOD XOSC1 XOSC2 XOSC1 XOSC2 32.768 kHz (TYP) UNCONNECTED CXO1 CXO2 EXTERNAL CLOCK (a) Crystal Connections (b) External Clock Source Connection Figure 1-5. Oscillator Connections The frequency, fXOSC, of the oscillator or external clock source is divided by two to produce the internal operating frequency, fOP, if selected by SYS1:SYS0 bits. 1.6.5.1 Crystal The circuit in Figure 1-5(a) shows a typical 2-pin oscillator circuit for a 32.768-kHz "watch" crystal. The crystal manufacturer's recommendations should be followed, since the crystal parameters determine the external component values required to provide maximum stability and reliable startup. The load capacitance values used in the oscillator circuit design should include all stray capacitances. The crystal and components should be mounted as close as possible to the pins for start-up stabilization and to minimize output distortion. An internal startup feedback resistor of Rxof between XOSC1 and XOSC2 and a MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 33 Freescale Semiconductor, Inc. General Description damping resistor of Rxod in series to XOSC2 can be selected as a mask option. 1.6.5.2 External Clock As shown in Figure 1-5(b), an external clock from another CMOS-compatible device can be connected to the XOSC1 input (with the XOSC2 output not connected). This configuration is possible regardless of the oscillator setup. Freescale Semiconductor, Inc... 1.6.5.3 XOSC Not Used When XOSC is not used, the XOSC1 pin must be connected to the RESET pin to assure proper initialization of the clock circuitry. XOSC2 pin should remain unconnected. 1.6.6 PA0-PA2/KWI0-KWI2, PA3/KWI3/BZ, PA4/AD0/EVI, PA5/ADI, PA6/RMO, and PA7 Port A is an 8-bit I/O port. The state of any pin is software programmable and all port A lines are configured as inputs during power-on or reset. Bits 0 through 3 are shared with the key wakeup subsystem, and bit 3 also is shared with the buzzer subsystem. Bit 4 is shared with the A/D converter and event counter. Bit 5 is shared with the A/D converter. Bit 6 is shared with the infrared (IR) remote output. See Section 7. Input/Output Ports (I/O) for more details on the I/O ports. 1.6.7 PB0-PB7/FP24-FP17 These eight I/O lines comprise port B. The state of any pin is software programmable, and all bits are configured as LCD output during power-on or reset. These bits are shared with LCD frontplane drivers. See Section 7. Input/Output Ports (I/O) for more details on the I/O ports. Technical Data 34 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. General Description Functional Pin Description 1.6.8 PC0/SCK, PC1/SDO, PC2/SDI, and PC3/IRQ These four I/O lines comprise port C. Bits 0 through 2 are shared with the SPI subsystem. Bit 3 is shared with the IRQ input. The state of any pin is software programmable, and all port C lines are configured as port inputs during power-on or reset. Each port C pin can be configured with a pullup resistor by a software option. SPI output pins SCK and SDO can be configured as open-drain outputs by a software option. See Section 7. Input/Output Ports (I/O) for more details on the I/O ports. The PC3/IRQ pin is used for special mode entry. Do not apply voltages above VDD for normal single-chip mode operation. See Section 15. Electrical Specifications for more details. Freescale Semiconductor, Inc... 1.6.9 BP3/FP0, FP1-FP18, and PB0-PB7/FP24-FP17 The LCD display has 25 frontplane drivers. Frontplanes 17 through 24 are shared with port B bits 7 through 0, respectively. Frontplane 0 is shared with backplane 3. See Section 11. LCD Driver for additional information. 1.6.10 BP0-BP2 and BP3/FP0 The LCD display has four backplane drivers. Backplane 3 is multiplexed with frontplane 0. See Section 11. LCD Driver for additional information. MC68HC05L25 -- Rev. 3.0 MOTOROLA General Description For More Information On This Product, Go to: www.freescale.com Technical Data 35 Freescale Semiconductor, Inc. General Description Freescale Semiconductor, Inc... Technical Data 36 General Description For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 2. Memory Map 2.1 Contents 2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Freescale Semiconductor, Inc... 2.3 Input/Output and Control Registers . . . . . . . . . . . . . . . . . . . . . 38 2.3.1 Read/Write Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 2.3.2 Read-Only Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.3 Write-Only Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.4 Reserved Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.5 Reset Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.3.6 Option Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.3.7 Random-Access Memory (RAM). . . . . . . . . . . . . . . . . . . . . 40 2.4 Read-Only Memory (ROM). . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.2 Introduction When the MC68HC05L25 is in the single-chip mode, 80 bytes of input/output (I/O) registers, 176 bytes of user RAM (including a 64-byte stack), 6144 bytes of user ROM, and 16 bytes of user vectors are available in the 8-K memory map as shown in Figure 2-1. MC68HC05L25 -- Rev. 3.0 MOTOROLA Memory Map For More Information On This Product, Go to: www.freescale.com Technical Data 37 Freescale Semiconductor, Inc. Memory Map $0000 I/O 64 BYTES $003F $0040 $004F $0050 $00BF $00C0 $00FF $0100 0000 DUAL MAPPED I/O REGISTERS 16 BYTES (SEE Figure 2-2.) $0000 $000F $0010 UNIMPLEMENTED 16 BYTES USER RAM 176 BYTES 0063 0064 0079 0080 I/O REGISTERS 48 BYTES (SEE Figure 2-2.) $003F 0191 STACK 0192 64 BYTES 0255 0256 TIME BASE VECTOR (HIGH BYTE) TIME BASE VECTOR (LOW BYTE) $1FF0 $1FF1 $1FF2 $1FF3 $1FF4 $1FF5 $1FF6 $1FF7 $1FF8 $1FF9 $1FFA $1FFB $1FFC $1FFD $1FFE $1FFF Freescale Semiconductor, Inc... UNIMPLEMENTED 1536 BYTES SPI VECTOR (HIGH BYTE) SPI VECTOR (LOW BYTE) EVENT CNTR VECTOR (HIGH BYTE) EVENT CNTR VECTOR (LOW BYTE) $06FF $0700 1791 1792 RESERVED RESERVED KEY WAKEUP VECTOR (HIGH BYTE) USER ROM 6144 BYTES KEY WAKEUP VECTOR (LOW BYTE) IRQ VECTOR (HIGH BYTE) IRQ VECTOR (LOW BYTE) $1EFF $1F00 $1FEF $1FF0 $1FFF TEST ROM AND VECTORS 240 BYTES USER VECTORS 16 BYTES 7935 7936 8175 8176 8191 SWI VECTOR (HIGH BYTE) SWI VECTOR (LOW BYTE) RESET VECTOR (HIGH BYTE) RESET VECTOR (LOW BYTE) Figure 2-1. MC68HC05L25 Single-Chip Mode Memory Map 2.3 Input/Output and Control Registers The I/O and control registers reside in locations $0000 through $003F. A summary of these registers is shown in Figure 2-3. The bit assignments for each register are shown in Figure 2-4. Reading from unimplemented bits (denoted with --) will return unknown states (unless explicitly defined to read 0), and writing to unimplemented bits will have no effect. See also Figure 2-2. Technical Data 38 Memory Map For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Memory Map Input/Output and Control Registers Register Address (Main map unless otherwise specified) Register Name (Full) Read Read: Time Base Control Register 2 Write: (TBCR2) Reset: Bit Name (Mnemonic) Read-Only Bit TBIF -- 0 TBIE 0 TBR1 1 Reserved Bit TBR0 1 0 RTBIF 0 0 -- 0 COPE 0 0 COPC 0 $0011 Freescale Semiconductor, Inc... Write Register Name (Mnemonic) Reset Value Read/Write Bit Write-Only Bit Figure 2-2. Register Description Key 2.3.1 Read/Write Bits Read/write bits are typically control bits. They are, in general, not modified by a module. Reset: indicates the initial value of the latch. 2.3.2 Read-Only Bits Read-only bits are status flag bits. They are indicators of module status. Reset: indicates the value that will be read immediately after system reset or before the module is enabled. 2.3.3 Write-Only Bits Write-only bits are control bits. They typically return a state of 0 to prevent an inadvertent write to this bit by a READ-MODIFY-WRITE instruction. Reset: indicates the value that will be read immediately after system reset, which is the forced read value (typically 0). 2.3.4 Reserved Bits Reserved bits are read-only bits that typically read 0. Writes to these bits are ignored, and the user should not write 1 for future compatibility. Reset: indicates the value that will be read immediately after system reset which is the forced read value of 0, typically. MC68HC05L25 -- Rev. 3.0 MOTOROLA Memory Map For More Information On This Product, Go to: www.freescale.com Technical Data 39 Freescale Semiconductor, Inc. Memory Map 2.3.5 Reset Value Values specified on the row marked Reset: are initial values of register bits after system reset. Those bits unaffected by reset are marked with the letter U. Those bits that are unaffected by reset but initialized by power-on reset are marked with an asterisk (*). 2.3.6 Option Map Freescale Semiconductor, Inc... Address locations $0000 through $000F are dual mapped. When the OPTM bit in the MISC register is cleared, the main address map is accessed. When the OPTM bit in the MISC register is set, the option address map is accessed. NOTE: Although not necessary for this device, the OPTM bit should be cleared when accessing memory locations $0010 and above for future compatibility. 2.3.7 Random-Access Memory (RAM) The user RAM consists of 176 bytes (including the stack) at locations $0050 through $00FF. The stack can access 64 locations beginning at address $00FF and proceeding down to $00C0. NOTE: Using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. 2.4 Read-Only Memory (ROM) This chip has a total of 6160 bytes of ROM. These are implemented as 6144 bytes of user ROM at locations $0700 through $1EFF and 16 bytes of user vectors at locations $1FF0 through $1FFF. A total of 240 bytes of test ROM and vectors is located from $1F00 through $1FEF. Technical Data 40 Memory Map For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Memory Map Read-Only Memory (ROM) Address $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 Name (Main Map Registers) Port A Data Register Port B Data Register Port C Data Register Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Interrupt Control Register Interrupt Status Register Serial Peripheral Control Register Serial Peripheral Status Register Serial Peripheral Data Register Unimplemented Unimplemented Unimplemented Time Base Control Register 1 Time Base Control Register 2 Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented A/D Data Register A/D Control/Status Register Time Base Control Register 3 LCD Control Register LCD Data Register 1 LCD Data Register 2 LCD Data Register 3 LCD Data Register 4 LCD Data Register 5 LCD Data Register 6 LCD Data Register 7 Address $0028 $0029 $002A $002B $002C $002D $002E $002F $0030 $0031 $0032 $0033 $0034 $0035 $0036 $0037 $0038 $0039 $003A $003B $003C $003D $003E $003F OPTN Address $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000A $000B $000C $000D $000E $000F LCD Data Register 8 LCD Data Register 9 Name LCD Data Register 10 LCD Data Register 11 LCD Data Register 12 LCD Data Register 13 Event Counter Control/Status Register Event Counter Timing Register Event Counter Data High Register Event Counter Data Low Register Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Miscellaneous Register Unimplemented Name (Option Map Registers) Port A Data Direction Register Port B Data Direction Register Port C Data Direction Register Unimplemented Unimplemented Unimplemented Unimplemented Unimplemented Resistor Control Register Resistor Control Register Wired-OR Mode Register Unimplemented Unimplemented Unimplemented Key Wakeup Input Enable Register Mask Option Status Register Freescale Semiconductor, Inc... $000A $000B $000C $000D $000E $000F $0010 $0011 $0012 $0013 $0014 $0015 $0016 $0017 $0018 $0019 $001A $001B $001C $001D $001E $001F $0020 $0021 $0022 $0023 $0024 $0025 $0026 $0027 Figure 2-3. I/O Register Memory Map Summary MC68HC05L25 -- Rev. 3.0 MOTOROLA Memory Map For More Information On This Product, Go to: www.freescale.com Technical Data 41 Freescale Semiconductor, Inc. Memory Map Addr. Register Name Port A Data Register Read: (PORTA) Write: See page 75. Reset: Port B Data Register Read: (PORTB) Write: See page 85. Reset: Port C Data Register Read: (PORTC) Write: See page 93. Reset: Unimplemented Unimplemented Interrupt Control Register Read: (INTCR) Write: See page 64. Reset: Interrupt Status Register Read: (INTSR) Write: See page 65. Reset: Serial Peripheral Control Register Read: (SPCR) Write: See page 135. Reset: Serial Peripheral Status Register Read: (SPSR) Write: See page 137. Reset: Serial Peripheral Data Register Read: (SPDR) Write: See page 138. Reset: Unimplemented Unimplemented Bit 7 PA7 6 PA6 5 PA5 4 PA4 3 PA3 2 PA2 1 PA1 Bit 0 PA0 $0000 Unaffected by reset PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 $0001 Unaffected by reset 0 0 0 0 0 0 0 0 PC3 U PC2 U PC1 U PC0 U Freescale Semiconductor, Inc... $0002 $0003 $0007 $0008 IRQE 0 IRQF 0 SPIE 0 SPIF 0 SPD7 0 0 0 0 SPE 0 DCOL 0 SPD6 0 0 0 0 DORD 0 0 0 SPD5 KWIE 0 KWIF 0 MSTR 0 0 0 SPD4 IRQS 0 0 RIRQ 0 0 0 0 0 SPD3 0 0 0 0 0 0 0 0 SPD2 0 0 0 0 0 0 0 0 SPD1 0 0 0 RKWIF 0 SPR 0 0 0 SPD0 $0009 $000A $000B $000C $000D $000F Unaffected by reset = Unimplemented R = Reserved U = Unaffected Figure 2-4. I/O Registers (Sheet 1 of 3) Technical Data 42 Memory Map For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Memory Map Read-Only Memory (ROM) Addr. Register Name LCD Control Register Read: (LCDCR) Write: See page 144. Reset: LCD Data Register Read: (LDAT1) Write: See page 148. Reset: LCD Data Register Read: (LDAT2) Write: See page 148. Reset: LCD Data Register Read: (LDAT3) Write: See page 148. Reset: LCD Data Register Read: (LDAT4) Write: See page 148. Reset: LCD Data Register Read: (LDAT5) Write: See page 148. Reset: Bit 7 LCDE 0 F1B3 6 PBEH 0 F1B2 5 DUTY 0 F1B1 4 PBEL 0 F1B0 3 0 0 F0B3 2 0 0 F0B2 1 FC 0 F0B1 Bit 0 LC 0 F0B0 $0020 $0021 Unaffected by reset F3B3 F3B2 F3B1 F3B0 F2B3 F2B2 F2B1 F2B0 $0022 Freescale Semiconductor, Inc... Unaffected by reset F5B3 F5B2 F5B1 F5B0 F4B3 F4B2 F4B1 F4B0 $0023 Unaffected by reset F7B3 F7B2 F7B1 F7B0 F6B3 F6B2 F6B1 F6B0 $0024 Unaffected by reset F9B3 F9B2 F9B1 F9B0 F8B3 F8B2 F8B1 F8B0 $0025 Unaffected by reset F11B2 F11B1 F11B0 F10B3 F10B2 F10B1 F10B0 $0026 LCD Data Register Read: F11B3 (LDAT6) Write: See page 148. Reset: LCD Data Register Read: F13B3 (LDAT7) Write: See page 148. Reset: LCD Data Register Read: F15B3 (LDAT8) Write: See page 148. Reset: LCD Data Register Read: F17B3 (LDAT9) Write: See page 148. Reset: Unaffected by reset F13B2 F13B1 F13B0 F12B3 F12B2 F12B1 F12B0 $0027 Unaffected by reset F15B2 F15B1 F15B0 F14B3 F14B2 F14B1 F14B0 $0028 Unaffected by reset F17B2 F17B1 F17B0 F16B3 F16B2 F16B1 F16B0 $0029 Unaffected by reset = Unimplemented R = Reserved U = Unaffected Figure 2-4. I/O Registers (Sheet 2 of 3) MC68HC05L25 -- Rev. 3.0 MOTOROLA Memory Map For More Information On This Product, Go to: www.freescale.com Technical Data 43 Freescale Semiconductor, Inc. Memory Map Addr. Register Name Bit 7 6 F19B2 5 F19B1 4 F19B0 3 F18B3 2 F18B2 1 F18B1 Bit 0 F18B0 $002A LCD Data Register Read: F19B3 (LDAT10) Write: See page 148. Reset: LCD Data Register Read: F21B3 (LDAT11) Write: See page 148. Reset: LCD Data Register Read: F23B3 (LDAT12) Write: See page 148. Reset: LCD Data Register Read: (LDAT13) Write: See page 148. Reset: 0 Unaffected by reset F21B2 F21B1 F21B0 F20B3 F20B2 F20B1 F20B0 $002B Unaffected by reset F23B2 F23B1 F23B0 F22B3 F22B2 F22B1 F22B0 $002C Freescale Semiconductor, Inc... Unaffected by reset 0 0 0 F24B3 F24B2 F24B1 F24B0 $002D Unaffected by reset EVIE EVOE EVIF EVOF 0 RCCF 0 ROIF 0 $002E Event Control Status/Counter Read: EVCE Register (EVSCR) Write: See page 61. Reset: Event Counter Timing Register Read: (EVTR) Write: See page 172. Reset: Event Counter Data Register High Read: (EVDH) Write: See page 176. Reset: Event Counter Data Register Low Read: (EVDL) Write: See page 176. Reset: Unimplemented Unimplemented Miscellaneous Register Read: (MISC) Write: See page 113. Reset: Reserved FTUP WT3 $002F WT2 WT1 WT0 MT3 MT2 MT1 MT0 BIT15 0 BIT7 0 BIT14 0 BIT6 0 BIT13 0 BIT5 0 BIT12 0 BIT4 0 BIT11 0 BIT3 0 BIT10 0 BIT2 0 BIT9 0 BIT1 0 BIT8 0 BIT0 0 $0030 $0031 $0032 $003D STUP 0 0 SYS1 0 R SYS0 0 R FOSCE 1 R OPTM 0 R $003E U R U R 0 R 0 R $003F = Unimplemented R = Reserved U = Unaffected Figure 2-4. I/O Registers (Sheet 3 of 3) Technical Data 44 Memory Map For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 3. Operating Modes 3.1 Contents 3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Single-Chip Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Freescale Semiconductor, Inc... 3.3 3.4 Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4.1 STOP Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4.2 WAIT Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.5 COP Watchdog Timer Considerations . . . . . . . . . . . . . . . . . . .48 3.2 Introduction The MC68HC05L25 has three modes of operation that affect the pinout and architecture of the MCU: single-chip mode, internal test mode, and expanded test mode. The single-chip mode normally will be used, while the test modes are required for the special needs of production test and burn-in. 3.3 Single-Chip Mode Single-chip mode allows the MCU to function as a self-contained microcontroller with maximum use of the pins for on-chip peripheral functions. The pinout for the single-chip mode is shown in Figure 1-2 and Figure 1-3. In single-chip mode, all address and data activity occurs within the MCU and is not available externally. MC68HC05L25 -- Rev. 3.0 MOTOROLA Operating Modes For More Information On This Product, Go to: www.freescale.com Technical Data 45 Freescale Semiconductor, Inc. Operating Modes 3.4 Low-Power Modes In each of its configuration modes, the MC68HC05L25 is capable of running in one of two low-power operational modes. The WAIT and STOP instructions provide two modes that reduce the power required for the MCU by stopping various internal clocks and/or the on-chip oscillator. The STOP and WAIT instructions are not normally used if the COP watchdog timer is enabled. The flow of the stop and wait modes is shown in Figure 3-1. Freescale Semiconductor, Inc... 3.4.1 STOP Instruction Execution of 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 except the time base/COP watchdog timer, if it is enabled and clocked from XOSC. Execution of the STOP instruction automatically clears the I bit in the condition code register. All other registers and memory remain unaltered. All input/output lines remain unchanged. Therefore, unused ports must be programmed as output or tied to the power rails to prevent excessive current consumption. Technical Data 46 Operating Modes For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Operating Modes Low-Power Modes STOP WAIT EXTERNAL OSCILLATOR ACTIVE AND INTERNAL TIMER CLOCK ACTIVE STOP OSCILLATOR AND ALL CLOCKS EXCEPT XOSC AND CLEAR I BIT IN CCR. STOP INTERNAL PROCESSOR CLOCK. Freescale Semiconductor, Inc... EXTERNAL RESET? N IRQ EXTERNAL INTERRUPT? N Y Y EXTERNAL RESET? N Y Y IRQ EXTERNAL INTERRUPT? N KWI INTERRUPT? N SPI INTERRUPT? N TBI INTERRUPT? N Y Y KWI INTERRUPT? N Y Y EVI INTERRUPT? N Y Y SPI INTERRUPT? N Y RESTART INTERNAL PROCESSOR CLOCK. TBI INTERRUPT? N NOTES: For slave mode only When clocked by XOSC FETCH RESET VECTOR OR SERVICE INTERRUPT A. STACK B. SET I BIT C. VECTOR TO INTERRUPT ROUTINE Figure 3-1. Stop/Wait Flowcharts MC68HC05L25 -- Rev. 3.0 MOTOROLA Operating Modes For More Information On This Product, Go to: www.freescale.com Technical Data 47 Freescale Semiconductor, Inc. Operating Modes The MCU can be brought out of stop mode by an external IRQ interrupt, KWI interrupt, SPI (slave mode only) interrupt or TBI interrupt clocked by XOSC or a reset. 3.4.2 WAIT Instruction The WAIT instruction places the MCU in a low-power mode, which consumes more power than stop mode. In wait mode, the internal processor clock is halted, suspending all processor and internal bus activity. Internal timer clocks remain active, permitting interrupts to be generated from the timer or a reset to be generated from the COP watchdog timer. Execution of the WAIT instruction automatically clears the I bit in the condition code register and external interrupt is allowed. All other registers, memory, and input/output lines remain in their previous states. If time base interrupts are enabled, a time base interrupt will cause the processor to exit the wait mode and resume normal operation. The time base may be used to generate a periodic exit from the wait mode. The wait mode also may be exited when an external interrupt (IRQ) or reset occurs. Freescale Semiconductor, Inc... 3.5 COP Watchdog Timer Considerations The COP watchdog timer is active in all modes of operation if enabled by a TBCR2 select bit. If the COP watchdog timer is selected by the TBCR2 bit, any execution of the STOP instruction (either intentional or inadvertent due to the CPU being disturbed) will cause the oscillator (OSC) to halt and thus the COP watchdog timer will not time out if driven from OSC. Thus for applications that require use of COP watchdog from OSC, STOP instruction must be disabled, or COP must be driven from XOSC. If the COP watchdog timer is selected by the TBCR2 select bit, the COP will reset the MCU when it times out. Therefore, it is recommended that the COP watchdog should be disabled for a system that must have intentional uses of the wait or stop modes for periods longer than the COP timeout period. Technical Data 48 Operating Modes For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 4. Central Processor Unit (CPU) Core 4.1 Contents 4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Freescale Semiconductor, Inc... 4.3 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.3.1 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.3.2 Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.3.3 Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3.4 Program Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3.5 Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 4.2 Introduction The MC68HC05L25 has an 8-K memory map. Therefore, it uses 13 bits of the address bus. 4.3 Registers The MCU contains five registers which are hard-wired within the CPU and are not part of the memory map. These five registers are shown in Figure 4-1. MC68HC05L25 -- Rev. 3.0 MOTOROLA Central Processor Unit (CPU) Core For More Information On This Product, Go to: www.freescale.com Technical Data 49 Freescale Semiconductor, Inc. Central Processor Unit (CPU) Core 7 6 5 4 3 2 1 0 A ACCUMULATOR 15 0 14 0 13 0 12 0 11 0 10 0 9 0 8 0 1 1 INDEX REGISTER X STACK POINTER SP 0 0 0 PROGRAM COUNTER PC CONDITION CODE REGISTER 1 1 1 H I N Z C CC Freescale Semiconductor, Inc... HALF-CARRY BIT (FROM BIT 3) INTERRUPT MASK NEGATIVE BIT ZERO BIT CARRY BIT Figure 4-1. M68HC05 Programming Model 4.3.1 Accumulator The accumulator is a general-purpose 8-bit register as shown in Figure 4-1. The CPU uses the accumulator to hold operands and results of arithmetic calculations or non-arithmetic operations. The accumulator is unaffected by a reset of the device. 4.3.2 Index Register The index register shown in Figure 4-1 is an 8-bit register that can perform two functions: 1. Indexed addressing 2. Temporary storage In indexed addressing with no offset, the index register contains the low byte of the operand address, and the high byte is assumed to be $00. In indexed addressing with an 8-bit offset, the CPU finds the operand address by adding the index register contents to an 8-bit immediate value. In indexed addressing with a 16-bit offset, the CPU finds the Technical Data 50 Central Processor Unit (CPU) Core For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Central Processor Unit (CPU) Core Registers operand address by adding the index register contents to a 16-bit immediate value. The index register also can serve as an auxiliary accumulator for temporary storage. The index register is unaffected by a reset of the device. 4.3.3 Stack Pointer Freescale Semiconductor, Inc... The stack pointer shown in Figure 4-1 is an internal 16-bit register. In devices with memory maps less than 64 Kbytes, the unimplemented upper address lines are ignored. The stack pointer contains the address of the next free location on the stack. During a reset or the reset stack pointer (RSP) instruction, the stack pointer is set to $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 10 most significant bits are permanently set to 0000000011. The five least significant register bits are appended to these 11 fixed bits to produce an address within the range of $00FF to $00C0. Subroutines and interrupts CAN use up to 64 ($40) locations. If 64 locations are exceeded, the stack pointer wraps around and writes over the previously stored information. A subroutine call occupies two locations on the stack; and an interrupt uses five locations. 4.3.4 Program Counter The program counter shown in Figure 4-1 is an internal 16-bit register. In devices with memory maps less than 64 Kbytes, the unimplemented upper address lines are ignored, and memory image is mirrored. The program counter contains the address of the next instruction or operand to be fetched. Normally, the address in the program counter increments to the next sequential memory location every time an instruction or operand is fetched. Jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. MC68HC05L25 -- Rev. 3.0 MOTOROLA Central Processor Unit (CPU) Core For More Information On This Product, Go to: www.freescale.com Technical Data 51 Freescale Semiconductor, Inc. Central Processor Unit (CPU) Core 4.3.5 Condition Code Register The condition code register shown in Figure 4-1 is a 5-bit register in which four bits are used to indicate the results of the instruction just executed. The fifth bit is the interrupt mask. These bits can be tested individually by a program, and specific actions can be taken as a result of their state. The condition code register should be thought of as having three additional upper bits that are always 1s. Only the interrupt mask is affected by a reset of the device. The following paragraphs explain the functions of the lower five bits of the condition code register. Freescale Semiconductor, Inc... Half-Carry Bit (H Bit) When the H bit is set, a carry has occurred between bits 3 and 4 of the accumulator during the last ADD or ADC (add with carry) operation. The half-carry bit is required for binary-coded decimal (BCD) arithmetic operations. Interrupt Mask (I Bit) When the I bit is set, the internal and external interrupts are disabled. Interrupts are enabled when the interrupt mask is cleared. When an interrupt occurs, the interrupt mask is set automatically after the CPU registers are saved on the stack, but before the interrupt vector is fetched. If an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. Normally, the interrupt is processed as soon as the interrupt mask is cleared. A return from interrupt (RTI) instruction pulls the CPU registers from the stack, restoring the interrupt mask to its state before the interrupt was encountered. After any reset, the interrupt mask is set and can be cleared only by the clear I bit (CLI), STOP, or WAIT instructions. Negative Bit (N Bit) The N bit is set when the result of the last arithmetic operation, logical operation, or data manipulation was negative. (Bit 7 of the result was a logical 1.) The negative bit can also be used to check an often-tested flag by assigning the flag to bit 7 of a register or memory location. Loading the accumulator with the contents of that register or location then sets or clears the negative bit according to the state of the flag. Technical Data 52 Central Processor Unit (CPU) Core For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Central Processor Unit (CPU) Core Registers Zero Bit (Z Bit) The Z bit is set when the result of the last arithmetic operation, logical operation, data manipulation, or data load operation was zero. Carry/Borrow Bit (C Bit) The C bit is set when a carry out of accumulator bit 7 occurs during the last arithmetic operation, logical operation, or data manipulation. The carry/borrow bit also is set or cleared during bit test and branch instructions and during shifts and rotates. This bit is not set by an INC or DEC instruction. Freescale Semiconductor, Inc... MC68HC05L25 -- Rev. 3.0 MOTOROLA Technical Data Central Processor Unit (CPU) Core For More Information On This Product, Go to: www.freescale.com 53 Freescale Semiconductor, Inc. Central Processor Unit (CPU) Core Freescale Semiconductor, Inc... Technical Data 54 Central Processor Unit (CPU) Core For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 5. Resets 5.1 Contents 5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 External Reset (RESET). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Freescale Semiconductor, Inc... 5.3 5.4 Internal Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.4.1 Power-On Delay (POD). . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.4.2 Computer Operating Properly Reset (COPR) . . . . . . . . . . . 57 5.2 Introduction The MCU can be reset from three sources: one external input and two internal restart conditions. The RESET pin is an input with a Schmitt trigger as shown in Figure 5-1. All peripheral modules which drive external pins will be reset by the synchronous reset signal (RST) coming from a latch, which is synchronized to the PH2 bus clock and set by any of the three reset sources. RESET OSC DATA ADDRESS COP WATCHDOG (COPR) CPU S TO OTHER PERIPHERALS VDD POWER-ON DELAY (POD) PH2 IS AN INTERNAL BUS PH2 LATCH RST Figure 5-1. Reset Block Diagram MC68HC05L25 -- Rev. 3.0 MOTOROLA Resets For More Information On This Product, Go to: www.freescale.com Technical Data 55 Freescale Semiconductor, Inc. Resets 5.3 External Reset (RESET) The RESET pin is the only external source of a reset. This pin is connected to a Schmitt trigger input gate to provide an upper and lower threshold voltage separated by a minimum amount of hysteresis. This external reset occurs whenever the RESET pin is pulled below the lower threshold and remains in reset until the RESET pin rises above the upper threshold. This active low input will generate the RST signal and reset the CPU and peripherals. Termination of the external RESET input or the internal COP watchdog reset are the only reset sources that can alter the operating mode of the MCU. Freescale Semiconductor, Inc... NOTE: Activation of the RST signal generally is referred to as reset of the device, unless otherwise specified. 5.4 Internal Resets The two internally generated resets are the initial power-on delay function and the COP watchdog timer reset. Termination of the external RESET input or the internal COP watchdog timer are the only reset sources that can alter the operating mode of the MCU. The other internal resets will not have any effect on the mode of operation when their reset state ends. 5.4.1 Power-On Delay (POD) The internal POD is generated on power-up to allow the clock oscillator to stabilize. The POD is strictly for power turn-on conditions and is not able to detect a drop in the power supply voltage (brown-out). There is an oscillator stabilization delay of between 8,064 and 8,192 internal processor bus clock cycles (PH2) after the oscillator becomes active. The power-on reset (POR) will generate the RST signal which will reset the CPU. If any other reset function is active at the end of this 8,064- to 8,192-cycle delay, the RST signal will remain in the reset condition until the other reset condition(s) end. Technical Data 56 Resets For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Resets Internal Resets 5.4.2 Computer Operating Properly Reset (COPR) The internal COPR reset is generated automatically (if enabled via a TBCR2 select bit) by a timeout of the COP watchdog timer. This timeout occurs if the counter in the COP watchdog timer is not reset (cleared) within a specific time by a program reset sequence. The COP watchdog timer can be disabled by a TBCR2 select bit. Refer to 9.3.4 COP for more information on this timeout feature. The COPR will generate the RST signal which will reset the CPU and other peripherals. If any other reset function is active at the end of the COPR reset signal, the RST signal will remain in the reset condition until the other reset condition(s) end. Freescale Semiconductor, Inc... MC68HC05L25 -- Rev. 3.0 MOTOROLA Technical Data Resets For More Information On This Product, Go to: www.freescale.com 57 Freescale Semiconductor, Inc. Resets Freescale Semiconductor, Inc... Technical Data 58 Resets For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 6. Interrupts 6.1 Contents 6.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 CPU Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 Reset Interrupt Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Software Interrupt (SWI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Hardware Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 Freescale Semiconductor, Inc... 6.3 6.4 6.5 6.6 6.7 External Interrupt (IRQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.7.1 External Interrupt Trigger Condition . . . . . . . . . . . . . . . . . . 62 6.7.2 Interrupt Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.7.3 Interrupt Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.8 6.9 6.10 6.11 6.12 Serial Peripheral Interface Interrupt (SPII) . . . . . . . . . . . . . . . . 66 Event Counter Interrupt (EVI) . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Time Base Interrupt (TBI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 Key Wakeup Interrupt (KWI). . . . . . . . . . . . . . . . . . . . . . . . . . . 67 IRQ/KWI Software Consideration . . . . . . . . . . . . . . . . . . . . . . . 67 MC68HC05L25 -- Rev. 3.0 MOTOROLA Interrupts For More Information On This Product, Go to: www.freescale.com Technical Data 59 Freescale Semiconductor, Inc. Interrupts 6.2 Introduction The MCU can be interrupted in these ways: 1. Nonmaskable software interrupt instruction (SWI) 2. External interrupt via IRQ (IRQ) 3. Serial peripheral interface interrupt (SPII) 4. Internal time base interrupt (TBI) 5. Key wakeup interrupt (KWI) Freescale Semiconductor, Inc... 6. Event counter overflow interrupt (EVOF) 6.3 CPU Interrupt Processing Interrupts cause the processor to save register contents on the stack and to set the interrupt mask (I bit) to prevent additional interrupts. Unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. If interrupts are not masked (I bit in the CCR is clear) and the corresponding interrupt enable bit is set, the processor will proceed with interrupt processing. Otherwise, the next instruction is fetched and executed. If an interrupt occurs, the processor completes the current instruction, then stacks the current CPU register states, sets the I bit to inhibit further interrupts, and finally checks the pending hardware interrupts. If more than one interrupt is pending after the stacking operation, the interrupt with the highest vector location shown in Table 6-1 will be serviced first. The SWI is executed in the same way as any other instruction, regardless of the I bit state. When an interrupt is to be processed, the CPU fetches the address of the appropriate interrupt software service routine from the vector table at locations $1FF0 through $1FFF as defined in Table 6-1. Technical Data 60 Interrupts For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Interrupts Reset Interrupt Sequence Table 6-1. Vector Address for Interrupts and Reset Register N/A N/A INTCR KWIEN -- Flag Name N/A N/A IRQF KWIF -- ECOF SPIF TBIF Interrupts Reset Software External Interrupt Key Wakeup Reserved Event Counter Serial Peripheral Time Base Periodical CPU Interrupt RESET SWI IRQ KWI -- EVI SPII TBI Vector Address $1FFE:$1FFF $1FFC:$1FFD $1FFA:$1FFB $1FF8:$1FF9 $1FF6:$1FF7 $1FF4:$1FF5 $1FF2:$1FF3 $1FF0:$1FF1 Freescale Semiconductor, Inc... EVSCR SPSR TBCR2 An RTI instruction is used to signify when the interrupt software service routine is completed. The RTI instruction causes the register contents to be recovered from the stack and normal processing to resume at the next instruction that was to be executed when the interrupt took place. Figure 6-1 shows the sequence of events that occurs during interrupt processing. 6.4 Reset Interrupt Sequence The reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner as shown in Figure 6-1. A low level input on the RESET pin or internally generated RST signal causes the program to vector to its starting address, which is specified by the contents of memory locations $1FFE through $1FFF. The I bit in the condition code register also is set. The MCU is configured to a known state during this type of reset as previously described in Section 5. Resets. 6.5 Software Interrupt (SWI) The SWI is an executable instruction and a nonmaskable interrupt since it is executed regardless of the state of the I bit in the CCR. If the I bit is MC68HC05L25 -- Rev. 3.0 MOTOROLA Interrupts For More Information On This Product, Go to: www.freescale.com Technical Data 61 Freescale Semiconductor, Inc. Interrupts zero (interrupts enabled), the SWI instruction executes after interrupts which were pending before the SWI was fetched or before interrupts generated after the SWI was fetched. The interrupt service routine address is specified by the contents of memory locations $1FFC and $1FFD. 6.6 Hardware Interrupts Freescale Semiconductor, Inc... All hardware interrupts except reset are maskable by the I bit in the CCR. If the I bit is set, all hardware interrupts (internal and external) are disabled. Clearing the I bit enables the hardware interrupts. Two types of hardware interrupts are explained in the following sections. 6.7 External Interrupt (IRQ) The IRQ pin provides an asynchronous interrupt to the CPU. The IRQ pin is enabled by the IRQE bit in the INTCR. Also see 7.5 Port C. The interrupt service routine address is specified by the contents of memory locations $1FFA:$1FFB. CPU instructions BIH and BIL test the pin state of the PC3/IRQ pin. 6.7.1 External Interrupt Trigger Condition External interrupt (IRQ) is activated by the negative-edged signal. H PC3/IRQ L tILIH tILIL The limit on the minimum pulse width (tILIH) is as specified. The pulse interval (tILIL) must be longer than the interrupt service routine's service time + 21 machine cycles. Technical Data 62 Interrupts For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Interrupts External Interrupt (IRQ) FROM RESET Y IS I BIT SET? N IRQ INTERRUPT? N Y Freescale Semiconductor, Inc... IRQ INTERRUPT? N SPI INTERRUPT? N Y Y TIME BASE INTERRUPT? N Y STACK PC, X, A, CC. SET I BIT IN CCR. FETCH NEXT INSTRUCTION. PC = PC+1 LOAD PC FROM: SWI: $1FFC:$1FFD IRQ: $1FFA:$1FFB KWI: $1FF8:$1FF9 EVI: $1FF4:$1FF5 SPII: $1FF2:$1FF3 TBI: $1FF0:$1FF1 SWI INSTRUCTION ? N Y RTI INSTRUCTION ? N EXECUTE INSTRUCTION. Y RESTORE REGISTERS FROM STACK CC, A, X, PC. Figure 6-1. Interrupt Processing Flowchart MC68HC05L25 -- Rev. 3.0 MOTOROLA Interrupts For More Information On This Product, Go to: www.freescale.com Technical Data 63 Freescale Semiconductor, Inc. Interrupts 6.7.2 Interrupt Control Register Address: $0008 Bit 7 Read: IRQE Write: Reset: 0 0 0 0 0 0 0 0 6 0 5 0 KWIE IRQS 4 3 2 0 1 0 Bit 0 0 = Unimplemented Freescale Semiconductor, Inc... Figure 6-2. Interrupt Control Register (INTCR) IRQE -- External Interrupt (IRQ) Enable The IRQE bit enables external interrupt when the interrupt mask is cleared and IRQF is set. This bit is cleared at reset. 1 = IRQ enabled 0 = IRQ disabled Bits 6-5 -- Reserved These bits are not used and always return to zero. KWIE -- KWI Enable The KWIE bit enables key wakeup interrupt when the KWIF bit is set. The KWIEx bit in the KWIEN register also must be set for enabling KWI. This bit is cleared at reset. 1 = KWI enabled 0 = KWI disabled IRQS -- External Interrupt (IRQ) Select Edge Sensitivity Only The IRQS bit determines whether the LEVEL and EDGE or EDGE only will trigger the IRQ interrupt. This bit is cleared at reset. 1 = Trigger only on negative EDGEs 0 = Trigger on low LEVEL and negative EDGEs Bits 2-0 -- Reserved These bits are not used and always return to zero. Technical Data 64 Interrupts For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Interrupts External Interrupt (IRQ) 6.7.3 Interrupt Status Register Address: $0009 Bit 7 Read: Write: Reset: 0 0 0 0 IRQF 6 0 5 0 4 KWIF 3 0 RIRQF 0 0 0 2 0 1 0 Bit 0 0 RKWIF 0 = Unimplemented Freescale Semiconductor, Inc... Figure 6-3. Interrupt Status Register (INSTR) IRQF -- External Interrupt (IRQ) Flag A falling edge on the IRQ pin sets the IRQF bit. If the IRQE bit and this bit are set and the interrupt mask is cleared, an interrupt is generated. This is a read-only bit. Clearing IRQF is accomplished by writing a one to the RIRQF bit. Reset clears this bit. Bits 6-5 -- Reserved These bits are not used and always read zero. KWIF -- Key Wakeup Interrupt Flag When the KWIEx bit in the KWIEN register is set, the falling edge at the KWIx pin sets the KWIF bit. If the KWIE bit and this bit are set, an interrupt is generated. This bit is a read-only bit and clearing it is accomplished by writing a one to the RKWIF bit. Reset clears this bit. RIRQF -- Reset IRQ Flag The RIRQF bit is a write-only bit and always read as zero. Writing a one to this bit clears the IRQF bit and writing zero to this bit has no effect. 1 = Clear IRQF 0 = No effect Bits 2-1 -- Reserved These bits are not used and always read zero. MC68HC05L25 -- Rev. 3.0 MOTOROLA Interrupts For More Information On This Product, Go to: www.freescale.com Technical Data 65 Freescale Semiconductor, Inc. Interrupts RKWIF -- Reset KWI Flag The RKWIF bit is a write-only bit and always read as zero. Writing a one to this bit clears the KWIF bit, and writing zero to this bit has no effect. 1 = Clear KWIF 0 = No effect 6.8 Serial Peripheral Interface Interrupt (SPII) Freescale Semiconductor, Inc... The SPII is generated by the serial peripheral interface system at the end of one byte of data transmission or reception. The I bit in the CCR must be clear and the SPIE bit of SPCR must be set for the SPII to be generated. This interrupt will vector to the interrupt service routine located at the address specified by the contents of memory locations $1FF2 and $1FF3. See Section 10. Serial Peripheral Interface for more information. 6.9 Event Counter Interrupt (EVI) The EVI interrupt is generated by the event counter system. The I bit in the CCR must be clear for the EVI interrupt to be enabled. This interrupt will vector to the interrupt service routine located at the address specified by the contents of memory locations $1FF4 and $1FF5. See Section 13. Event Counter for more information. 6.10 Time Base Interrupt (TBI) The TBI is generated periodically by the time base system. The I bit in the CCR must be clear for the TBI to be enabled. This interrupt will vector to the interrupt service routine located at the address specified by the contents of memory locations $1FF0:$1FF1. See Section 9. Time Base for more information. Technical Data 66 Interrupts For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Interrupts Key Wakeup Interrupt (KWI) 6.11 Key Wakeup Interrupt (KWI) The KWI interrupt is generated by the key wakeup system. The I bit in the CCR must be clear for the KWI interrupt to be enabled. This interrupt will vector to the interrupt service routine located at the address specified by the contents of memory locations $1FF8 and $1FF9. See Section 7. Input/Output Ports (I/O) for more information. 6.12 IRQ/KWI Software Consideration Freescale Semiconductor, Inc... IRQ and KWI interrupts have a timing delay in a case as shown in Figure 6-5. This section shows programming for proper interrupts with IRQ or KWI. Figure 6-4 shows an example of a timer interrupt. In this case, the interrupt by TOF occurs as soon as TOIE (timer overflow interrupt enable) bit is set. . . CLI BSET TOIE, TCR LDA #$55 . . . TOF Interrupt pending Interrupt occurs before this instruction Figure 6-4. Timer Interrupt Figure 6-5 shows an example of an IRQ interrupt. In this case, the interrupt occurs after execution of the instruction which sets the IRQE bit. A similar precaution is required for KWI interrupts. . . CLI BSET IRQE, INTCR LDA #$55 . . . IRQ Interrupt pending Interrupt occurs after this instruction Figure 6-5. IRQ Timing Delay MC68HC05L25 -- Rev. 3.0 MOTOROLA Interrupts For More Information On This Product, Go to: www.freescale.com Technical Data 67 Freescale Semiconductor, Inc. Interrupts This problem can be solved by using a software code as illustrated in Figure 6-6. A similar procedure should be used for KWI. . . CLI BSET IRQE, INTCR NOP LDA #$55 . . IRQ Interrupt pending Interrupt occurs after this instruction Freescale Semiconductor, Inc... Figure 6-6. Software Patch for IRQ Technical Data 68 Interrupts For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 7. Input/Output Ports (I/O) 7.1 Contents 7.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Freescale Semiconductor, Inc... 7.3 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.3.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.3.2 Port A Data Direction Register . . . . . . . . . . . . . . . . . . . . . . 75 7.3.3 Port A Pullup Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 7.3.4 Port A Wired-OR Mode Register . . . . . . . . . . . . . . . . . . . . . 76 7.3.5 Key Wakeup Interrupt (KWI) . . . . . . . . . . . . . . . . . . . . . . . .76 7.3.6 I/O Pin Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.4 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.4.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 7.4.2 Port B Data Direction Register . . . . . . . . . . . . . . . . . . . . . . 85 7.4.3 Port B Pullup Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 7.4.4 Port B Wire-ORed Mode Register . . . . . . . . . . . . . . . . . . . .86 7.4.5 I/O Pin Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.5 Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7.5.1 Port C Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 7.5.2 Port C Data Direction Register . . . . . . . . . . . . . . . . . . . . . . 93 7.5.3 Port C Pullup Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 7.5.4 Port C Wired-OR Mode Register. . . . . . . . . . . . . . . . . . . . . 94 7.5.5 I/O Pin Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.6 I/O Port Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.6.1 Pin Data Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.6.2 Output Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 7.6.3 Input Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.6.4 I/O Pin Transitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.6.5 I/O Pins with Subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.6.6 Resistor Control Register 1 . . . . . . . . . . . . . . . . . . . . . . . . 101 7.6.7 Resistor Control Register 2 . . . . . . . . . . . . . . . . . . . . . . .102 7.6.8 Open Drain Output Control Register . . . . . . . . . . . . . . . . . 103 MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 69 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.2 Introduction In single-chip mode, 20 bidirectional input/output (I/O) lines are arranged as three ports: A, B, and C. Individual bits in these ports are programmable as either inputs or outputs under software control by the data direction registers (DDRs). If enabled by select bits in RCR or WOMR, port pins may have software programmable pullup resistors or open-drain outputs, respectively. Freescale Semiconductor, Inc... 7.3 Port A Port A is an 8-bit bidirectional port which shares bits 0-3 with the key wakeup subsystem, and bit 3 also is shared with the buzzer subsystem as shown in Figure 7-1 and Figure 7-2. Bit 4 is shared with the analog-to-digital (A/D) converter and the event counter subsystems as shown in Figure 7-3. Bit 5 is shared with the A/D converter subsystem as shown in Figure 7-4. Bit 6 is shared with the time base subsystem as shown in Figure 7-5. Each port A pin is controlled by the corresponding bits in a data direction register and data register enable bits of appropriate subsystems. The port A data register is located at address $0000. The port A data direction register (DDRA) is located at address $0000 of the option map. Reset clears the DDRA. The port A data register is unaffected by reset. Port A bits 0-3, when configured as an output port, is an open-drain output. Each pin can sink a maximum of 20 mA at VDD = 5.0 V and VOL (max) = 0.8 V. See Section 15. Electrical Specifications. Technical Data 70 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A READ OPTN:$0008 WRITE OPTN:$0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP READ OPTN:$0000 WRITE OPTN:$0000 DATA DIRECTION REGISTER BIT I/O PIN WRITE $0000 DATA REGISTER BIT OUTPUT* Freescale Semiconductor, Inc... READ $0000 KWI REGISTER BIT *NOTE: OPEN DRAIN OUTPUT INTERNAL HC05 DATA BUS RESET (RST) Figure 7-1. Port A0:A2/KWI0:KWI2 I/O Circuitry READ OPTN:$0008 WRITE OPTN:$0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP BUZZER SUBSYSTEM READ OPTN:$0000 WRITE OPTN:$0000 DATA DIRECTION REGISTER BIT I/O PIN WRITE $0000 DATA REGISTER BIT OUTPUT* READ $0000 KWI REGISTER BIT INTERNAL HC05 DATA BUS RESET (RST) *NOTE: OPEN DRAIN OUTPUT Figure 7-2. Port A3/KWI3/BZ I/O Circuitry MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 71 Freescale Semiconductor, Inc. Input/Output Ports (I/O) READ OPTN:$0008 WRITE OPTN:$0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP READ OPTN:$000A WRITE OPTN:$000A OPEN DRAIN REGISTER BIT READ OPTN:$0000 WRITE OPTN:$0000 DATA DIRECTION REGISTER BIT I/O PIN Freescale Semiconductor, Inc... WRITE $0000 DATA REGISTER BIT OUTPUT READ $0000 EVENT COUNTER SYSTEM A/D CONVERTER SYSTEM RESEt (RST) INTERNAL HC05 DATA BUS Figure 7-3. Port A4/AD0/EVI I/O Circuitry Technical Data 72 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A READ OPTN:$0008 WRITE OPTN:$0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP READ OPTN:$000A WRITE OPTN:$000A OPEN DRAIN REGISTER BIT READ OPTN:$0000 WRITE OPTN:$0000 DATA DIRECTION REGISTER BIT I/O PIN Freescale Semiconductor, Inc... WRITE $0000 DATA REGISTER BIT OUTPUT READ $0000 A/D CONVERTER SYSTEM INTERNAL HC05 DATA BUS RESET (RST) Figure 7-4. Port A5/AD1 I/O Circuitry MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 73 Freescale Semiconductor, Inc. Input/Output Ports (I/O) READ OPTN:$0008 WRITE OPTN:$0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP READ OPTN:$000A WRITE OPTN:$000A OPEN DRAIN REGISTER BIT READ OPTN:$0000 WRITE OPTN:$0000 DATA DIRECTION REGISTER BIT I/O PIN Freescale Semiconductor, Inc... WRITE $0000 DATA REGISTER BIT OUTPUT READ $0000 TIME BASE SYSTEM INTERNAL HC05 DATA BUS RESEt (RST) Figure 7-5. Port A6/RMO I/O Circuitry READ OPTN:$0008 WRITE OPTN:$0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP READ OPTN:$000A WRITE OPTN:$000A OPEN DRAIN REGISTER BIT READ OPTN:$0000 WRITE OPTN:$0000 DATA DIRECTION REGISTER BIT I/O PIN WRITE $0000 DATA REGISTER BIT OUTPUT READ $0000 INTERNAL HC05 DATA BUS RESET (RST) Figure 7-6. Port A7 I/O Circuitry Technical Data 74 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A 7.3.1 Port A Data Register Address: $0000 Bit 7 Read: PA7 Write: Reset: Unaffected by Reset PA6 PA5 PA4 PA3 PA2 PA1 PA0 6 5 4 3 2 1 Bit 0 Figure 7-7. Port A Data Register Freescale Semiconductor, Inc... Each port A I/O pin has a corresponding bit in the port A data register. When a port A pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. When a port A pin is programmed as an input, any read of the port A data register will return the logic state of the corresponding I/O pin. The port A data register is unaffected by reset. 7.3.2 Port A Data Direction Register Address: $0000 Bit 7 Read: DDRA7 Write: Reset: 0 0 0 0 0 0 0 0 DDRA6 DDRA5 DDRA4 DDRA3 DDRA2 DDRA1 DDRA0 6 5 4 3 2 1 Bit 0 Figure 7-8. Port A Data Direction Register Each port A I/O pin may be programmed as an input by clearing the corresponding bit in the DDRA or may be programmed as an output by setting the corresponding bit in the DDRA. The DDRA can be accessed at address $0000 of the option map. The DDRA is cleared by reset. MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 75 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.3.3 Port A Pullup Register Each port A pin may have a software programmable pullup device enabled by the RCR select bits RAH and RAL. The pullup is activated whenever the corresponding bit in the RCR is set. Since reset clears the RCR, all pins will initialize with the pullup devices disabled. See 7.6.6 Resistor Control Register 1. 7.3.4 Port A Wired-OR Mode Register Freescale Semiconductor, Inc... Port A bits 0:3 configured for output pins are wired-OR mode (open drain) only. Port A bits 4:7 configured for output pins may have software programmable wired-OR mode (open drain) output enabled by the AWOM bit in the WOMR. Since reset clears the WOMR, the wired-OR mode is disabled on reset. See 7.6.8 Open Drain Output Control Register. 7.3.5 Key Wakeup Interrupt (KWI) Four key wakeup inputs (KWI0:KWI3) share pins with port A. Each key wakeup input is enabled by the corresponding bit in the KWIEN register which resides in the option map. KWI is enabled by the KWIE bit in the INTCR. When a falling edge is detected at one of the enabled key wakeup inputs, the KWIF bit in the INTSR is set and KWI is generated if KWIE = 1. Each input has a latch which responds only to the falling edge at the pin. All input latches are cleared at the same time by clearing the KWIF bit. See Figure 7-9. Technical Data 76 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A KWIE0 H KWI0 D C R Q KWIE1 H KWI1 D C R Q Freescale Semiconductor, Inc... KWIE2 H KWI2 D C R Q READ KWIF KWIE3 S Q KWIF R DATA BUS H KWI3 D C R Q RESET/POR WRITE 1 TO RKWIF KWI KWIE Figure 7-9. Key Wakeup Interrupt (KWI) MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 77 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.3.6 I/O Pin Truth Tables Table 7-1 through Table 7-6 summarize the input or output mode programming for port A. Table 7-1. PA0-PA2/KWI0-KWI2 I/O Pin Functions Output Latch KWIE0- KWIE2 Access to DDRA0- DDRA2 Read/Write Access to Data Register Latch PA0-PA2 Read Pin Pin Pin Pin Latch Latch Latch Latch Latch Latch Write Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin DDR RAL I/O Pin Modes Freescale Semiconductor, Inc... 0 0 0 0 1 1 1 1 1 1 NOTES: 1. 2. X X X X 0 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 0 1 0 1 X 0 1 X 0 1 IN, Hi-Z, KWI Disable IN, KWI Disable, Pullup IN, Hi-Z, KWI Enable IN, KWI Enable, Pullup OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup OUT, OD, KWI Enable OUT, OD, Hi-Z, KWI Enable OUT, OD, Pullup, KWI Enable DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 DDRA0- DDRA2 X is don't care state. Does not affect input, but stored to data register latch Technical Data 78 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A Table 7-2. PA3/KWI3/BZ I/O Pin Functions DDR Output KWIE3 Latch X X X X 0 1 1 0 1 1 X 0 0 1 1 0 0 0 1 1 1 0 BZPE RAL I/O Pin Modes IN, Hi-Z, KWI Disable IN, Hi-Z, KWI Disable, Pullup IN, Hi-Z, KWI Enable IN, Hi-Z, KWI Enable, Pullup Port OUT, OD, KWI Disable Port OUT, OD, Hi-Z, KWI Disable Port OUT, OD, KWI Disable, Pullup Port OUT, OD, KWI Enable Port OUT, OD, Hi-Z, KWI Enable Port OUT, OD, Pullup, KWI Enable BZ OUT, OD, KWI Disable BZ OUT, OD, KWI Disable, Pullup BZ OUT, OD, KWI Enable BZ OUT, OD, KWI Enable, Pullup Access to DDRA3 Read/Write 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 X 0 1 X 0 1 0 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 DDRA3 Access to Data Register Latch PA3 Read Pin Pin Pin Pin Latch Latch Latch Latch Latch Latch Pin Latch DDRA3 Pin Latch DDRA3 Pin Latch DDRA3 Pin Latch Latch2 Latch2 Latch2 Write Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch2 Freescale Semiconductor, Inc... 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 NOTES: 1. 2. X 0 1 1 X 1 1 0 X 1 1 1 X is don't care state. Does not affect input, but stored to data register latch MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 79 Freescale Semiconductor, Inc. Input/Output Ports (I/O) Table 7-3. PA4/AD0/EVI I/O Pin Functions DDR 0 0 0 0 0 Output A/D EVCE ADON Latch CH X X X X X X X X 0 1 1 X 0 1 1 1 X 0 1 1 X 0 1 1 AWOM X X X X X X X 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 RAH 0 1 X 0 1 0 1 X X 0 1 X X 0 0 1 X X 0 1 X X 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup A/D IN Port IN, Hi-Z Port IN, Pullup Port IN, Hi-Z, Event In Port IN, Pullup, Event In OUT, CMOS OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup OUT, CMOS OUT, OD OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup OUT, CMOS, Event In OUT, OD, Event In OUT, OD, Hi-Z, Event In OUT, OD, Event In, Pullup OUT, CMOS, Event In OUT, OD, Event In OUT, OD, Hi-Z, Event In OUT, OD, Event In, Pullup Access to Access to Data Register DDRA4 Latch PA4 Read/Write DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 DDRA4 Read Pin Pin 0 Pin Pin Pin Pin Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Latch Write Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin 0 0 X X X 1 1 0 0 0 0 0 0 X 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 X X 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 X X 0 1-7 1-7 X X X X X X X X 0 1-7 X X X X X 1-7 1-7 1-7 1-7 Freescale Semiconductor, Inc... 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 NOTES: 1. X is don't care state. 2. Does not affect input, but stored to data register latch 3. Do not apply analog voltage to this pin unless the I/O pin mode is set to A/D IN. Excessive current may be drawn if this pin is read as a digital input port while analog voltage is applied. Technical Data 80 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A Table 7-4. PA5/AD1 I/O Pin Functions DDR 0 0 0 0 Output Latch X X X X X X 0 1 1 X 0 1 1 ADON 0 0 1 1 1 0 0 0 0 1 1 1 1 A/D CH X X 1 0, 2-7 0, 2-7 X X X X X X X X AWOM X X X X X 0 1 1 1 0 1 1 1 RAH 0 1 X 0 1 X X 0 1 X X 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup A/D IN Port IN, Hi-Z Port IN, Pullup OUT, CMOS OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup OUT, CMOS OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup Access to DDRA5 Read/Write DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 DDRA5 Access to Data Register Latch PA5 Read Pin Pin 0 Pin Pin Latch Latch Latch Latch Latch Latch Latch Latch Write Latch2 Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Freescale Semiconductor, Inc... 0 1 1 1 1 1 1 1 1 NOTES: 1. X is don't care state. 2. Does not affect input, but stored to data register latch 3. Do not apply analog voltage to this pin unless the I/O pin mode is set to A/D IN. Excessive current may be drawn if this pin is read as a digital input port while analog voltage is applied. MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 81 Freescale Semiconductor, Inc. Input/Output Ports (I/O) Table 7-5. PA6/RMO I/O Pin Functions I/O Port DDR 0 0 1 OL X X X 0 1 1 X X X X X Remote Carrier Output RMPE X X 0 0 0 0 1 1 1 1 1 RMON X X X X X X 0 0 1 1 1 RPOL X X X X X X 0 1 X X X X X 0 1 1 1 0 0 0 1 1 0 1 X X 0 1 X X X 0 1 Port IN, Hi-Z Port IN, Pullup OUT, Output Latch, CMOS OUT, Output Latch, OD OUT, Output Latch, OD, Hi-Z OUT, Output Latch, OD, Pullup OUT, Remote Idle, CMOS = VSS OUT, Remote Idle, CMOS = VDD OUT, Remote Carrier, CMOS OUT, Remote Carrier, OD/Hi-Z OUT, Remote Carrier, OD/Pullup Access to DDRA6 Read/Write DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 DDRA6 Access to Data Register Latch PA6 Read Pin Pin Latch Latch Latch Latch Latch Latch Latch Latch Latch Write Latch3 Latch3 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch3 Latch3 Latch3 Latch3 Latch3 AWOM RAH I/O Pin Modes Freescale Semiconductor, Inc... 1 1 1 1 1 1 1 1 NOTES: 1. 2. 3. 4. OL = output latch X is don't care state. Does not affect input, but stored to data register latch VSS/Hi-Z = output is either VSS (N-ch on) or Hi-Z (N- and P-ch off) depending on clock pulse 5. VSS/Pullup = output is either VSS (N-ch on) or pullup (resistive) depending on clock pulse Technical Data 82 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port A Table 7-6. PA7 I/O Pin Functions DDR 0 0 1 1 Output Latch X X X 0 1 1 AWOMH X X 0 1 1 1 RAH 0 1 X X 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup OUT, CMOS OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup Access to DDRA7 Read/Write DDRA7 DDRA7 DDRA7 DDRA7 DDRA7 DDRA7 Access to Data Register Latch PA7 Read Pin Pin Latch Latch Latch Latch Write Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Freescale Semiconductor, Inc... 1 1 NOTES: 1. X is don't care state. 2. Does not affect input, but is stored to the data register latch MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 83 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.4 Port B Port B is an 8-bit bidirectional port that is shared with LCD frontplane drivers as shown in Figure 7-10. Each port B pin is controlled by the corresponding bits in a data direction register and a data register. The port B data register is located at address $0001. The port B data direction register (DDRB) is located at address $0001 of the option map. Reset clears the DDRB. The port B data register is unaffected by reset. The LCD frontplane drivers are enabled on reset. Freescale Semiconductor, Inc... READ OPTN: $0008 WRITE OPTN: $0008 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP READ OPTN: $000A WRITE OPTN: $000A OPEN DRAIN REGISTER BIT FP LCD SYSTEM LCDCR PBE BIT READ OPTN: $0001 WRITE OPTN: $0001 OUTPUT DATA DIRECTION REGISTER BIT DATA REGISTER BIT OUTPUT WRITE $0001 READ $0001 I/O PIN RESET (RST) INTERNAL HC05 DATA BUS Figure 7-10. Port B0:B7/FP24:FP17 I/O Circuitry Technical Data 84 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port B 7.4.1 Port B Data Register Address: $0001 Bit 7 Read: PB7 Write: Reset: Unaffected by Reset PB6 PB5 PB4 PB3 PB2 PB1 PB0 6 5 4 3 2 1 Bit 0 Figure 7-11. Port B Data Register (PORTB) Freescale Semiconductor, Inc... Each port B I/O pin has a corresponding bit in the port B data register. When a port B pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. When a port B pin is programmed as an input, any read of the port B data register will return the logic state of the corresponding I/O pin. The port B data register is unaffected by reset. 7.4.2 Port B Data Direction Register Address: Option -- $0001 Bit 7 Read: DDRB7 Write: Reset: Unaffected by Reset DDRB6 DDRB5 DDRB4 DDRB3 DDRB2 DDRB1 DDRB0 6 5 4 3 2 1 Bit 0 Figure 7-12. Port B Data Direction Register (DDRB) Each port B I/O pin can be programmed as an input by clearing the corresponding bit in the DDRB or programmed as an output by setting the corresponding bit in the DDRB. The DDRB can be accessed at address $0001 of the option map. The DDRB is cleared by reset. MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 85 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.4.3 Port B Pullup Register Each port B pin may have a software programmable pullup device enabled by the RCR select bits RBH and RBL. The pullup is activated whenever the corresponding bit in the RCR is set. Since reset clears the RCR, all pins will initialize with the pullup devices disabled. See 7.6.6 Resistor Control Register 1. NOTE: Do not turn on port B pullups when LCD is selected for corresponding port pin. Freescale Semiconductor, Inc... 7.4.4 Port B Wire-ORed Mode Register Port B bits 0-7 configured for output pins may have software programmable wired-OR mode (open drain) output enabled by the BWOMH and BWOML bits in the WOMR. Since reset clears the WOMR, the wired-OR mode becomes disabled on reset. See 7.6.8 Open Drain Output Control Register. 7.4.5 I/O Pin Truth Tables Table 7-7 and Table 7-8 summarize the input or output and LCD mode programming for port B. Technical Data 86 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port B Table 7-7. PB0-PB3/FP24-FP21 I/O Pin Functions Output Latch X X X X X 0 1 1 LCDCR PBEL 0 0 1 1 1 1 1 1 Access to DDRB0- DDRB3 Read/Write X X 0 X X X X 0 1 1 1 0 1 0 1 X X 0 1 LCD FP Output DDRB0-DDRB3 LCD FP Output, DDRB0-DDRB3 Pullup3 Port IN, Hi-Z Port IN, Pullup OUT, CMOS OUT, OD OUT, OD, Hi-Z DDRB0-DDRB3 DDRB0-DDRB3 DDRB0-DDRB3 DDRB0-DDRB3 DDRB0-DDRB3 Access to Data Register Latch PB0-PB3 Read 0 0 Pin Pin Latch Latch Latch Latch Write Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin DDR BWOML RBL I/O Pin Modes Freescale Semiconductor, Inc... 0 1 1 1 1 OUT, OD, Pullup DDRB0-DDRB3 NOTES: 1. X is don't care state. 2. Does not affect input, but is stored to data register latch 3. Do not turn on pullup R (RBL = 1) when using these pins as LCD ports. Table 7-8. PB4-PB7/FP20-FP17 I/O Pin Functions Output Latch X X X X X 0 1 1 LCDCR PBEH 0 0 1 1 1 1 1 1 Access to DDRB4- DDRB7 Read/Write X X 0 0 1 1 1 1 X X X X 0 1 1 1 0 1 0 1 X X 0 1 LCD FP Output DDRB4-DDRB7 LCD FP Output, DDRB4-DDRB7 Pullup3 Port IN, Hi-Z Port IN, Pullup OUT, CMOS OUT, OD OUT, OD, Hi-Z DDRB4-DDRB7 DDRB4-DDRB7 DDRB4-DDRB7 DDRB4-DDRB7 DDRB4-DDRB7 Access to Data Register Latch PB4-PB7 Read 0 0 Pin Pin Latch Latch Latch Latch Write Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin DDR BWOMH RBH I/O Pin Modes OUT, OD, Pullup DDRB4-DDRB7 NOTES: 1. X is don't care state. 2. Does not affect input, but is stored to data register latch 3. Do not turn on pullup R (RBH = 1) when using these pins as LCD ports. MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 87 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.5 Port C Port C is a 4-bit I/O port which shares its pins with external interrupt IRQ and the serial peripheral interface (SPI) system as shown in Figure 7-13 through Figure 7-16. Each port C pin is controlled by the corresponding bits in a wired-OR mode register and a pullup register. The port C data register is located at address $0002. The port C pullup register (RCR) is located at address $0009 of the option map. The wired-OR mode register (WOMR) is located at address $000A of the option map. Reset clears the RCR and the WOMR. Freescale Semiconductor, Inc... The PC0-PC2 pins are shared with the serial peripheral interface (SPI). When the SPI is enabled (SPE = 1), the pins PC0, PC1, and PC2 are configured as serial clock output or input (SCK), serial data output (SDO), and serial data input (SDI) pins, respectively. The direction of the SCK depends on the MSTR bit in the SPCR. When PORTC is read, the pin state is read. See Table 7-9 through Table 7-10. The SCK pin should be at the VDD level before the SPI is enabled. The PC3 pin is shared with the external interrupt IRQ pin. The IRQ pin has a Schmitt trigger to improve noise immunity. The PC3 pin state can be read any time regardless of the IRQ configurations. Port C bits 2 and 3, when configured as output ports, are open drain outputs. Technical Data 88 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port C READ OPTN: $0009 WRITE OPTN: $0009 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP SPI SYSTEM MSTR SCK OUT SCK IN OUTPUT READ OPTN: $000A Freescale Semiconductor, Inc... WRITE OPTN: $000A OPEN DRAIN REGISTER BIT READ OPTN: $0002 WRITE OPTN: $0002 DATA DIRECTION REGISTER BIT DATA REGISTER BIT OUTPUT I/O PIN WRITE $0002 READ $0002 INTERNAL HC05 DATA BUS RESET (RST) Figure 7-13. Port PC0/SCK Circuitry MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 89 Freescale Semiconductor, Inc. Input/Output Ports (I/O) READ OPTN: $0009 WRITE OPTN: $0009 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP SPI SYSTEM SDO OUTPUT READ OPTN: $000A Freescale Semiconductor, Inc... WRITE OPTN: $000A OPEN DRAIN REGISTER BIT READ OPTN: $0002 WRITE OPTN: $0002 DATA DIRECTION REGISTER BIT WRITE $0002 DATA REGISTER BIT READ $0002 INTERNAL HC05 DATA BUS RESET (RST) OUTPUT I/O PIN Figure 7-14. PC1/SDO Circuitry Technical Data 90 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port C READ OPTN: $0009 WRITE OPTN: $0009 PULLUP REGISTER BIT PULLUP LOGIC R PULLUP SPI SYSTEM READ OPTN: $000A OPEN DRAIN REGISTER BIT READ OPTN: $0002 SDI Freescale Semiconductor, Inc... WRITE OPTN: $0002 DATA DIRECTION REGISTER BIT DATA REGISTER BIT OUTPUT* I/O PIN WRITE $0002 READ $0002 INTERNAL HC05 DATA BUS RESET (RST) *NOTE: Open Drain Output Figure 7-15. PC2/SDI Circuitry MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 91 Freescale Semiconductor, Inc. Input/Output Ports (I/O) READ OPTN: $0009 WRITE OPTN: $0009 PULLUP REGISTER BIT R PULLUP TO INTERRUPT SYSTEM S READ $0009 Q Q IRQF R R C D Freescale Semiconductor, Inc... READ $0008 WRITE $0008 IRQ ENABLE BIT READ OPTN: $000A OPEN DRAIN REGISTER BIT READ OPTN: $0002 WRITE OPTN: $0002 DATA DIRECTION REGISTER BIT DATA REGISTER BIT OUTPUT* I/O PIN WRITE $0002 READ $0002 *NOTE: Open Drain Output INTERNAL HC05 DATA BUS RESET (RST) Figure 7-16. PC3/IRQ Circuitry Technical Data 92 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port C 7.5.1 Port C Data Register Each port C input pin has a corresponding bit in the port C data register. Regardless of the peripheral configuration, any read of the port C data register will return the logic state of the corresponding I/O pin. The port C data register is unaffected by reset. Address: $0002 Bit 7 6 0 5 0 4 0 PC3 Write: Reset: 0 0 0 0 U U = Unaffected U U U PC2 PC1 PC0 3 2 1 Bit 0 Freescale Semiconductor, Inc... Read: 0 = Unimplemented Figure 7-17. Port C Data Register (PORTC) 7.5.2 Port C Data Direction Register Each port C I/O pin can be programmed as an input by clearing the corresponding bit in the DDRC or programmed as an output by setting the corresponding bit in the DDRC. The DDRC can be accessed at address $0002 of the option map. The DDRC is cleared by reset. Address: Option -- $0002 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 0 6 0 5 0 4 0 DDRC3 DDRC2 DDRC1 DDRC0 3 2 1 Bit 0 = Unimplemented Figure 7-18. Port C Data Direction Register (DDRC) MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 93 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.5.3 Port C Pullup Register Each port C pin can have a software programmable pullup device enabled by the RCR2 select bit RC. The pullup is activated whenever the RC bit in the RCR2 is set. Since reset clears the RCR2, all pins will initialize with the pullup devices disabled. See 7.6.7 Resistor Control Register 2. 7.5.4 Port C Wired-OR Mode Register Freescale Semiconductor, Inc... Port C bits 0 and 1 are configured for output pins and can have software programmable wired-OR mode (open drain) output enabled by the CWOM bit in the WOMR. Since reset clears the WOMR, the wired-OR mode is disabled on reset. Port C bits 2 and 3, when configured as an output port, have wired-OR mode output only. See 7.6.8 Open Drain Output Control Register. 7.5.5 I/O Pin Truth Tables Table 7-9 through Table 7-12 summarize the input, pullup, wired-OR mode, and SPI pin programming. Technical Data 94 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port C Table 7-9. PC0/SCK I/O Pin Functions DDR 0 0 1 1 Output SPCR Latch SPE X X X 0 1 1 X X X X X X X X X X 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 SPCR WOMR RCR2 MSTR CWOM RC Bit X X X X X X 0 0 1 1 1 1 1 1 1 1 X X 0 1 1 1 X X 0 0 0 0 1 1 1 1 0 1 X X 0 1 0 0 0 1 0 1 0 1 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup OUT, CMOS OUT, OD OUT, OD, Hi-Z OUT, OD, Pullup SCK IN, Hi-Z SCK IN, Hi-Z SCK OUT, CMOS, Hi-Z SCK OUT, CMOS, Pullup SCK OUT, CMOS, Hi-Z SCK OUT, CMOS, Pullup SCK OUT, OD, Hi-Z SCK OUT, OD, Pullup SCK OUT, OD, Hi-Z SCK OUT, OD, Pullup Access to DDRC0 Read/Write DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 DDRC0 Access to Data Register Latch PC0 Read Pin Pin Latch Latch Latch Latch Pin Latch Pin Pin Latch Latch Pin Pin Latch Latch Write Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Freescale Semiconductor, Inc... 1 1 0 1 0 0 1 1 0 0 1 1 NOTES: 1. X is don't care state. 2. Does not affect input, but stored to data register latch MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 95 Freescale Semiconductor, Inc. Input/Output Ports (I/O) Table 7-10. PC1/SDO I/O Pin Functions DDR 0 0 1 1 Output Latch X X X 0 1 1 X X X X X X X X SPCR SPE 0 0 0 0 0 0 1 1 1 1 1 1 1 1 WOMR RCR2 CWOM RC Bit X X 0 1 1 1 0 0 0 0 1 1 1 1 0 1 X X 0 1 0 1 0 1 0 1 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup Port OUT, CMOS Port OUT, OD Port OUT, OD, Hi-Z Port OUT, OD, Pullup SDO OUT, CMOS, Hi-Z SDO OUT, CMOS, Pullup SDO OUT, CMOS, Hi-Z SDO OUT, CMOS, Pullup SDO OUT, OD, Hi-Z SDO OUT, OD, Pullup SDO OUT, OD, Hi-Z SDO OUT, OD, Pullup Access to Access to Data Register DDRC1 Latch PC1 Read/Write DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 DDRC1 Read Pin Pin Latch Latch Latch Latch Pin Pin Latch Latch Pin Pin Latch Latch Write Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Latch2 Freescale Semiconductor, Inc... 1 1 0 0 1 1 0 0 1 1 NOTES: 1. X is don't care state. 2. Does not affect input, but stored to data register latch Technical Data 96 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) Port C Table 7-11. PC2/SDI I/O Pin Functions DDR 0 0 1 1 Output SPCR Latch SPE X X 0 1 1 X X X X 0 0 0 0 0 1 1 1 1 WOMR CWOM X X X X X X X X X RCR2 RC Bit 0 1 X 0 1 0 1 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup Port OUT, OD Port OUT, OD, Hi-Z Port OUT, OD, Pullup SDI IN, Hi-Z SDI IN, Pullup SDI IN, Hi-Z SDI IN, Pullup Access to DDRC2 Read/Write DDRC2 DDRC2 DDRC2 DDRC2 DDRC2 DDRC2 DDRC2 DDRC2 DDRC2 Access to Data Register Latch PC2 Read Pin Pin Latch Latch Latch Pin Pin Latch Latch Write Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch2 Latch 2 Latch2 Latch 2 Freescale Semiconductor, Inc... 1 0 0 1 1 NOTES: 1. X is don't care state. 2. Does not affect input, but stored to data register latch Table 7-12. PC3/IRQ I/O Pin Functions DDR 0 0 0 0 1 1 1 1 1 1 Output Latch X X X X 0 1 1 0 1 1 INTCR WOMR RCR2 IRQE CWOM RC Bit 0 0 1 1 0 0 0 1 1 1 X X X X X X X X X X 0 1 0 1 X 0 1 X 0 1 I/O Pin Modes Port IN, Hi-Z Port IN, Pullup Port IN, Hi-Z, IRQ Port IN, Pullup, IRQ Port OUT, OD Port OUT, OD, Hi-Z Port OUT, OD, Pullup Port OUT, OD, IRQ Port OUT, OD, Hi-Z, IRQ Port OUT, OD, Pullup, IRQ Access to Access to Data Register DDRC3 Latch PC3 Read/Write DDRC3 DDRC3 DDRC3 DDRC3 DDRC3 DDRC3 DDRC3 DDRC3 DDRC3 DDRC3 Read Pin Pin Pin Pin Latch Latch Latch Latch Latch Latch Write Latch2 Latch2 Latch2 Latch2 Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin Latch, Pin NOTES: 1. X is don't care state. 2. Does not affect input, but stored to data register latch MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 97 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.6 I/O Port Programming All bidirectional I/O pins can be programmed as inputs or outputs. 7.6.1 Pin Data Direction The direction of a pin is determined by the state of its corresponding bit in the associated port data direction register (DDR). A pin is configured as an output if its corresponding DDR bit is set to a logic 1. A pin is configured as an input if its corresponding DDR bit is cleared to a logic 0. The data direction bits DDRA0:DDRA7, DDRB0:DDRB7, and DDRC0:DDRC3 are read/write bits which can be manipulated with read-modify-write instructions. At power-on or reset, all DDRs are cleared, which configures all I/O port pins as input (except port B is configured as an LCD port). Freescale Semiconductor, Inc... 7.6.2 Output Pin When an I/O pin is programmed as an output pin, the state of the corresponding data register bit will determine the state of the pin. The state of the data register bits can be altered by writing to address $0000 for port A, address $0001 for port B, and address $0002 for port C. Reads of the corresponding data register bit at address $0000 or $0003 will return the state of the data register bit (not the state of the I/O pin itself). Therefore, bit manipulation is possible on all pins programmed as outputs. 7.6.3 Input Pin When an I/O pin is programmed as an input pin, or for an input-only pin, the state of the pin can be determined by reading the corresponding data register bit. Any writes to the corresponding data register bit for an input-only pin will be ignored. If the corresponding bit in the pullup register is set, the input pin will have an activated pullup device. Since the pullup register bits are read-write, bit manipulation may be used on these register bits. Technical Data 98 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) I/O Port Programming 7.6.4 I/O Pin Transitions A glitch can be generated on an I/O pin when changing it from an input to an output unless the data register is first pre-conditioned to the desired state before changing the corresponding DDR bit from a zero to a one. 7.6.5 I/O Pins with Subsystems An I/O pin that is shared with another subsystem is in general configured as an input pin during reset, except for LCD driver pins. The LCD driver output pins BP0:BP3 and FP0:FP24 are configured to output VDD level during and after reset. See truth tables of each I/O port for more details. Freescale Semiconductor, Inc... MC68HC05L25 -- Rev. 3.0 MOTOROLA Technical Data Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com 99 Freescale Semiconductor, Inc. Input/Output Ports (I/O) Table 7-13. Port Control Register Bits Summary Port Bit 0 1 2 A 3 4 5 DDR DDRA0 DDRA1 DDRA2 DDRA3 DDRA4 DDRA5 DDRA6 DDRA7 DDRB0 DDRB1 DDRB2 DDRB3 DDRB4 DDRB5 DDRB6 DDRB7 DDRC0 DDRC1 DDRC2 DDRC3 1 1 IRQE IRQS CWOM RC SPE BWOMH RBH LCDE, PBEH BWOML RBL LCDE, PBEL AWOM RAH WOM 1 1 1 1 BZPE, KWIE ADON, EVCE ADON RME -- RAL KWIE Pullup R Module Control KWIE0 KWIE1 KWIE2 BZxx, KWIE3 CH2:CH0/EVxx CH2:CH0 TBCLK, RMC4:RMC0 -- F24B3:F24B0 F23B3:F23B0 F22B3:F22B0 F21B3:F21B0 F20B3:F20B0 F19B3:F19B0 F18B3:F18B0 F17B3:F17B0 MSTR, SPR DORD, SPR Module KWI0 KWI1 KWI2 KWI3/BZ AD0/EVI AD1 RMO -- FP24 FP23 FP22 FP21 FP20 FP19 FP18 FP17 SCK SDO SDI IRQ Freescale Semiconductor, Inc... 6 7 0 1 2 B 3 4 5 6 7 0 C 1 2 3 NOTES: 1. Pullup resistor resistances are typical values with VDD = 3 V. See Section 15. Electrical Specifications for more details. 2. Port C bits 2 and 3 are open-drain outputs and do not have CMOS drive capability. Technical Data 100 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) I/O Port Programming 7.6.6 Resistor Control Register 1 Address: Option -- $0008 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 0 6 0 5 0 4 0 RBH RBL RAH RAL 3 2 1 Bit 0 = Unimplemented Freescale Semiconductor, Inc... Figure 7-19. Resistor Control Register 1 (RCR1) Bits 7-4 -- Reserved These bits are not used and always read as zero. RBH -- Port B Pullup Resistor (H) When this bit is set, the pullup resistor is connected to the upper four bits of port B. However, for those pins configured as CMOS output or open-drain output with output of logic low, the pullup resistors are disabled. This bit is cleared on reset. RBL -- Port B Pullup Resistor (L) When this bit is set, the pullup resistor is connected to the lower four bits of port B. However, for those pins configured as CMOS output or open-drain output with output of logic low, the pullup resistors are disabled. This bit is cleared on reset. RAH -- Port A Pullup Resistor (H) When this bit is set, the pullup resistor is connected to the upper four bits of port A. However, for those pins configured as CMOS output or open-drain output with output of logic low, the pullup resistors are disabled. This bit is cleared on reset. RAL -- Port A Pullup Resistor (L) When this bit is set, the pullup resistor is connected to the lower four bits of port A. However, for those pins configured as CMOS output or open-drain output with output of logic low, the pullup resistors are disabled. This bit is cleared on reset. MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 101 Freescale Semiconductor, Inc. Input/Output Ports (I/O) 7.6.7 Resistor Control Register 2 Address: Option -- $0009 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 0 6 0 5 0 4 0 3 0 2 0 1 0 RC Bit 0 = Unimplemented Freescale Semiconductor, Inc... Figure 7-20. Resistor Control Register 2 (RCR2) Bits 7:1 -- Reserved These bits are not used and always read as zero. RC -- Port C Pullup Resistor When the RC bit is set, the pullup resistor is connected to all four bits of port C. However, for those pins configured as CMOS output or open-drain output with output of logic low, the pullup resistors are disabled. This bit is cleared on reset. Technical Data 102 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Input/Output Ports (I/O) I/O Port Programming 7.6.8 Open Drain Output Control Register Address: Option -- $000A Bit 7 Read: BWOMH Write: Reset: 0 0 0 0 0 0 0 0 BWOML 6 5 0 4 0 3 0 CWOM AWOM 2 1 Bit 0 0 = Unimplemented Freescale Semiconductor, Inc... Figure 7-21. Wired-OR Mode Register (WOM) BWOMH -- Port B Open-Drain Mode (H) When this bit is set, the upper four bits (7-4) of port B pins that are configured as outputs become open-drain outputs. This bit is cleared on reset. BWOML -- Port B Open-Drain Mode (L) When this bit is set, the lower four bits (3-0) of port B pins that are configured as outputs become open-drain outputs. This bit is cleared on reset. Bits 5-3 -- Reserved These bits are not used and always read zero. CWOM -- Port C Open-Drain Mode When this bit is set, port C pins that are configured as outputs become open-drain outputs. This bit is cleared on reset. AWOM -- Port A Open-Drain Mode (High Nibble) When this bit is set, the upper four bits of port A that are configured as outputs become open-drain outputs. This bit is cleared on reset. Bit 0 -- Reserved This bit is not used and always returns to zero. MC68HC05L25 -- Rev. 3.0 MOTOROLA Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com Technical Data 103 Freescale Semiconductor, Inc. Input/Output Ports (I/O) Freescale Semiconductor, Inc... Technical Data 104 Input/Output Ports (I/O) For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 8. Oscillators and Clock 8.1 Contents 8.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 OSC Clock Divider and POR Counter . . . . . . . . . . . . . . . . . .106 System Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 OSC and XOSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 OSC On Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 Freescale Semiconductor, Inc... 8.3 8.4 8.5 8.6 8.7 XOSC On Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 8.7.1 XOSC with FOSCE = 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 8.7.2 XOSC with FOSCE = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.7.3 XOSC with FOSCE = 0 and STOP . . . . . . . . . . . . . . . . . . 109 8.7.4 Unused XOSC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.8 8.9 8.10 8.11 8.12 8.13 Stop and Wait Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 XOSC Clock Divider and POD Counter . . . . . . . . . . . . . . . . . 112 System Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 XOSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Stop and Wait Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Miscellaneous Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 8.2 Introduction The MC68HC05L25 has dual on-chip oscillators for typical 4.0-MHz and 32.768-kHz crystals. Refer to Figure 8-1. The clock generated is used by the CPU and by the subsystem modules such as time base and LCD. Refer to Figure 8-3. MC68HC05L25 -- Rev. 3.0 MOTOROLA Oscillators and Clock For More Information On This Product, Go to: www.freescale.com Technical Data 105 Freescale Semiconductor, Inc. Oscillators and Clock 8.3 OSC Clock Divider and POR Counter The OSC clock is divided by a 7-bit counter which is used for the system clock, time base, and POR counter. Clocks divided by 2, 4, and 64 are available for the system clock selections and clock divided by 128 is provided for the time base and POR counter. The POR counter is a 6-bit clock counter that is driven by the OSC divided by 128. The overflow of this counter is used for setting FTUP bit, release of power-on reset (POR), and resuming operation from stop mode. The 7-bit divider and POR counter are initialized to $0078 by these conditions: * * Power-on detection When FOSCE bit is cleared Freescale Semiconductor, Inc... 8.4 System Clock Control The system clock is provided for all internal modules except time base. Both OSC and XOSC are available as the system clock source. The divide ratio is selected by the SYS1 and SYS0 bits in the MISC register. By default, OSC divided by two is selected on reset. Table 8-1. System Bus Frequency Selection CPU Bus Frequency (Hz) SYS1 SYS0 Divide Ratio OSC = 4.0 M OSC = 4.1943 M XOSC = 32.768 K 0 0 1 1 0 1 0 1 OSC Divided by 2 (Default) OSC Divided by 4 OSC Divided by 64 XOSC Divided by 2 2.0 M 1.0 M 62.5 k -- 2.0972 M 1.0486 M 65.536 k -- -- -- -- 16.384 k Technical Data 106 Oscillators and Clock For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Oscillators and Clock OSC and XOSC 8.5 OSC and XOSC The secondary oscillator (XOSC) runs continuously after power-up. The main oscillator (OSC) can be stopped to conserve power via the STOP instruction or clearing the FOSCE bit in the MISC register. The effects of restarting the OSC will vary depending on the current state of the MCU, including SYS0-SYS1 and FOSCE bits. NOTE: Freescale Semiconductor, Inc... Do not switch the system clock to XOSC (SYS1-SYS0 = 11) when XOSC clock is not available. XOSC clock is available when STUP flag is set. Do not switch the system clock to OSC (SYS1-SYS0 = 00, 01, or 10) when OSC clock is not available. OSC clock is available when FTUP flag is set. 8.6 OSC On Line If the system clock is OSC, FOSCE should remain set. Executing the STOP instruction in this condition will halt OSC, put the MCU into a low-power mode and clear the 6-bit POR counter. The 7-bit divider is not initialized. Exiting STOP with external IRQ or RESET re-starts the oscillator. When the POR counter overflows, internal reset is released and execution can begin. The stabilization time will vary between 8064 and 8192 counts. NOTE: Exiting STOP with external IRQ will always return the MCU to the state as defined by the register definitions prior to executing the STOP instruction. MC68HC05L25 -- Rev. 3.0 MOTOROLA Oscillators and Clock For More Information On This Product, Go to: www.freescale.com Technical Data 107 Freescale Semiconductor, Inc. Oscillators and Clock 8.7 XOSC On Line If XOSC is the system clock (SYS0-SYS1 = 1-1), OSC can be stopped either by the STOP instruction or by clearing the FOSCE bit. The suboscillator (XOSC) never stops except during powerdown. This clock can also be used as the clock source of the system clock and time base. OSC and XOSC pins have options for feedback and damping resistor implementations. These options are set through mask option and can be read through the MOSR register. Freescale Semiconductor, Inc... OSC OSC1 Rf MASK OPTION ON CHIP OFF CHIP OSC2 XOSC1 XOSC XOSC2 Rxf Rxd MASK OPTION Figure 8-1. OSC1, OSC2, XOSC1, and XOSC2 Mask Options 8.7.1 XOSC with FOSCE = 1 If the system clock is XOSC and FOSCE = 1, executing the STOP instruction will halt OSC, put the MCU into a low-power mode, and clear the 6-bit POR counter. The 7-bit divider is not initialized. Exiting STOP with external IRQ re-starts the oscillator; however, execution begins immediately using XOSC. When the POR counter overflows, FTUP is set, signaling that OSC is stable and OSC can be used as the system clock. The stabilization time will vary between 8064 and 8192 counts. Technical Data 108 Oscillators and Clock For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Oscillators and Clock XOSC On Line 8.7.2 XOSC with FOSCE = 0 If XOSC is the system clock, clearing FOSCE will stop OSC and preset the 7-bit divider and 6-bit POR counter to $0078. Execution will continue with XOSC and when FOSCE is set again, OSC will re-start. When the POR counter overflows, FTUP is set, signaling that OSC is stable and OSC can be used as the system clock. The stabilization time will be 8072 counts. 8.7.3 XOSC with FOSCE = 0 and STOP If XOSC is the system clock and FOSCE is cleared, further power reduction can be achieved by executing the STOP instruction. In this case, OSC is stopped, the 7-bit divider and 6-bit POR counter are preset to $0078 (since FOSCE = 0), and execution is halted. Exiting STOP with external IRQ does not re-start the OSC; however, execution begins immediately using XOSC. OSC can be re-started by setting FOSCE, and when the POR counter overflows, FTUP be will set, signaling that OSC is stable and can be used as the system clock. The stabilization time will be 8072 counts. 8.7.4 Unused XOSC When XOSC is not used, the XOSC1 pin must be connected to the RESET pin to ensure proper initialization of clock circuitry. The XOSC2 pin should be left unconnected. See Figure 8-2. Configure time base by setting the TBCLK bit in TBCR1 to receive clock from fast oscillator OSC. Freescale Semiconductor, Inc... NOTE: When XOSC is not used, the XOSC1 input pin should be connected to RESET pin to ensure proper initialization of clock circuitry. RESET LOGIC RESET ON CHIP OFF CHIP XOSC1 XOSC XOSC2 NO CONNECT FROM EXTERNAL RESET CIRCUIT Figure 8-2. Unused XOSC1 Pin MC68HC05L25 -- Rev. 3.0 MOTOROLA Oscillators and Clock For More Information On This Product, Go to: www.freescale.com Technical Data 109 Freescale Semiconductor, Inc. Oscillators and Clock 8.8 Stop and Wait Modes During stop mode, the main oscillator (OSC) is shut down and the clock path from the second oscillator (XOSC) is disconnected, such that all modules except time base are halted. Entering stop mode clears the FTUP flag in the MISC register and initializes the POR counter. Stop mode is exited by RESET, IRQ, KWI, SPI (slave mode), or TBI interrupt. If OSC is selected as the system clock source during stop mode, CPU resumes after the overflow of the POR counter, and this overflow also sets FTUP status flag. If XOSC is selected as the system clock source during stop mode, no stop recovery time is required for exiting stop mode because XOSC never stops, and re-start of main oscillator depends on FOSCE bit. During wait mode, only the CPU clocks are halted and the peripheral modules are not affected. Wait mode is exited by the RESET and any interrupts. Table 8-2. CPU Startup Time Requirements Before RESET or Interrupt CPU Clock Source -- OSC (OSC ON) CPU FOSCE -- RUN RUN OSC (OSC OFF) STOP STOP XOSC (OSC ON) RUN RUN XOSC (OSC OFF) STOP STOP NOTES: 1. Do not enter this state. 2. This state does not exist. Freescale Semiconductor, Inc... Power-On External Reset RESET Delay -- -- -- -- -- -- -- -- -- No Delay Delay Delay Delay No Delay Delay Delay Delay Exit Stop Mode by an Interrupt -- -- -- Delay Delay -- -- No Delay No Delay -- 1 01 1 02 1 0 1 0 NOTE: Power-on reset is strictly for power-on conditions and does not detect a drop in power. Technical Data 110 Oscillators and Clock For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Oscillators and Clock Stop and Wait Modes 1/3 0 1 1 SEL 1/2 0 SEL PORT A6 REMOTE CONTROL CARRIER OUTPUT TIME BASE CONTROL REGISTER 1 ($10) TBCLK 0 LCLK RMC4 RMC3 RMC2 RMC1 RMC0 Freescale Semiconductor, Inc... RF OSC2 OSC LSB 7-BIT DIVIDER #1 1/32 1/64 1/16 1/2 1/4 1/8 OSC1 SEL MSB X1 C1 C2 TIME BASE CLOCK (TBCLK) 6-BIT DIVIDER XOSC1 RXF XOSC SEL LSB 01 10 SEL 00 11 0 SEL 1 1/2 0 SEL SYSTEM CLOCK (PH2) 0 1/128 1/64 1 LCD Clock (LCDCLK) XOSC2 7-BIT DIVIDER #2 0 0 1 1 SEL 1 (0 RXD MSB 1) POL BUZZER OUTPUT X2 C3 C4 (0 LSB 0 0 0 0 0 0) MSB 1/128 1/64 FTUP STUP 0 0 SYS1 7-BIT DIVIDER #3 1/32 SYS0 FOSCE OPTM MISC REGISTER ($3E) 11 10 SEL 01 00 F-F 1/4 COP RESET (COPR) TBIF TBIE TBR1 TBR0 RTBIF -- COPE COPC TIME BASE CONTROL REGISTER 2 ($11) Figure 8-3. Clock Signal Distribution MC68HC05L25 -- Rev. 3.0 MOTOROLA Oscillators and Clock For More Information On This Product, Go to: www.freescale.com Technical Data 111 Freescale Semiconductor, Inc. Oscillators and Clock 8.9 XOSC Clock Divider and POD Counter The XOSC clock divided by a 14-bit counter, also called power-on divider (POD), is used for the system clock. The oscillator clock divided by two is used by the system clock and oscillator clock divided by 64 or 128 is provided for the LCD module. The overflow of the POD counter is used for setting the STUP bit and releasing power-on reset (POR). The 14-bit divider/POD counter is initialized to $0078 by power-on detection. Freescale Semiconductor, Inc... 8.10 System Clock Control The system clock (PH2) is provided for CPU and all internal modules. 8.11 XOSC The oscillator (XOSC) runs continuously after power-up. The XOSC never stops while power is applied. XOSC pins have options for feedback and damping resistor implementations. These options are set through mask option and may be read through the mask option status register (MOSR). See 1.4 Mask Options. 8.12 Stop and Wait Modes Power reduction can be achieved by executing the STOP instruction and halting the CPU. During stop mode, the CPU and all modules except time base are halted. The stop mode is exited by external RESET, COP reset, IRQ, SPI (slave mode), or TB interrupt. The CPU resumes immediately from stop mode since XOSC never stops oscillating during stop mode. The CPU clock is halted and the peripheral modules are not affected during wait mode. Wait mode is exited by RESET or any interrupts. Technical Data 112 Oscillators and Clock For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Oscillators and Clock Miscellaneous Register Table 8-3. Recovery Time Requirements Delay Time After Reset or Interrupt Mode Before Reset or Interrupt Power Off Run Stop/Wait Power-On Reset Delay See Note See Note COP and External RESET -- No Delay No Delay Exit Stop Mode by Interrupt -- -- No Delay Freescale Semiconductor, Inc... NOTE: Power-on reset is strictly for power-on conditions and does not detect a drop in power. 8.13 Miscellaneous Register Address: $003E Bit 7 Read: Write: Reset: U U 0 0 0 U = Unaffected 0 1 0 FTUP 6 STUP 5 0 4 0 SYS1 SYS0 FOSCE OPTM 3 2 1 Bit 0 = Unimplemented Figure 8-4. Miscellaneous Register (MISC) FTUP -- OSC Time Up Flag Power-on detection and clearing FOSCE bit clears this bit. This bit is set by the overflow of the POR counter. A reset does not affect this bit. Read: 1 = OSC clock available for the system clock 0 = During POR or OSC shut down STUP -- XOSC Time Up Flag The power-on detection clears this bit. This bit is set after the time base has counted 16,264 clocks. A reset does not affect this bit. Read: 1 = XOSC clock available for the system clock 0 = XOSC is not stabilized or no signal on XOSC1 and XOSC2 pins MC68HC05L25 -- Rev. 3.0 MOTOROLA Oscillators and Clock For More Information On This Product, Go to: www.freescale.com Technical Data 113 Freescale Semiconductor, Inc. Oscillators and Clock Bits 5 and 4 -- Reserved These bits are not used and always read as zero. SYS1 and SYS0 -- System Clock Select These two bits select the system clock source. On reset the SYS1 and SYS0 bits are initialized to zero and zero, respectively. Table 8-4. System Bus Frequency Selection SYS1 SYS0 Divide Ratio OSC Divided by 2 (Default) OSC Divided by 4 OSC Divided by 64 XOSC Divided by 2 2.0 M 1.0 M 62.5 k -- 2 CPU Bus Frequency (Hz) OSC = 4.0 M OSC = 4.1943 M XOSC = 32.768 k 0 0 1 1 0 1 0 1 2.0972 M 1.0486 M 65.536 k -- -- -- -- 16.384 k Freescale Semiconductor, Inc... NOTE: Do not switch the system clock to XOSC (SYS1-SYS0 = 11) when the XOSC clock is not available. The XOSC clock is available when the STUP flag is set. Do not switch the system clock to OSC (SYS1-SYS0 = 00, 01, or 10) when the OSC clock is not available. OSC clock is available when the FTUP flag is set. FOSCE -- Fast (Main) Oscillator Enable The FOSCE bit controls the main oscillator activity. This bit should not be cleared by the CPU when the main oscillator is selected as the system clock source. This bit is set on reset. 1 = When this bit is set: 1. The main oscillator starts again. 2. The FTUP flag is set by the POR counter overflow (8072 clocks) and OSC is ready to be used as the system and time base clocks. 0 = When this bit is cleared: 1. OSC is shut down. 2. The 7-bit dividers at the OSC input and POR counter are initialized to $0078. 3. The FTUP flag is cleared. Technical Data 114 Oscillators and Clock For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Oscillators and Clock Miscellaneous Register OPTM -- Option Map Select The OPTM bit selects one of two register maps at $0000-$000F. This bit is cleared on reset. 1 = Option map selected 0 = Main register map selected STATE A Freescale Semiconductor, Inc... CPU:RUN 2:OSC/2 OSC:ON XOSC:ON STATE C CPU:RUN 2:OSC/64 OSC:ON XOSC:ON RESET INT STATE B CPU:RUN 2:OSC/4 OSC:ON XOSC:ON STATE A STATE B STATE C CPU:RUN 2:XOSC/2 OSC:ON XOSC:ON STATE D RESET, INT FOSCE = 0 WHEN STUP = 1 FOSCE = 1 WHEN FTUP = 1 DELAY STOP STOP POWER ON CPU:RUN 2:XOSC/2 OSC:OFF XOSC:ON STATE E INT RESET STOP HIGH SPEED A B INT STATE D STATE E 2 = BUS CLOCK C D E STOP LOW POWER NOTES: 1. When switching from state E to state D, the FTUP bit in the MISC register must be set. 2. When switching from state D to state E, the STUP bit in the MISC register must be set. Figure 8-5. Clock State and STOP/POD Delay Diagram MC68HC05L25 -- Rev. 3.0 MOTOROLA Oscillators and Clock For More Information On This Product, Go to: www.freescale.com Technical Data 115 Freescale Semiconductor, Inc. Oscillators and Clock Freescale Semiconductor, Inc... Technical Data 116 Oscillators and Clock For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 9. Time Base 9.1 Contents 9.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Freescale Semiconductor, Inc... 9.3 Time Base Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.3.1 LCDCLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.3.2 STUP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.3.3 TBI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 9.3.4 COP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 9.3.5 Remote Control Carrier Generator . . . . . . . . . . . . . . . . . .121 9.3.6 Buzzer Tone Generator. . . . . . . . . . . . . . . . . . . . . . . . . . . 123 9.4 9.5 9.6 Time Base Control Register 1. . . . . . . . . . . . . . . . . . . . . . . . . 124 Time Base Control Register 2 . . . . . . . . . . . . . . . . . . . . . . . . 125 Time Base Control Register 3 . . . . . . . . . . . . . . . . . . . . . . . . 127 9.2 Introduction Time base is a 14-bit up-counter which is clocked by XOSC. This 14-bit divider is initialized to $0078 only upon power-on reset (POR). After counting 16,264 clocks, the STUP bit in the MISC register is set. See Figure 8-4 for more information. MC68HC05L25 -- Rev. 3.0 MOTOROLA Time Base For More Information On This Product, Go to: www.freescale.com Technical Data 117 Freescale Semiconductor, Inc. Time Base 9.3 Time Base Submodules The clock divided by the time base is used for LCDCLK, STUP, TBI, and COP. The time base clock can be provided either from OSC or XOSC. 9.3.1 LCDCLK One of four clock frequency combinations can be selected for the LCD clock. Freescale Semiconductor, Inc... Table 9-1. LCD Clock Frequency TBCR1 TBCLK LCLK 0 0 1 1 0 1 0 1 XOSC / 64 XOSC / 28 OSC / 8192 OSC / 16,384 Divide Ratio 512 256 244 122 LCD Clock Frequency (Hz) (fXOSC = 32.768 kHz) OSC = 2.0 MHz OSC = 4.0 MHz OSC = 4.1943 MHz 512 256 488 244 512 256 512 256 9.3.2 STUP The time base divider is initialized to $0078 at power-on, and when the count reaches 16,264, the STUP flag in the MISC register is set. Once the STUP flag is set, it is never cleared while power is applied. Technical Data 118 Time Base For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Time Base Time Base Submodules 9.3.3 TBI Time base interrupt can be generated every 0.5, 0.25, 0.125, or 0.0039 seconds with a 32.768-kHz crystal at XOSC pins. See Table 9-2. Time base interrupt flag (TBIF) is set every period and an interrupt is requested if the enable bit (TBIE) is set. The clock divided by 128, 4096, 8192, or 16,384 is used to set TBIF, and this clock is selected by the TBR1 and TBR0 bits in the TBCR2 register. Freescale Semiconductor, Inc... Table 9-2. Time Base Interrupt Frequency TBCR2 TBR1 TBR0 0 0 1 1 0 1 0 1 Divide Ratio TBCLK / 128 TBCLK / 4096 TBCLK / 8192 TBCLK / 16,384 Frequency (Hz) OSC = 4.0 MHz OSC = 4.1943 MHz XOSC = 32.768 kHz 244 7.63 3.81 1.91 256 8.00 4.00 2.00 256 8.00 4.00 2.00 MC68HC05L25 -- Rev. 3.0 MOTOROLA Time Base For More Information On This Product, Go to: www.freescale.com Technical Data 119 Freescale Semiconductor, Inc. Time Base 9.3.4 COP The computer operating properly (COP) watchdog timer on the MC68HC05L25 is controlled by the COPE and COPC bits in the TBCR2 register. The COP uses the same clock as TBI that is selected by the TBR1 and TBR0 bits. The TBI clock is divided by four and overflow of this divider generates COP timeout reset if the COP enable (COPE) bit is set. The COP timeout reset has the same vector address as power-on and external RESET. To prevent the COP timeout, the COP divider is cleared by writing a one to the COP clear (COPC) bit. When the time base divider is driven by the OSC clock, the clock for the divider is suspended during stop mode or when FOSCE is equal to zero. This may cause stretching of the COP period or no COP timeout reset occurring when there is a processing error. It is recommended that the XOSC clock be used as the clock source for time base to avoid these problems. When the COP is enabled during stop mode and the time base is driven by the XOSC clock, the divider does not stop counting and the COPC bit must be triggered to prevent the COP timeout. It is recommended that the COP watchdog should be disabled for a system that must have intentional use of the stop mode period longer than the COP timeout period. Table 9-3. COP Timeout Period TBCR2 OSC = 4.0 MHz TBR1 TBR0 Min 0 0 1 1 0 1 0 1 12.3 393 786 1573 Freescale Semiconductor, Inc... COP Period (ms) OSC = 4.1943 MHz Min 11.7 375 750 1500 XOSC = 32.768 kHz Min 11.7 375 750 1500 Max 16.4 524 1048 2097 Max 15.6 500 1000 2000 Max 15.6 500 1000 2000 Technical Data 120 Time Base For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Time Base Time Base Submodules 9.3.5 Remote Control Carrier Generator The PA6/RMO pin functions as a general-purpose I/O port after reset. The RMPE bit must be set in order to use this port as a remote control carrier output. The RMO outputs idle state is set by the RPOL bit when RMON is cleared. The RMCLK signal selected by RMC4-RMC0 bits is output on the pin when RMON is set. Table 9-4. Remote Carrier Frequency Selection Freescale Semiconductor, Inc... RMC4 RMC3 RMC2: RMC0 0 1 RMO Duty Divider 1/4 1/8 110 kHz 55.0 kHz 27.5 kHz 13.8 kHz 6.88 kHz 3.44 kHz 36.7 kHz 18.3 kHz 9.17 kHz 4.58 kHz 2.29 kHz 1.15 kHz 220 kHz 110 kHz 55.0 kHz 27.5 kHz 13.8 kHz 6.88 kHz 73.3 kHz 36.7 kHz 18.3 kHz 9.17 kHz 4.58 kHz 2.29 kHz Remote Carrier Frequency on RMO Pin (RMCLK) OSC = 440 kHz OSC = 3.6 MHz 900 kHz 450 kHz 225 kHz 113 kHz 56.3 kHz 28.1 kHz 300 kHz 150 kHz 75.0 kHz 37.5 kHz 18.8 kHz 9.38 kHz 1800 kHz 900 kHz 450 kHz 225 kHz 113 kHz 56.3 kHz 600 kHz 300 kHz 150 kHz 75.0 kHz 37.5 kHz 18.8 kHz OSC = 4.0 MHz 1000 kHz 500 kHz 250 kHz 125 kHz 62.5 kHz 31.3 kHz 333 kHz 167 kHz 83.3 kHz 41.7 kHz 20.8 kHz 10.4 kHz 2000 kHz 1000 kHz 500 kHz 250 kHz 125 kHz 62.5 kHz 667 kHz 333 kHz 167 kHz 83.3 kHz 41.7 kHz 20.8 kHz Technical Data 1 2 3 4 50% 1/16 1/32 1/64 1/128 1/12 1/24 0 5 0 1 0 2 3 4 5 0 1 1 2 3 4 50% 50% 1/48 1/96 1/192 1/384 1/2 1/4 1/8 1/16 1/32 1/64 1/6 1/12 1 5 0 1 0 2 3 4 5 33% 1/24 1/48 1/96 1/192 MC68HC05L25 -- Rev. 3.0 MOTOROLA Time Base For More Information On This Product, Go to: www.freescale.com 121 Freescale Semiconductor, Inc. Time Base RMCLK PA6 I/O PORT PA6/RMO RMO PORT PA6 I/O PORT IDLE DDRA6 CARRIER OUT IDLE RMPE Freescale Semiconductor, Inc... RMON RPOL Figure 9-1. Remote Control Carrier Output Port Control (RPOL = 1) RMCLK PA6 I/O PORT PA6/RMO RMO PORT PA6 I/O PORT IDLE DDRA6 CARRIER OUT IDLE RMPE RMON RPOL Figure 9-2. Remote Control Carrier Output Port Control (RPOL = 0) RMC4 = 0: RPOL = X RMC4 = 1: RMCLK RMCLK Figure 9-3. Remote Control Carrier Duty Control Technical Data 122 Time Base For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Time Base Time Base Submodules 9.3.6 Buzzer Tone Generator The PA3/KWI3/BZ pin functions as a general-purpose I/O port after reset. The BZPE bit must be set in order to use this port as buzzer tone output. The BZ outputs idle state is set by the BPOL bit when BZON is cleared. The BZCLK signal selected by the BCLK bit is output on the pin when BZON is set. The BZ output pin is open drain. Table 9-5. Buzzer Frequency Freescale Semiconductor, Inc... Buzzer Frequency on BZ Pin (BZCLK) TBCR1 TBCR3 TBCLK BCLK 0 0 1 1 0 1 0 1 fOSC = 2 MHz fXOSC = 32.768 kHz 4096 Hz 2048 Hz Approximately 1953 Hz Approximately 977 Hz fOSC = 3.6 MHz fXOSC = 32.768 kHz 4096 Hz 2048 Hz Approximately 3516 Hz Approximately 1758 Hz fOSC = 4 MHz fXOSc = 32.768 kHz 4096 Hz 2048 Hz Approximately 3906 Hz Approximately 1953 Hz fOSC = 4.194304 MHz fXOSC = 32.768 kHz 4096 Hz 2048 Hz 4096 Hz 2048 Hz BZCLK PC2 I/O PORT PA3/BZ* BZ PORT PC2 I/O PORT IDLE CLOCK OUT IDLE BZPE BZON BPOL *The BZ output pin is open drain. The logic 1 shown for the BZ pin is actually a hi-Z state unless it is a pullup. Figure 9-4. Buzzer Tone Output Control MC68HC05L25 -- Rev. 3.0 MOTOROLA Time Base For More Information On This Product, Go to: www.freescale.com Technical Data 123 Freescale Semiconductor, Inc. Time Base 9.4 Time Base Control Register 1 Address: $0010 Bit 7 Read: TBCLK Write: Reset: 0 0 0 0 0 0 0 0 6 0 LCLK RMC4 RMC3 RMC2 RMC1 RMC0 5 4 3 2 1 Bit 0 = Unimplemented Freescale Semiconductor, Inc... Figure 9-5. Time Base Control Register 1 (TBCR1) TBCLK -- Clock Source This bit selects the time base clock source and is cleared on reset. 1 = OSC selected for time base clock source 0 = XOSC selected for the time base clock source Bit 6 -- Reserved This bit is not used and always reads as zero. LCLK -- LCD Clock The LCLK bit selects the clock for the LCD driver and is cleared on reset. When TBCLK = 0: 1 = XOSC divide by 128 selected for the LCD clock 0 = XOSC divide by 64 selected for the LCD clock When TBCLK = 1: 1 = OSC divide by 16,384 selected for the LCD clock 0 = OSC divide by 8192 selected for the LCD clock RMC4 -- Remote Control Generator Divider This bit selects the remote control carrier duty cycle and is cleared on reset. 1 = 33-67% duty selected if RMC3 = 0 0 = 50-50% duty selected RMC3:RMC0 -- Remote Control Generator Divider These bits select the remote control carrier frequency. (See Table 9-4.) These bits are cleared on reset. Technical Data 124 Time Base For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Time Base Time Base Control Register 2 9.5 Time Base Control Register 2 Address: $0011 Bit 7 Read: Write: Reset: 0 0 0 0 TBIF TBIE TBR1 TBR0 RTBIF 0 0 0 6 5 4 3 0 2 0 COPE COPC 0 1 Bit 0 0 = Unimplemented Freescale Semiconductor, Inc... Figure 9-6. Time Base Control Register 2 (TBCR2) TBIF -- Time Base Interrupt Flag The TBIF bit is set every timeout interval of the time base interrupt. This is a read-only bit and is cleared by writing a one to the RTBIF bit. Reset clears the TBIF bit. The time base interrupt period between reset and first TBIF depends on the time elapsed during reset, since the time base divider is not initialized on reset. TBIE -- Time Base Interrupt Enable The TBIE bit enables the time base interrupt capability. If TBIF = 1 and TBIE = 1, the time base interrupt is generated. 1 = TB interrupt requested when TBIF = 1 0 = TB interrupt disabled TBR1-TBR0 -- Time Base Interrupt Rate Select The TBR1 and TBR0 bits select one of four rates for the time base interrupt period. The TBI rate is also related to the COP timeout reset period. See Table 9-2 and Table 9-3. These bits are set to a logical 1 on reset. RTBIF -- Reset Time Base Interrupt Flag The RTBIF bit is a write-only bit and always reads as zero. Writing a one to this bit clears the TBIF bit and writing zero to this bit has no effect. 1 = Reset TBIF 0 = No effect MC68HC05L25 -- Rev. 3.0 MOTOROLA Time Base For More Information On This Product, Go to: www.freescale.com Technical Data 125 Freescale Semiconductor, Inc. Time Base Bit 2 -- Reserved This bit is not used and always reads as zero. COPE -- COP Enable When the COPE bit is one, the COP reset function is enabled. This bit is cleared on reset (including COP timeout reset) and a write to this bit is allowed only once after reset. 1 = COP enabled 0 = COP disabled Freescale Semiconductor, Inc... COPC -- COP Clear Writing a logical 1 to COPC bit clears the 2-bit divider to prevent COP timeout. (The COP timeout period depends on the TBI rate.) This is a write-only bit and returns to zero when read. 1 = Clear COP timeout divider 0 = No effect Technical Data 126 Time Base For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Time Base Time Base Control Register 3 9.6 Time Base Control Register 3 Address: $001F Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 0 RMON RPOL RMPE BCLK BZON BPOL BZPE 6 5 4 3 2 1 Bit 0 = Unimplemented Freescale Semiconductor, Inc... Figure 9-7. Time Base Control Register 3 (TBCR3) Bit 7 -- Reserved This bit is not used and always reads as zero. RMON -- Remote Control Generator Signal ON When the port is used as remote control output (RMPE = 1), this bit turns on or off the remote control signal. The idle state is output when cleared and is cleared on reset. 1 = Carrier on 0 = Carrier off; idle state defined by RPOL as output RPOL -- Remote Control Idle Polarity This bit controls the idle state of the remote control generator output on the port and is cleared on reset. 1 = Remote idle state outputs logic 1. 0 = Remote idle state outputs logic 0. RMPE -- Remote Control Generator Port Output Enable This bit enables the remote control generator output on the port. The actual remote signal on/off is controlled by RMON bit. This bit is cleared on reset. 1 = Port pin functions as remote control output. 0 = Port pin functions as general I/O port. MC68HC05L25 -- Rev. 3.0 MOTOROLA Time Base For More Information On This Product, Go to: www.freescale.com Technical Data 127 Freescale Semiconductor, Inc. Time Base BCLK -- Buzzer Clock Select This bit selects the buzzer tone output frequency. This bit is cleared on reset. 1 = OSC/211 or XOSC/24 selected for buzzer clock 0 = OSC/210 or XOSC/23 selected for buzzer clock BZON -- Buzzer Signal ON When the port is used as buzzer output (BZPE = 1), BZON turns on the buzzer signal. Reset clears BZON. 1 = Buzzer on 0 = Buzzer off; idle state defined by BPOL as output BPOL -- Buzzer Output Polarity This bit selects the buzzer output pin's polarity during buzzer idle (standby) period (BZON = 0). When BZE = 0, this bit has no effect. This bit is cleared on reset. 1 = Buzzer idle state outputs logic 1. 0 = Buzzer idle state outputs logic 0. BZPE -- Buzzer Output Port Enable This bit controls whether the port functions as buzzer output or a general I/O port. The actual buzzer signal on/off is controlled by the BZON bit. (See Table 7-1.) This bit is cleared on reset. 1 = Port pin functions as buzzer output. 0 = Port pin functions as general I/O port. Freescale Semiconductor, Inc... Technical Data 128 MC68HC05L25 -- Rev. 3.0 Time Base For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 10. Serial Peripheral Interface 10.1 Contents 10.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Freescale Semiconductor, Inc... 10.3 10.4 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 10.4.1 Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 10.4.2 SPDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 10.4.3 SPCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 10.4.4 Clock Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 10.4.5 Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.4.6 Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.4.7 Serial Data Out (SDO). . . . . . . . . . . . . . . . . . . . . . . . . . . .132 10.4.8 Serial Data In (SDI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.4.9 Serial Clock (SCK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.5 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 10.6 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 10.6.1 Serial Peripheral Control Register . . . . . . . . . . . . . . . . . .135 10.6.2 Serial Peripheral Status Register . . . . . . . . . . . . . . . . . . . 137 10.6.3 SPI Data Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 10.6.4 Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 10.6.5 Stop/Wait Condition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.6.6 Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 10.6.7 Wait Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 MC68HC05L25 -- Rev. 3.0 MOTOROLA Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com Technical Data 129 Freescale Semiconductor, Inc. Serial Peripheral Interface 10.2 Introduction The serial peripheral interface (SPI) is built into the MC68HC05L25 to transmit or receive synchronous serial data. In this format, the serial clock is not included in the data stream and must be provided as a separate signal. When the SPI is enabled, reading port C will return the actual pin level. The MSTR bit selects the source of the serial clock from the internal or the external clock. The internal clock speed is selectable as 1/2 or 1/16 of the system clock. Freescale Semiconductor, Inc... 10.3 Features * * * * * * * Full Duplex 3-Wire Synchronous Transfers Master or Slave Operation Bit Rate Selection End of Transmission Interrupt Data Collision Flag Master Mode Maximum Serial Clock Speed at 1/2 the CPU System Clock Slave Mode Maximum Serial Clock Speed Up until the CPU System Clock 10.4 Block Diagram Figure 10-1 illustrates the block diagram of the SPI module. Technical Data 130 Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Serial Peripheral Interface Block Diagram HC05 INTERNAL BUS INTERRUPT CONTROLS & ADDRESS BUS CONTROL LOGIC DATA BUS 000000 SPSR SPCR SPE DORD MSTR 0 SPDR D CK START Q SDO Freescale Semiconductor, Inc... SPIF DCOL SPR R RESET CLOCK GENERATOR SCK SDI . Figure 10-1. SPI Block Diagram 10.4.1 Control The control logic is an interface to the HC05 internal bus. It generates the clock start signal, when writing to SPDR is detected in master mode. It also generates a flag clear signal and interrupt request to the CPU. 10.4.2 SPDR The serial peripheral data register (SPDR) is an 8-bit shift register. This register can be read or written by the CPU. It can also change parallel data to serial or vice versa. 10.4.3 SPCR The serial peripheral control register (SPCR) contains bits SPIE, SPE, DORD, SPR, and MSTR. The description on each bit can be found in 10.6.1 Serial Peripheral Control Register. MC68HC05L25 -- Rev. 3.0 MOTOROLA Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com Technical Data 131 Freescale Semiconductor, Inc. Serial Peripheral Interface 10.4.4 Clock Generator The clock generator includes a 3-bit serial clock counter. The counter starts after detecting the serial clock and halts after setting SPIF when the counter overflows. In master mode, this block generates serial clock (SCK) when CPU writes to the data register (SPDR) and the clock rate is selected by SPR bit in the control register (SPCR). Freescale Semiconductor, Inc... In slave mode, external clock from the SCK pin is used instead of master mode clock, and SPR has no effect. 10.4.5 Others The SPI does not use the data register of port C. Therefore, regardless of whether the SPI is used, the data register can be read from port C. 10.4.6 Signal Description The basic signals SDO, SDI, and SCK of SPI are described in the following paragraphs. SCK, SDO, and SDI pins are shared with port C pins PC0, PC1, and PC2, respectively. 10.4.7 Serial Data Out (SDO) SDO is an output pin. This pin is shared with port C pin PC1. When the SPI is enabled by SPE bit in the SPCR, this pin becomes an output pin. When the SPE is cleared, the pin becomes PC1 and thus becomes an input pin. The state of PC1/SDO can be read any time through PC1 data register. When the SPI is enabled and PC1/SDO is an output, data output becomes valid at the falling edge of the serial clock. Technical Data 132 Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Serial Peripheral Interface Block Diagram 10.4.8 Serial Data In (SDI) The SDI pin is multiplexed with a general-purpose I/O pin. This becomes an input-only pin and accepts serial input data when the SPI is enabled. 10.4.9 Serial Clock (SCK) The SCK pin is used for synchronization of both input and output data streams through SDI and SDO pins. The SCK pin should be at VDD level before SPI is enabled. The master and slave devices are capable of exchanging a data byte during a sequence of eight clock pulses. Since SCK is generated by the master, slave data transfer is accomplished by synchronization of SCK. When the MSTR bit in the SPCR is set, SCK becomes an output and the serial clock is supplied to the internal and external systems. When the serial clock is idling, high level is being output. When the bit is a logic 1, the CPU writes data to SPCR and outputs eight clock pulses. After the end of the eighth clock, high level is being output while idling. The clock speed in master mode is one-half the system clock. When the MSTR bit in the SPCR is cleared, SCK becomes an input and the external system supplies the serial clock while the internal system operates by synchronizing to this clock. After eight serial clocks are input to the SCK pin, the SPIF bit in the SPSR is set and will not receive the next serial clock input until the SPIF bit is cleared. The clock speed in slave mode is dependent upon the speed of the external system and has a maximum speed up till the internal system clock. Freescale Semiconductor, Inc... MC68HC05L25 -- Rev. 3.0 MOTOROLA Technical Data Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com 133 Freescale Semiconductor, Inc. Serial Peripheral Interface 10.5 Functional Description A block diagram of the SPI module is shown in Figure 10-1. In the SPI, if the SPE bit (SPI enable) of SPCR is set, bits 0, 1, and 2 of port C will be connected. During this time, bit 0 is used as the SCK (serial clock), bit 1 as the SDO (serial data out), and bit 2 will become SDI. When SPE is a logic zero, SPI system is disabled. In master mode (MSTR = 1), SCK becomes an output. When the CPU writes data to SPDR, start trigger will be applied from the control logic to the clock generator. The clock generator divides the system clock of the CPU (by 2 or 16) to generate the serial clock which is then output to the SCK pin. This clock is also used in the 3-bit clock counter and 8-bit shift register (SPDR). In slave mode (MSTR = 0), SCK becomes an input, and the external serial clock is used. Therefore, the internal clock generator will not generate the serial clock. After detecting the external clock, the clock will be used by the 3-bit clock counter and the 8-bit shift register (SPDR) located in the clock generator. The SCK is used to latch incoming data. In either master or slave mode, the SPIF flag is set after the end of the transmission and if the SPIE bit in the SPCR is set, the interrupt request is sent to the CPU. This interrupt request is accepted when the I mask bit of condition code register (CCR) is a logic zero and is inhibited when the bit is a logic one or until the mask is released. Also, if the SPIE bit is cleared, the interrupt request will not be accepted by the CPU. To clear the SPIF while it is still set, the SPDR must be read or written after accessing SPSR. Regardless of the master/slave I/O conditions, the DCOL bit of SPSR will be set when SPDR is accessed while the shift register is operating and while SPSR is not being accessed with SPIF set. DCOL is used to indicate that the data is not being properly read or written into SPDR. To clear the DCOL flag while it is still set, the SPDR must be read or written after accessing SPSR. Freescale Semiconductor, Inc... Technical Data 134 MC68HC05L25 -- Rev. 3.0 Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Serial Peripheral Interface Register Description 10.6 Register Description The SPI has three registers: control register (SPCR), status register (SPSR), and data register (SPDR). SPCR and SPDR can be read or written by the CPU, but SPSR can only be read. 10.6.1 Serial Peripheral Control Register Address: $000A Bit 7 Read: SPIE Write: Reset: 0 0 0 0 0 0 0 0 SPE DORD MSTR 6 5 4 3 0 2 0 1 0 SPR Bit 0 Freescale Semiconductor, Inc... = Unimplemented Figure 10-2. SPI Control Register (SPCR) SPIE -- SPI Interrupt Enable When SPIE (SPI interrupt enable) is set, it allows the occurrence of processor interrupt when SPIF in the SPSR is set. This interrupt request is accepted when the I bit in the CCR is cleared but inhibited when I bit is set. If the interrupt request is sent repeatedly while the I bit and only when SPIE and SPIF are set, the interrupt will occur immediately after the I bit is cleared. Reset clears this bit. 1 = SPI interrupt enabled 0 = SPI interrupt disabled SPE -- SPI Enable When SPE (SPI enable) is set, it enables the SPI system and connects bit 0 and bit 1 of port C to SCK and SDIO. Clearing SPE initializes the SPI system and disconnects SPI from port C. Reset clears this bit. 1 = SPI enabled 0 = SPI disabled MC68HC05L25 -- Rev. 3.0 MOTOROLA Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com Technical Data 135 Freescale Semiconductor, Inc. Serial Peripheral Interface NOTE: PC0/SCK should be at VDD level before SPI is enabled. This can be done with an internal or external pullup resistor or by setting DDRC0 = 1 and PC0 = 1 prior to enabling the SPI. Otherwise, the circuit will not initialize correctly. DORD -- Data Transmission Order When DORD is set, the data in the 8-bit shift register (SPDR) is shifted in/out from LSB first. When clear, the data is shifted MSB first. Reset clears this bit. 1 = LSB first 0 = MSB first MSTR -- Master Mode Select This MSTR (master mode select) bit determines whether to output the serial clock internally or input the clock externally. When set, SPI is in master mode and SCK is configured as an output pin. SCK outputs the serial clock when CPU writes data to SPDR. When cleared, the SPI is in slave mode and SCK is configured as an input pin. SCK receives the serial clock externally. Reset clears this bit. 1 = Master mode 0 = Slave mode Bits 3:1 -- Reserved These bits are reserved and always read as zero. SPR -- SPI Clock Rate Select This is the clock rate selection bit. When set, the master mode SCK rate is the system clock divided by 16. When clear, the rate system clock is divided by two. Reset clears this bit. 1 = System clock divided by 16 0 = System clock divided by 2 Freescale Semiconductor, Inc... Technical Data 136 MC68HC05L25 -- Rev. 3.0 Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Serial Peripheral Interface Register Description 10.6.2 Serial Peripheral Status Register Address: $000B Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 SPIF 6 DCOL 5 0 4 0 3 0 2 0 1 0 Bit 0 0 = Unimplemented Freescale Semiconductor, Inc... Figure 10-3. SPI Status Register (SPSR) SPIF -- Serial Transfer Complete Flag SPIF (serial peripheral interface flag) notifies the user that the data transfer between MC68HC05L25 and the external device has been completed. Upon completion of the data transfer, the rising edge of the eighth serial clock pulse sets SPIF. If SPIE in the SPCR is set, the SPI interrupt (SPII) will be generated. While SPIF is set, all access to the SPDR is inhibited until SPSR is read by the CPU. Also, even if the ninth serial clock is detected, the shift register (SPDR) will not operate. Clearing the SPIF is accomplished by a software sequence of accessing the SPSR while SPIF is set and followed by the SPDR access. (SPIF and DCOL can be cleared simultaneously.) Reset clears this bit. 1 = Serial data transfer complete 0 = Serial data transfer in progress DCOL -- Data Collision DCOL (data collision) notifies the user that an invalid access to the SPDR has been made. This bit is set when an attempt was made to read or write to SPDR while a data transfer was taking place with an external device. When DCOL is set, access to the SPDR becomes invalid. The transfer continues uninterrupted without any effect from the SPDR access. This flag does not generate SPI interrupt. It is read-only. MC68HC05L25 -- Rev. 3.0 MOTOROLA Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com Technical Data 137 Freescale Semiconductor, Inc. Serial Peripheral Interface DCOL is cleared by reading the SPSR with SPIF set followed by a read or write to the SPDR. If the last part of the clearing sequence is done after another transmission has started, DCOL will be set again. (DCOL and SPIF can be cleared simultaneously.) Reset clears this bit. 1 = Data collision occurred 0 = Data collision did not occur Bits 5-0 -- Reserved Freescale Semiconductor, Inc... These bits are unused and always read as zero. 10.6.3 SPI Data Register Address: $000C Bit 7 Read: SPD7 Write: Reset: Unaffected by Reset SPD6 SPD5 SPD4 SPD3 SPD2 SPD1 SPD0 6 5 4 3 2 1 Bit 0 Figure 10-4. SPI Data Register (SPDR) The SPDR is used to transmit and receive data on the serial bus. In master mode, a write to SPDR initiates the transmission/reception of data byte. At transfer completion, SPIF status bits are set. In slave mode, a write to the SPDR will not initiate the serial clock. The serial clock is input to the SCK pin by the external device. In either master or slave mode, a write to the SPDR is inhibited while this register is shifting (this condition causes DCOL to set) or when SPIF is set without reading SPSR. In this case, even if an access has occurred, the access becomes invalid. Refer to SPIF and DCOL descriptions for more information. When SPI is not being used, SPDR can be used as a data storage. This byte is not affected by reset. Technical Data 138 Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Serial Peripheral Interface Register Description 10.6.4 Timing Diagram Figure 10-5 illustrates the clock/data timing. SCK SDO DORD = 0 MSB BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 LSB Freescale Semiconductor, Inc... SDI DORD = 0 MSB BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 LSB SDO DORD = 1 LSB BIT1 BIT2 BIT3 BIT4 BIT5 BIT6 MSB SDI DORD = 1 LSB BIT1 BIT2 BIT3 BIT4 BIT5 BIT6 MSB DATA SAMPLE Figure 10-5. Clock/Data Timing MC68HC05L25 -- Rev. 3.0 MOTOROLA Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com Technical Data 139 Freescale Semiconductor, Inc. Serial Peripheral Interface 10.6.5 Stop/Wait Condition The following paragraphs describe stop and wait modes. 10.6.6 Stop Mode The SPI configured as master mode is not operational during stop mode since the system clock and SPI clock generator are halted. If stop mode occurs while SPI is in progress (transmitting/receiving) and in master mode, the access will halt and remains halted until stop is released. Due to the static architecture, the previous conditions of SCK and SDIO are preserved during stop mode. In slave mode, all accesses are possible during stop mode. However, at the end of transmission, interrupt occurs but the SPI will not be set immediately until after the system clock starts operating. (This operation is transparent to the programmer.) Freescale Semiconductor, Inc... 10.6.7 Wait Mode In wait mode, the CPU halts but will not affect the SPI operation. Therefore, SPI interrupt in master and slave modes can be executed to wake up the CPU. Technical Data 140 Serial Peripheral Interface For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 11. LCD Driver 11.1 Contents 11.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Freescale Semiconductor, Inc... 11.3 11.4 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 11.4.1 LCD Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 11.4.2 Fast Change Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 11.4.3 LCD Data Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 11.5 Terminal Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.5.1 VLCD Bias Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.5.2 Backplane Drivers (BP0-BP3) . . . . . . . . . . . . . . . . . . . . . 149 11.5.3 Frontplane Drivers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.6 LCD Connection and LCD Driver Operation. . . . . . . . . . . . . .154 11.7 LCD Waveform Base Clock and LCD Cycle Frame . . . . . . . . 157 11.7.1 Time Base Control Register 1 . . . . . . . . . . . . . . . . . . . . . . 158 11.7.2 LCD Cycle Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 11.8 Simplified LCD Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 141 Freescale Semiconductor, Inc. LCD Driver 11.2 Introduction The MC68HC05L25 has 25 or 24 frontplane (FP) and three or four backplane (BP) drivers. The number of drivers for the FP and BP can be selected by software option. The maximum number of segments configurable is either 24 x 4 = 96 or 25 x 3 = 75 segments. The MC68HC05L25 uses a 1/3 biasing method. The bias voltages are supplied from an external source using the VLCD pin. Voltages VLCD1, VLCD2, and VLCD3 are generated internally with resistor divider. Freescale Semiconductor, Inc... There are 11 bytes of data latch for selection (turned on) or nonselection (turned off) of segments. Each byte consists of two FP drivers and either three or four BP drivers depending on the duty configured. The data latch is available in memory locations $21 through $2D and can be accessed by the CPU using the conventional memory access method (LOAD, STORE, BIT operations, etc.). The clock which forms the LCD FP and BP waveforms is supplied by the time base module. Technical Data 142 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Block Diagram 11.3 Block Diagram Figure 11-1 illustrates the block diagram of the LCD module. FP10 FP11 FP12 FP13 FP14 FP15 Freescale Semiconductor, Inc... LCD FRONTPLANE DRIVER + DATA LATCH FP16 FP5 FP6 FP7 FP8 FP9 FP4 FP3 PORTB PB7/FP17 PB6/FP18 PB5/FP19 1/3 1/4 BACKPLANE FP2 FP1 BP3/FP0 BP2 BP1 BP0 VLCD LCDE (LCDC) DRIVER STATE CONTROL 1/3 1/4 PB4/FP20 PB3/FP21 PB2/FP22 PB1/FP23 PB0/FP24 Figure 11-1. LCD Block Diagram MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 143 Freescale Semiconductor, Inc. LCD Driver 11.4 Functional Description The following paragraphs provide a functional description of the LCD driver. See Figure 11-15 for a simplified schematic of the LCD system. 11.4.1 LCD Control Register Address: $0020 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 LCDE 6 PBEH 5 DUTY 4 PBEL 3 0 2 0 1 FC Bit 0 LC Freescale Semiconductor, Inc... = Unimplemented Figure 11-2. LCD Control Register LCDE -- LCD Enable Setting this bit enables the LCD waveforms to appear on the pins. Reset clears this bit. 1 = LCD drivers are operational. Each FP and BP driver outputs the driver waveform specified by the data latch. 0 = LCD drivers are halted. All FP and BP drivers have the same electric potential as VDD. RLCDs are disconnected to reduce DC current. PBEH -- Port B Enable High Nibble This bit enables the port B I/O bits 4-7 that are multiplexed with frontplane drivers 20-17. Reset clears this bit. 0 = PB4-PB7/FP20-FP17 pins function as port B bits 4-7. 0 = PB4-PB7/FP20-FP17 pins function as LCD frontplane drivers 20-17. DUTY -- Duty Cycle Select This bit selects the duty cycle of the LCD waveforms between 1/3 duty and 1/4 duty and selects either BP3 or FP0 for the muxed pin. Reset clears this bit. 1 = 1/3 duty cycle is selected and BP3/FP0 pin functions as FP0. 0 = 1/4 duty cycle is selected and BP3/FP0 pin functions as BP3. Technical Data 144 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Functional Description PBEL -- Port B Enable Low Nibble This bit enables the port B I/O bits 0-3 that are multiplexed with frontplane drivers 24-21. Reset clears this bit. 1 = PB0-PB3/FP24-FP21 pins function as port B bits 0-3. 0 = PB0-PB3/FP24-FP21 pins function as LCD frontplane drivers 24-21. Bits 3 and 2 -- Reserved These bits are unused and always read as zero. Freescale Semiconductor, Inc... FC and LC -- Fast Charge and Low Current These bits are used to select various values of resistors in the voltage generator resistor chain. Reset clears these bits. Table 11-1. RLCD Configuration FC X 0 1 LC 0 1 1 Action Default value of approximately 160 k per resistor Resistor value of approximately 860 k per resistor Fast-Charge: For a period of LCDCLK/128 in each frame, the resistor values are reduced to default (value for LC = 0). MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 145 Freescale Semiconductor, Inc. LCD Driver 11.4.2 Fast Change Option The RLCD is approximately 160 k at VDD = 3 V by default. This value can be inappropriate for some applications. For those applications that require less DC current drain through the RLCD chain, it may be increased to approximately 860 k at VDD = 3 V by setting the LC bit in LCDCR. Some applications may require the default resistance to drive the capacitive load of the LCD panel, yet do not wish to have the DC current drain of it while the LCD segments are not switching. For a compromise, a fast-charge option is available. The RLCD values are reduced to the default resistance for a fraction of the LCD segment cycle before the LCD segments change, and then are set to low-current mode for the remainder of the LCD cycle frame. The DC current increase is very negligible and will be within a few percent increase of the low-current mode. Freescale Semiconductor, Inc... BP0 FC CLOCK Figure 11-3. BP0/FC Clock Timing Technical Data 146 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Functional Description 11.4.3 LCD Data Registers The LCD data latches LDAT1 through LDAT11 maintain the ON/OFF data for the FP and BP segments of the LCD. Four bits of data latch are assigned to each frontplane driver from address space $21 through $2D as shown in Figure 11-4. When a logic 1 is written to the bits in the data latch, the applicable FP-BP segment turns ON. When a logic 0 is written to the bits, the segment is turned OFF. The values in the data latches are not initialized and are unknown on reset. If 1/3 duty is selected, each BP3 bit in the data latches is ignored. Freescale Semiconductor, Inc... MC68HC05L25 -- Rev. 3.0 MOTOROLA Technical Data LCD Driver For More Information On This Product, Go to: www.freescale.com 147 Freescale Semiconductor, Inc. LCD Driver Addr Hex $0020 Register Name Bit 7 LCD Control Register (LCDCR) Read: Write: LCDE 6 PBEH 5 Bit Number Sequence 4 PBEL 3 0 2 0 1 FC Bit 0 LC DUTY $0021 LCD Data Register (LDAT1) Read: Write: F1B3 F1B2 F1B1 F1B0 F0B3 F0B2 F0B1 F0B0 $0022 LCD Data Register (LDAT2) Read: Write: F3B3 F3B2 F3B1 F3B0 F2B3 F2B2 F2B1 F2B0 Freescale Semiconductor, Inc... $0023 LCD Data Register (LDAT3) Read: Write: F5B3 F5B2 F5B1 F5B0 F4B3 F4B2 F4B1 F4B0 $0024 LCD Data Register (LDAT4) Read: Write: F7B3 F7B2 F7B1 F7B0 F6B3 F6B2 F6B1 F6B0 $0025 LCD Data Register (LDAT5) Read: Write: F9B3 F9B2 F9B1 F9B0 F8B3 F8B2 F8B1 F8B0 $0026 LCD Data Register (LDAT6) Read: Write: F11B3 F11B2 F11B1 F11B0 F10B3 F10B2 F10B1 F10B0 $0027 LCD Data Register (LDAT7) Read: Write: F13B3 F13B2 F13B1 F13B0 F12B3 F12B2 F12B1 F12B0 $0028 LCD Data Register (LDAT8) Read: Write: F15B3 F15B2 F15B1 F15B0 F14B3 F14B2 F14B1 F14B0 $0029 LCD Data Register (LDAT9) Read: Write: F17B3 F17B2 F17B1 F17B0 F16B3 F16B2 F16B1 F16B0 $002A LCD Data Register (LDAT10) Read: Write: F19B3 F19B2 F19B1 F19B0 F18B3 F18B2 F18B1 F18B0 $002B LCD Data Register (LDAT11) Read: Write: F21B3 F21B2 F21B1 F21B0 F20B3 F20B2 F20B1 F20B0 $002C LCD Data Register (LDAT12) Read: Write: F23B3 0 F23B2 0 F23B1 0 F23B0 0 F22B3 F22B2 F22B1 F22B0 $002D LCD Data Register (LDAT13) Read: Write: F24B3 F24B2 F24B1 F24B0 = Unimplemented Figure 11-4. LCD Data Registers (LDAT1-LDAT13) Technical Data 148 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Terminal Description 11.5 Terminal Description A total of 27 pins is dedicated to the LCD driver. 11.5.1 VLCD Bias Inputs VLCD1 through VLCD3 are internal bias voltages for the LCD driver waveforms. VLCD3 potential is available externally as the VLCD pin, and a variable resistor for contrast can be placed between VLCD and VSS. See Figure 11-15. The LCD uses the three bias voltages typically as follows: 1. VLCD1 = VDD -- 1/3 VLCDA (VLCDA is the ON voltage for the LCD modules.) 2. VLCD2 = VDD -- 2/3 VLCDA (Usually, VLCDA VDD is used.) 3. VLCD3 = VDD -- VLCDA = VLCD (VLCD is the external pin.) The three voltages shown above are arranged so that the external voltages will have a VLCD1 > VLCD2 > VLCD3 relationship in a voltage divider configuration. Freescale Semiconductor, Inc... 11.5.2 Backplane Drivers (BP0-BP3) Pins BP0-BP3 are the output terminals for the backplane drivers. These are connected to the backplane of the LCD panel. Depending on the duty, the waveforms in Figure 11-5 and Figure 11-6 appear on the backplane pins. 11.5.3 Frontplane Drivers Pins FP0-FP24 are the output terminals for the frontplane drivers. These are connected to the frontplane of the LCD panel. Depending on the content of the data latch, the waveforms in Figure 11-7 and Figure 11-8 appear on the frontplane drivers. MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 149 Freescale Semiconductor, Inc. LCD Driver . DUTY = 1/3 1FRAME VDD BP0 VLCD1 VLCD2 VLCD3 VDD BP1 VLCD1 VLCD2 VLCD3 Freescale Semiconductor, Inc... VDD BP2 VLCD1 VLCD2 VLCD3 NOTES: 1. BP3 is not used. 2. At 1/3 duty, 1FRAME has three times the cycle of LCD waveform base clock. Figure 11-5. 1/3 Duty LCD Backplane Driver Waveforms Technical Data 150 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Terminal Description DUTY = 1/4 1FRAME VDD BP0 VLCD1 VLCD2 VLCD3 VDD VLCD1 BP1 VLCD2 VLCD3 Freescale Semiconductor, Inc... VDD BP2 VLCD1 VLCD2 VLCD3 VDD BP3 VLCD1 VLCD2 VLCD3 NOTE: The element which selects or does not select the BP waveforms is as follows. VDD SELECTED VLCD1 VLCD2 VLCD3 VDD NOT SELECTED VLCD1 VLCD2 VLCD3 Figure 11-6. 1/4 Duty LCD Backplane Driver Waveforms MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 151 Freescale Semiconductor, Inc. LCD Driver DUTY = 1/3 DATA LATCH: 1 . . . . ON (SELECTED) 0. . . . OFF (NOT SELECTED) CONTENT OF FPX DATA LATCH BP2 -- 0 BP1 0 BP0 0 VDD VLCD1 VLCD2 VLCD3 VDD BP2 -- 0 BP1 0 BP0 1 VLCD1 VLCD2 VLCD3 VDD Freescale Semiconductor, Inc... BP2 -- 0 BP1 1 BP0 0 VLCD1 VLCD2 VLCD3 VDD BP2 -- 1 BP1 0 BP0 0 VLCD1 VLCD2 VLCD3 VDD BP2 -- 0 BP1 1 BP0 1 VLCD1 VLCD2 VLCD3 VDD BP2 -- 1 BP1 1 BP0 0 VLCD1 VLCD2 VLCD3 VDD BP2 -- 1 BP1 0 BP0 1 VLCD1 VLCD2 VLCD3 VDD BP2 -- 1 BP1 1 BP0 1 VLCD1 VLCD2 VLCD3 . Figure 11-7. 1/3 Duty LCD Frontplane Driver Waveforms Technical Data 152 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Terminal Description DUTY = 1/4 ONLY A PORTION IS ILLUSTRATED CONTENTS OF FPX DATA LATCH BP3 0 BP2 0 BP1 0 BP0 0 VDD VLCD1 VLCD2 VLCD3 VDD BP3 0 BP2 0 BP1 0 BP0 1 VLCD1 VLCD2 VLCD3 VDD BP3 0 BP2 1 BP1 1 BP0 0 VLCD1 VLCD2 VLCD3 Freescale Semiconductor, Inc... NOTE: The fundamental elements which select or do not select the frontplane waveforms are as follows. VDD VLCD1 SELECTED (1) VLCD2 VLCD3 VDD VLCD1 NOT SELECTED (0) VLCD2 VLCD3 Figure 11-8. 1/4 Duty LCD Frontplane Driver Waveforms MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 153 Freescale Semiconductor, Inc. LCD Driver 11.6 LCD Connection and LCD Driver Operation The connection between the MC68HC05L25 and the seven segments of the LCD panel is discussed in the following paragraphs. Figure 11-9 illustrates a 1/3 duty example. Pins BP0, BP1, BP2, FP0, FP1, and FP2 output the waveforms illustrated in Figure 11-10. Freescale Semiconductor, Inc... FP CONNECTION a BP CONNECTION a f g b f g b BP0 (a, b CONNECTED) e d c e d c BP1 (c, f, g CONNECTED) BP2 (d, e CONNECTED) FP0 FP1 FP2 (e, f) (a, d, g) (b, c) The segment assignments for each bit in the data latch are: -- D G A -- E F -- FP1 -- -- -- -- -- -- FP0 C B (Unrelated FP) FP2 (-- means not assigned in this case) To display a 4 using the assignments above will have the following data written to LDAT1 and LDAT2. -- 0 1 0 -- 0 1 X FP1 -- -- -- -- -- X FP0 1 1 FP2 (Unrelated FP) (X . . . don't care) (--, X . . . are zero in this case) Figure 11-9. 1/3 Duty Example Technical Data 154 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver LCD Connection and LCD Driver Operation DUTY = 1/3 1FRAME VDD BP0 VLCD1 VLCD2 VLCD3 VDD BP1 VLCD1 VLCD2 VLCD3 Freescale Semiconductor, Inc... VDD BP2 VLCD1 VLCD2 VLCD3 FP0 WAVEFORM BP2 -- 0 BP1 1 BP0 0 VDD VLCD1 VLCD2 VLCD3 FP1 WAVEFORM BP2 -- 0 BP1 1 BP0 0 VDD VLCD1 VLCD2 VLCD3 FP2 WAVEFORM BP2 -- 0 BP1 1 BP0 1 VDD VLCD1 VLCD2 VLCD3 Figure 11-10. BP0-BP2 and FP0-FP2 Output Waveforms MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 155 Freescale Semiconductor, Inc. LCD Driver The electric potential waveform for the F segment (between FP0 and BP1) is illustrated in Figure 11-11. As shown, the LCD ON voltage (VLCD) of the AC waveform is attained, so the F segment will turn ON. VLCD VLCD1 VLCD2 BP1-FP0 0 -VLCD2 Freescale Semiconductor, Inc... -VLCD1 -VLCD Figure 11-11. F Segment Potential Waveform The electric potential waveform for the E segment (between FP0 and BP2) is illustrated in Figure 11-12. This segment is not turned ON. VLCD VLCD1 VLCD2 BP2-FP0 0 -VLCD2 -VLCD1 -VLCD Figure 11-12. E Segment Electric Potential Waveform Technical Data 156 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver LCD Waveform Base Clock and LCD Cycle Frame The methods described will determine whether to turn ON or turn OFF the LCD segment. The waveform elements which select or do not select the BP and FP waveforms are shown in Figure 11-13. FP DATA LATCH -> SELECTED 1 0 NOT SELECTED VDD VDD VLCD1 VLCD2 VLCD3 FP VLCD1 VLCD2 VLCD3 Freescale Semiconductor, Inc... BP SELECTED VDD VLCD1 VLCD2 VLCD3 ON +VLCD +2 VLCD/3 +VLCD/3 0 -VLCD/3 -2 VLCD/3 -VLCD NOT SELECTED VDD VLCD1 VLCD2 VLCD3 OFF +VLCD +2 VLCD/3 +VLCD/3 0 -VLCD/3 -2 VLCD/3 -VLCD ON OFF +VLCD +2 VLCD/3 +VLCD/3 0 -VLCD/3 -2VLCD/3 -VLCD +VLCD +2 VLCD/3 +VLCD/3 0 -VLCD/3 -2VLCD/3 -VLCD Figure 11-13. Waveform Elements 11.7 LCD Waveform Base Clock and LCD Cycle Frame The clock which produces the LCD FP and BP output waveforms, the LCD waveform back clock, is generated from the time base module. The frequency for the LCD waveform base clock can be changed by the time base control register. MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 157 Freescale Semiconductor, Inc. LCD Driver 11.7.1 Time Base Control Register 1 Address: $0010 Bit 7 Read: TBCLK Write: Reset: 0 0 0 0 0 0 0 0 6 0 LCLK RMC4 RMC3 RMC2 RMC1 RMC0 5 4 3 2 1 Bit 0 = Unimplemented Freescale Semiconductor, Inc... Figure 11-14. Time Base Control Register 1 (TBCR1) LCLK -- LCD Clock The LCLK bit selects the clock for the LCD driver. This bit is cleared on reset. When TBCLK = 0: 1 = XOSC divide by 128 is selected for the LCD clock 0 = XOSC divide by 64 is selected for the LCD clock When TBCLK = 1: 1 = OSC divide by 16,384 is selected for the LCD clock 0 = OSC divide by 8192 is selected for the LCD clock Table 11-2. LCD Waveform Base Clock Frequency TBCR1 Divide Ratio TBCLK LCLK 0 0 1 1 0 1 0 1 XOSC / 64 XOSC / 128 OSC / 8192 OSC / 16384 LCD Waveform Base Clock Frequency (Hz) (fXOSC = 32.768 kHz) OSC = 2.0 MHz OSC = 4.0 MHz OSC = 4.1943 MHz 512 256 244 122 512 256 488 244 512 256 512 256 Technical Data 158 LCD Driver For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. LCD Driver Simplified LCD Schematic 11.7.2 LCD Cycle Frame The LCD cycle frame with respect to the LCD waveform base clock and duty is 1 ( LCD Cycle Frame ) = -------------------------------------------------------------------------------------------------( LCD Waveform Base Clock ) ( Duty ) For example, given 1/3 duty and 256 Hz waveform base clock. 1 ( LCD Cycle Frame ) = ----------------1 256 -3 Freescale Semiconductor, Inc... = 11.72 ms 11.8 Simplified LCD Schematic A simplified schematic of the LCD driver is shown in Figure 11-15. MC68HC05L25 -- Rev. 3.0 MOTOROLA LCD Driver For More Information On This Product, Go to: www.freescale.com Technical Data 159 Freescale Semiconductor, Inc... Technical Data LCD FP0 FP1 FP24 BP0 BP1 BP2 RFP RFP RFP RBP RBP RBP VDD VLCD1 VLCD2 VLCD3 160 MC68HC05L25 LCD DRIVER, 1/3 DUTY AND 1/3 BIAS LCD Driver BYPASS CAPS RLCD Freescale Semiconductor, Inc. LCD Driver For More Information On This Product, Go to: www.freescale.com RLCD VLCD RLCD VR MC68HC05L25 -- Rev. 3.0 MOTOROLA Figure 11-15. Simplified LCD Schematic Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 12. Analog Subsystem 12.1 Contents 12.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Analog Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Freescale Semiconductor, Inc... 12.3 12.4 Ratiometric Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.4.1 VREFH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.4.2 Accuracy and Precision. . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.5 Conversion Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 12.6 Digital Section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163 12.6.1 Conversion Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 12.6.2 Internal versus External Oscillator. . . . . . . . . . . . . . . . . . .163 12.6.3 Multi-Channel Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 164 12.7 12.8 12.9 A/D Subsystem Operation during Wait Modes . . . . . . . . . . . . 164 A/D Subsystem Operation during Stop Modes . . . . . . . . . . . . 164 A/D Status and Control Register. . . . . . . . . . . . . . . . . . . . . . .165 12.10 A/D Conversion Data Register . . . . . . . . . . . . . . . . . . . . . . . . 167 12.2 Introduction The MC68HC05L25 includes a 2-channel, multiplexed input, 8-bit, successive approximation analog-to-digital (A/D) converter. The A/D subsystem shares its inputs with port A pins PA4 and PA5. MC68HC05L25 -- Rev. 3.0 MOTOROLA Analog Subsystem For More Information On This Product, Go to: www.freescale.com Technical Data 161 Freescale Semiconductor, Inc. Analog Subsystem 12.3 Analog Section The following paragraphs describe the operation and performance of analog modules within the analog subsystem. 12.4 Ratiometric Conversion The A/D converter is ratiometric, with pin VREFH = VDD supplying the high reference voltage. Applying an input voltage equal to VREFH produces a conversion result of $FF (full scale). Applying an input voltage equal to VSS produces a conversion result of $00. An input voltage greater than VREFH will convert to $FF with no overflow indication. For ratiometric conversions, VREFH should be at the same potential as the supply voltage being used by the analog signal being measured and should be referenced to VSS. Freescale Semiconductor, Inc... 12.4.1 VREFH The reference supply for the A/D converter is tied to VDD internally. The low reference is tied to the VSS pin internally. 12.4.2 Accuracy and Precision The 8-bit conversion result is accurate to within 1.5 LSB, including quantization; however, the accuracy of conversions is tested and guaranteed only with external oscillator operation at VDD = 5 V. 12.5 Conversion Process The A/D reference inputs are applied to a precision digital-to-analog (D/A) converter. Control logic drives the D/A and the analog output is successively compared to the selected analog input which was sampled at the beginning of the conversion cycle. The conversion process is monotonic and has no missing codes. Technical Data 162 Analog Subsystem For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Analog Subsystem Digital Section 12.6 Digital Section The following paragraphs describe the operation and performance of digital modules within the analog subsystem. 12.6.1 Conversion Times Each input conversion requires 32 PH2 (bus) clock cycles, which must be at a frequency equal to or greater than 1 MHz. Freescale Semiconductor, Inc... 12.6.2 Internal versus External Oscillator If the MCU PH2 clock frequency is less than 1 MHz (2-MHz external oscillator), the internal RC oscillator (approximately 1.5 MHz) must be used for the A/D converter clock. The internal RC clock is selected by setting the ADRC bit in the ADSC register. When the internal RC oscillator is being used, these limitations apply: 1. Since the internal RC oscillator is running asynchronously with respect to the PH2 clock, the conversion complete bit (CC) in register ADSC must be used to determine when a conversion sequence has been completed. 2. Electrical noise will slightly degrade the accuracy of the A/D converter. The A/D converter is synchronized to read voltages during the quiet period of the clock driving it. Since the internal and external clocks are not synchronized, the A/D converter occasionally will measure an input when the external clock is making a transition. 3. If the PH2 clock is 1 MHz or greater (for example, external oscillator 2 MHz or greater and SYS1-SYS0 = 0-0), the internal RC oscillator must be turned off and the external oscillator used as the conversion clock. MC68HC05L25 -- Rev. 3.0 MOTOROLA Analog Subsystem For More Information On This Product, Go to: www.freescale.com Technical Data 163 Freescale Semiconductor, Inc. Analog Subsystem 12.6.3 Multi-Channel Operation An input multiplexer allows the A/D converter to select from one of two external analog signals. Port A pins PA4 and PA5 are shared with the inputs to the multiplexer. NOTE: Applying analog voltage to an A/D input pin that is not selected (used as a general-purpose digital I/O port) may result in excessive IDD. Freescale Semiconductor, Inc... 12.7 A/D Subsystem Operation during Wait Modes The A/D subsystem continues normal operation during wait modes. To decrease power consumption during wait, the ADON and ADRC bits in the A/D status and control register should be cleared if the A/D subsystem is not being used. 12.8 A/D Subsystem Operation during Stop Modes When stop mode is enabled, execution of the STOP instruction will terminate all A/D subsystem functions. Any pending conversion is aborted. When the oscillator resumes operation upon leaving stop mode, a finite amount of time passes before the A/D subsystem stabilizes sufficiently to provide conversions at its rated accuracy. The delays built into the MC68HC05L25 when coming out of stop mode are sufficient for this purpose. No explicit delays need to be added to the application software. Technical Data 164 Analog Subsystem For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Analog Subsystem A/D Status and Control Register 12.9 A/D Status and Control Register The ADSC register reports the completion of A/D conversion and provides control over oscillator selection, analog subsystem power, and input channel selection. Address: $001E Bit 7 Read: CC ADRC Write: Reset: 0 0 0 0 0 0 0 0 ADON 6 5 4 0 3 0 CH2 CH1 CH0 2 1 Bit 0 Freescale Semiconductor, Inc... = Unimplemented Figure 12-1. A/D Status and Control Register (ADSC) CC -- Conversion Complete This read-only status bit is set when a conversion sequence has completed and data is ready to be read from the ADDR register. CC is cleared when a channel is selected for conversion, when data is read from the ADDR register, or when the A/D subsystem is turned off. Once a conversion has been started, conversions of the selected channel will continue every 32 PH2 clock cycles until the ADSC register is written to again. During continuous conversion operation, the ADDR register will be updated with new data and the CC bit will be set every 32 PH2 clock cycles. Also, data from the previous conversion will be overwritten regardless of the state of the CC bit. 1 = A/D conversion sequence completed 0 = A/D subsystem is off or conversion is in progress ADRC -- RC Oscillator Control When ADRC is set, the A/D subsystem operates from the internal RC oscillator instead of the PH2 clock. The RC oscillator requires a time, tRCON, to stabilize before accurate conversion results can be obtained. See 12.6.2 Internal versus External Oscillator for more information. 1 = RC OSC on 0 = RC OSC off MC68HC05L25 -- Rev. 3.0 MOTOROLA Analog Subsystem For More Information On This Product, Go to: www.freescale.com Technical Data 165 Freescale Semiconductor, Inc. Analog Subsystem ADON -- A/D Subsystem On When the A/D subsystem is turned on (ADON = 1), it requires a time, tADON, to stabilize before accurate conversion results can be attained. 1 = A/D subsystem enabled 0 = A/D subsystem disabled Bits 4:3 -- Reserved These bits are not used and always read as zero. Freescale Semiconductor, Inc... CH2:CH0 -- Channel Select Bits Channel select bits CH2, CH1, and CH0 form a 3-bit field which is used to select an input to the A/D converter. Channels 0 and 1 correspond to port A input pins PA4 and PA5. Channels 4-6 are used for reference measurements. In single-chip mode, channels 2, 3, and 7 are reserved. If a conversion is attempted with channel 2, 3, or 7 selected, the result will be undefined. Table 12-1 lists the inputs selected by bits CH0-CH2. If the ADON bit is set, and an input from channel 0 or 1 is selected, the corresponding port A pin will not function as a digital port. If the port A data register is read when DDR = 0 while the A/D is on and one of the shared input channels is selected using bits CH0-CH2, the corresponding port A pin will read as a logic 0. If the DDR = 1, the port A data register will read the output latch value. The remaining port A pins will read normally. To digitally read a multiplexed port A pin as an input port, the A/D subsystem must be disabled (ADON = 0) or input channels 2-7 must be selected. Table 12-1. A/D Multiplexer Input Channel Assignments Channel 0 1 2 3 4 5 6 7 Signal AD0 Port A Bit 4 AD1 Port A Bit 5 Reserved Reserved VREFH = VDD (VREFH + VREFL)/2 VREFL = VSS Factory Test Technical Data 166 Analog Subsystem For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Analog Subsystem A/D Conversion Data Register 12.10 A/D Conversion Data Register This register contains the output of the A/D converter. Address: $001D Bit 7 Read: Write: AD7 6 AD6 5 AD5 4 AD4 3 AD3 2 AD2 1 AD1 Bit 0 AD0 Freescale Semiconductor, Inc... Reset: = Unimplemented Unaffected by Reset Figure 12-2. A/D Conversion Value Data Register (ADDR) MC68HC05L25 -- Rev. 3.0 MOTOROLA Analog Subsystem For More Information On This Product, Go to: www.freescale.com Technical Data 167 Freescale Semiconductor, Inc. Analog Subsystem Freescale Semiconductor, Inc... Technical Data 168 Analog Subsystem For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 13. Event Counter 13.1 Contents 13.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Event Counter Status/Control Register. . . . . . . . . . . . . . . . . . 171 Event Counter Timing Register . . . . . . . . . . . . . . . . . . . . . . .172 Event Counter Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Event Counter During Wait Mode . . . . . . . . . . . . . . . . . . . . . . 175 Event Counter During Stop Mode. . . . . . . . . . . . . . . . . . . . . . 176 Event Counter Data Registers . . . . . . . . . . . . . . . . . . . . . . . . 176 Freescale Semiconductor, Inc... 13.3 13.4 13.5 13.6 13.7 13.8 13.9 13.2 Features Event counter features include: * * * * * * Asynchronous Input up to 6 MHz Overflow Interrupt Event Count Complete Interrupt Variable Gate Generation Spike Filter Effective 18-Bit Resolution MC68HC05L25 -- Rev. 3.0 MOTOROLA Event Counter For More Information On This Product, Go to: www.freescale.com Technical Data 169 Freescale Semiconductor, Inc. Event Counter 13.3 Introduction The event counter consists of a 16-bit counter externally driven from the event counter pin, with input gate generation and filtering circuitry. Average frequency measurements can be made over user specified intervals ranging from 4 to 60 ms (with 2-MHz bus clock). Measurements are continuously repeated at a user specified rate. A maskable and resetable event count complete interrupt and event counter overflow interrupt are available. Using the overflow interrupt, an effective 18-bit count can be achieved. See Table 13-1. Freescale Semiconductor, Inc... INTERNAL HC05 BUS 8 8 16-BIT COUNTER FILTER EVI EVOE EVOF EVCE SYSTEM CLOCK 1/214 ECCI EVIE GATE SIGNAL CONTROL EVOI EVIF EVC TIMING REGISTER Figure 13-1. Event Counter Block Diagram Technical Data 170 Event Counter For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Event Counter Event Counter Status/Control Register 13.4 Event Counter Status/Control Register Address: $002E Bit 7 Read: Write: Reset: EVCE 0 EVIE 0 EVOE 0 0 0 6 5 4 EVIF 3 EVOF 2 0 RCCF 0 1 0 ROIF 0 0 Bit 0 0 = Unimplemented Figure 13-2. Event Counter Status/Control Register (EVSC) Freescale Semiconductor, Inc... EVCE -- Event Counter Enable 1 = Event counter enabled 0 = Event counter disabled EVIE -- Event Counter Complete Interrupt Enable 1 = Event counter complete interrupt enabled 0 = Event counter complete interrupt disabled EVOE -- Event Counter Overflow Enable 1 = Event counter overflow interrupt enabled 0 = Event counter overflow interrupt disabled EVIF -- Event Counter Complete Interrupt Flag (read only) 1 = Flag set when gate delay time expires 0 = Flag cleared when logic 1 is written to ROIF EVOF -- Event Counter Overflow Flag (read only) 1 = Flag set when gate delay time expires 0 = Flag cleared when logic 1 is written to ROIF RCCF -- Reset Count Complete Interrupt Flag (write only) When a logic 1 is written to this bit, EVIF is cleared. Always reads as zero. ROIF -- Reset Overflow Interrupt Flag (write only) When a logic 1 is written to this bit, EVOF is cleared. Always reads as zero. Bit 0 -- Reserved This bit is not used and always reads as zero. MC68HC05L25 -- Rev. 3.0 MOTOROLA Event Counter For More Information On This Product, Go to: www.freescale.com Technical Data 171 Freescale Semiconductor, Inc. Event Counter 13.5 Event Counter Timing Register Address: $002F Bit 7 Read: Write: Reset: WT3 1 WT2 1 WT1 1 WT0 1 MT3 1 MT2 1 MT1 1 MT0 1 6 5 4 3 2 1 Bit 0 Figure 13-3. Event Counter Timing Register (EVTR) Freescale Semiconductor, Inc... This register controls generation of the gate signal which is used to control the input to the event counter. See Figure 13-5. The value in the event counter timing register determines the length of the measurement and the length of the wait time between measurements. See Table 13-1 and Table 13-2. The measurement time bits, MT3 through MT0, determine the length of time that the input gate on the EVI pin is open. During this time the gate signal is a logic 1. The wait time bits, WT3 through WT0, determine the length of time that the gate signal is a logic 0. tgc is the length of a unit count. The specification for tgc is found in Section 15. Electrical Specifications. After being enabled, EVCE = 1, the event counter will make measurements continuously. If the event counter timing register is written, the current measurement will be aborted, and a new measurement will be initiated. EVI ... MT3:0 X tGC GATE SIGNAL WT3:0 X tGC COUNTER INPUT COUNT 1 2 3 ... N-1 N 1 2 3 4 5 Figure 13-4. Event Counter Input Timing Example Technical Data 172 Event Counter For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Event Counter Event Counter Timing Register The input to the event counter is the logical AND of the signal on the EVI pin and the internally generated gate signal. The rising edges of the counter input signal are used to generate the events that increment the counter. If the pulse width of the ANDed signal is less than that which the circuitry is capable of detecting, the narrow pulse will not be allowed to pass through the filter. Table 13-1. Measurement Time Nibble MT3:MT0 Measurement Time 0 ms 3.9063 ms 7.8125 ms 11.719 ms 15.625 ms 19.531 ms 23.438 ms 27.344 ms MT3:MT0 $X8 $X9 $XA $XB $XC $XD $XE $XF Measurement Time 31.250 ms 35.156 ms 39.063 ms 42.969 ms 46.875 ms 50.781 ms 54.688 ms 58.593 ms Freescale Semiconductor, Inc... $X0 $X1 $X2 $X3 $X4 $X5 $X6 $X7 Table 13-2. Wait Time Nibble WT3:WT0 $0X ms $1X ms $2X ms $3X ms $4X ms $5X ms $6X ms $7X ms Wait Time 0 ms 3.9063 ms 7.8125 ms 11.719 ms 15.625 ms 19.531 ms 23.438 ms 27.344 ms WT3:WT0 $8x $9x $Ax $BX $CX $DX $EX $FX Wait Time 31.250 ms 35.156 ms 39.063 ms 42.969 ms 46.875 ms 50.781 ms 54.688 ms 58.593 ms NOTE: SYS0 and SYS1 = 00, fosc = 4.1943 MHz MC68HC05L25 -- Rev. 3.0 MOTOROLA Event Counter For More Information On This Product, Go to: www.freescale.com Technical Data 173 Freescale Semiconductor, Inc. Event Counter EVTR WRITE 1 SYSTEM CLOCK 2 3 4 1 2 16,384 16,385 ... DATA & INTERRUPT CLEAR ... Freescale Semiconductor, Inc... GATE SIGNAL NOTE: MT3 THROUGH MT0 = -$X1 ... Figure 13-5. Event Counter Gate Signal Timing Example The above example illustrates the relation of the gate signal to external oscillator clocks for the case of MT3-MT0 = $1. The beginning of the gate signal can be caused by a write to the event counter timing register or expiration of the wait time. If the event counter timing register is written, the rising edge of the gate signal will occur on the fourth internal processor clock cycle of the write to the event counter timing register. The event counter data registers are cleared on the rising edge of the internal gate signal. The external gate signal rises two clock cycles later. After MT3-MT0 x tgt, the gate signal will rise, terminating the measurement time. The gate signal will be the same length for all successive measurements. Unless the start of the gate delay signal and the event counter input signal are externally synchronized, the value of the least significant bit of the event counter data low register may arbitrarily change. If the fast oscillator, OSC, is disabled, the event counter will not function properly. Technical Data 174 Event Counter For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Event Counter Event Counter Interrupts 13.6 Event Counter Interrupts The event counter complete interrupt (ECCI) is generated at the falling edge of the gate signal. This interrupt indicates the presence of valid data in the event counter data registers. Since reading the data registers during the measurement time may give invalid results, the CPU must read the data registers before the rising edge of the gate signal. The event counter complete interrupt can be cleared by writing a one to RCCF. The event counter complete interrupt is cleared automatically at the beginning of each measurement. Freescale Semiconductor, Inc... The event counter overflow interrupt (EVOF) is generated if the count exceeds 65,535, the maximum value of the 16-bit event counter. This interrupt can be used to indicate an invalid measurement or to increase the resolution of the event counter, which will be described later. The event counter overflow interrupt can be cleared by writing a one to ROIF. The event counter overflow interrupt is cleared automatically at the beginning of each measurement. If an overflow occurs (the counter increments beyond $FFFF), the event counter overflow flag (EVOF) will be set. If EVOE is set, an interrupt will be generated. Following an overflow, the event counter will increment from zero. The resolution of the event counter can be increased by using the event counter overflow interrupt. If it is a count of more than 65,535 the maximum value of the 16-bit event counter is encountered, the event counter overflow interrupt service routine should note the number of "roll-overs" that occur. The overflow interrupt service routine should not clear the event counter interrupt. In this way, the user can be assured that the correct count has been recorded. 13.7 Event Counter During Wait Mode The event counter continues to operate in wait mode. If EVOE is set and an event counter overflow interrupt occurs, the processor will exit wait mode. If EVIE is set and an event counter interrupt occurs, the processor will exit wait mode. MC68HC05L25 -- Rev. 3.0 MOTOROLA Event Counter For More Information On This Product, Go to: www.freescale.com Technical Data 175 Freescale Semiconductor, Inc. Event Counter 13.8 Event Counter During Stop Mode In stop mode, the event counter is disabled. 13.9 Event Counter Data Registers Address: $0030 Bit 7 6 BIT14 5 BIT13 4 BIT12 3 BIT11 2 BIT10 1 BIT9 Bit 0 BIT8 Freescale Semiconductor, Inc... Read: Write: Reset: BIT15 0 0 0 0 0 0 0 0 = Unimplemented Figure 13-6. Event Counter Data High Register (EVDH) Address: $0031 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 BIT7 6 BIT6 5 BIT5 4 BIT4 3 BIT3 2 BIT2 1 BIT1 Bit 0 BIT0 = Unimplemented Figure 13-7. Event Counter Data Low Register (EVDL) These read-only registers are the basis of all event counter operations. While the gate signal is low, the value of the most recent event count will remain in the event counter data registers. After the event counter interrupt, the result of the event count can be read. If the event counter data registers are read while the gate signal is high, an incorrect value may result. Technical Data 176 Event Counter For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 14. Instruction Set 14.1 Contents 14.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Freescale Semiconductor, Inc... 14.3 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 14.3.1 Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 14.3.2 Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179 14.3.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 14.3.4 Extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 14.3.5 Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 14.3.6 Indexed, 8-Bit Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 14.3.7 Indexed,16-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 14.3.8 Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 14.4 Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 14.4.1 Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . 182 14.4.2 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . 183 14.4.3 Jump/Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . 184 14.4.4 Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . .186 14.4.5 Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 14.5 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 177 Freescale Semiconductor, Inc. Instruction Set 14.2 Introduction The MCU instruction set has 62 instructions and uses eight addressing modes. The instructions include all those of the M146805 CMOS Family plus one more: the unsigned multiply (MUL) instruction. The MUL instruction allows unsigned multiplication of the contents of the accumulator (A) and the index register (X). The high-order product is stored in the index register, and the low-order product is stored in the accumulator. Freescale Semiconductor, Inc... 14.3 Addressing Modes The CPU uses eight addressing modes for flexibility in accessing data. The addressing modes provide eight different ways for the CPU to find the data required to execute an instruction. The eight addressing modes are: * * * * * * * * Inherent Immediate Direct Extended Indexed, no offset Indexed, 8-bit offset Indexed, 16-bit offset Relative Technical Data 178 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Instruction Set Addressing Modes 14.3.1 Inherent Inherent instructions are those that have no operand, such as return from interrupt (RTI) and stop (STOP). Some of the inherent instructions act on data in the CPU registers, such as set carry flag (SEC) and increment accumulator (INCA). Inherent instructions require no operand address and are one byte long. 14.3.2 Immediate Freescale Semiconductor, Inc... Immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. Immediate instructions require no operand address and are two bytes long. The opcode is the first byte, and the immediate data value is the second byte. 14.3.3 Direct Direct instructions can access any of the first 256 memory locations with two bytes. The first byte is the opcode, and the second is the low byte of the operand address. In direct addressing, the CPU automatically uses $00 as the high byte of the operand address. 14.3.4 Extended Extended instructions use three bytes and can access any address in memory. The first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. When using the Motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. The assembler automatically selects the shortest form of the instruction. MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 179 Freescale Semiconductor, Inc. Instruction Set 14.3.5 Indexed, No Offset Indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. The index register contains the low byte of the effective address of the operand. The CPU automatically uses $00 as the high byte, so these instructions can address locations $0000-$00FF. Indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used RAM or I/O location. Freescale Semiconductor, Inc... 14.3.6 Indexed, 8-Bit Offset Indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. The CPU adds the unsigned byte in the index register to the unsigned byte following the opcode. The sum is the effective address of the operand. These instructions can access locations $0000-$01FE. Indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. The table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01FE). The k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. 14.3.7 Indexed,16-Bit Offset Indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. The CPU adds the unsigned byte in the index register to the two unsigned bytes following the opcode. The sum is the effective address of the operand. The first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. Indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. As with direct and extended addressing, the Motorola assembler determines the shortest form of indexed addressing. Technical Data 180 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Instruction Set Instruction Types 14.3.8 Relative Relative addressing is only for branch instructions. If the branch condition is true, the CPU finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. If the branch condition is not true, the CPU goes to the next instruction. The offset is a signed, two's complement byte that gives a branching range of -128 to +127 bytes from the address of the next location after the branch instruction. Freescale Semiconductor, Inc... When using the Motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch. 14.4 Instruction Types The MCU instructions fall into the following five categories: * * * * * Register/Memory Instructions Read-Modify-Write Instructions Jump/Branch Instructions Bit Manipulation Instructions Control Instructions MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 181 Freescale Semiconductor, Inc. Instruction Set 14.4.1 Register/Memory Instructions These instructions operate on CPU registers and memory locations. Most of them use two operands. One operand is in either the accumulator or the index register. The CPU finds the other operand in memory. Table 14-1. Register/Memory Instructions Instruction Mnemonic ADC ADD AND BIT CMP CPX EOR LDA LDX MUL ORA SBC STA STX SUB Freescale Semiconductor, Inc... Add Memory Byte and Carry Bit to Accumulator Add Memory Byte to Accumulator AND Memory Byte with Accumulator Bit Test Accumulator Compare Accumulator Compare Index Register with Memory Byte EXCLUSIVE OR Accumulator with Memory Byte Load Accumulator with Memory Byte Load Index Register with Memory Byte Multiply OR Accumulator with Memory Byte Subtract Memory Byte and Carry Bit from Accumulator Store Accumulator in Memory Store Index Register in Memory Subtract Memory Byte from Accumulator Technical Data 182 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Instruction Set Instruction Types 14.4.2 Read-Modify-Write Instructions These instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. NOTE: Do not use read-modify-write operations on write-only registers. Table 14-2. Read-Modify-Write Instructions Instruction Mnemonic ASL ASR BCLR (1) BSET(1) CLR COM DEC INC LSL LSR NEG ROL ROR TST(2) Freescale Semiconductor, Inc... Arithmetic Shift Left (Same as LSL) Arithmetic Shift Right Bit Clear Bit Set Clear Register Complement (One's Complement) Decrement Increment Logical Shift Left (Same as ASL) Logical Shift Right Negate (Two's Complement) Rotate Left through Carry Bit Rotate Right through Carry Bit Test for Negative or Zero 1. Unlike other read-modify-write instructions, BCLR and BSET use only direct addressing. 2. TST is an exception to the read-modify-write sequence because it does not write a replacement value. MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 183 Freescale Semiconductor, Inc. Instruction Set 14.4.3 Jump/Branch Instructions Jump instructions allow the CPU to interrupt the normal sequence of the program counter. The unconditional jump instruction (JMP) and the jump-to-subroutine instruction (JSR) have no register operand. Branch instructions allow the CPU to interrupt the normal sequence of the program counter when a test condition is met. If the test condition is not met, the branch is not performed. The BRCLR and BRSET instructions cause a branch based on the state of any readable bit in the first 256 memory locations. These 3-byte instructions use a combination of direct addressing and relative addressing. The direct address of the byte to be tested is in the byte following the opcode. The third byte is the signed offset byte. The CPU finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. The bit to be tested and its condition (set or clear) is part of the opcode. The span of branching is from -128 to +127 from the address of the next location after the branch instruction. The CPU also transfers the tested bit to the carry/borrow bit of the condition code register. Freescale Semiconductor, Inc... Technical Data 184 MC68HC05L25 -- Rev. 3.0 Instruction Set For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Instruction Set Instruction Types Table 14-3. Jump and Branch Instructions Instruction Branch if Carry Bit Clear Branch if Carry Bit Set Branch if Equal Branch if Half-Carry Bit Clear Branch if Half-Carry Bit Set Branch if Higher Mnemonic BCC BCS BEQ BHCC BHCS BHI BHS BIH BIL BLO BLS BMC BMI BMS BNE BPL BRA BRCLR BRN BRSET BSR JMP JSR Freescale Semiconductor, Inc... Branch if Higher or Same Branch if IRQ Pin High Branch if IRQ Pin Low Branch if Lower Branch if Lower or Same Branch if Interrupt Mask Clear Branch if Minus Branch if Interrupt Mask Set Branch if Not Equal Branch if Plus Branch Always Branch if Bit Clear Branch Never Branch if Bit Set Branch to Subroutine Unconditional Jump Jump to Subroutine MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 185 Freescale Semiconductor, Inc. Instruction Set 14.4.4 Bit Manipulation Instructions The CPU can set or clear any writable bit in the first 256 bytes of memory, which includes I/O registers and on-chip RAM locations. The CPU can also test and branch based on the state of any bit in any of the first 256 memory locations. Table 14-4. Bit Manipulation Instructions Instruction Mnemonic BCLR BRCLR BRSET BSET Freescale Semiconductor, Inc... Bit Clear Branch if Bit Clear Branch if Bit Set Bit Set Technical Data 186 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Instruction Set Instruction Types 14.4.5 Control Instructions These instructions act on CPU registers and control CPU operation during program execution. Table 14-5. Control Instructions Instruction Clear Carry Bit Clear Interrupt Mask Mnemonic CLC CLI NOP RSP RTI RTS SEC SEI STOP SWI TAX TXA WAIT Freescale Semiconductor, Inc... No Operation Reset Stack Pointer Return from Interrupt Return from Subroutine Set Carry Bit Set Interrupt Mask Stop Oscillator and Enable IRQ Pin Software Interrupt Transfer Accumulator to Index Register Transfer Index Register to Accumulator Stop CPU Clock and Enable Interrupts MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 187 Freescale Semiconductor, Inc. Instruction Set 14.5 Instruction Set Summary Table 14-6. Instruction Set Summary Opcode Source Form ADC ADC ADC ADC ADC ADC ADD ADD ADD ADD ADD ADD #opr opr opr opr,X opr,X ,X #opr opr opr opr,X opr,X ,X Operation Description H I NZC Add with Carry A (A) + (M) + (C) -- Freescale Semiconductor, Inc... IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX REL ii A9 2 B9 dd 3 C9 hh ll 4 D9 ee ff 5 E9 ff 4 F9 3 AB ii 2 BB dd 3 CB hh ll 4 DB ee ff 5 EB ff 4 FB 3 ii A4 2 B4 dd 3 C4 hh ll 4 D4 ee ff 5 E4 ff 4 F4 3 38 48 58 68 78 37 47 57 67 77 24 11 13 15 17 19 1B 1D 1F 25 27 28 29 22 24 dd 5 3 3 6 5 5 3 3 6 5 3 5 5 5 5 5 5 5 5 3 3 3 3 3 3 Add without Carry A (A) + (M) -- AND #opr AND opr AND opr AND opr,X AND opr,X AND ,X ASL opr ASLA ASLX ASL opr,X ASL ,X ASR opr ASRA ASRX ASR opr,X ASR ,X BCC rel Logical AND A (A) (M) ---- -- Arithmetic Shift Left (Same as LSL) C b7 b0 0 ---- ff dd Arithmetic Shift Right b7 b0 C ---- ff rr dd dd dd dd dd dd dd dd rr rr rr rr rr rr Branch if Carry Bit Clear PC (PC) + 2 + rel ? C = 0 ---------- BCLR n opr Clear Bit n Mn 0 DIR (b0) DIR (b1) DIR (b2) DIR (b3) ---------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) ---------- ---------- ---------- ---------- ---------- ---------- REL REL REL REL REL REL BCS rel BEQ rel BHCC rel BHCS rel BHI rel BHS rel Branch if Carry Bit Set (Same as BLO) Branch if Equal Branch if Half-Carry Bit Clear Branch if Half-Carry Bit Set Branch if Higher Branch if Higher or Same PC (PC) + 2 + rel ? C = 1 PC (PC) + 2 + rel ? Z = 1 PC (PC) + 2 + rel ? H = 0 PC (PC) + 2 + rel ? H = 1 PC (PC) + 2 + rel ? C Z = 0 PC (PC) + 2 + rel ? C = 0 Technical Data 188 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Cycles Effect on CCR Operand Address Mode Freescale Semiconductor, Inc. Instruction Set Instruction Set Summary Table 14-6. Instruction Set Summary (Continued) Opcode Source Form BIH rel BIL rel BIT #opr BIT opr BIT opr BIT opr,X BIT opr,X BIT ,X BLO rel BLS rel BMC rel BMI rel BMS rel BNE rel BPL rel BRA rel Operation Branch if IRQ Pin High Branch if IRQ Pin Low Description PC (PC) + 2 + rel ? IRQ = 1 PC (PC) + 2 + rel ? IRQ = 0 H I NZC ---------- ---------- REL REL IMM DIR EXT IX2 IX1 IX REL REL REL REL REL REL REL REL DIR (b0) DIR (b1) DIR (b2) DIR (b3) DIR (b4) DIR (b5) DIR (b6) DIR (b7) REL DIR (b0) DIR (b1) DIR (b2) DIR (b3) DIR (b4) DIR (b5) DIR (b6) DIR (b7) 2F 2E rr rr Bit Test Accumulator with Memory Byte (A) (M) ---- -- Freescale Semiconductor, Inc... ii A5 2 B5 dd 3 C5 hh ll 4 D5 ee ff 5 E5 ff 4 F5 3 25 23 2C 2B 2D 26 2A 20 01 03 05 07 09 0B 0D 0F 21 00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E rr rr rr rr rr rr rr rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd dd dd dd dd dd dd dd 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 Branch if Lower (Same as BCS) Branch if Lower or Same Branch if Interrupt Mask Clear Branch if Minus Branch if Interrupt Mask Set Branch if Not Equal Branch if Plus Branch Always PC (PC) + 2 + rel ? C = 1 PC (PC) + 2 + rel ? C Z = 1 PC (PC) + 2 + rel ? I = 0 PC (PC) + 2 + rel ? N = 1 PC (PC) + 2 + rel ? I = 1 PC (PC) + 2 + rel ? Z = 0 PC (PC) + 2 + rel ? N = 0 PC (PC) + 2 + rel ? 1 = 1 ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- BRCLR n opr rel Branch if Bit n Clear PC (PC) + 2 + rel ? Mn = 0 -------- BRN rel Branch Never PC (PC) + 2 + rel ? 1 = 0 ---------- BRSET n opr rel Branch if Bit n Set PC (PC) + 2 + rel ? Mn = 1 -------- BSET n opr Set Bit n Mn 1 DIR (b0) DIR (b1) DIR (b2) DIR (b3) ---------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) BSR rel Branch to Subroutine PC (PC) + 2; push (PCL) SP (SP) - 1; push (PCH) SP (SP) - 1 PC (PC) + rel C0 I0 ---------- REL AD rr CLC CLI Clear Carry Bit Clear Interrupt Mask -------- 0 -- 0 ------ INH INH 98 9A MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 189 Cycles 3 3 6 2 2 Effect on CCR Operand Address Mode Freescale Semiconductor, Inc. Instruction Set Table 14-6. Instruction Set Summary (Continued) Opcode Source Form CLR opr CLRA CLRX CLR opr,X CLR ,X CMP #opr CMP opr CMP opr CMP opr,X CMP opr,X CMP ,X COM opr COMA COMX COM opr,X COM ,X CPX CPX CPX CPX CPX CPX #opr opr opr opr,X opr,X ,X Operation Description M $00 A $00 X $00 M $00 M $00 H I NZC Clear Byte ---- 0 1 -- DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR EXT IX2 IX1 IX 3F 4F 5F 6F 7F dd ff Freescale Semiconductor, Inc... Compare Accumulator with Memory Byte (A) - (M) ---- ii A1 2 B1 dd 3 C1 hh ll 4 D1 ee ff 5 E1 ff 4 F1 3 33 43 53 63 73 dd 5 3 3 6 5 Complement Byte (One's Complement) M (M) = $FF - (M) A (A) = $FF - (A) X (X) = $FF - (X) M (M) = $FF - (M) M (M) = $FF - (M) ---- 1 ff Compare Index Register with Memory Byte (X) - (M) ---- ii A3 2 B3 dd 3 C3 hh ll 4 D3 ee ff 5 E3 ff 4 F3 3 3A 4A 5A 6A 7A dd 5 3 3 6 5 DEC opr DECA DECX DEC opr,X DEC ,X EOR EOR EOR EOR EOR EOR #opr opr opr opr,X opr,X ,X Decrement Byte M A X M M (M) - 1 (A) - 1 (X) - 1 (M) - 1 (M) - 1 ---- -- ff EXCLUSIVE OR Accumulator with Memory Byte A (A) (M) ---- -- ii A8 2 B8 dd 3 C8 hh ll 4 D8 ee ff 5 E8 ff 4 F8 3 3C 4C 5C 6C 7C dd 5 3 3 6 5 INC opr INCA INCX INC opr,X INC ,X JMP opr JMP opr JMP opr,X JMP opr,X JMP ,X Increment Byte M (M) + 1 A (A) + 1 X (X) + 1 M (M) + 1 M (M) + 1 ---- -- ff Unconditional Jump PC Jump Address ---------- BC dd 2 CC hh ll 3 DC ee ff 4 EC ff 3 FC 2 Technical Data 190 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Cycles 5 3 3 6 5 Effect on CCR Operand Address Mode Freescale Semiconductor, Inc. Instruction Set Instruction Set Summary Table 14-6. Instruction Set Summary (Continued) Opcode Source Form JSR opr JSR opr JSR opr,X JSR opr,X JSR ,X LDA #opr LDA opr LDA opr LDA opr,X LDA opr,X LDA ,X LDX #opr LDX opr LDX opr LDX opr,X LDX opr,X LDX ,X LSL opr LSLA LSLX LSL opr,X LSL ,X LSR opr LSRA LSRX LSR opr,X LSR ,X MUL NEG opr NEGA NEGX NEG opr,X NEG ,X NOP ORA ORA ORA ORA ORA ORA #opr opr opr opr,X opr,X ,X Operation Description H I NZC PC (PC) + n (n = 1, 2, or 3) Push (PCL); SP (SP) - 1 Push (PCH); SP (SP) - 1 PC Effective Address Jump to Subroutine ---------- DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX INH DIR INH INH IX1 IX INH IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX BD dd 5 CD hh ll 6 DD ee ff 7 ED ff 6 FD 5 ii A6 2 B6 dd 3 C6 hh ll 4 D6 ee ff 5 E6 ff 4 F6 3 AE ii 2 BE dd 3 CE hh ll 4 DE ee ff 5 EE ff 4 FE 3 38 48 58 68 78 34 44 54 64 74 42 30 40 50 60 70 9D dd dd 5 3 3 6 5 5 3 3 6 5 11 5 3 3 6 5 2 Freescale Semiconductor, Inc... Load Accumulator with Memory Byte A (M) ---- -- Load Index Register with Memory Byte X (M) ---- -- Logical Shift Left (Same as ASL) C b7 b0 0 ---- ff dd Logical Shift Right 0 b7 b0 C ---- 0 ff Unsigned Multiply X : A (X) x (A) M -(M) = $00 - (M) A -(A) = $00 - (A) X -(X) = $00 - (X) M -(M) = $00 - (M) M -(M) = $00 - (M) 0 ------ 0 Negate Byte (Two's Complement) ---- ff No Operation ---------- Logical OR Accumulator with Memory A (A) (M) ---- -- AA ii 2 BA dd 3 CA hh ll 4 DA ee ff 5 EA ff 4 FA 3 39 49 59 69 79 dd 5 3 3 6 5 ROL opr ROLA ROLX ROL opr,X ROL ,X Rotate Byte Left through Carry Bit C b7 b0 ---- ff MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 191 Cycles Effect on CCR Operand Address Mode Freescale Semiconductor, Inc. Instruction Set Table 14-6. Instruction Set Summary (Continued) Opcode Source Form ROR opr RORA RORX ROR opr,X ROR ,X RSP Operation Description H I NZC Rotate Byte Right through Carry Bit b7 b0 C ---- DIR INH INH IX1 IX INH 36 46 56 66 76 9C dd ff Reset Stack Pointer SP $00FF SP (SP) + 1; Pull (CCR) SP (SP) + 1; Pull (A) SP (SP) + 1; Pull (X) SP (SP) + 1; Pull (PCH) SP (SP) + 1; Pull (PCL) SP (SP) + 1; Pull (PCH) SP (SP) + 1; Pull (PCL) ---------- Freescale Semiconductor, Inc... RTI Return from Interrupt INH 80 RTS SBC #opr SBC opr SBC opr SBC opr,X SBC opr,X SBC ,X SEC SEI STA opr STA opr STA opr,X STA opr,X STA ,X STOP STX opr STX opr STX opr,X STX opr,X STX ,X SUB SUB SUB SUB SUB SUB #opr opr opr opr,X opr,X ,X Return from Subroutine ---------- INH IMM DIR EXT IX2 IX1 IX INH INH DIR EXT IX2 IX1 IX INH DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX 81 Subtract Memory Byte and Carry Bit from Accumulator A (A) - (M) - (C) ---- ii A2 2 B2 dd 3 C2 hh ll 4 D2 ee ff 5 E2 ff 4 F2 3 99 9B 2 2 Set Carry Bit Set Interrupt Mask C1 I1 -------- 1 -- 1 ------ Store Accumulator in Memory M (A) ---- -- B7 dd 4 C7 hh ll 5 D7 ee ff 6 E7 ff 5 F7 4 8E 2 Stop Oscillator and Enable IRQ Pin -- 0 ------ Store Index Register In Memory M (X) ---- -- BF dd 4 CF hh ll 5 DF ee ff 6 EF ff 5 FF 4 ii A0 2 B0 dd 3 C0 hh ll 4 D0 ee ff 5 E0 ff 4 F0 3 Subtract Memory Byte from Accumulator A (A) - (M) ---- SWI Software Interrupt PC (PC) + 1; Push (PCL) SP (SP) - 1; Push (PCH) SP (SP) - 1; Push (X) SP (SP) - 1; Push (A) -- 1 ------ SP (SP) - 1; Push (CCR) SP (SP) - 1; I 1 PCH Interrupt Vector High Byte PCL Interrupt Vector Low Byte X (A) ---------- INH 83 10 TAX Transfer Accumulator to Index Register INH 97 Technical Data 192 Instruction Set For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Cycles 5 3 3 6 5 2 9 6 2 Effect on CCR Operand Address Mode Freescale Semiconductor, Inc. Instruction Set Instruction Set Summary Table 14-6. Instruction Set Summary (Continued) Opcode Source Form TST opr TSTA TSTX TST opr,X TST ,X TXA WAIT Operation Description H I NZC Test Memory Byte for Negative or Zero (M) - $00 ---- -- DIR INH INH IX1 IX INH INH 3D 4D 5D 6D 7D 9F 8F dd ff Transfer Index Register to Accumulator Stop CPU Clock and Enable Interrupts Accumulator Carry/borrow flag Condition code register Direct address of operand Direct address of operand and relative offset of branch instruction Direct addressing mode High and low bytes of offset in indexed, 16-bit offset addressing Extended addressing mode Offset byte in indexed, 8-bit offset addressing Half-carry flag High and low bytes of operand address in extended addressing Interrupt mask Immediate operand byte Immediate addressing mode Inherent addressing mode Indexed, no offset addressing mode Indexed, 8-bit offset addressing mode Indexed, 16-bit offset addressing mode Memory location Negative flag Any bit A (X) ---------- -- opr PC PCH PCL REL rel rr SP X Z # () -( ) ? : Freescale Semiconductor, Inc... ------ A C CCR dd dd rr DIR ee ff EXT ff H hh ll I ii IMM INH IX IX1 IX2 M N n -- Operand (one or two bytes) Program counter Program counter high byte Program counter low byte Relative addressing mode Relative program counter offset byte Relative program counter offset byte Stack pointer Index register Zero flag Immediate value Logical AND Logical OR Logical EXCLUSIVE OR Contents of Negation (two's complement) Loaded with If Concatenated with Set or cleared Not affected MC68HC05L25 -- Rev. 3.0 MOTOROLA Instruction Set For More Information On This Product, Go to: www.freescale.com Technical Data 193 Cycles 4 3 3 5 4 2 2 Effect on CCR Operand Address Mode Freescale Semiconductor, Inc... Technical Data 194 Table 14-7. Opcode Map Branch REL 2 3 4 5 6 7 8 9 A B C D E F 3 SUB IX 3 CMP 2 2 2 3 3 3 3 3 2 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 2 MSB LSB 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 IX 3 SBC IX 3 3 CPX IX 3 AND IX 3 BIT IX 3 2 LDA IX 4 STA IX 3 EOR IX 3 1 ADC IX 3 ORA IX 3 ADD IX 2 JMP IX 5 JSR IX 3 LDX IX 4 STX IX Bit Manipulation DIR INH INH IX1 IX INH INH IMM DIR EXT IX2 IX1 IX Read-Modify-Write Control Register/Memory DIR DIR MSB LSB 2 2 2 10 SWI INH 2 2 2 2 1 2 2 3 2 3 2 3 3 2 3 3 2 0 1 MSB LSB Instruction Set 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 9 RTI INH 6 RTS INH 2 3 4 5 6 2 SUB IMM 2 CMP IMM 2 SBC IMM 2 CPX IMM 2 AND IMM 2 BIT IMM 2 LDA IMM 7 8 9 A Freescale Semiconductor, Inc. Instruction Set For More Information On This Product, Go to: www.freescale.com 2 EOR IMM 2 ADC IMM 2 ORA IMM 2 ADD IMM 2 TAX INH 2 CLC INH 2 SEC INH 2 CLI INH 2 SEI INH 2 RSP INH 2 NOP INH 6 BSR REL 2 2 LDX 2 IMM 2 2 STOP INH 2 2 TXA WAIT INH INH 1 B C D E F 5 5 BSET0 BRSET0 DIR 3 DIR 2 5 5 BCLR0 BRCLR0 DIR 3 DIR 2 5 5 BSET1 BRSET1 DIR 3 DIR 2 5 5 BCLR1 BRCLR1 DIR 3 DIR 2 5 5 BSET2 BRSET2 DIR 3 DIR 2 5 5 BCLR2 BRCLR2 DIR 3 DIR 2 5 5 BSET3 BRSET3 DIR 3 DIR 2 5 5 BCLR3 BRCLR3 DIR 3 DIR 2 5 5 BSET4 BRSET4 DIR 3 DIR 2 5 5 BCLR4 BRCLR4 DIR 3 DIR 2 5 5 BSET5 BRSET5 DIR 3 DIR 2 5 5 BCLR5 BRCLR5 DIR 3 DIR 2 5 5 BSET6 BRSET6 DIR 3 DIR 2 5 5 BCLR6 BRCLR6 DIR 3 DIR 2 5 5 BSET7 BRSET7 DIR 3 DIR 2 5 5 BCLR7 BRCLR7 DIR 3 DIR 2 5 6 3 3 5 3 NEG NEG NEGX NEGA NEG BRA IX 1 IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BRN 2 REL 1 3 11 BHI MUL 2 REL 1 INH 5 6 3 3 5 3 COM COM COMX COMA COM BLS IX 1 IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 LSR LSR LSRX LSRA LSR BCC IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BCS/BLO 2 REL 5 6 3 3 5 3 ROR ROR RORX RORA ROR BNE IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 ASR ASR ASRX ASRA ASR BEQ IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 ASL/LSL ASLA/LSLA ASLX/LSLX ASL/LSL ASL/LSL BHCC IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 ROL ROL ROLX ROLA ROL BHCS IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 DEC DEC DECX DECA DEC BPL IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BMI 2 REL 5 6 3 3 5 3 INC INC INCX INCA INC BMC IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 4 5 3 3 4 3 TST TST TSTX TSTA TST BMS IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BIL 2 REL 1 5 6 3 3 5 3 CLR CLR CLRX CLRA CLR BIH IX 1 IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 SUB DIR 3 CMP DIR 3 SBC DIR 3 CPX DIR 3 AND DIR 3 BIT DIR 3 LDA DIR 4 STA DIR 3 EOR DIR 3 ADC DIR 3 ORA DIR 3 ADD DIR 2 JMP DIR 5 JSR DIR 3 LDX DIR 4 STX DIR 4 SUB EXT 4 CMP EXT 4 SBC EXT 4 CPX EXT 4 AND EXT 4 BIT EXT 4 LDA EXT 5 STA EXT 4 EOR EXT 4 ADC EXT 4 ORA EXT 4 ADD EXT 3 JMP EXT 6 JSR EXT 4 LDX EXT 5 STX EXT 5 SUB IX2 5 CMP IX2 5 SBC IX2 5 CPX IX2 5 AND IX2 5 BIT IX2 5 LDA IX2 6 STA IX2 5 EOR IX2 5 ADC IX2 5 ORA IX2 5 ADD IX2 4 JMP IX2 7 JSR IX2 5 LDX IX2 6 STX IX2 4 SUB IX1 1 4 CMP IX1 1 4 SBC IX1 1 4 CPX IX1 1 4 AND IX1 1 4 BIT IX1 1 4 LDA IX1 1 5 STA IX1 1 4 EOR IX1 1 4 ADC IX1 1 4 ORA IX1 1 4 ADD IX1 1 3 JMP IX1 1 6 JSR IX1 1 4 LDX IX1 1 5 STX IX1 1 0 LSB of Opcode in Hexadecimal MSB of Opcode in Hexadecimal MC68HC05L25 -- Rev. 3.0 MOTOROLA INH = InherentREL = Relative IMM = ImmediateIX = Indexed, No Offset DIR = DirectIX1 = Indexed, 8-Bit Offset EXT = ExtendedIX2 = Indexed, 16-Bit Offset 0 5 Number of Cycles BRSET0 Opcode Mnemonic 3 DIR Number of Bytes/Addressing Mode Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 15. Electrical Specifications 15.1 Contents 15.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Operating Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 DC Operating Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 197 DC Electrical Characteristics (VDD = 3.3 V) . . . . . . . . . . . . . . 198 DC Electrical Characteristics (VDD = 5.0 V) . . . . . . . . . . . . . . 199 LCD DC Electrical Characteristics (VDD = 3.0 V, VLCD = 0 V) . . . . . . . . . . . . . . . . . . . . . . . . . 200 Freescale Semiconductor, Inc... 15.3 15.4 15.5 15.6 15.7 15.8 15.9 15.10 LCD DC Electrical Characteristics (VDD = 5.0 V, VLCD = 2.0 V). . . . . . . . . . . . . . . . . . . . . . . . 201 15.11 A/D Converter Characteristics . . . . . . . . . . . . . . . . . . . . . . . . 202 15.12 Control Timing (VDD = 3.3 V) . . . . . . . . . . . . . . . . . . . . . . . . . 203 15.13 Control Timing (VDD = 5.0 V) . . . . . . . . . . . . . . . . . . . . . . . . . 204 15.2 Introduction This section contains electrical specifications for the MC68HC05L25. MC68HC05L25 -- Rev. 3.0 MOTOROLA Electrical Specifications For More Information On This Product, Go to: www.freescale.com Technical Data 195 Freescale Semiconductor, Inc. Electrical Specifications 15.3 Maximum Ratings Maximum ratings are the extreme limits to which the MCU can be exposed without permanently damaging it. The MCU contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table below. Keep VIN and VOUT within the range VSS (VIN or VOUT) VDD. Connect unused inputs to the appropriate voltage level, either VSS or VDD. Freescale Semiconductor, Inc... Rating Supply Voltage Input Voltage (Normal Digital Level) Current Drain Per Pin Excluding VDD and VSS Storage Temperature Range NOTE: Voltages referenced to VSS Symbol VDD VIN I TSTG Value -0.3 to +7.0 VSS -0.3 to VDD +0.3 25 -65 to +150 Unit V V mA C NOTE: This device is not guaranteed to operate properly at the maximum ratings. Refer to 15.7 DC Electrical Characteristics (VDD = 3.3 V) and 15.8 DC Electrical Characteristics (VDD = 5.0 V) for guaranteed operating conditions. Technical Data 196 Electrical Specifications For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Electrical Specifications Operating Range 15.4 Operating Range Characteristic Operating Temperature Range MC68HC05L25 (Standard) Symbol TA Value TL to TH 0 to +70 Unit C 15.5 Thermal Characteristics Freescale Semiconductor, Inc... Characteristic Thermal Resistance MC68HC05L25FA (48-pin VQFP) MC68HC05L25PB (52-pin TQFP) Symbol JA Value 195 126 Unit C/W 15.6 DC Operating Characteristics Characteristic Operating Voltage Internal Operating Frequency fOP = 1.0 MHz Internal Operating Frequency fOP = 2.1 MHz Symbol VDD Min 3.0 4.5 Max 5.5 5.5 Unit V NOTE: VSS = 0 Vdc, TA = 0 C to +7 0C, unless otherwise noted MC68HC05L25 -- Rev. 3.0 MOTOROLA Electrical Specifications For More Information On This Product, Go to: www.freescale.com Technical Data 197 Freescale Semiconductor, Inc. Electrical Specifications 15.7 DC Electrical Characteristics (VDD = 3.3 V) Characteristic Output Voltage ILoad = 10.0 A Output High Voltage (ILoad = -0.4 mA) PA4:PA7, PB0:PB7, and PC0:PC1 Output Low Voltage (ILoad = 0.8 mA) PA0:PA7, PB0:PB7, and PC0:PC3 (ILoad = 20 mA) PA0:PA3 Symbol VOL VOH VOH VOL Min -- VDD -0.1 VDD -0.8 -- -- 0.7 x VDD Typ -- -- -- Max 0.1 -- -- Unit V V -- -- -- 0.4 1.0 VDD V Freescale Semiconductor, Inc... Input High Voltage PA0:PA7, PB0:PB7, and PC0:PC3, IRQ, RESET, and XOSC1 Input Low Voltage PA0:PA7, PB0:PB7, and PC0:PC3, IRQ, RESET, and XOSC1 Supply Current (See Notes) Run (fOP = 1.0 MHz) Wait (fOP = 1.0 MHz) Stop With Time Base Running; LCD Off With All Clocks Halted I/O Ports Hi-Z Leakage Current (Without Individual Pullup Activated) PA0:PA7, PB0:PB7, and PC0:PC3 Pullup Current (With Individual Pullup Activated) PA0:PA7 and PB0:PB7 PC0:PC3 Input Current RESET, IRQ, and XOSC1 Capacitance Ports (As Input or Output) RESET, IRQ Crystal Oscillator Mode Feedback Resistor OSC1 to OSC2 XOSC1 to XOSC2 Crystal Oscillator Mode Damping Resistor on XOSC2 RESET Pin Pullup Resistance VIH V VIL VSS -- 0.3 x VDD V IDD -- -- -- -- 1.5 1.0 8.0 2.0 -- 8.0 5.0 20 10 10 mA mA A A A IIL -- IIL IIN COUT CIN ROF R XOF RXOD RRST 6 20 -- 20 60 -- 60 180 1 12 8 3 8.2 480 120 A A pF -- -- 1 2.7 160 20 -- -- 2 5.5 320 60 M k k NOTES: 1. VDD = 3.3 Vdc 0.3 Vdc, VSS = 0 Vdc, TA = 0 C to +70 C, unless otherwise noted 2. All values shown reflect average measurements. 3. Typical values at midpoint of voltage range, 25 C only 4. Wait IDD: Only time base active 5. Run (Operating) IDD, wait IDD: Measured using external square wave clock source to OSC1 (fOP = 1.0 MHz); all inputs 0.2 Vdc from rail; no DC loads; less than 50 pF on all outputs; CL = 20 pF on OSC2 6. Wait and stop IDD: All ports configured as inputs, VIL = 0.2 Vdc, VIH = VDD -0.2 Vdc 7. Wait and stop IDD are affected linearly by the OSC2, XOSC2 capacitance. Technical Data 198 Electrical Specifications For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Electrical Specifications DC Electrical Characteristics (VDD = 5.0 V) 15.8 DC Electrical Characteristics (VDD = 5.0 V) Characteristic Output Voltage ILoad = 10.0 A Output High Voltage (ILoad = -0.8 mA) PA4:PA7, PB0:PB7, and PC0:PC1 Output Low Voltage (ILoad = 0.8 mA) PA0:PA7, PB0:PB7, and PC0:PC3 (ILoad = 20 mA) PA0:PA3 Symbol VOL VOH VOH VOL Min -- VDD -0.1 VDD -0.8 -- -- 0.7 x VDD Typ -- -- -- -- -- -- Max 0.1 -- -- 0.4 0.8 VDD Unit V V V Freescale Semiconductor, Inc... Input High Voltage PA0:PA7, PB0:PB7, and PC0:PC3, IRQ, RESET, and XOSC1 Input Low Voltage PA0:PA7, PB0:PB7, and PC0:PC3, IRQ, RESET, and XOSC1 Supply Current (See Notes) Run (fOP = 2.1 MHz) Wait (fOP = 2.1 MHz) Stop With Time Base Running; LCD Off With All Clocks Halted I/O Ports Hi-Z Leakage Current (Without Individual Pullup Activated) PA0:PA7, PB0:PB7, and PC0:PC3 Pullup Current (With Individual Pullup Activated) PA0:PA7 and PB0:PB7 PC0:PC3 Input Current RESET, IRQ, and XOSC1 Capacitance Ports (As Input or Output) RESET, IRQ Crystal Oscillator Mode Feedback Resistor OSC1 to OSC2 XOSC1 to XOSC2 Crystal Oscillator Mode Damping Resistor on XOSC2 RESET Pin Pullup Resistance VIH V VIL VSS -- 0.3 x VDD V IDD -- -- -- -- 3.0 2.0 17 3.0 -- 12 6.0 40 15 10 mA mA A A A IIL -- IIH IIN COUT CIN ROF RXOF RXOD 10 20 -- -- -- 1 2.7 160 30 60 -- -- -- 2 5.5 320 90 180 1 12 8 3 8.2 480 A A pF M k RRST 10 32 70 k NOTES: 1. V DD = 5.0 Vdc 0.5 Vdc, VSS = 0 Vdc, TA = 0 C to +70 C, unless otherwise noted 2. All values shown reflect average measurements. 3. Typical values at midpoint of voltage range, 25 C only 4. Wait IDD: Only time base active 5. Run (Operating) IDD , wait IDD : Measured using external square wave clock source to OSC1 (fOP = 2.1 MHz); all inputs 0.2 Vdc from rail; no DC loads; less than 50 pF on all outputs; CL = 20 pF on OSC2 6. Wait, stop IDD : All ports configured as inputs, VIL = 0.2 Vdc, VIH = VDD -0.2 Vdc 7. Wait, stop IDD is affected linearly by the OSC2, XOSC2 capacitance. Technical Data Electrical Specifications For More Information On This Product, Go to: www.freescale.com 199 MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Electrical Specifications 15.9 LCD DC Electrical Characteristics (VDD = 3.0 V, VLCD = 0 V) Characteristic LCD Bias Resistance Default Low-Current Mode Output Current, Backplanes and Frontplanes High-Current State (Default) VO = 2.85 V VO = 1.85 V VO = 1.15 V VO = 0.15 V Output Current, Backplanes and Frontplanes Low-Current State VO = 2.85 V VO = 1.85 V VO = 1.15 V VO = 0.15 V Symbol RLCD Min 80 430 Typ 160 860 Max 240 1300 Unit k IBH Freescale Semiconductor, Inc... -400 -10 1 20 -260 -2.8 4 50 -120 -1 10 80 A IBL -400 -1 0.1 20 -260 -0.2 0.6 50 -120 -0.05 1 80 A NOTES: 1. All values shown reflect average measurements. These values are design targets and not characterization results. 2. If the FC option is selected, for time 1/(32 x fLCD) after the backplane or frontplane waveform changes to a new voltage level, the circuit is maintained in the high-current state to allow the load capacitors to charge quickly. Then the circuit is returned to the low-current state until the next voltage level change occurs. Technical Data 200 Electrical Specifications For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Electrical Specifications LCD DC Electrical Characteristics (VDD = 5.0 V, VLCD = 2.0 V) 15.10 LCD DC Electrical Characteristics (VDD = 5.0 V, VLCD = 2.0 V) Characteristic LCD Bias Resistance Default Low-Current Mode Output Current, Backplanes and Frontplanes High-Current State (Default) VO = 4.85 V VO = 3.85 V VO = 3.15 V VO = 2.15 V Output Current, Backplanes and Frontplanes Low-Current State VO = 4.85 V VO = 3.85 V VO = 3.15 V VO = 2.15 V Symbol RLCD Min 80 430 Typ 160 860 Max 240 1300 Unit k IBH Freescale Semiconductor, Inc... -660 -10 1 20 -440 -3.8 4.2 50 -220 -1 10 80 A IBL -660 -1 0.2 20 -440 -0.2 1.2 50 -220 -0.05 3 30 A NOTES: 1. All values shown reflect average measurements. These values are design targets and not characterization results. 2. If the FC option is selected, for time 1/(32 x fLCD) after the backplane or frontplane waveform changes to a new voltage level, the circuit is maintained in the high-current state to allow the load capacitors to charge quickly. Then the circuit is returned to the low-current state until the next voltage level change occurs. MC68HC05L25 -- Rev. 3.0 MOTOROLA Electrical Specifications For More Information On This Product, Go to: www.freescale.com Technical Data 201 Freescale Semiconductor, Inc. Electrical Specifications 15.11 A/D Converter Characteristics Characteristic Resolution Absolute Accuracy VDD = 4.5 to 5.5 V VDD = 3.0 to 3.6 V Conversion Range ADC On Current Stabilization TIme Symbol -- -- -- tADON tRCON -- -- -- -- 00 FF 12 -- 01 FF 12 12 -- -- VSS -- -- 32 -- Min 8 Max Units Bit Comments 1.5 3 VDD 100 5 32 32 LSB LSB V s s tAD s Error includes quantization. Freescale Semiconductor, Inc... RC Oscillator Stabilization Time Conversion Time (Includes Sampling Time) External Clock (MCU System Clock) Internal RC Oscillator (ADRC = 1) Monotonicity Zero Input Reading Ratiometric Reading Sample Acquisition Time External Clock (MCU System Clock) Internal RC Oscillator (ADRC = 1) tAD = tcyc if clock source equals MCU. Inherent Within Total Error Hex Hex tAD s VIN = 0 V VIN = VDD Source impedances greater than 10 k adversely affect internal RC charging time during input sampling. tAD = tcyc if clock source equals MCU. -- Input Capacitance Analog Input Voltage Input Leakage AD0 and AD1 -- -- -- -- VSS -- 8 VDD 400 pF V nA The external system error caused by input leakage current is approximately equal to the product of R source and input current. NOTES: 1. VDD = 5.0 Vdc 10%, VSS = 0 Vdc, TA = 0 C to +70 C, unless otherwise noted Technical Data 202 Electrical Specifications For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Electrical Specifications Control Timing (VDD = 3.3 V) 15.12 Control Timing (VDD = 3.3 V) Characteristic Frequency of Operation OSC Crystal Oscillator Option XOSC Crystal Oscillator Option External Clock Source Internal Operating Frequency Crystal Oscillator (fosc / 2) External Clock (fosc / 2) Symbol fOSC fXOSC fOSC fOP tCYC tOXON tRL tILIH tILIL t tGC Min -- -- dc -- dc 1 000 -- 1.5 250 Note 2 200 16,384 Typ -- 32.768 -- -- -- -- -- -- -- -- -- 16,384 Max 2.0 -- 2.0 1.0 1.0 -- 100 -- -- -- -- 16,384 Unit MHz kHz MHz MHz ns ms tCYC ns tCYC ns fOSC Freescale Semiconductor, Inc... Cycle Time (1 / fOP) Crystal Oscillator Startup Time (Crystal Oscillator Option) RESET Pulse Width Low IRQ Interrupt Pulse Width Low (Edge-Triggered) IRQ Interrupt Pulse Period OSC1 Pulse Width Event Counter Gate Count NOTES: 1. VDD = 3.3 Vdc 0.3 Vdc, VSS = 0 Vdc, TA = 0 C to +70 C, unless otherwise noted 2. The minimum period, tILIL or tIHIH, should not be less than the number of cycles it takes to execute the interrupt service routine plus 21 tCYC. MC68HC05L25 -- Rev. 3.0 MOTOROLA Electrical Specifications For More Information On This Product, Go to: www.freescale.com Technical Data 203 Freescale Semiconductor, Inc. Electrical Specifications 15.13 Control Timing (VDD = 5.0 V) Characteristic Frequency of Operation OSC Crystal Oscillator Option XOSC Crystal Oscillator Option External Clock Source Internal Operating Frequency Crystal Oscillator (fosc / 2) External Clock (fosc / 2) Symbol fOSC fXOSC fOSC fOP tCYC tOXON tRL tILIH tILIL t tGC Min -- -- dc -- dc 480 -- 1.5 125 Note 2 90 16,384 Typ -- 32.768 -- -- -- -- -- -- -- -- -- 16,384 Max 4.2 -- 4.2 2.1 2.1 -- 100 -- -- -- -- 16,384 Unit MHz kHz MHz MHz ns ms tCYC ns tCYC ns fOSC Freescale Semiconductor, Inc... Cycle Time (1 / fOP) Crystal Oscillator Startup Time (Crystal Oscillator Option) RESET Pulse Width Low IRQ Interrupt Pulse Width Low (Edge-Triggered) IRQ Interrupt Pulse Period OSC1 Pulse Width Event Counter Gate Count NOTES: 1. VDD = 5.0 Vdc 0.5 Vdc, VSS = 0 Vdc, TA = 0 C to +70 C, unless otherwise noted 2. The minimum period, tILIL or tIHIH, should not be less than the number of cycles it takes to execute the interrupt service routine plus 21 tCYC. Technical Data 204 Electrical Specifications For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 16. Mechanical Specifications The MC68HC05L25 is available in the following packages: * 48-pin quad flat pack (VQFP) 52-pin thin quad flat pack (TQFP) Freescale Semiconductor, Inc... * Package specifications for the MC68HC05L25 were not available at the time of this publication. Contact your local Motorola sales office for the latest information. MC68HC05L25 -- Rev. 3.0 MOTOROLA Mechanical Specifications For More Information On This Product, Go to: www.freescale.com Technical Data 205 Freescale Semiconductor, Inc. Mechanical Specifications Freescale Semiconductor, Inc... Technical Data 206 Mechanical Specifications For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Technical Data -- MC68HC05L25 Section 17. Ordering Information 17.1 Contents 17.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 MCU Ordering Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Application Program Media. . . . . . . . . . . . . . . . . . . . . . . . . . . 208 ROM Program Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 ROM Verification Units (RVUs). . . . . . . . . . . . . . . . . . . . . . . . 210 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210 Freescale Semiconductor, Inc... 17.3 17.4 17.5 17.6 17.7 17.2 Introduction This section contains instructions for ordering custom-masked ROM MCUs. 17.3 MCU Ordering Forms To initiate an order for a ROM-based MCU, first obtain the current ordering form for the MCU from a Motorola representative. Submit the following items when ordering MCUs: * * * A current MCU ordering form that is completely filled out (Contact your Motorola sales office for assistance.) A copy of the customer specification if the customer specification deviates from the Motorola specification for the MCU Customer's application program on one of the media listed in 17.4 Application Program Media MC68HC05L25 -- Rev. 3.0 MOTOROLA Ordering Information For More Information On This Product, Go to: www.freescale.com Technical Data 207 Freescale Semiconductor, Inc. Ordering Information 17.4 Application Program Media Please deliver the application program to Motorola in one of the following media: * * * Macintosh(R)1 3 1/2-inch diskette (double-sided 800 K or double-sided high-density 1.4 M) MS-DOS(R)2 or PC-DOSTM3 3 1/2-inch diskette (double-sided 720 K or double-sided high-density 1.44 M) MS-DOS(R) or PC-DOSTM 5 1/4-inch diskette (double-sided double-density 360 K or double-sided high-density 1.2 M) Freescale Semiconductor, Inc... Use positive logic for data and addresses. When submitting the application program on a diskette, clearly label the diskette with the following information: * * * * * * * Customer name Customer part number Project or product name File name of object code Date Name of operating system that formatted diskette Formatted capacity of diskette On diskettes, the application program must be in Motorola's S-record format (S1 and S9 records), a character-based object file format generated by M6805 cross assemblers and linkers. NOTE: Begin the application program at the first user ROM location. Program addresses must correspond exactly to the available on-chip user ROM addresses as shown in the memory map. Write $00 in all non-user ROM locations or leave all non-user ROM locations blank. Refer to the current 1. Macintosh is a registered trademark of Apple Computer, Inc. 2. MS-DOS is a registered trademark of Microsoft Corporation. 3. PC-DOS is a trademark of International Business Machines Corporation. Technical Data 208 Ordering Information For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Ordering Information ROM Program Verification MCU ordering form for additional requirements. Motorola may request pattern re-submission if non-user areas contain any non-zero code. If the memory map has two user ROM areas with the same addresses, then write the two areas in separate files on the diskette. Label the diskette with both filenames. In addition to the object code, a file containing the source code can be included. Motorola keeps this code confidential and uses it only to expedite ROM pattern generation in case of any difficulty with the object code. Label the diskette with the filename of the source code. Freescale Semiconductor, Inc... 17.5 ROM Program Verification The primary use for the on-chip ROM is to hold the customer's application program. The customer develops and debugs the application program and then submits the MCU order along with the application program. Motorola inputs the customer's application program code into a computer program that generates a listing verify file. The listing verify file represents the memory map of the MCU. The listing verify file contains the user ROM code and may also contain non-user ROM code, such as self-check code. Motorola sends the customer a computer printout of the listing verify file along with a listing verify form. To aid the customer in checking the listing verify file, Motorola will program the listing verify file into customer-supplied blank preformatted Macintosh or DOS disks. All original pattern media are filed for contractual purposes and are not returned. Check the listing verify file thoroughly, then complete and sign the listing verify form and return the listing verify form to Motorola. The signed listing verify form constitutes the contractual agreement for the creation of the custom mask. MC68HC05L25 -- Rev. 3.0 MOTOROLA Ordering Information For More Information On This Product, Go to: www.freescale.com Technical Data 209 Freescale Semiconductor, Inc. Ordering Information 17.6 ROM Verification Units (RVUs) After receiving the signed listing verify form, Motorola manufactures a custom photographic mask. The mask contains the customer's application program and is used to process silicon wafers. The application program cannot be changed after the manufacture of the mask begins. Motorola then produces 10 MCUs, called RVUs, and sends the RVUs to the customer. RVUs are usually packaged in unmarked ceramic and tested to 5 Vdc at room temperature. RVUs are not tested to environmental extremes because their sole purpose is to demonstrate that the customer's user ROM pattern was properly implemented. The 10 RVUs are free of charge with the minimum order quantity. These units are not to be used for qualification or production. RVUs are not guaranteed by Motorola Quality Assurance. Freescale Semiconductor, Inc... 17.7 MC Order Numbers The following table shows the MC order numbers for the available package types. MC Order Number MC68HC05L25FA MC68HC05L25PB NOTES: FA = 48-pin quad flat pack (VQFP) PB = 52-pin thin quad flat pack (TQFP) Operating Temperature Range -0 to 70C -0 to 70C Technical Data 210 Ordering Information For More Information On This Product, Go to: www.freescale.com MC68HC05L25 -- Rev. 3.0 MOTOROLA Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. HOW TO REACH US: USA/EUROPE/LOCATIONS NOT LISTED: Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217 1-303-675-2140 or 1-800-441-2447 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu Minato-ku, Tokyo 106-8573 Japan 81-3-3440-3569 ASIA/PACIFIC: Freescale Semiconductor, Inc... Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong 852-26668334 TECHNICAL INFORMATION CENTER: 1-800-521-6274 HOME PAGE: http://www.motorola.com/semiconductors Information in this document is provided solely to enable system and software implementers to use Motorola products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. 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 the Stylized M Logo are registered in the U.S. Patent and Trademark Office. digital dna is a trademark of Motorola, Inc. All other product or service names are the property of their respective owners. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. (c) Motorola, Inc. 2002 MC68HC05L25/D For More Information On This Product, Go to: www.freescale.com This datasheet has been download from: www..com Datasheets for electronics components. |
Price & Availability of 68HC05L25
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |