Freescale reserves the right to make changes without further notice to any products
herein. Freescale makes no warranty, representation or guarantee regarding the
suitability of its products for any particular purpose, nor does Freescale 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 Freescale data sheets
and/or specifications can and do vary in different applications and actual performance
may vary over time. All operating par ameters, including "Typicals" m ust be validated
for each customer application by customer's technical experts. Freescale does not
convey any license under its pa tent rig hts n or th e righ ts of ot hers . Fre esca le pro duc ts
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 Freescale product could
create a situation where personal injury or death may occur. Should Buyer pur chase or
use Freescale products for any such unintended or unauthorized application, Buyer
shall indemnify and hold Freescale 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 unintend ed or unauthorized use, even if such claim
alleges that Freescale was negligent regarding the design or manufacture of the part.
Freescale, Inc. is an Equal Opportunity/Affirmative Action Employer.
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
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
Date
February
2002
August, 20052.1Updated to meet Freescale identity guidelines.—
The MC68HC908LJ12 is a member of the low-cost, high-performance
M68HC08 Family of 8-bit microcontroller units (MCUs). The M68HC08
Family is based on the customer-specified integrated circuit (CSIC)
design strategy. 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.
1.3 Features
Features of the MC68HC908LJ12 include the following:
•High-performance M68HC08 architecture
•Fully upward-compatible object code with M6805, M146805, and
M68HC05 Families
•Maximum internal bus frequency:
–8-MHz at 5V operating voltage
–4-MHz at 3.3V operating voltage
•32-kHz crystal oscillator clock input with 32MHz internal phaselock-loop
•Optional continuous crystal oscillator operation in stop mode
•12k-bytes user program FLASH memory with security1 feature
•512 bytes of on-chip RAM
•Two 16-bit, 2-channel timer interface modules (TIM1 and TIM2)
with selectable input capture, output compare, and PWM
capability on each channel
•Real time clock (RTC) with clock, calendar, alarm, and
chronograph functions. Selectable periodic interrupt requests for
seconds, minutes, hours, days, 2-Hz, 4-Hz, and 100-Hz
•Serial communications interface module (SCI) with infrared (IR)
encoder/decoder
1. No security feature is absolutely secure. However, Freescale’s strategy is to make reading or
copying the FLASH difficult for unauthorized users.
Technical DataMC68HC908LJ12 — Rev. 2.1
34General DescriptionFreescale Semiconductor
General Description
•Serial peripheral interface module (SPI)
•IRQ external interrupt pin with integrated pullup
•8-bit keyboard wakeup port with programmable pullup
•32 general-purpose input/output (I/O) pins:
–H igh current 8-mA sink capability on PTB2–PTB5
–H igh current 20-mA sink capability on PTB0–PTB1
•4/3 backplanes and static with maximum 27 frontplanes liquid
crystal display (LCD) driver
•Resident routines for in-circuit programming and EEPROM
emulation
•Low-power design (fully static with stop and wait modes)
•Master reset pin (with integrated pullup) and power-on reset
•Spike filter protection for EMC performance enhancement
•System protection features
–Optional computer operating properly (COP) reset, driven by
internal 64-kHz RC oscillator
–Low-voltage detection with optional reset or interrupt
–Illegal opcode detection with reset
–Illegal address detection with reset
•64-pin quad flat pack (QFP), 64-pin low-profile quad flat pack
(LQFP), 52-pin low-profile quad flat pack (LQFP), and die form
•Specific features of the MC68HC908LJ12 in 52-pin LQFP are:
–20 general-purpose I/Os only
–H igh current 8-mA sink capability on PTB2–PTB3 only
–4-bit keyboard wakeup port with programmable pullup
–No serial peripheral interface module (SPI)
–No TIM2 input capture/output compare pins
–4 -channel analog-to-digital converter only
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorGeneral Description35
General Description
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.4 MCU Block Diagram
Figure 1-1 shows the structure of the MC68HC908LJ12.
Technical DataMC68HC908LJ12 — Rev. 2.1
36General DescriptionFreescale Semiconductor
M68HC08 CPU
CPU
REGISTERS
CONTROL AND STATUS REGISTERS — 96 BYTES
USER FLASH — 12,288 BYTES
ARITHMETIC/LOGIC
UNIT (ALU)
INTERNAL BUS
KEYBOARD INTERRUPT
MODULE
10-BIT ANALOG-TO-DIGITAL
CONVERTER MODULE
General Description
PTA7/ADC3
PTA6/ADC2
PTA5/ADC1
PTA4/ADC0
DDRA
PTA3/KBI3**
PORTA
PTA2/KBI2**
PTA1/KBI1**
PTA0/KBI0**
USER RAM — 512 BYTES
MONITOR ROM — 960 BYTES
USER FLASH VECTOR SPACE — 48 BYTES
CLOCK GENERATOR MODULE
OSC1
OSC2
CGMXFC
* RST
* IRQ
VDDA
VDD
VSS
VREFH
VREFL
32.768-kHz OSCILLATOR
PHASE-LOCKED LOOP
SYSTEM INTEGRATION
MODULE
EXTERNAL INTERRUPT
MODULE
COMPUTER OPERATING
PROPERLY MODULE
POWER-ON RESET
MODULE
POWER
ADC REFERENCE
2-CHANNEL TIMER INTERFACE
2-CHANNEL TIMER INTERFACE
* Pin contains integrated pullup device.
** Pin contains integrated pullup device if configured as KBI.
VDD and VSS are the power supply and ground pins. The MCU operates
from a single power supply.
Fast signal transitions on MCU pins place high, short-duration current
demands on the power supply. To prevent noise problems, take special
care to provide power supply bypassing at the MCU as Figure 1-4
shows. Place the C1 bypass capacitor as close to the MCU as possible.
Use a high-frequency-response ceramic capacitor for C1. C2 is an
optional bulk current bypass capacitor for use in applications that require
the port pins to source high current levels. VSS must be grounded for
proper MCU operation.
1.6.2 Analog Power Supply Pin (V
V
DDA
V
DDA
immunity, route V
as close as possible to the package (see Figure 1-4).
)
DDA
is the voltage supply for the analog parts of the MCU. Connect the
pin to the same voltage potential as VDD. For maximum noise
via a separate trace and place bypass capacitors
DDA
MCU
V
DD
0.1 µF
C1(a)
+
C2(a)
V
NOTE: Component values shown
DD
represent typical applications.
V
SS
0.1 µF
C1(b)
+
C2(b)
V
DDA
V
DD
Figure 1-4. Power Supply Bypassing
Technical DataMC68HC908LJ12 — Rev. 2.1
40General DescriptionFreescale Semiconductor
1.6.3 Oscillator Pins (OSC1 and OSC2)
The OSC1 and OSC2 pins are the connections for the on-chip oscillator
circuit. The OSC1 pin contains a schmitt-trigger and a spike filter for
improved EMC performance. See Section 7. Oscillator (OSC).
1.6.4 External Reset Pin (RST)
A logic 0 on the RST pin forces the MCU to a known start-up state. RST
is bidirectional, allowing a reset of the entire system. It is driven low when
any internal reset source is asserted. A schmitt-trigger and a spike filter
is associated with this pin so that the device is more robust to EMC
noise.This pin also contains an internal pullup resistor. See Section 9.
System Integration Module (SIM).
General Description
1.6.5 External Interrupt Pin (IRQ)
IRQ is an asynchronous external interrupt pin. This pin contains an
internal pullup resistor. See Section 18. External Interrupt (IRQ).
1.6.6 External Filter Capacitor Pin (CGMXFC)
CGMXFC is an external filter capacitor connection for the CGM. See
Section 8. Clock Generator Module (CGM).
1.6.7 ADC Voltage High Reference Pin (V
V
is the voltage input pin for the ADC voltage high reference. See
REFH
REFH
Section 15. Analog-to-Digital Converter (ADC)
1.6.8 ADC Voltage Low Reference Pin (V
V
is the voltage input pin for the ADC voltage low reference. See
REFL
REFL
Section 15. Analog-to-Digital Converter (ADC)
)
)
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorGeneral Description41
General Description
1.6.9 Port A Input/Output (I/O) Pins (PTA7–PTA0)
PTA7–PTA0 are special function, bidirectional port pins (Section 17.).
PTA7/ADC3–PTA4/ADC0 are shared with the ADC (Section 15.), and
PTA3/KBI3–PTA0/KBI0 are shared with the KBI module (Section 19.).
1.6.10 Port B I/O Pins (PTB7–PTB0)
PTB7–PTB0 are special function, bidirectional port pins (Section 17.).
PTB0/TxD–PTB1/RxD are shared with the SCI module (Section 13.),
PTB5/T2CH1–PTB4/T2CH0 are shared with the TIM2 (Section 11.),
PTB3/T1CH1–PTB2/T1CH0 are shared with the TIM1(Section 11.),
PTB6/ADC4–PTB7/ADC5 are shared with the ADC (Section 15.).
1.6.11 Port C I/O Pins (PTC7–PTC0)
PTC7–PTC0 are special function, bidirectional port pins (Section 17.).
PTC7/FP26–PTC0/FP19 are shared with the LCD frontplane drivers
(Section 16.).
1.6.12 Port D I/O Pins (PTD7–PTD0)
PTD7–PTD0 are special function, bidirectional port pins (Section 17.).
PTD7/KBI7–PTD4/KBI4 are shared with KBI module (Section 19.).
PTD3/SPSCK–PTD0/SS
are shared with SPI module (Section 14.).
1.6.13 LCD Backplane and Frontplane (BP0–BP2, FP0/BP3, FP1–FP18)
BP0–BP2 are the LCD backplane driver pins and FP1– FP18 are the
frontplane driver pins. FP0/BP3 is the shared driver pin between FP0
and BP3 (Section 16.).
The CPU08 can address 64k-bytes of memory space. The memory
map, shown in Figure 2-1, includes:
Section 2. Memory Map
•12,288 bytes of user FLASH memory
•512 bytes of random-access memory (RAM)
•48 bytes of user-defined vectors
•960 bytes of monitor ROM
2.3 Unimplemented Memory Locations
Accessing an unimplemented location can cause an illegal address
reset if illegal address resets are enabled. In the memory map
(Figure 2-1) and in register figures in this document, unimplemented
locations are shaded.
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map43
Memory Map
2.4 Reserved Memory Locations
Accessing a reserved location can have unpredictable effects on MCU
operation. In the Figure 2-1 and in register figures in this document,
reserved locations are marked with the word Reserved or with the
letter R.
2.5 Input/Output (I/O) Section
Most of the control, status, and data registers are in the zero page area
of $0000–$005F. Additional I/O registers have these addresses:
•$FE00; SIM break status register, SBSR
•$FE01; SIM reset status register, SRSR
•$FE02; Reserved
•$FE03; SIM break flag control register, SBFCR
•$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; FLASH block protect register, FLBPR
•$FE0A; Reserved
•$FE0B; Reserved
•$FE0C; Break address register high, BRKH
•$FE0D; Break address register low, BRKL
•$FE0E; Break status and control register, BRKSCR
•$FE0F; LVI status register, LVISR
•$FFFF; COP control register, COPCTL
Data registers are shown in Figure 2-2. Table 2-1 is a list of vector
locations.
Technical DataMC68HC908LJ12 — Rev. 2.1
44Memory MapFreescale Semiconductor
Memory Map
$0000
↓
$005F
$0060
↓
$025F
$0260
↓
$BFFF
$C000
↓
$EFFF
$F000
↓
$FBFF
$FC00
↓
$FDFF
$FE00SIM Break Status Register (SBSR)
$FE01SIM Reset Status Register (SRSR)
$FE02Reserved
$FE03SIM Break Flag Control Register (SBFCR)
$FE04Interrupt Status Register 1 (INT1)
$FE05Interrupt Status Register 2 (INT2)
$FE06Interrupt Status Register 3 (INT3)
$FE07Reserved
$FE08FLASH Control Register (FLCR)
$FE09FLASH Block Protect Register (FLBPR)
$FE0AReserved
$FE0BReserved
$FE0CBreak Address Register High (BRKH)
$FE0DBreak Address Register Low (BRKL)
$FE0EBreak Status and Control Register (BRKSCR)
$FE0FLVI Status Register (LVISR)
$FE10
↓
$FFCF
$FFD0
↓
$FFFF
I/O Registers
96 Bytes
RAM
512 Bytes
Unimplemented
48,544 Bytes
FLASH Memory
12,288 Bytes
Unimplemented
3,072 Bytes
Monitor ROM 1
512 Bytes
Monitor ROM 2
448 Bytes
FLASH Vectors
48 Bytes
Figure 2-1. Memory Map
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map45
Memory Map
Addr.Register NameBit 7654321Bit 0
Read:
$0000
$0001
$0002
$0003
$0004
$0005
Port A Data Register
(PTA)
Port B Data Register
(PTB)
Port C Data Register
(PTC)
Port D Data Register
(PTD)
Data Direction Register A
(DDRA)
Data Direction Register B
(DDRB)
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
PTA7PTA6PTA5PTA4PTA3PTA2PTA1PTA0
PTB7PTB6PTB5PTB4PTB3PTB2PTB1PTB0
PTC7PTC6PTC5PTC4PTC3PTC2PTC1PTC0
PTD7PTD6PTD5PTD4PTD3PTD2PTD1PTD0
DDRA7DDRA6DDRA5DDRA4DDRA3DDRA2DDRA1DDRA0
DDRB7DDRB6DDRB5DDRB4DDRB3DDRB2DDRB1DDRB0
Data Direction Register C
$0006
Data Direction Register D
$0007
$0008Unimplemented
$0009Unimplemented
(DDRC)
(DDRD)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 1 of 12)
Read:
DDRC7DDRC6DDRC5DDRC4DDRC3DDRC2DDRC1DDRC0
Write:
Reset:00000000
Read:
DDRD7DDRD6DDRD5DDRD4DDRD3DDRD2DDRD1DDRD0
Write:
Reset:00000000
Read:
Write:
Reset:
Read:
Write:
Reset:
= UnimplementedR= Reserved
Technical DataMC68HC908LJ12 — Rev. 2.1
46Memory MapFreescale Semiconductor
Memory Map
Addr.Register NameBit 7654321Bit 0
Read:
$000AUnimplemented
$000BUnimplemented
Port B LED Control
$000C
$000DUnimplemented
$000E
$000FUnimplemented
Register
(LEDB)
Unimplemented
Write:
Reset:
Read:
Write:
Reset:
Read:00
LEDB5LEDB4LEDB3LEDB2LEDB1LEDB0
Write:
Reset:00000000
Read:
Write:
Reset:
Read:
Write:
Reset:
Read:
Write:
Reset:
$0010
$0011
$0012
$0013
Read:
SPI Control Register
(SPCR)
SPI Status and Control
Register
(SPSCR)
SPI Data Register
(SPDR)
SCI Control Register 1
(SCC1)
U = UnaffectedX = Indeterminate
Write:
Reset:00101000
Read:SPRF
Write:
Reset:00001000
Read:R7R6R5R4R3R2R1R0
Write:T7T6T5T4T3T2T1T0
Reset:UUUUUUUU
Read:
Write:
Reset:00000000
Figure 2-2. Control, Status, and Data Registers (Sheet 2 of 12)
SPRIERSPMSTRCPOLCPHASPWOMSPESPTIE
ERRIE
LOOPSENSCI
OVRFMODFSPTE
MODFENSPR1SPR0
0
MWAKEILTYPENPTY
= UnimplementedR= Reserved
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map47
Memory Map
Addr.Register NameBit 7654321Bit 0
Read:
$0014
$0015
$0016
$0017
$0018
$0019
SCI Control Register 2
(SCC2)
SCI Control Register 3
(SCC3)
SCI Status Register 1
(SCS1)
SCI Status Register 2
(SCS2)
SCI Data Register
(SCDR)
SCI Baud Rate Register
(SCBR)
Write:
Reset:00000000
Read:R8
Write:
Reset:
Read:SCTETCSCRFIDLEORNFFEPE
Write:
Reset:11000000
Read:000000BKFRPF
Write:
Reset:00000000
Read:R7R6R5R4R3R2R1R0
Write:T7T6T5T4T3T2T1T0
Reset:
Read:
Write:
Reset:00000000
SCTIETCIESCRIEILIETERERWUSBK
T8DMAREDMATEORIENEIEFEIEPEIE
UU
UUUUUUUU
0
CKS
000000
SCP1SCP0RSCR2SCR1SCR0
$001A
$001B
$001C
$001D
SCI Infrared Control
Register
(SCIRCR)
Keyboard Status and
Control Register
(KBSCR)
Keyboard Interrupt
Enable Register
(KBIER)
Configuration Register 2
(CONFIG2)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 3 of 12)
Read:
Write:
Reset:00000000
Read:0000KEYF0
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:0
Write:
†
Reset:0000000††0
R
KBIE7KBIE6KBIE5KBIE4KBIE3KBIE2KBIE1KBIE0
000
STOP_
IRCDIS
STOP_
XCLKEN
DIV2CLKPCEHPCELLVISEL1LVISEL0
= UnimplementedR= Reserved
RTNP1TNP0IREN
IMASKKMODEK
ACKK
††
Technical DataMC68HC908LJ12 — Rev. 2.1
48Memory MapFreescale Semiconductor
Memory Map
Addr.Register NameBit 7654321Bit 0
IRQ Status and Control
$001E
$001F
† One-time writable register after each reset.
†† Reset by POR only.
$0020
$0021
$0022
Configuration Register 1
Timer 1 Status and
Register
(INTSCR)
(CONFIG1)
Control Register
(T1SC)
Timer 1 Counter
Register High
(T1CNTH)
Timer 1 Counter
Register Low
(T1CNTL)
Read:0000IRQF0
Write:ACK
Reset:00000000
Read:
Write:
†
Reset:00010000
Read:TOF
Write:0TRST
Reset:00100000
Read:Bit 1514131211109Bit 8
Write:
Reset:00000000
Read:Bit 7654321Bit 0
Write:
Reset:00000000
COPRSLVISTOP LVIRSTD LVIPWRD
00
TOIETSTOP
IMASKMODE
0
SSRECSTOPCOPD
PS2PS1PS0
$0023
$0024
$0025
$0026
Timer 1 Counter Modulo
Register High
(T1MODH)
Timer 1 Counter Modulo
Register Low
(T1MODL)
Timer 1 Channel 0 Status
and Control Register
(T1SC0)
Timer 1 Channel 0
Register High
(T1CH0H)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 4 of 12)
Read:
Bit 1514131211109Bit 8
Write:
Reset:11111111
Read:
Bit 7654321Bit 0
Write:
Reset:11111111
Read:CH0F
CH0IEMS0BMS0AELS0BELS0ATOV0CH0MAX
Write:0
Reset:00000000
Read:
Bit 1514131211109Bit 8
Write:
Reset:XXXXXXXX
= UnimplementedR= Reserved
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map49
Memory Map
Addr.Register NameBit 7654321Bit 0
Timer 1 Channel 0
$0027
Timer 1 Channel 1 Status
$0028
$0029
$002A
$002B
$002C
Register Low
(T1CH0L)
and Control Register
(T1SC1)
Timer 1 Channel 1
Register High
(T1CH1H)
Timer 1 Channel 1
Register Low
(T1CH1L)
Timer 2 Status and
Control Register
(T2SC)
Timer 2 Counter
Register High
(T2CNTH)
Read:
Write:
Reset:XXXXXXXX
Read:CH1F
Write:0
Reset:00000000
Read:
Write:
Reset:XXXXXXXX
Read:
Write:
Reset:XXXXXXXX
Read:TOF
Write:0TRST
Reset:00100000
Read:Bit 1514131211109Bit 8
Write:
Reset:00000000
Bit 7654321Bit 0
CH1IE
Bit 1514131211109Bit 8
Bit 7654321Bit 0
TOIETSTOP
0
MS1AELS1BELS1ATOV1CH1MAX
00
PS2PS1PS0
$002D
$002E
$002F
$0030
Timer 2 Counter
Register Low
(T2CNTL)
Timer 2 Counter Modulo
Register High
(T2MODH)
Timer 2 Counter Modulo
Register Low
(T2MODL)
Timer 2 Channel 0 Status
and Control Register
(T2SC0)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 5 of 12)
Read:Bit 7654321Bit 0
Write:
Reset:00000000
Read:
Bit 1514131211109Bit 8
Write:
Reset:11111111
Read:
Bit 7654321Bit 0
Write:
Reset:11111111
Read:CH0F
CH0IEMS0BMS0AELS0BELS0ATOV0CH0MAX
Write:0
Reset:00000000
= UnimplementedR= Reserved
Technical DataMC68HC908LJ12 — Rev. 2.1
50Memory MapFreescale Semiconductor
Memory Map
Addr.Register NameBit 7654321Bit 0
$0031
$0032
$0033
$0034
$0035
$0036
Timer 2 Channel 0
Register High
(T2CH0H)
Timer 2 Channel 0
Register Low
(T2CH0L)
Timer 2 Channel 1 Status
and Control Register
(T2SC1)
Timer 2 Channel 1
Register High
(T2CH1H)
Timer 2 Channel 1
Register Low
(T2CH1L)
PLL Control Register
(PTCL)
Read:
Write:
Reset:XXXXXXXX
Read:
Write:
Reset:XXXXXXXX
Read:CH1F
Write:0
Reset:00000000
Read:
Write:
Reset:XXXXXXXX
Read:
Write:
Reset:XXXXXXXX
Read:
Write:
Reset:00100000
Bit 1514131211109Bit 8
Bit 7654321Bit 0
CH1IE
Bit 1514131211109Bit 8
Bit 7654321Bit 0
PLLF
PLLIE
0
MS1AELS1BELS1ATOV1CH1MAX
PLLONBCSPRE1PRE0VPR1VPR0
$0037
$0038
$0039
$003A
PLL Bandwidth Control
Register
(PBWC)
PLL Multiplier Select
Register High
(PMSH)
PLL Multiplier Select
Register Low
(PMSL)
PLL VCO Range Select
Register
(PMRS)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 6 of 12)
Read:
AUTO
Write:
Reset:00000000
Read:0000
Write:
Reset:00000000
Read:
MUL7MUL6MUL5MUL4MUL3MUL2MUL1MUL0
Write:
Reset:01000000
Read:
VRS7VRS6VRS5VRS4VRS3VRS2VRS1VRS0
Write:
Reset:01000000
LOCK
ACQ
0000
R
MUL11MUL10MUL9MUL8
= UnimplementedR= Reserved
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map51
Memory Map
Addr.Register NameBit 7654321Bit 0
PLL Reference Divider
$003B
ADC Status and Control
$003C
$003D
$003E
$003F
ADC Data Register High
ADC Data Register Low
$0040
Select Register
(PMDS)
Register
(ADSCR)
(ADRH)
(ADRL)
ADC Clock Register
(ADCLK)
Unimplemented
Read:0000
Write:
Reset:
Read:COCO
Write:
Reset:00011111
Read:ADxADxADxADxADxADxADxADx
Write:RRRRRRRR
Reset:00000000
Read:ADxADxADxADxADxADxADxADx
Write:RRRRRRRR
Reset:00000000
Read:
Write:
Reset:00000100
Read:
Write:
0
ADIV2ADIV1ADIV0ADICLKMODE1MODE0
00
AIENADCOADCH4ADCH3ADCH2ADCH1ADCH0
0
RDS3RDS2RDS1RDS0
0001
00
R
$0041Unimplemented
$0042
$0043
$0044
RTC Control Register 1
(RTCCR1)
RTC Control Register 2
(RTCCR2)
RTC Status Register
(RTCSR)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 7 of 12)
Reset:
Read:
Write:
Reset:
Read:
Write:
Reset:00000000
Read:0
Write:RCHRCLR
Reset:00000000
Read:ALMFCHRFDAYFHRFMINFSECFTB1FTB2F
Write:
Reset:00000000
ALMIECHRIEDAYIEHRIEMINIESECIETB1IETB2IE
0
CHRERTCE
= UnimplementedR= Reserved
0
XTL2XTL1XTL0
Technical DataMC68HC908LJ12 — Rev. 2.1
52Memory MapFreescale Semiconductor
Memory Map
Addr.Register NameBit 7654321Bit 0
$0045
$0046
$0047
$0048
$0049
$004A
Alarm Minute Register
(ALMR)
Alarm Hour Register
(ALHR)
Second Register
(SECR)
Minute Register
(MINR)
Hour Register
(HRR)
Day Register
(DAYR)
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:00
Write:
Reset:00000000
Read:00
Write:
Reset:00000000
Read:000
Write:
Reset:00000000
Read:000
Write:
Reset:00000001
00
AM5AM4AM3AM2AM1AM0
000
AH4AH3AH2AH1AH0
SEC5SEC4SEC3SEC2SEC1SEC0
MIN5MIN4MIN3MIN2MIN1MIN0
HR4HR3HR2HR1HR0
DAY4DAY3DAY2DAY1DAY0
$004B
$004C
$004D
$004E
Read:0000
Month Register
(MTHR)
Year Register
(YRR)
Day-Of-Week Register
(DOWR)
Chronograph Data
Register
(CHRR)
U = UnaffectedX = Indeterminate
Write:
Reset:00000001
Read:
Write:
Reset:00000000
Read:00000
Write:
Reset:00000000
Read:0CHR6CHR5CHR4CHR3CHR2CHR1CHR0
Write:
Reset:00000000
Figure 2-2. Control, Status, and Data Registers (Sheet 8 of 12)
MTH3MTH2MTH1MTH0
YR7YR6YR5YR4YR3YR2YR1YR0
DOW2DOW1DOW0
= UnimplementedR= Reserved
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map53
Memory Map
Addr.Register NameBit 7654321Bit 0
$004F
$0050Reserved
$0051
$0052
$0053
$0054
LCD Clock Register
LCD Control Register
LCD Data Register 1
LCD Data Register 2
LCD Data Register 3
(LCDCLK)
(LCDCR)
(LDAT1)
(LDAT2)
(LDAT3)
Read:0
Write:
Reset:00000000
Read:
RRRRRRRR
Write:
Reset:
Read:
LCDE
Write:
Reset:00000000
Read:
F1B3F1B2F1B1F1B0F0B3F0B2F0B1F0B0
Write:
Reset:UUUUUUUU
Read:
F3B3F3B2F3B1F3B0F2B3F2B2F2B1F2B0
Write:
Reset:UUUUUUUU
Read:
F5B3F5B2F5B1F5B0F4B3F4B2F4B1F4B0
Write:
Reset:UUUUUUUU
FCCTL1FCCTL0DUTY1DUTY0LCLK2LCLK1LCLK0
0
FCLCLCCON3LCCON2LCCON1LCCON0
$0055
$0056
$0057
$0058
Read:
LCD Data Register 4
(LDAT4)
LCD Data Register 5
(LDAT5)
LCD Data Register 6
(LDAT6)
LCD Data Register 7
(LDAT7)
U = UnaffectedX = Indeterminate
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:UUUUUUUU
Read:
Write:
Reset:UUUUUUUU
F7B3F7B2F7B1F7B0F6B3F6B2F6B1F6B0
F9B3F9B2F9B1F9B0F8B3F8B2F8B1F8B0
F11B3F11B2F11B1F11B0F10B3F10B2F10B1F10B0
F13B3F13B2F13B1F13B0F12B3F12B2F12B1F12B0
= UnimplementedR= Reserved
Figure 2-2. Control, Status, and Data Registers (Sheet 9 of 12)
Technical DataMC68HC908LJ12 — Rev. 2.1
54Memory MapFreescale Semiconductor
Memory Map
Addr.Register NameBit 7654321Bit 0
$0059
$005A
$005B
$005C
$005D
$005E
LCD Data Register 8
(LDAT8)
LCD Data Register 9
(LDAT9)
LCD Data Register 10
(LDAT10)
LCD Data Register 11
(LDAT11)
LCD Data Register 12
(LDAT12)
LCD Data Register 13
(LDAT13)
Read:
F15B3F15B2F15B1F15B0F14B3F14B2F14B1F14B0
Write:
Reset:UUUUUUUU
Read:
F17B3F17B2F17B1F17B0F16B3F16B2F16B1F16B0
Write:
Reset:UUUUUUUU
Read:
F19B3F19B2F19B1F19B0F18B3F18B2F18B1F18B0
Write:
Reset:UUUUUUUU
Read:
F21B3F21B2F21B1F21B0F20B3F20B2F20B1F20B0
Write:
Reset:UUUUUUUU
Read:
F23B3F23B2F23B1F23B0F22B3F22B2F22B1F22B0
Write:
Reset:UUUUUUUU
Read:
F25B3F25B2F25B1F25B0F24B3F24B2F24B1F24B0
Write:
Reset:UUUUUUUU
$005F
$FE00
Note: Writing a logic 0 clears SBSW.
$FE01
LCD Data Register 14
(LDAT14)
SIM Break Status Register
(SBSR)
SIM Reset Status Register
(SRSR)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 10 of 12)
Read:
Write:
Reset:UUUUUUUU
Read:
RRRRRR
Write:Note
Reset:0
Read:PORPINCOPILOPILAD0LVI0
Write:
POR:10000000
= UnimplementedR= Reserved
F26B3F26B2F26B1F26B0
SBSW
R
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorMemory Map55
Memory Map
Addr.Register NameBit 7654321Bit 0
$FE02Reserved
SIM Break Flag Control
$FE03
Interrupt Status Register 1
$FE04
Interrupt Status Register 2
$FE05
Interrupt Status Register 3
$FE06
$FE07Reserved
Register
(SBFCR)
(INT1)
(INT2)
(INT3)
Read:
RRRRRRRR
Write:
Reset:
Read:
BCFERRRRRRR
Write:
Reset:0
Read:IF6IF5IF4IF3IF2IF100
Write:RRRRRRRR
Reset:00000000
Read:IF14IF13IF12IF11IF10IF9IF8IF7
Write:RRRRRRRR
Reset:00000000
Read:00000IF17IF16IF15
Write:RRRRRRRR
Reset:00000000
Read:
RRRRRRRR
Write:
$FE08
$FE09
$FE0AReserved
$FE0BReserved
FLASH Control Register
(FLCR)
FLASH Block Protect
Register
(FLBPR)
U = UnaffectedX = Indeterminate
Figure 2-2. Control, Status, and Data Registers (Sheet 11 of 12)
Reset:
Read:0000
HVENMASSERASEPGM
Write:
Reset:00000000
Read:
BPR7BPR6BPR5BPR4BPR3BPR2BPR1BPR0
Write:
Reset:00000000
Read:
RRRRRRRR
Write:
Reset:
Read:
RRRRRRRR
Write:
Reset:
= UnimplementedR= Reserved
Technical DataMC68HC908LJ12 — Rev. 2.1
56Memory MapFreescale Semiconductor
Memory Map
Addr.Register NameBit 7654321Bit 0
$FE0C
$FE0D
Break Status and Control
$FE0E
Low-Voltage Inhibit Status
$FE0F
$FFFF
COP Control Register
Break Address
Register High
(BRKH)
Break Address
Register Low
(BRKL)
Register
(BRKSCR)
Register
(LVISR)
(COPCTL)
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read:
Write:
Reset:00000000
Read: LVIOUT
Write:
Reset:00000000
Read:Low byte of reset vector
Write:Writing clears COP counter (any value)
Reset:Unaffected by reset
Bit 1514131211109Bit 8
Bit 7654321Bit 0
000000
BRKEBRKA
LVIIF00000
LVIIE
LVIIAK
U = UnaffectedX = Indeterminate
= UnimplementedR= Reserved
Figure 2-2. Control, Status, and Data Registers (Sheet 12 of 12)
This section describes the 512 bytes of RAM (random-access memory).
3.3 Functional Description
Addresses $0060 through $025F are RAM locations. The location of the
stack RAM is programmable. The 16-bit stack pointer allows the stack to
be anywhere in the 64k-byte memory space.
NOTE:For correct operation, the stack pointer must point only to RAM
locations.
Within page zero are 160 bytes of RAM. Because the location of the
stack RAM is programmable, all page zero RAM locations can be used
for I/O control and user data or code. When the stack pointer is moved
from its reset location at $00FF out of page zero, direct addressing mode
instructions can efficiently access all page zero RAM locations. Page
zero RAM, therefore, provides ideal locations for frequently accessed
global variables.
Before processing an interrupt, the CPU uses five bytes of the stack to
save the contents of the CPU registers.
NOTE:For M6805 compatibility, the H register is not stacked.
During a subroutine call, the CPU uses two bytes of the stack to store
the return address. The stack pointer decrements during pushes and
increments during pulls.
NOTE:Be careful when using nested subroutines. The CPU may overwrite data
in the RAM during a subroutine or during the interrupt stacking
operation.
This section describes the operation of the embedded FLASH memory.
This memory can be read, programmed, and erased from a single
external supply. The program and erase operations are enabled through
the use of an internal charge pump.
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorFLASH Memory (FLASH)61
FLASH Memory (FLASH)
Addr.Register NameBit 7654321Bit 0
$FE08
$FE09
FLASH Control Register
(FLCR)
FLASH Block Protect
Register
(FLBPR)
Reset:00000000
Reset:00000000
4.3 Functional Description
The FLASH memory consists of an array of 12,288 bytes for user
memory plus a block of 48 bytes for user interrupt vectors. An erased bit reads as logic 1 and a programmed bit reads as a logic 0. The FLASH
memory page size is defined as 128 bytes, and is the minimum size that
can be erased in a page erase operation. Program and erase operations
are facilitated through control bits in FLASH control register (FLCR). The
address ranges for the FLASH memory are:
Read:0000
HVENMASSERASEPGM
Write:
Read:
BPR7BPR6BPR5BPR4BPR3BPR2BPR1BPR0
Write:
= Unimplemented
Figure 4-1. FLASH I/O Register Summary
•$C000–$EFFF; user memory; 12,288 bytes
•$FFD0–$FFFF; user interrupt vectors; 48 bytes
Programming tools are available from Freescale. Contact your local
Freescale representative for more information.
NOTE:A security feature prevents viewing of the FLASH contents.
1. No security feature is absolutely secure. However, Freescale’s strategy
Technical DataMC68HC908LJ12 — Rev. 2.1
1
62FLASH Memory (FLASH)Freescale Semiconductor
4.4 FLASH Control Register
The FLASH control register (FLCR) controls FLASH program and erase
operations.
Address:$FE08
FLASH Memory (FLASH)
Bit 7654321Bit 0
Read:0000
HVENMASSERASEPGM
Write:
Reset:00000000
Figure 4-2. FLASH Control Register (FLCR)
HVEN — High Voltage Enable Bit
This read/write bit enables the charge pump to drive high voltages for
program and erase operations in the array. HVEN can only be set if
either PGM = 1 or ERASE = 1 and the proper sequence for program
or erase is followed.
1 = High voltage enabled to array and charge pump on
0 = High voltage disabled to array and charge pump off
MASS — Mass Erase Control Bit
This read/write bit configures the memory for mass erase operation or
block erase operation when the ERASE bit is set.
This read/write bit configures the memory for erase operation.
ERASE is interlocked with the PGM bit such that both bits cannot be
equal to 1 or set to 1 at the same time.
This read/write bit configures the memory for program operation.
PGM is interlocked with the ERASE bit such that both bits cannot be
equal to 1 or set to 1 at the same time.
1 = Program operation selected
0 = Program operation not selected
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorFLASH Memory (FLASH)63
FLASH Memory (FLASH)
4.5 FLASH Page Erase Operation
Use the following procedure to erase a page of FLASH memory. A page
consists of 128 consecutive bytes starting from addresses $xx00 or
$xx80. The 48-byte user interrupt vectors area also forms a page. The
48-byte user interrupt vectors cannot be erased by the page erase
operation because of security reasons. Mass erase is required to erase
this page.
1.Set the ERASE bit and clear the MASS bit in the FLASH control
register.
2.Write any data to any FLASH address within the page address
range desired.
3.Wait for a time, t
(at least 10µs).
nvs
4.Set the HVEN bit.
5.Wait for a time, t
erase
(1ms).
6.Clear the ERASE bit.
7.Wait for a time, t
8.Clear the HVEN bit.
9.After time, t
rcv
mode.
NOTE:Programming and erasing of FLASH locations cannot be performed by
executing code from the FLASH memory; the code must be executed
from RAM. While these operations must be performed in the order as
shown, but other unrelated operations may occur between the steps.
(5µs).
nvh
(1µs), the memory can be accessed again in read
Technical DataMC68HC908LJ12 — Rev. 2.1
64FLASH Memory (FLASH)Freescale Semiconductor
4.6 FLASH Mass Erase Operation
Use the following procedure to erase the entire FLASH memory to read
as logic 1:
1.Set both the ERASE bit and the MASS bit in the FLASH control
register.
2.Write any data to any FLASH address within the FLASH memory
address range.
FLASH Memory (FLASH)
3.Wait for a time, t
(10µs).
nvs
4.Set the HVEN bit.
5.Wait for a time t
merase
(4ms).
6.Clear the ERASE bit.
7.Wait for a time, t
nvhl
(100µs).
8.Clear the HVEN bit.
9.After time, t
(1µs), the memory can be accessed again in read
rcv
mode.
NOTE:Programming and erasing of FLASH locations cannot be performed by
executing code from the FLASH memory; the code must be executed
from RAM. While these operations must be performed in the order as
shown, but other unrelated operations may occur between the steps.
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorFLASH Memory (FLASH)65
FLASH Memory (FLASH)
4.7 FLASH Program Operation
Programming of the FLASH memory is done on a row basis. A row
consists of 64 consecutive bytes starting from addresses $xx00, $xx40,
$xx80, or $xxC0. The procedure for programming a row of the FLASH
memory is outlined below:
1.Set the PGM bit. This configures the memory for program
operation and enables the latching of address and data for
programming.
2.Write any data to any FLASH address within the row address
range desired.
3.Wait for a time, t
(10µs).
nvs
4.Set the HVEN bit.
5.Wait for a time, t
pgs
(5µs).
6.Write data to the FLASH address to be programmed.
7.Wait for time, t
prog
(30µs).
8.Repeat step 6 and 7 until all the bytes within the row are
programmed.
9.Clear the PGM bit.
10.Wait for time, t
11.Clear the HVEN bit.
12.After time, t
rcv
mode.
This program sequence is repeated throughout the memory until all data
is programmed.
NOTE:Programming and erasing of FLASH locations cannot be performed by
executing code from the FLASH memory; the code must be executed
from RAM. While these operations must be performed in the order as
shown, but other unrelated operations may occur between the steps. Do
not exceed t
Characteristics.
maximum. See 23.18 FLASH Memory
prog
(5µs).
nvh
(1µs), the memory can be accessed again in read
Figure 4-3 shows a flowchart representation for programming the
FLASH memory.
Technical DataMC68HC908LJ12 — Rev. 2.1
66FLASH Memory (FLASH)Freescale Semiconductor
FLASH Memory (FLASH)
Algorithm for programming
a row (64 bytes) of FLASH memory
1
2
Write any data to any FLASH address
Set PGM bit
within the row address range desired
3
4
5
6
Wait for a time, t
Set HVEN bit
Wait for a time, t
Write data to the FLASH address
to be programmed
7
Wait for a time, t
nvs
pgs
prog
Completed
programming
this row?
NOTE:
The time between each FLASH address change (step 6 to step 6), or
the time between the last FLASH address programmed
to clearing PGM bit (step 6 to step 9)
must not exceed the maximum programming
PROG
max.
time, t
This row program algorithm assumes the row/s
to be programmed are initially erased.
Figure 4-3. FLASH Programming Flowchart
Y
N
9
10
11
12
Clear PGM bit
Wait for a time, t
Clear HVEN bit
Wait for a time, t
nvh
rcv
End of Programming
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorFLASH Memory (FLASH)67
FLASH Memory (FLASH)
4.8 FLASH Protection
Due to the ability of the on-board charge pump to erase and program the
FLASH memory in the target application, provision is made to protect
pages of memory from unintentional erase or program operations due to
system malfunction. This protection is done by use of a FLASH block
protect register (FLBPR). The FLBPR determines the range of the
FLASH memory which is to be protected. The range of the protected
area starts from a location defined by FLBPR and ends to the bottom of
the FLASH memory ($FFFF). When the memory is protected, the HVEN
bit cannot be set in either erase or program operations.
NOTE:When the FLBPR is cleared (all 0’s), the entire FLASH memory is
protected from being programmed and erased. When all the bits are set,
the entire FLASH memory is accessible for program and erase.
4.8.1 FLASH Block Protect Register
The FLASH block protect register is implemented as an 8-bit I/O register.
The content of this register determine the starting location of the
protected range within the FLASH memory.
Address:$FE09
Read:
Write:
Reset:00000000
BPR[7:0] — FLASH Block Protect Register Bit 7 to Bit 0
BPR[7:1] represent bits [13:7] of a 16-bit memory address. Bits
[15:14] are logic 1’s and bits [6:0] are logic 0’s.
Bit 7654321Bit 0
BPR7BPR6BPR5BPR4BPR3BPR2BPR1BPR0
Figure 4-4. FLASH Block Protect Register (FLBPR)
16-bit memory address
Start address of FLASH block protect 110000000
BPR[7:1]
Figure 4-5. FLASH Block Protect Start Address
Technical DataMC68HC908LJ12 — Rev. 2.1
68FLASH Memory (FLASH)Freescale Semiconductor
FLASH Memory (FLASH)
BPR0 is used only for BPR[7:0] = $FF, for no block protection.
The resultant 16-bit address is used for specifying the start address
of the FLASH memory for block protection. The FLASH is protected
from this start address to the end of FLASH memory, at $FFFF. With
this mechanism, the protect start address can be XX00 or XX80 (at
page boundaries — 128 bytes) within the FLASH memory.
Examples of protect start address:
BPR[7:0]Start of Address of Protect Range
$00 or $01
$02 or $03$C080 (1100 0000 1000 0000)
$04 or $05$C100 (1100 0001 0000 0000)
$06 or $07$C180 (1100 0001 1000 0000)
$08 or $09$C200 (1100 0010 0000 0000)
and so on...
$F8 or $F9$FE00 (1111 1110 0000 0000)
$FA or $FB$FE80 (1111 1110 1000 0000)
$FC or $FD$FF00 (1111 1111 0000 0000)
$FE$FF80 (1111 1111 1000 0000)
$FFThe entire FLASH memory is not protected.
Note:
The end address of the protected range is always $FFFF.
The configuration registers are used in the initialization of various
options. The configuration registers can be written once after each reset.
All of the configuration register bits are cleared during reset. Since the
various options affect the operation of the MCU, it is recommended that
these registers be written immediately after reset. The configuration
registers are located at $001D and $001F. The configuration registers
may be read at anytime.
Read:0
Write:
Read:
COPRSLVISTOP LVIRSTD LVIPWRD
Write:
STOP_
IRCDIS
= Unimplemented
STOP_
XCLKEN
DIV2CLKPCEHPCELLVISEL1LVISEL0
Figure 5-1. CONFIG Registers Summary
††
0
SSRECSTOPCOPD
NOTE:The options except LVISEL[1:0] are one-time writable by the user after
each reset. The LVISEL[1:0] bits are one-time writable by the user only
after each POR (power-on reset). The CONFIG registers are not in the
FLASH memory but are special registers containing one-time writable
latches after each reset. Upon a reset, the CONFIG registers default to
predetermined settings as shown in Figure 5-2 and Figure 5-3.
SSREC enables the CPU to exit stop mode with a delay of 32 ICLK
cycles instead of a 4096 ICLK cycle delay.
1 = Stop mode recovery after 32 ICLK cycles
0 = Stop mode recovery after 4096 ICLK cycles
NOTE:Exiting stop mode by pulling reset will result in the long stop recovery.
If using an external crystal oscillator, do not set the SSREC bit.
NOTE:When the LVISTOP is enabled, the system stabilization time for power
on reset and long stop recovery (both 4096 ICLK cycles) gives a delay
longer than the enable time for the LVI. There is no period where the
MCU is not protected from a low power condition. However, when using
the short stop recovery configuration option, the 32 ICLK delay is less
than the LVI’s turn-on time and there exists a period in start-up where the
LVI is not protecting the MCU.
Setting STOP_IRCDIS disables the internal RC oscillator during stop
mode. When this bit is cleared, the internal RC oscillator continues to
operate in stop mode. Reset clears this bit.
1 = Internal RC oscillator disabled during stop mode
0 = Internal RC oscillator enabled during stop mode
STOP_XCLKEN — Crystal Oscillator Stop Mode Enable
Setting STOP_XCLKEN enables the external crystal (XTAL) oscillator
to continue operating during stop mode. This is useful for driving the
real time clock module to allow it to generate periodic wake-up while
in stop mode. When this bit is cleared, the external XTAL oscillator will
be disabled during stop mode. Reset clears this bit.
1 = XTAL oscillator enabled during stop mode
0 = XTAL oscillator disabled during stop mode
††
DIV2CLK — Divide-by-2 Clock Bypass
When CGMXCLK is selected to drive the system clocks (BCS=0),
setting DIV2CLK allows the CGMXCLK to bypass the divide-by-2
divider in the CGM module; CGMOUT will equal CGMXCLK and bus
clock will equal CGMXCLK divide-by-2.
DIV2CLK bit has no effect when the BCS=1 in the PLL control
register (CGMVCLK selected and divide-by-2 always enabled). Reset
clears this bit.
Setting PCEH configures the PTC4/FP23–PTC7/FP26 pins for LCD
frontplane driver use. Reset clears this bit.
1 = PTC4/FP23–PTC7/FP26 pins configured as LCD frontplane
driver pins: FP23–FP26
0 = PTC4/FP23–PTC7/FP26 pins configured as standard I/O pins:
PTC4–PTC7
PCEL — Port C Enable Low Nibble
Setting PCEL configures the PTC0/FP19–PTC3/FP22 pins for LCD
frontplane driver use. Reset clears this bit.
1 = PTC0/FP19–PTC3/FP22 pins configured as LCD frontplane
driver pins: FP19–FP22
0 = PTC0/FP19–PTC3/FP22 pins configured as standard I/O pins:
PTC0–PTC3
LVISEL[1:0] — LVI Operating Mode Selection
LVISEL[1:0] selects the voltage operating mode of the LVI module.
(See Section 21. Low-Voltage Inhibit (LVI).) The voltage mode
selected for the LVI should match the operating VDD. See Section 23.
Electrical Specificationsfor the LVI voltage trip points for each of
Freescale SemiconductorCentral Processor Unit (CPU)77
Central Processor Unit (CPU)
6.2 Introduction
The M68HC08 CPU (central processor unit) is an enhanced and fully
object-code-compatible version of the M68HC05 CPU. The CPU08 Reference Manual (Freescale document order number CPU08RM/AD)
contains a description of the CPU instruction set, addressing modes,
and architecture.
6.3 Features
Feature of the CPU include:
•Object code fully upward-compatible with M68HC05 Family
•16-bit stack pointer with stack manipulation instructions
•16-Bit index register with X-register manipulation instructions
•8-MHz CPU internal bus frequency
•64-Kbyte program/data memory space
•16 addressing modes
•Memory-to-memory data moves without using accumulator
•Fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions
•Enhanced binary-coded decimal (BCD) data handling
•Modular architecture with expandable internal bus definition for
extension of addressing range beyond 64-Kbytes
•Low-power stop and wait modes
Technical DataMC68HC908LJ12 — Rev. 2.1
78Central Processor Unit (CPU)Freescale Semiconductor
6.4 CPU Registers
Central Processor Unit (CPU)
Figure 6-1 shows the five CPU registers. CPU registers are not part of
the memory map.
6.4.1 Accumulator
7
15
HX
15
15
70
V11HINZC
0
ACCUMULATOR (A)
0
INDEX REGISTER (H:X)
0
STACK POINTER (SP)
0
PROGRAM COUNTER (PC)
CONDITION CODE REGISTER (CCR)
CARRY/BORROW FLAG
ZERO FLAG
NEGATIVE FLAG
INTERRUPT MASK
HALF-CARRY FLAG
TWO’S COMPLEMENT OVERFLOW FLAG
Figure 6-1. CPU Registers
The accumulator is a general-purpose 8-bit register. The CPU uses the
accumulator to hold operands and the results of arithmetic/logic
operations.
Bit 7654321Bit 0
Read:
Write:
Reset:Unaffected by reset
Figure 6-2. Accumulator (A)
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorCentral Processor Unit (CPU)79
Central Processor Unit (CPU)
6.4.2 Index Register
The 16-bit index register allows indexed addressing of a 64K-byte
memory space. H is the upper byte of the index register, and X is the
lower byte. H:X is the concatenated 16-bit index register.
In the indexed addressing modes, the CPU uses the contents of the
index register to determine the conditional address of the operand.
The index register can serve also as a temporary data storage location.
6.4.3 Stack Pointer
Bit
1413121110987654321
15
Read:
Write:
Reset:00000000XXXXXXXX
X = Indeterminate
Bit
0
The stack pointer is a 16-bit register that contains the address of the next
location on the stack. During a reset, the stack pointer is preset to
$00FF. The reset stack pointer (RSP) instruction sets the least
significant byte to $FF and does not affect the most significant byte. The
stack pointer decrements as data is pushed onto the stack and
increments as data is pulled from the stack.
In the stack pointer 8-bit offset and 16-bit offset addressing modes, the
stack pointer can function as an index register to access data on the
stack. The CPU uses the contents of the stack pointer to determine the
conditional address of the operand.
Technical DataMC68HC908LJ12 — Rev. 2.1
80Central Processor Unit (CPU)Freescale Semiconductor
NOTE:The location of the stack is arbitrary and may be relocated anywhere in
6.4.4 Program Counter
Central Processor Unit (CPU)
RAM. Moving the SP out of page 0 ($0000 to $00FF) frees direct
address (page 0) space. For correct operation, the stack pointer must
point only to RAM locations.
The program counter is a 16-bit register that contains the address of the
next instruction or operand to be fetched.
Normally, the program counter automatically increments to the next
sequential memory location every time an instruction or operand is
fetched. Jump, branch, and interrupt operations load the program
counter with an address other than that of the next sequential location.
During reset, the program counter is loaded with the reset vector
address located at $FFFE and $FFFF. The vector address is the
address of the first instruction to be executed after exiting the reset state.
Bit
1413121110987654321
15
Read:
Write:
Reset:Loaded with Vector from $FFFE and $FFFF
Figure 6-5. Program Counter (PC)
Bit
0
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorCentral Processor Unit (CPU)81
Central Processor Unit (CPU)
6.4.5 Condition Code Register
The 8-bit condition code register contains the interrupt mask and five
flags that indicate the results of the instruction just executed. Bits 6 and
5 are set permanently to logic 1. The following paragraphs describe the
functions of the condition code register.
Bit 7654321Bit 0
Read:
Write:
Reset:
V11HI NZC
X1 1X1XXX
X = Indeterminate
Figure 6-6. Condition Code Register (CCR)
V — Overflow Flag
The CPU sets the overflow flag when a two's complement overflow
occurs. The signed branch instructions BGT, BGE, BLE, and BLT use
the overflow flag.
1 = Overflow
0 = No overflow
H — Half-Carry Flag
The CPU sets the half-carry flag when a carry occurs between
accumulator bits 3 and 4 during an add-without-carry (ADD) or addwith-carry (ADC) operation. The half-carry flag is required for binarycoded decimal (BCD) arithmetic operations. The DAA instruction
uses the states of the H and C flags to determine the appropriate
correction factor.
1 = Carry between bits 3 and 4
0 = No carry between bits 3 and 4
Technical DataMC68HC908LJ12 — Rev. 2.1
82Central Processor Unit (CPU)Freescale Semiconductor
Central Processor Unit (CPU)
I — Interrupt Mask
When the interrupt mask is set, all maskable CPU interrupts are
disabled. CPU interrupts are enabled when the interrupt mask is
cleared. When a CPU interrupt occurs, the interrupt mask is set
automatically after the CPU registers are saved on the stack, but
before the interrupt vector is fetched.
1 = Interrupts disabled
0 = Interrupts enabled
NOTE:To maintain M6805 Family compatibility, the upper byte of the index
register (H) is not stacked automatically. If the interrupt service routine
modifies H, then the user must stack and unstack H using the PSHH and
PULH instructions.
After the I bit is cleared, the highest-priority interrupt request is
serviced first.
A return-from-interrupt (RTI) instruction pulls the CPU registers from
the stack and restores the interrupt mask from the stack. After any
reset, the interrupt mask is set and can be cleared only by the clear
interrupt mask software instruction (CLI).
N — Negative Flag
The CPU sets the negative flag when an arithmetic operation, logic
operation, or data manipulation produces a negative result, setting
bit 7 of the result.
1 = Negative result
0 = Non-negative result
Z — Zero Flag
The CPU sets the zero flag when an arithmetic operation, logic
operation, or data manipulation produces a result of $00.
1 = Zero result
0 = Non-zero result
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorCentral Processor Unit (CPU)83
Central Processor Unit (CPU)
C — Carry/Borrow Flag
The CPU sets the carry/borrow flag when an addition operation
produces a carry out of bit 7 of the accumulator or when a subtraction
operation requires a borrow. Some instructions — such as bit test and
branch, shift, and rotate — also clear or set the carry/borrow flag.
1 = Carry out of bit 7
0 = No carry out of bit 7
6.5 Arithmetic/Logic Unit (ALU)
The ALU performs the arithmetic and logic operations defined by the
instruction set.
Refer to the CPU08 Reference Manual (Freescale document order
number CPU08RM/AD) for a description of the instructions and
addressing modes and more detail about the architecture of the CPU.
6.6 Low-Power Modes
6.6.1 Wait Mode
The WAIT and STOP ins tr uc ti on s put the MCU in l o w p o w e r- c o ns u m p ti o n
standby modes.
The WAIT instruction:
•Clears the interrupt mask (I bit) in the condition code register,
enabling interrupts. After exit from wait mode by interrupt, the I bit
remains clear. After exit by reset, the I bit is set.
•Disables the CPU clock.
Technical DataMC68HC908LJ12 — Rev. 2.1
84Central Processor Unit (CPU)Freescale Semiconductor
6.6.2 Stop Mode
The STOP instruction:
•Clears the interrupt mask (I bit) in the condition code register,
enabling external interrupts. After exit from stop mode by external
interrupt, the I bit remains clear. After exit by reset, the I bit is set.
•Disables the CPU clock.
After exiting stop mode, the CPU clock begins running after the oscillator
stabilization delay.
6.7 CPU During Break Interrupts
If the break module is enabled, a break interrupt causes the CPU to
execute the software interrupt instruction (SWI) at the completion of the
current CPU instruction. (See Section 22. Break Module (BRK).) The
program counter vectors to $FFFC–$FFFD ($FEFC–$FEFD in monitor
mode).
Central Processor Unit (CPU)
A return-from-interrupt instruction (RTI) in the break routine ends the
break interrupt and returns the MCU to normal operation if the break
interrupt has been deasserted.
6.8 Instruction Set Summary
Table 6-1 provides a summary of the M68HC08 instruction set.
6.9 Opcode Map
The opcode map is provided in Table 6-2.
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorCentral Processor Unit (CPU)85
92Central Processor Unit (CPU)Freescale Semiconductor
Central Processor Unit (CPU)
Table 6-1. Instruction Set Summary (Sheet 8 of 8)
Effect on
Source
Form
SWISoftware Interrupt
TAPTransfer A to CCRCCR ← (A)↕↕↕↕↕↕INH842
TAXTransfer A to XX ← (A)––––––INH971
TPATransfer CCR to AA ← (CCR)– – – – – – INH851
TST opr
TSTA
TSTX
TST opr,X
TST ,X
TST opr,SP
TSXTransfer SP to H:XH:X ← (SP) + 1––––––INH952
TXATransfer X to AA ← (X)––––––INH9F1
TXSTransfer H:X to SP(SP) ← (H:X) – 1––––––INH942
AAccumulatornAny bit
CCarry/borrow bitoprOperand (one or two bytes)
CCR Condition code registerPCProgram counter
ddDirect address of operandPCH Program counter high byte
dd rr Direct address of operand and relative offset of branch instructionPCL Program counter low byte
DDDirect to direct addressing modeREL Relative addressing mode
DIRDirect addressing moderelRelative program counter offset byte
DIX+ Direct to indexed with post increment addressing moderrRelative program counter offset byte
ee ff High and low bytes of offset in indexed, 16-bit offset addressingSP1 Stack pointer, 8-bit offset addressing mode
EXT Extended addressing modeSP2 Stack pointer 16-bit offset addressing mode
ffOffset byte in indexed, 8-bit offset addressingSPStack pointer
HHalf-carry bitUUndefined
HIndex register high byteVOverflow bit
hh llHigh and low bytes of operand address in extended addressingXIndex register low byte
IInterrupt maskZZero bit
iiImmediate operand byte&Logical AND
IMDImmediate source to direct destination addressing mode|Logical OR
IMM Immediate addressing mode
INHInherent addressing mode( )Contents of
IXIndexed, no offset addressing mode–( ) Negation (two’s complement)
IX+Indexed, no offset, post increment addressing mode#Immediate value
IX+D Indexed with post increment to direct addressing mode
IX1Indexed, 8-bit offset addressing mode←Loaded with
IX1+ Indexed, 8-bit offset, post increment addressing mode?If
IX2Indexed, 16-bit offset addressing mode:Concatenated with
MMemory location↕Set or cleared
NNegative bit—Not affected
Test for Negative or Zero(A) – $00 or (X) – $00 or (M) – $000 – – ↕↕–
The oscillator module provides the reference clock for the clock
generator module (CGM), the real time clock module (RTC), and other
MCU sub-systems.
The oscillator module consist of two types of oscillator circuits:
•Internal RC oscillator
•Crystal (x-tal) oscillator
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorOscillator (OSC)95
Oscillator (OSC)
From SIM
SIMOSCEN
CONFIG2
STOP_IRCDIS
The reference clock for the CGM, real time clock module (RTC), and
other MCU sub-systems is driven by the crystal oscillator. The COP
module is always driven by internal RC oscillator.
The RC internal oscillator runs continuously after a POR or reset and is
always available in run and wait modes. In stop mode, it can be disabled
by setting the STOP_IRCDIS bit in CONFIG2 register.
Figure 7-1. shows the block diagram of the oscillator module.
EN
INTERNAL RC
OSCILLATOR
ICLK
To SIM, COP
INTERNAL RC OSCILLATOR
CONFIG2
STOP_XCLKEN
MCU
*RS can be zero (shorted) when used with higher-frequency crystals.
Refer to manufacturer’s data.
See Section 23. for component value requirements.
CRYSTAL OSCILLATOR
CGMRCLK
CGMXCLK
OSC2OSC1
R
B
RS*
X
1
C
1
C
2
To CGM PLL
To RTC, ADC, LCD,
CGM Clock Selection MUX
Figure 7-1. Oscillator Module Block Diagram
Technical DataMC68HC908LJ12 — Rev. 2.1
96Oscillator (OSC)Freescale Semiconductor
7.3 Internal Oscillator
The internal RC oscillator clock (ICLK) is a free running 64kHz clock (at
VDD = 5V) that requires no external components. It is the reference clock
input to the computer operating properly (COP) module.
The ICLK can be turned off in stop mode by setting the STOP_IRCDIS
bit in CONFIG2. After reset, the bit is clear by default and ICLK is
enabled during stop mode.
7.4 Crystal (X-tal) Oscillator
The crystal (x-tal) oscillator circuit is designed for use with an external
crystal or ceramic resonator to provide an accurate clock source.
In its typical configuration, the X-tal oscillator is connected in a Pierce
oscillator configuration, as shown in Figure 7-1. This figure shows only
the logical representation of the internal components and may not
represent actual circuitry. The oscillator configuration uses five
components:
Oscillator (OSC)
7.5 I/O Signals
•Crystal, X
•Fixed capacitor, C
1
1
•Tuning capacitor, C2 (can also be a fixed capacitor)
•Feedback resistor, R
B
•Series resistor, RS (optional)
The series resistor (RS) is included in the diagram to follow strict Pierce
oscillator guidelines and may not be required for all ranges of operation,
especially with high frequency crystals. Refer to the crystal
manufacturer’s data for more information.
The following paragraphs describe the oscillator I/O signals.
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorOscillator (OSC)97
Oscillator (OSC)
7.5.1 Crystal Amplifier Input Pin (OSC1)
OSC1 pin is an input to the crystal oscillator amplifier. Schmitt trigger and
glitch filter are implemented on this pin to improve EMC performance.
See Section 23. Electrical Specifications for detail specification of the
glitch filter.
7.5.2 Crystal Amplifier Output Pin (OSC2)
OSC2 pin is the output of the crystal oscillator inverting amplifier.
7.5.3 Oscillator Enable Signal (SIMOSCEN)
The SIMOSCEN signal from the system integration module (SIM)
enables/disables the internal RC and x-tal oscillator circuits.
7.5.4 Internal RC Clock (ICLK)
The ICLK clock is the output from the internal RC oscillator. This clock
drives the SIM and COP modules.
7.5.5 CGM Oscillator Clock (CGMXCLK)
The CGMXCLK clock is the output from the x-tal oscillator. This clock
drives to CGM, real time clock module, analog-to-digital converter, liquid
crystal display driver module, and other MCU sub-systems.
7.5.6 CGM Reference Clock (CGMRCLK)
This is buffered signal of CGMXCLK, it is used by the CGM as the
phase-locked-loop (PLL) reference clock.
7.6 Low Power Modes
The WAIT and STOP instructions put the MCU in low-power
consumption standby modes.
Technical DataMC68HC908LJ12 — Rev. 2.1
98Oscillator (OSC)Freescale Semiconductor
7.6.1 Wait Mode
7.6.2 Stop Mode
Oscillator (OSC)
The WAIT instruction has no effect on the oscillator module. CGMXCLK,
CGMRCLK, and ICLK continues to drive the MCU modules.
The STOP instruction clears the SIMOSCEN signal, and hence the
CGMXCLK (and CGMRCLK) clock stops running. For continuous
CGMXCLK operation in stop mode, set the STOP_XCLKEN to logic 1
before entering stop mode. Continuous CGMXCLK operation in stop
mode allows the RTC module to generate interrupts to wake up the CPU.
By default, the internal RC oscillator clock, ICLK, continues to run in stop
mode. To disable the ICLK in stop mode, set the STOP_IRCDIS bit to
logic 1 before entering stop mode.
7.7 Oscillator During Break Mode
The oscillator circuits continue to drive CGMXCLK, CGMRCLK, and
ICLK when the device enters the break state.
MC68HC908LJ12 — Rev. 2.1Technical Data
Freescale SemiconductorOscillator (OSC)99
Oscillator (OSC)
Technical DataMC68HC908LJ12 — Rev. 2.1
100Oscillator (OSC)Freescale Semiconductor
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.