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://freescale.com/
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
This product incorporates SuperFlash® technology licensed from SST.
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.
Revision History (Sheet 1 of 3)
Date
September,
2002
December,
2002
January,
2003
Revision
Level
N/AInitial releaseN/A
1.2 Features — Added 8-pin dual flat no lead (DFN) packages to features list.19
Figure 1-2. MCU Pin Assignments — Figure updated to include DFN packages.21
Figure 2-2. Control, Status, and Data Registers — Corrected bit definitions for
Port A Data Register (PTA) and Data Direction Register A (DDRA).
Table 13-3. Interrupt Sources — Corrected vector addresses for keyboard
interrupt and ADC conversion complete interrupt.
Chapter 13 System Integration Module (SIM) — Removed reference to break
status register as it is duplicated in break module.
11.3.1 Internal Oscillator and 11.3.1.1 Internal Oscillator Trimming — Clarified
oscillator trim option ordering information and what to expect with untrimmed
device.
Figure 11-5. Oscillator Trim Register (OSCTRIM) — Bit 1 designation corrected.98
Figure 15-13. Monitor Mode Circuit (Internal Clock, No High Voltage) —
0.1
0.24.2 Features — Corrected third bulleted item.49
Diagram updated for clarity.
Figure 12-1. I/O Port Register Summary — Corrected bit definitions for PTA7,
DDRA7, and DDRA6.
Figure 12-2. Port A Data Register (PTA) — Corrected bit definition for PTA7.100
Figure 12-3. Data Direction Register A (DDRA) — Corrected bit definitions for
DDRA7 and DDRA6.
Figure 12-6. Port B Data Register (PTB) — Corrected bit definition for PTB1103
Chapter 9 Keyboard Interrupt Module (KBI) — Section reworked after deletion
of auto wakeup for clarity.
Chapter 4 Auto Wakeup Module (AWU) — New section added for clarity.49
15.3 Monitor Module (MON) — Updated with additional data.147
Chapter 16 Electrical Specifications — Updated with additional data.169–173
Figure 2-2. Control, Status, and Data Registers — Deleted unimplemented
areas from $FFB0–$FFBD and $FFC2–$FFCF as they are actually available.
Also corrected $FFBF designation from unimplemented to reserved.
Figure 6-1. COP Block Diagram — Reworked for clarity59
6.3.2 STOP Instruction — Added subsection60
13.4.2 Active Resets from Internal Sources — Reworked notes for clarity.111
Table 13-2. Reset Recovery Timing — Replaced previous table with new
information.
Table 17-1. MC Order Numbers — Corrected temperature and package
designators.
Figure 2-2. Control, Status, and Data Registers — Corrected reset state for the
FLASH Block Protect Register at address location $FFBE and the Internal
Oscillator Trim Value at $FFC0.
Figure 2-5. FLASH Block Protect Register (FLBPR) — Restated reset state for
clarity.
Page
Number(s)
20
23
26
47
77–79
27
112
143
175
32
38
MC68HC908QY/QT Family Data Sheet, Rev. 5
Freescale Semiconductor5
Revision History
Revision History (Sheet 3 of 3)
Date
November,
2004
July,
2005
Revision
Level
4.0
5.0
Description
Reformatted to meet current documentation standardsThroughout
6.3.1 BUSCLKX4 — Clarified description of BUSCLKX458
Chapter 7 Central Processor Unit (CPU) — In 7.7 Instruction Set Summary:
Reworked definitions for STOP instruction
Added WAIT instruction
13.8.1 SIM Reset Status Register — Clarified SRSR flag setting117
14.9.1 TIM Status and Control Register — Added information to TSTOP note127
16.8 5-V Oscillator Characteristics — Added values for deviation from trimmed
inernal oscillator
16.12 3-V Oscillator Characteristics — Added values for deviation from trimmed
inernal oscillator
Figure 5-2. Configuration Register 1 (CONFIG1) — Clarified bit definitions for
COPRS.
Chapter 8 External Interrupt (IRQ) — Reworked for clarification.73
The MC68HC908QY4 is a member of the low-cost, high-performance M68HC08 Family of 8-bit
microcontroller units (MCUs). The M68HC08 Family is a Complex Instruction Set Computer (CISC) with
a Von Neumann architecture. All MCUs in the family use the enhanced M68HC08 central processor unit
(CPU08) and are available with a variety of modules, memory sizes and types, and package types.
0.4
Table 1-1. Summary of Device Variations
Device
MC68HC908QT11536 bytes—8 pins
MC68HC908QT21536 bytes4 ch, 8 bit8 pins
MC68HC908QT44096 bytes4 ch, 8 bit8 pins
MC68HC908QY11536 bytes—16 pins
MC68HC908QY21536 bytes4 ch, 8 bit16 pins
MC68HC908QY44096 bytes4 ch, 8 bit16 pins
FLASH
Memory Size
Analog-to-Digital
Converter
1.2 Features
Features include:
•High-performance M68HC08 CPU core
•Fully upward-compatible object code with M68HC05 Family
•5-V and 3-V operating voltages (V
•8-MHz internal bus operation at 5 V, 4-MHz at 3 V
•Trimmable internal oscillator
–3.2 MHz internal bus operation
–8-bit trim capability allows 0.4% accuracy
–± 25% untrimmed
•Auto wakeup from STOP capability
•Configuration (CONFIG) register for MCU configuration options, including:
–Low-voltage inhibit (LVI) trip point
•In-system FLASH programming
•FLASH security
(2)
DD
)
(1)
Pin
Count
1. The oscillator frequency is guaranteed to ±5% over temperature and voltage range after trimming.
2. No security feature is absolutely secure. However, Freescale’s strategy is to make reading or copying the FLASH difficult for
unauthorized users.
MC68HC908QY/QT Family Data Sheet, Rev. 5
Freescale Semiconductor17
General Description
•On-chip in-application programmable FLASH memory (with internal program/erase voltage
generation)
–MC68HC908QY4 and MC68HC908QT4 — 4096 bytes
–MC68HC908QY2, MC68HC908QY1, MC68HC908QT2, and MC68HC908QT1 — 1536 bytes
•128 bytes of on-chip random-access memory (RAM)
•2-channel, 16-bit timer interface module (TIM)
•4-channel, 8-bit analog-to-digital converter (ADC) on MC68HC908QY2, MC68HC908QY4,
MC68HC908QT2, and MC68HC908QT4
•5 or 13 bidirectional input/output (I/O) lines and one input only:
–Six shared with keyboard interrupt function and ADC
–Two shared with timer channels
–One shared with external interrupt (IRQ)
–Eight extra I/O lines on 16-pin package only
–High current sink/source capability on all port pins
–Selectable pullups on all ports, selectable on an individual bit basis
–Three-state ability on all port pins
•6-bit keyboard interrupt with wakeup feature (KBI)
•Low-voltage inhibit (LVI) module features:
–Software selectable trip point in CONFIG register
•System protection features:
–Computer operating properly (COP) watchdog
–Low-voltage detection with reset
–Illegal opcode detection with reset
–Illegal address detection with reset
•External asynchronous interrupt pin with internal pullup (IRQ
) shared with general-purpose input
pin
•Master asynchronous reset pin (RST
) shared with general-purpose input/output (I/O) pin
•Power-on reset
•Internal pullups on IRQ
and RST to reduce external components
•Memory mapped I/O registers
•Power saving stop and wait modes
•MC68HC908QY4, MC68HC908QY2, and MC68HC908QY1 are available in these packages:
–16-pin plastic dual in-line package (PDIP)
–16-pin small outline integrated circuit (SOIC) package
–16-pin thin shrink small outline package (TSSOP)
•MC68HC908QT4, MC68HC908QT2, and MC68HC908QT1 are available in these packages:
–8-pin PDIP
–8-pin SOIC
–8-pin dual flat no lead (DFN) package
MC68HC908QY/QT Family Data Sheet, Rev. 5
18Freescale Semiconductor
MCU Block Diagram
Features of the CPU08 include the following:
•Enhanced HC05 programming model
•Extensive loop control functions
•16 addressing modes (eight more than the HC05)
•16-bit index register and stack pointer
•Memory-to-memory data transfers
•Fast 8 × 8 multiply instruction
•Fast 16/8 divide instruction
•Binary-coded decimal (BCD) instructions
•Optimization for controller applications
•Efficient C language support
1.3 MCU Block Diagram
Figure 1-1 shows the structure of the MC68HC908QY4.
1.4 Pin Assignments
The MC68HC908QT4, MC68HC908QT2, and MC68HC908QT1 are available in 8-pin packages and the
MC68HC908QY4, MC68HC908QY2, and MC68HC908QY1 in 16-pin packages. Figure 1-2 shows the pin
assignment for these packages.
MC68HC908QY/QT Family Data Sheet, Rev. 5
Freescale Semiconductor19
General Description
PTA0/AD0/TCH0/KBI0
PTA1/AD1/TCH1/KBI1
PTA2/IRQ
/KBI2/TCLK
PTA3/RST
PTA4/OSC2/AD2/KBI4
PTA5/OSC1/AD3/KBI5
/KBI3
PTB0
PTB1
PTB2
PTB3
PTB4
PTB5
PTB6
PTB7
POWER SUPPLY
PTA
PTB
8-BIT ADC
128 BYTES RAM
DDRA
DDRB
V
DD
V
SS
M68HC08 CPU
MC68HC908QY4 AND MC68HC908QT4
4096 BYTES
MC68HC908QY2, MC68HC908QY1,
MC68HC908QT2, AND MC68HC908QT1:
1536 BYTES
USER FLASH
CLOCK
GENERATOR
(OSCILLATOR)
SYSTEM INTEGRATION
MODULE
SINGLE INTERRUPT
MODULE
BREAK
MODULE
POWER-ON RESET
MODULE
KEYBOARD INTERRUPT
MODULE
16-BIT TIMER
MODULE
COP
MODULE
MONITOR ROM
RST, IRQ: Pins have internal (about 30K Ohms) pull up
PTA[0:5]: High current sink and source capability
PTA[0:5]: Pins have programmable keyboard interrupt and pull up
PTB[0:7]: Not available on 8-pin devices – MC68HC908QT1, MC68HC908QT2, and MC68HC908QT4 (see note in
12.1 Introduction)
ADC: Not available on the MC68HC908QY1 and MC68HC908QT1
Figure 1-1. Block Diagram
MC68HC908QY/QT Family Data Sheet, Rev. 5
20Freescale Semiconductor
Pin Assignments
V
PTA5/OSC1/KBI5
PTA4/OSC2/KBI4
PTA3/RST
/KBI3
V
PTB7
PTB6
PTA5/OSC1/KBI5
PTA4/OSC2/KBI4
PTB5
PTB4
PTA3/RST
/KBI3
DD
1
2
3
4
8
7
6
5
8-PIN ASSIGNMENT
MC68HC908QT1 PDIP/SOIC
1
DD
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9
16-PIN ASSIGNMENT
MC68HC908QY1 PDIP/SOIC
V
SS
PTA0/TCH0/KBI0
PTA1/TCH1/KBI1
PTA2/IRQ/KBI2/TCLK
V
SS
PTB0
PTB1
PTA0/TCH0/KBI0
PTA1/TCH1/KBI1
PTB2
PTB3
PTA2/IRQ
/KBI2/TCLK
V
PTA5/OSC1/AD3/KBI5
PTA4/OSC2/AD2/KBI4
PTA3/RST
/KBI3
1
DD
2
3
4
8-PIN ASSIGNMENT
MC68HC908QT2 AND MC68HC908QT4 PDIP/SOIC
V
PTB7
PTB6
PTA5/OSC1/AD3/KBI5
PTA4/OSC2/AD2/KBI4
PTB5
PTB4
PTA3/RST
/KBI3
1
DD
2
3
4
5
6
7
8
16-PIN ASSIGNMENT
MC68HC908QY2 AND MC68HC908QY4 PDIP/SOIC
V
SS
8
PTA0/AD0/TCH0/KBI0
7
6
PTA1/AD1/TCH1/KBI1
PTA2/IRQ/KBI2/TCLK
5
V
16
SS
15
PTB0
14
PTB1
PTA0/AD0/TCH0/KBI0
13
PTA1/AD1/TCH1/KBI1
12
11
PTB2
10
PTB3
PTA2/IRQ
9
/KBI2/TCLK
PTA0/TCH0/KBI0
PTB1
PTB0
V
V
PTB7
PTB6
PTA5/OSC1/KBI5
PTA0/TCH0/KBI0
PTA5/OSC1/KB15
1
2
3
4
SS
5
DD
6
7
8
16-PIN ASSIGNMENT
MC68HC908QY1 TSSOP
1
2
V
SS
V
3
DD
4
8-PIN ASSIGNMENT
MC68HC908QT1 DFN
PTA1/TCH1/KBI1
16
PTB2
15
PTB3
14
PTA2/IRQ
13
PTA3/RST
12
11
PTB4
10
PTB5
9
PTA4/OSC2/KBI4
8
PTA1/TCH1/KBI1
7
PTA2/IRQ/KBI2/TCLK
6
PTA3/RST
PTA4/OSC2/KBI4
5
/KBI2/TCLK
/KBI3
/KBI3
PTA0/AD0/TCH0/KBI0
PTA5/OSC1/AD3/KBI5
PTA0/AD0/TCH0/KBI0
PTA5//OSC1/AD3/KB15
Figure 1-2. MCU Pin Assignments
PTB1
PTB0
V
V
PTB7
PTB6
1
2
3
4
SS
5
DD
6
7
8
PTA1/AD1/TCH1/KBI1
16
PTB2
15
PTB3
14
PTA2/IRQ
13
PTA3/RST
12
11
PTB4
10
PTB5
9
PTA4/OSC2/AD2/KBI4
16-PIN ASSIGNMENT
MC68HC908QY2 AND MC68HC908QY4 TSSOP
1
V
2
SS
V
3
DD
4
8
PTA1/AD1/TCH1/KBI1
7
PTA2/IRQ/KBI2/TCLK
6
PTA3/RST
PTA4/OSC2/AD2/KBI4
5
8-PIN ASSIGNMENT
MC68HC908QT2 AND MC68HC908QT4 DFN
/KBI2/TCLK
/KBI3
/KBI3
MC68HC908QY/QT Family Data Sheet, Rev. 5
Freescale Semiconductor21
General Description
1.5 Pin Functions
Table 1-2 provides a description of the pin functions.
Table 1-2. Pin Functions
Pin
Name
V
DD
V
SS
PTA0
PTA1
PTA2
PTA3
DescriptionInput/Output
Power supplyPower
Power supply groundPower
PTA0 — General purpose I/O portInput/Output
AD0 — A/D channel 0 inputInput
TCH0 — Timer Channel 0 I/OInput/Output
KBI0 — Keyboard interrupt input 0Input
PTA1 — General purpose I/O portInput/Output
AD1 — A/D channel 1 inputInput
TCH1 — Timer Channel 1 I/OInput/Output
KBI1 — Keyboard interrupt input 1Input
PTA2 — General purpose input-only portInput
— External interrupt with programmable pullup and Schmitt trigger inputInput
IRQ
KBI2 — Keyboard interrupt input 2Input
TCLK — Timer clock inputInput
PTA3 — General purpose I/O portInput/Output
RST — Reset input, active low with internal pullup and Schmitt triggerInput
KBI3 — Keyboard interrupt input 3Input
PTA4 — General purpose I/O portInput/Output
OSC2 —XTAL oscillator output (XTAL option only)
PTA4
PTA5
PTB[0:7]
1. The PTB pins are not available on the 8-pin packages (see note in 12.1 Introduction).
22Freescale Semiconductor
RC or internal oscillator output (OSC2EN = 1 in PTAPUE register)
AD2 — A/D channel 2 inputInput
KBI4 — Keyboard interrupt input 4Input
PTA5 — General purpose I/O portInput/Output
OSC1 — XTAL, RC, or external oscillator inputInput
AD3 — A/D channel 3 inputInput
KBI5 — Keyboard interrupt input 5Input
(1)
8 general-purpose I/O portsInput/Output
MC68HC908QY/QT Family Data Sheet, Rev. 5
Output
Output
Pin Function Priority
1.6 Pin Function Priority
Table 1-3 is meant to resolve the priority if multiple functions are enabled on a single pin.
NOTE
Upon reset all pins come up as input ports regardless of the priority table.
Table 1-3. Function Priority in Shared Pins
Pin NameHighest-to-Lowest Priority Sequence
PTA0AD0 → TCH0 → KBI0 → PTA0
PTA1AD1 →TCH1 → KBI1 → PTA1
PTA2IRQ
PTA3RST
PTA4OSC2 → AD2 → KBI4 → PTA4
PTA5OSC1 → AD3 → KBI5 → PTA5
→ KBI2 → TCLK → PTA2
→ KBI3 → PTA3
MC68HC908QY/QT Family Data Sheet, Rev. 5
Freescale Semiconductor23
General Description
MC68HC908QY/QT Family Data Sheet, Rev. 5
24Freescale Semiconductor
Chapter 2
Memory
2.1 Introduction
The central processor unit (CPU08) can address 64 Kbytes of memory space. The memory map, shown
in Figure 2-1, includes:
•4096 bytes of user FLASH for MC68HC908QT4 and MC68HC908QY4
•1536 bytes of user FLASH for MC68HC908QT2, MC68HC908QT1, MC68HC908QY2, and
MC68HC908QY1
•128 bytes of random access memory (RAM)
•48 bytes of user-defined vectors, located in FLASH
•416 bytes of monitor read-only memory (ROM)
•1536 bytes of FLASH program and erase routines, located in ROM
2.2 Unimplemented Memory Locations
Accessing an unimplemented location can have unpredictable effects on MCU operation. In Figure 2-1
and in register figures in this document, unimplemented locations are shaded.
2.3 Reserved Memory Locations
Accessing a reserved location can have unpredictable effects on MCU operation. In Figure 2-1 and in
register figures in this document, reserved locations are marked with the word Reserved or with the
letter R.
MC68HC908QY/QT Family Data Sheet, Rev. 5
Freescale Semiconductor25
Memory
$0000
↓
$003F
$0040
↓
$007F
$0080
↓
$00FF
$0100
↓
$27FF
$2800
↓
$2DFF
$2E00
↓
$EDFF
$EE00
↓
$FDFF
$FE00BREAK STATUS REGISTER (BSR)
$FE01RESET STATUS REGISTER (SRSR)
$FE02BREAK AUXILIARY REGISTER (BRKAR)
$FE03BREAK FLAG CONTROL REGISTER (BFCR)
$FE04INTERRUPT STATUS REGISTER 1 (INT1)
$FE05INTERRUPT STATUS REGISTER 2 (INT2)
$FE06INTERRUPT STATUS REGISTER 3 (INT3)
$FE07
$FE08
$FE09BREAK ADDRESS HIGH REGISTER (BRKH)
$FE0ABREAK ADDRESS LOW REGISTER (BRKL)
$FE0BBREAK STATUS AND CONTROL REGISTER (BRKSCR)
$FE0CLVISR
$FE0D
↓
$FE0F
$FE10
↓
$FFAF
$FFB0
↓
$FFBD
$FFBEFLASH BLOCK PROTECT REGISTER (FLBPR)
$FFBF
$FFC0INTERNAL OSCILLATOR TRIM VALUE
$FFC1
$FFC2
↓
$FFCF
$FFD0
↓
$FFFF
RESERVED FOR FLASH TEST CONTROL REGISTER (FLTCR)
MC68HC908QT4 AND MC68HC908QY4
FLASH CONTROL REGISTER (FLCR)
I/O REGISTERS
64 BYTES
RESERVED
64 BYTES
128 BYTES
UNIMPLEMENTED
9984 BYTES
AUXILIARY ROM
1536 BYTES
UNIMPLEMENTED
49152 BYTES
FLASH MEMORY
4096 BYTES
RESERVED FOR FLASH TEST
MONITOR ROM 416 BYTES
14 BYTES
RESERVED FLASH
RESERVED FLASH
14 BYTES
USER VECTORS
48 BYTES
(1)
RAM
(1)
(1)
3 BYTES
FLASH
FLASH
Note 1.
Attempts to execute code from addresses in this
range will generate an illegal address reset.
UNIMPLEMENTED
51712 BYTES
FLASH MEMORY
1536 BYTES
MC68HC908QT1, MC68HC908QT2,
MC68HC908QY1, and MC68HC908QY2
Memory Map
$2E00
↓
$F7FF
$F800
↓
$FDFF
Figure 2-1. Memory Map
MC68HC908QY/QT Family Data Sheet, Rev. 5
26Freescale Semiconductor
Input/Output (I/O) Section
2.4 Input/Output (I/O) Section
Addresses $0000–$003F, shown in Figure 2-2, contain most of the control, status, and data registers.
Additional I/O registers have these addresses:
•$FE00 — Break status register, BSR
•$FE01 — Reset status register, SRSR
•$FE02 — Break auxiliary register, BRKAR
•$FE03 — Break flag control register, BFCR
•$FE04 — Interrupt status register 1, INT1
•$FE05 — Interrupt status register 2, INT2
•$FE06 — Interrupt status register 3, INT3
•$FE07 — Reserved
•$FE08 — FLASH control register, FLCR
•$FE09 — Break address register high, BRKH
•$FE0A — Break address register low, BRKL
•$FE0B — Break status and control register, BRKSCR
•$FE0C — LVI status register, LVISR
•$FE0D — Reserved
•$FFBE — FLASH block protect register, FLBPR
•$FFC0 — Internal OSC trim value — Optional
•$FFFF — COP control register, COPCTL
Addr.Register NameBit 7654321Bit 0
Port A Data Register
$0000
Port B Data Register
$0001
$0002 Unimplemented
$0003 Unimplemented
Data Direction Register A
$0004
Data Direction Register B
$0005
(PTA)
See page 98.
(PTB)
See page 100.
(DDRA)
See page 98.
(DDRB)
See page 101.
Read:
Write:
Reset:Unaffected by reset
Read:
Write:
Reset:Unaffected by reset
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
R
PTB7PTB6PTB5PTB4PTB3PTB2PTB1PTB0
RRDDRA5DDRA4DDRA3
DDRB7DDRB6DDRB5DDRB4DDRB3DDRB2DDRB1DDRB0
AWUL
= UnimplementedR= ReservedU = Unaffected
PTA5PTA4PTA3
PTA2
0
DDRA1DDRA0
PTA1PTA0
Figure 2-2. Control, Status, and Data Registers (Sheet 1 of 5)