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.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
20Freescale Semiconductor
Chapter 1
General Description
1.1 Introduction
The MC68HC908AS60A and MC68HC908AZ60A are members of the low-cost, high-performance
M68HC08 Family of 8-bit microcontroller units (MCUs). 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.
These parts are designed to emulate the MC68HC08ASxx and MC68HC08AZxx automotive families and
may offer extra features which are not available on those devices. It is the user’s responsibility to ensure
compatibility between the features used on the MC68HC908AS60A and MC68HC908AZ60A and those
which are available on the device which will ultimately be used in the application.
1.2 Features
Features of the MC68HC908AS60A and MC68HC908AZ60A include:
•High-Performance M68HC08 Architecture
•Fully Upward-Compatible Object Code with M6805, M146805, and M68HC05 Families
•8.4 MHz Internal Bus Frequency
•60 Kbytes of FLASH Electrically Erasable Read-Only Memory (FLASH)
•FLASH Data Security
•1 Kbyte of On-Chip Electrically Erasable Programmable Read-Only Memory with Security Option
(EEPROM)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor27
General Description
NOTE
The following pin descriptions are just a quick reference. For a more
detailed representation, see Chapter 22 Input/Output Ports.
1.4.1 Power Supply Pins (VDD and VSS)
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 shown in
Figure 1-6. 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.
is also the ground for the port output buffers and the ground return for the serial clock in the Serial
V
SS
Peripheral Interface module (SPI). See Chapter 19 Serial Peripheral Interface (SPI).
NOTE
V
must be grounded for proper MCU operation.
SS
1.4.2 Oscillator Pins (OSC1 and OSC2)
The OSC1 and OSC2 pins are the connections for the on-chip oscillator circuit. See Chapter 10 Clock
Generator Module (CGM).
1.4.3 External Reset Pin (RST)
A 0 on the RST pin forces the MCU to a known startup state. RST is bidirectional, allowing a reset of the
entire system. It is driven low when any internal reset source is asserted. See Chapter 9 System
Integration Module (SIM) for more information.
1.4.4 External Interrupt Pin (IRQ)
IRQ is an asynchronous external interrupt pin. See Chapter 17 External Interrupt Module (IRQ).
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
28Freescale Semiconductor
Pin Assignments
1.4.5 Analog Power Supply Pin (V
V
is the power supply pin for the analog portion of the Clock Generator Module (CGM). See
DDA
DDA
)
Chapter 10 Clock Generator Module (CGM).
1.4.6 Analog Ground Pin (V
V
is the ground connection for the analog portion of the Clock Generator Module (CGM). See
SSA
SSA
)
Chapter 10 Clock Generator Module (CGM).
1.4.7 External Filter Capacitor Pin (CGMXFC)
CGMXFC is an external filter capacitor connection for the Clock Generator Module (CGM). See
Chapter 10 Clock Generator Module (CGM).
1.4.8 ADC Analog Power Supply Pin (V
V
DDAREF
is the power supply pin for the analog portion of the Analog-to-Digital Converter (ADC). See
DDAREF
Chapter 26 Analog-to-Digital Converter (ADC).
1.4.9 ADC Analog Ground Pin (AVSS/V
The AVSS/V
pin provides both the analog ground connection and the reference low voltage for the
REFL
REFL
Analog-to-Digital Converter (ADC). See Chapter 26 Analog-to-Digital Converter (ADC).
)
)
1.4.10 ADC Reference High Voltage Pin (V
V
provides the reference high voltage for the Analog-to-Digital Converter (ADC). See Chapter 26
REFH
REFH
)
Analog-to-Digital Converter (ADC).
1.4.11 Port A Input/Output (I/O) Pins (PTA7–PTA0)
PTA7–PTA0 are general-purpose bidirectional I/O port pins. See Chapter 22 Input/Output Ports.
1.4.12 Port B I/O Pins (PTB7/ATD7–PTB0/ATD0)
Port B is an 8-bit special function port that shares all eight pins with the Analog-to-Digital Converter (ADC).
See Chapter 26 Analog-to-Digital Converter (ADC) and Chapter 22 Input/Output Ports.
1.4.13 Port C I/O Pins (PTC5–PTC0)
PTC5–PTC3 and PTC1–PTC0 are general-purpose bidirectional I/O port pins. PTC2/MCLK is a special
function port that shares its pin with the system clock which has a frequency equivalent to the system
clock. See Chapter 22 Input/Output Ports.
1.4.14 Port D I/O Pins (PTD7–PTD0/ATD8)
Port D is an 8-bit special-function port that shares seven of its pins with the Analog-to-Digital Converter
module (ADC-15), one of its pins with the Timer Interface Module A (TIMA), and one more of its pins with
the Timer Interface Module B (TIMB). See Chapter 25 Timer Interface Module A (TIMA), Chapter 20 Timer
Interface Module B (TIMB), Chapter 26 Analog-to-Digital Converter (ADC) and Chapter 22 Input/Output
Ports.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor29
General Description
1.4.15 Port E I/O Pins (PTE7/SPSCK–PTE0/TxD)
Port E is an 8-bit special function port that shares two of its pins with the Timer Interface Module A (TIMA),
four of its pins with the Serial Peripheral Interface module (SPI), and two of its pins with the Serial
Communication Interface module (SCI). See Chapter 18 Serial Communications Interface (SCI), Chapter
19 Serial Peripheral Interface (SPI), Chapter 25 Timer Interface Module A (TIMA), and Chapter 22
Input/Output Ports.
1.4.16 Port F I/O Pins (PTF6–PTF0/TACH2)
Port F is a 7-bit special function port that shares its pins with the Timer Interface Module B (TIMB). Six of
its pins are shared with the Timer Interface Module A (TIMA-6). See Chapter 25 Timer Interface Module
A (TIMA), Chapter 20 Timer Interface Module B (TIMB), and Chapter 22 Input/Output Ports.
1.4.17 Port G I/O Pins (PTG2/KBD2–PTG0/KBD0)
Port G is a 3-bit special function port that shares all of its pins with the Keyboard Module (KBD). See
Chapter 24 Keyboard Module (KBI) and Chapter 22 Input/Output Ports.
1.4.18 Port H I/O Pins (PTH1/KBD4–PTH0/KBD3)
Port H is a 2-bit special-function port that shares all of its pins with the Keyboard Module (KBD). See
Chapter 24 Keyboard Module (KBI) and Chapter 22 Input/Output Ports.
1.4.19 CAN Transmit Pin (CANTx)
This pin is the digital output from the CAN module (CANTx). See Chapter 23 MSCAN Controller
(MSCAN08).
1.4.20 CAN Receive Pin (CANRx)
This pin is the digital input to the CAN module (CANRx). See Chapter 23 MSCAN Controller (MSCAN08).
1.4.21 BDLC Transmit Pin (BDTxD)
This pin is the digital output from the BDLC module (BDTxD). See Chapter 27 Byte Data Link Controller
(BDLC).
1.4.22 BDLC Receive Pin (BDRxD)
This pin is the digital input to the CAN module (BDRxD). See Chapter 27 Byte Data Link Controller
(BDLC).
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor31
General Description
Table 1-1. External Pins Summary (Continued)
Pin NameFunctionDriver Type
PTF0/TACH2
PTG2/KBD2–PTG0/KBD0
PTH1/KBD4 –PTH0/KBD3
V
DD
V
SS
V
DDA
V
SSA
V
DDAREF
A
VSS/VREFL
V
REFH
Hysteresis
General-Purpose I/O
Timer A Channel 2
General-Purpose I/O/
Keyboard Wakeup Pin
General-Purpose I/O/
Keyboard Wakeup Pin
Dual StateYesInput Hi-Z
Dual StateYesInput Hi-Z
Dual StateYesInput Hi-Z
Chip Power SupplyN/AN/AN/A
Chip GroundN/AN/AN/A
CGM Analog Power Supply
CGM Analog Ground
ADC Power SupplyN/AN/AN/A
ADC Ground/
ADC Reference Low Voltage
N/AN/AN/A
A/D Reference High VoltageN/AN/AN/A
(1)
Reset State
OSC1External Clock InN/ANoInput Hi-Z
OSC2External Clock OutN/AN/AOutput
CGMXFCPLL Loop Filter CapN/AN/AN/A
IRQ
RST
External Interrupt RequestN/AN/AInput Hi-Z
ResetN/AN/AOutput Low
CANRxCAN Serial InputN/AYesInput Hi-Z
CANTxCAN Serial OutputOutputNoOutput
BDRxDBDLC Serial InputN/AYesInput Hi-Z
BDTxDBDLC Serial OutputOutputNoOutput
1. Hysteresis is not 100% tested but is typically a minimum of 300 mV.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
32Freescale Semiconductor
Table 1-2. Clock Signal Naming Conventions
Clock Signal NameDescription
Pin Assignments
CGMXCLK
CGMOUT
Bus ClockCGMOUT divided by two
SPSCKSPI serial clock
TACLKExternal clock input for TIMA
TBCLKExternal clock input for TIMB
Buffered version of OSC1 from
Clock Generation Module (CGM)
PLL-based or OSC1-based clock output from
Clock Generator Module (CGM)
Table 1-3. Clock Source Summary
ModuleClock Source
ADCCGMXCLK or Bus Clock
CANCGMXCLK or CGMOUT
COPCGMXCLK
CPUBus Clock
FLASHBus Clock
EEPROMCGMXCLK or Bus Clock
RAMBus Clock
SPIBus Clock/SPSCK
SCICGMXCLK
TIMABus Clock or PTD6/ATD14/TACLK
TIMBBus Clock or PTD4/TBCLK
PITBus Clock
SIMCGMOUT and CGMXCLK
IRQBus Clock
BRKBus Clock
LVIBus Clock and CGMXCLK
CGMOSC1 and OSC2
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor33
General Description
1.5 Ordering Information
This subsection contains instructions for ordering the MC68HC908AZ60A / MC68HC908AS60A.
Table 1-4. MC Order Numbers
MC Order Number
MC68HC908AS60ACFU (64-Pin QFP)–40°C to + 85°C
MC68HC908AS60AVFU (64-Pin QFP)–40°C to + 105°C
MC68HC908AS60AMFU (64-Pin QFP)–40°C to + 125°C
MC68HC908AS60ACFN (52-Pin PLCC)–40°C to + 85°C
MC68HC908AS60AVFN (52-Pin PLCC)–40°C to + 105°C
MC68HC908AS60AMFN (52-Pin PLCC)–40°C to + 125°C
MC68HC908AZ60ACFU (64-Pin QFP)–40°C to + 85°C
MC68HC908AZ60AVFU (64-Pin QFP)–40°C to + 105°C
MC68HC908AZ60AMFU (64-Pin QFP)–40°C to + 125°C
Operating
Temperature Range
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
34Freescale Semiconductor
Chapter 2
Memory Map
2.1 Introduction
The CPU08 can address 64K bytes of memory space. The memory map, shown in Figure 2-1, includes:
•60K Bytes of FLASH EEPROM
•2048 Bytes of RAM
•1024 Bytes of EEPROM with Protect Option
•52 Bytes of User-Defined Vectors
•256 Bytes of Monitor ROM
The following definitions apply to the memory map representation of reserved and unimplemented
locations.
•Reserved — Accessing a reserved location can have unpredictable effects on MCU operation.
•Unused — These locations are reserved in the memory map for future use, accessing an unused
location can have unpredictable effects on MCU operation.
•Unimplemented — Accessing an unimplemented location can cause an illegal address reset
(within the constraints as outlined in the Chapter 9 System Integration Module (SIM)).
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor35
Memory Map
MC68HC908AZ60AMC68HC908AS60A
$0000
↓↓
$003F$003F
$0040
↓
$004F$004F
$0050
↓↓
$044F$044F
$0450
↓
$04FF
$0500
↓
$057F
$0580
↓
$05FF$05FF
$0600
↓↓
$07FF$07FF
$0800
↓↓
$09FF$09FF
$0A00
↓↓
$0DFF$0DFF
$0E00
↓↓
$7FFF$7FFF
$8000
↓↓
$FDFF$FDFF
$FE00SIM BREAK STATUS REGISTER (SBSR) $FE00
$FE01SIM RESET STATUS REGISTER (SRSR)$FE01
$FE02
CAN CONTROL AND MESSAGE BUFFERS
I/O REGISTERS
16 BYTES
FLASH-2
176 BYTES
128 BYTES
FLASH-2
128 BYTES
I/O REGISTERS
64 BYTES
UNIMPLEMENTED
11 BYTES
I/O REGISTERS
5 BYTES
RAM-1
1024 BYTES
FLASH-2
432 BYTES
EEPROM-2
512 BYTES
EEPROM-1
512 BYTES
RAM-2
1024 BYTES
FLASH-2
29,184 BYTES
FLASH-1
32,256BYTES
RESERVED $FE02
$0000
$0040
↓
$004A
$004B
$0050
$0450
↓
$0600
$0800
$0A00
$0E00
$8000
Figure 2-1. Memory Map (Sheet 1 of 3)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
36Freescale Semiconductor
Introduction
MC68HC908AZ60AMC68HC908AS60A
$FE03SIM BREAK FLAG CONTROL REGISTER (SBFCR) $FE03
1. Registers appearing in italics are for Freescale test purpose only and only appear in the Memory Map for reference.
2. While some differences between MC68HC908AS60A and MC68HC908AZ60A are highlighted, some registers remain available on both parts. Refer to individual modules for details whether these registers are active or inactive.
RESERVED$FF75
RESERVED$FF76
RESERVED$FF77
RESERVED$FF78
RESERVED$FF79
RESERVED$FF7E
RESERVED
6 BYTES
RESERVED$FF89
RESERVED$FF8A
RESERVED
65 BYTES
VECTORS
52 BYTES
See Table 2-1
$FF82
$FF8B
↓
Figure 2-1. Memory Map (Sheet 3 of 3)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
38Freescale Semiconductor
I/O Section
2.2 I/O Section
Addresses $0000–$004F, shown in Figure 2-2, contain the I/O Data, Status, and Control Registers.
Addr.Register NameBit 7654321Bit 0
$0000
$0001
$0002
$0003
$0004
$0005
$0006
$0007
$0008
$0009
$000A
$000B
$000C
$000D
$000E
$000F
Port A Data Register
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)
Data Direction Register C
(DDRC)
Data Direction Register D
(DDRD)
Port E Data Register
(PTE)
Port F Data Register
(PTF)
Port G Data Register
(PTG)
Port H Data Register
(PTH)
Data Direction Register E
(DDRE)
Data Direction Register F
(DDRF)
Data Direction Register G
(DDRG)
Data Direction Register H
(DDRH)
Read:
(PTA)
Write:
Read:
Write:
Read:00
Write:RR
Read:
Write:
Read:
Write:
Read:
Write:
Read:
Write:R
Read:
Write:
Read:
Write:
Read:0
Write:R
Read:00000
Write:RRRRR
Read:000000
Write:RRRRRR
Read:
Write:
Read:0
Write:R
Read:00000
Write:RRRRR
Read:000000
Write:RRRRRR
PTA7PTA6PTA5PTA4PTA3PTA2PTA1PTA0
PTB7PTB6PTB5PTB4PTB3PTB2PTB1PTB0
PTC5PTC4PTC3PTC2PTC1PTC0
PTD7PTD6PTD5PTD4PTD3PTD2PTD1PTD0
DDRA7DDRA6DDRA5DDRA4DDRA3DDRA2DDRA1DDRA0
DDRB7DDRB6DDRB5DDRB4DDRB3DDRB2DDRB1DDRB0
MCLKEN
DDRD7DDRD6DDRD5DDRD4DDRD3DDR2DDRD1DDRD0
PTE7PTE6PTE5PTE4PTE3PTE2PTE1PTE0
DDRE7DDRE6DDRE5DDRE4DDRE3DDRE2DDRE1DDRE0
0
DDRC5DDRC4DDRC3DDRC2DDRC1DDRC0
PTF6PTF5PTF4PTF3PTF2PTF1PTF0
DDRF6DDRF5DDRF4DDRF3DDRF2DDRF1DDRF0
PTG2PTG1PTG0
PTH1PTH0
DDRG2DDRG1DDRG0
DDRH1DDRH0
= UnimplementedR= Reserved
Figure 2-2. I/O Data, Status and Control Registers (Sheet 1 of 5)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor39
Memory Map
Addr.Register NameBit 7654321Bit 0
$0010
$0011
$0012
$0013
$0014
$0015
$0016
$0017
$0018
$0019
$001A
$001B
$001C
$001D
$001E
$001F
$0020
SPI Control Register
(SPCR)
SPI Status and Control
Register (SPSCR)
SPI Data Register
(SPDR)
SCI Control Register 1
(SCC1)
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)
IRQ Status and Control
Register (ISCR)
Keyboard Status and Control
Register (KBSCR)
PLL Control Register
(PCTL)
PLL Bandwidth Control
Register (PBWC)
PLL Programming Register
(PPG)
Configuration Write-Once
Register (CONFIG-1)
Timer A Status and Control
Register (TASC)
Read:
Write:
Read:SPRF
Write:
Read:R7R6R5R4R3R2R1R0
Write:T7T6T5T4T3T2T1T0
Read:
Write:
Read:
Write:
Read:R8
Write:
Read:SCTETCSCRFIDLEORNFFEPE
Write:
Read:000000BKFRPF
Write:
Read:R7R6R5R4R3R2R1R0
Write:T7T6T5T4T3T2T1T0
Read:00
Write:
Read:0000IRQF0
Write:RRRRRACK
Read:0000KEYF0
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read:TOF
Write:0TRSTR
SPRIERSPMSTRCPOLCPHASPWOMSPESPTIE
ERRIE
LOOPSENSCITXINVMWAKEILTYPENPTY
SCTIETCIESCRIEILIETERERWUSBK
T8RRORIENEIEFEIEPEIE
PLLIE
AUTO
MUL7MUL6MUL5MUL4VRS7VRS6VRS5VRS4
LVISTOPRLVIRSTLVIPWRSSRECCOPLSTOPCOPD
PLLF
LOCK
TOIETSTOP
OVRFMODFSPTE
SCP1SCP0RSCR2SCR1SCR0
PLLONBCS
ACQXLD
00
MODFENSPR1SPR0
IMASKMODE
ACKK
1111
0000
PS2PS1PS0
IMASKKMODEK
= UnimplementedR= Reserved
Figure 2-2. I/O Data, Status and Control Registers (Sheet 2 of 5)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
40Freescale Semiconductor
I/O Section
Addr.Register NameBit 7654321Bit 0
$0021
$0022
$0023
$0024
$0025
$0026
$0027
$0028
$0029
$002A
$002B
$002C
$002D
$002E
$002F
$0030
$0031
Keyboard Interrupt Enable
Register (KBIER)
Timer A Counter Register
High (TACNTH)
Timer A Counter Register
Low (TACNTL)
Timer A Modulo Register
High (TAMODH)
Timer A Modulo Register
Low (TAMODL)
Timer A Channel 0 Status
and Control Register (TASC0)
Timer A Channel 0 Register
High (TACH0H)
Timer A Channel 0 Register
Low (TACH0L)
Timer A Channel 1 Status
and Control Register (TASC1)
Timer A Channel 1 Register
High (TACH1H)
Timer A Channel 1 Register
Low (TACH1L)
Timer A Channel 2 Status
and Control Register (TASC2)
Timer A Channel 2 Register
High (TACH2H)
Timer A Channel 2 Register
Low (TACH2L)
Timer A Channel 3 Status
and Control Register (TASC3)
Timer A Channel 3 Register
High (TACH3H)
Timer A Channel 3 Register
Low (TACH3L)
Read:000
Write:
Read:Bit 1514131211109Bit 8
Write:
Read:Bit 7654321Bit 0
Write:
Read:
Write:
Read:
Write:
Read:CH0F
Write:0
Read:
Write:
Read:
Write:
Read:CH1F
Write:0R
Read:
Write:
Read:
Write:
Read:CH2F
Write:0
Read:
Write:
Read:
Write:
Read:CH3F
Write:0R
Read:
Write:
Read:
Write:
Bit 1514131211109Bit 8
Bit 7654321Bit 0
CH0IEMS0BMS0AELS0BELS0ATOV0CH0MAX
Bit 1514131211109Bit 8
Bit 7654321Bit 0
0
CH1IE
Bit 1514131211109Bit 8
Bit 7654321Bit 0
CH2IEMS2BMS2AELS2BELS2ATOV2CH2MAX
Bit 1514131211109Bit 8
Bit 7654321Bit 0
0
CH3IE
Bit 1514131211109Bit 8
Bit 7654321Bit 0
KBIE4KBIE3KBIE2KBIE1KBIE0
MS1AELS1BELS1ATOV1CH1MAX
MS3AELS3BELS3ATOV3CH3MAX
= UnimplementedR= Reserved
Figure 2-2. I/O Data, Status and Control Registers (Sheet 3 of 5)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor41
Memory Map
Addr.Register NameBit 7654321Bit 0
$0032
$0033
$0034
$0035
$0036
$0037
$0038
$0039
$003A
$003B
$003C
$003D
$003E
$003F
$0040
$0041
$0042
Timer A Channel 4 Status
and Control Register (TASC4)
Timer A Channel 4 Register
High (TACH4H)
Timer A Channel 4 Register
Low (TACH4L)
Timer A Channel 5 Status
and Control Register (TASC5)
Timer A Channel 5 Register
High (TACH5H)
Timer A Channel 5 Register
Low (TACH5L)
Analog-to-Digital Status and
Control Register (ADSCR)
Analog-to-Digital Data
Register (ADR)
Analog-to-Digital Input Clock
Register (ADICLK)
BDLC Analog and Roundtrip
Delay Register (BARD)
BDLC Control Register 1
(BCR1)
BDLC Control Register 2
(BCR2)
BDLC State Vector Register
(BSVR)
BDLC Data Register
(BDR)
Timer B Status and Control
Register (TBSCR)
Timer B Counter Register
High (TBCNTH)
Timer B Counter Register
Low (TBCNTL)
Read:CH4F
Write:0
Read:
Write:
Read:
Write:
Read:CH5F
Write:0R
Read:
Write:
Read:
Write:
Read:COCO
Write:R
Read:AD7AD6AD5AD4AD3AD2AD1AD0
Write:
Read:
Write:
Read:
Write:RR
Read:
Write:RR
Read:
Write:
Read:0 0 I3I2I1I0 0 0
Write:RRRRRRRR
Read:
Write:
Read:TOF
Write:0TRSTR
Read:Bit 1514131211109Bit 8
Write:
Read:Bit 7654321Bit 0
Write:
Bit 1514131211109Bit 8
Bit 7654321Bit 0
Bit 1514131211109Bit 8
Bit 7654321Bit 0
ADIV2ADIV1ADIV0ADICLK
ATERXPOL
IMSGCLKSR1R0
ALOOPDLOOPRX4XENBFSTEODTSIFRTMIFR1TMIFR0
BD7BD6BD5BD4BD3BD2BD1BD0
CH4IEMS4BMS4AELS4BELS4ATOV4CH4MAX
CH5IE
AIENADCOADCH4ADCH3ADCH2ADCH1ADCH0
TOIETSTOP
0
00
MS5AELS5BELS5ATOV5CH5MAX
00
0000
BO3BO2BO1BO0
00
PS2PS1PS0
IEWCM
= UnimplementedR= Reserved
Figure 2-2. I/O Data, Status and Control Registers (Sheet 4 of 5)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
42Freescale Semiconductor
I/O Section
Addr.Register NameBit 7654321Bit 0
$0043
$0044
$0045
$0046
$0047
$0048
$0049
$004A
$004B
$004C
$004D
$004E
$004F
Timer B Modulo Register
High (TBMODH)
Timer B Modulo Register
Low (TBMODL)
Timer B CH0 Status and
Control Register (TBSC0)
Timer B CH0 Register
High (TBCH0H)
Timer B CH0 Register
Low (TBCH0L)
Timer B CH1 Status and
Control Register (TBSC1)
Timer B CH1 Register High
(TBCH1H)
Timer B CH1 Register Low
(TBCH1L)
PIT Status and Control
Register (PSC)
PIT Counter Register High
(PCNTH)
PIT Counter Register Low
(PCNTL)
PIT Modulo Register High
(PMODH)
PIT Modulo Register Low
(PMODL)
Read:
Write:
Read:
Write:
Read:CH0F
Write:0
Read:
Write:
Read:
Write:
Read:CH1F
Write:0R
Read:
Write:
Read:
Write:
Read:POF
Write:0PRST
Read:Bit 1514131211109Bit 8
Write:
Read:Bit 7654321Bit 0
Write:
Read:
Write:
Read:
Write:
Bit 1514131211109Bit 8
Bit 7654321Bit 0
CH0IEMS0BMS0AELS0BELS0ATOV0CH0MAX
Bit 1514131211109Bit 8
Bit 7654321Bit 0
CH1IE
Bit 1514131211109Bit 8
Bit 7654321Bit 0
POIEPSTOP
Bit 1514131211109Bit 8
Bit 7654321Bit 0
0
MS1AELS1BELS1ATOV1CH1MAX
00
PPS2PPS1PPS0
= UnimplementedR= Reserved
Figure 2-2. I/O Data, Status and Control Registers (Sheet 5 of 5)
All registers are shown for both MC68HC908AS60A and MC68HC908AZ60A. Refer to individual module
chapters to determine if the module is available and the register active or not.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor43
Memory Map
2.3 Additional Status and Control Registers
Selected addresses in the range $FE00 to $FFCB contain additional Status and Control registers as
shown in Figure 2-3. A noted exception is the COP Control Register (COPCTL) at address $FFFF.
Addr.Register NameBit 7654321Bit 0
$FE00
$FE01
$FE03
$FE08
$FE09
$FE0C
$FE0D
$FE0E
$FE0F
$FE10
SIM Break Status Register
(SBSR)
SIM Reset Status Register
(SRSR)
SIM Break Flag Control
Register (SBFCR)
FLASH-2 Control Register
(FL2CR)
Configuration Write-Once
Register (CONFIG-2)
Break Address Register High
(BRKH)
Break Address Register Low
(BRKL)
Break Status and Control
Register (BRKSCR)
LVI Status Register
(LVISR)
EE1DIV Hi Nonvolatile
Register (EE1DIVHNVR)
Read:
Write:0
Read:PORPINCOPILOPILAD0LVI0
Write:
Read:
Write:
Read:0000
Write:
Read:
Write:R
Read:
Write:
Read:
Write:
Read:
Write:
Read:LVIOUT0000000
Write:
Read:
Write:
RRRRRR
BCFERRRRRRR
HVENVERFERASEPGM
EEDIVCLKRRMSCAND
Bit 1514131211109Bit 8
Bit 7654321Bit 0
BRKEBRKA
EEDIVS-
ECD
RRRREEDIV10EEDIV9EEDIV8
000000
AT 6 0A
RRAZxx
BW
R
$FE11
$FE1A
$FE1B
$FE1C
$FE1D
EE1DIV Lo Nonvolatile
Register (EE1DIVLNVR)
EE1DIV Divider High Register
(EE1DIVH)
EE1DIV Divider Low Register
(EE1DIVL)
EEPROM-1 Nonvolatile
Register (EE1NVR)
EEPROM-1 Control Register
(EE1CR)
Read:
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
Write:
Read:
EEDIVS-
Write:
Read:
Write:
Read:
Write:
Read:
Write:
ECD
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
UNUSEDUNUSEDUNUSED EEPRTCTEEBP3EEBP2EEBP1EEBP0
UNUSED
0000
EEDIV10EEDIV9EEDIV8
0
EEOFFEERAS1EERAS0EELATAUTOEEPGM
= UnimplementedR= Reserved
Figure 2-3. Additional Status and Control Registers (Sheet 1 of 2)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Figure 2-3. Additional Status and Control Registers (Sheet 2 of 2)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor45
Memory Map
2.4 Vector Addresses and Priority
Addresses in the range $FFCC to $FFFF contain the user-specified vector locations. The vector
addresses are shown in Table 2-1. Please note that certain vector addresses differ between the
MC68HC908AS60A and the MC68HC908AZ60A as shown in the table. It is recommended that all vector
addresses are defined.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor47
Memory Map
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
48Freescale Semiconductor
Chapter 3
Random-Access Memory (RAM)
3.1 Introduction
This chapter describes the 2048 bytes of random-access memory (RAM).
3.2 Functional Description
Addresses $0050 through $044F and $0A00 through $0DFF are RAM locations. The location of the stack
RAM is programmable with the reset stack pointer instruction (RSP). The 16-bit stack pointer allows the
stack RAM 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 176 bytes of RAM. Because the location of the stack RAM is programmable, all page
zero RAM locations can be used for input/output (I/O) control and user data or code. When the stack
pointer is moved from its reset location at $00FF, direct addressing mode instructions can access all page
zero RAM locations efficiently. 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 M68HC05, M6805, and M146805 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 could overwrite data
in the RAM during a subroutine or during the interrupt stacking operation.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor49
Random-Access Memory (RAM)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
50Freescale Semiconductor
Chapter 4
FLASH-1 Memory
4.1 Introduction
This chapter describes the operation of the embedded FLASH-1 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.
4.2 Functional Description
The FLASH-1 memory is an array of 32,256 bytes with two bytes of block protection (one byte for
protecting areas within FLASH-1 array and one byte for protecting areas within FLASH-2 array) and an
additional 40 bytes of user vectors on the MC68HC908AS60A and 52 bytes of user vectors on the
MC68HC908AZ60A. An erased bit reads as a logic 1 and a programmed bit reads as a logic 0.
Memory in the FLASH-1 array is organized into rows within pages. There are two rows of memory per
page with 64 bytes per row. The minimum erase block size is a single page,128 bytes. Programming is
performed on a per-row basis, 64 bytes at a time. Program and erase operations are facilitated through
control bits in the FLASH-1 Control Register (FL1CR). Details for these operations appear later in this
chapter.
The FLASH-1 memory map consists of:
•$8000–$FDFF: User Memory (32,256 bytes)
•$FF80: FLASH-1 Block Protect Register (FL1BPR)
•$FF81: FLASH-2 Block Protect Register (FL2BPR)
•$FF88: FLASH-1 Control Register (FL1CR)
•$FFCC–$FFFF: these locations are reserved for user-defined interrupt and reset vectors. (Please
see 2.4 Vector Addresses and Priority for details)
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 is to make reading or copying the FLASH difficult for
unauthorized users.
(1)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor51
FLASH-1 Memory
4.3 FLASH-1 Control and Block Protect Registers
The FLASH-1 array has two registers that control its operation, the FLASH-1 Control Register (FL1CR)
and the FLASH-1 Block Protect Register (FL1BPR).
4.3.1 FLASH-1 Control Register
The FLASH-1 Control Register (FL1CR) controls FLASH-1 program and erase operations.
Address:$FF88
Bit 7654321Bit 0
Read:0000
Write:
Reset:00000000
= Unimplemented
HVENMASSERASEPGM
Figure 4-1. FLASH-1 Control Register (FL1CR)
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
Setting this read/write bit configures the FLASH-1 array for mass or page erase operation.
This read/write bit configures the memory for erase operation. ERASE is interlocked with the PGM bit
such that both bits cannot be set 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 unselected
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
52Freescale Semiconductor
FLASH-1 Control and Block Protect Registers
4.3.2 FLASH-1 Block Protect Register
The FLASH-1 Block Protect Register (FL1BPR) is implemented as a byte within the FLASH-1 memory
and therefore can only be written during a FLASH programming sequence. The value in this register
determines the starting location of the protected range within the FLASH-1 memory.
Address:$FF80
Bit 7654321Bit 0
Read:
Write:
FL1BPR[7:0] — Block Protect Register Bit 7 to Bit 0
These eight bits represent bits [14:7] of a 16-bit memory address. Bit 15 is logic 1 and bits [6:0] are
logic 0s.
The resultant 16-bit address is used for specifying the start address of the FLASH-1 memory for block
protection. FLASH-1 is protected from this start address to the end of FLASH-1 memory at $FFFF.
With this mechanism, the protect start address can be $XX00 and $XX80 (128 byte page boundaries)
within the FLASH-1 array.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor53
FLASH-1 Memory
Decreasing the value in FL1BPR by one increases the protected range by one page (128 bytes).
However, programming the block protect register with $FE protects a range twice that size, 256 bytes, in
the corresponding array. $FE means that locations $FF00–$FFFF are protected in FLASH-1.
The FLASH memory does not exist at some locations. The block protection range configuration is
unaffected if FLASH memory does not exist in that range. Refer to the memory map and make sure that
the desired locations are protected.
4.4 FLASH-1 Block 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 for protecting blocks of memory from unintentional erase or program
operations due to system malfunction. This protection is done by using the FLASH-1 Block Protection
Register (FL1BPR). FL1BPR determines the range of the FLASH-1 memory which is to be protected. The
range of the protected area starts from a location defined by FL1BPR and ends at the bottom of the
FLASH-1 memory ($FFFF). When the memory is protected, the HVEN bit can not be set in either ERASE
or PROGRAM operations.
NOTE
In performing a program or erase operation, the FLASH-1 Block Protect
Register must be read after setting the PGM or ERASE bit and before
asserting the HVEN bit.
When the FLASH-1 Block Protect Register is programmed with all 0’s, the entire memory is protected
from being programmed and erased. When all the bits are erased (all 1’s), the entire memory is accessible
for program and erase.
When bits within FL1BPR are programmed (logic 0), they lock a block of memory address ranges as
shown in 4.3.2 FLASH-1 Block Protect Register. If FL1BPR is programmed with any value other than $FF,
the protected block of FLASH memory can not be erased or programmed.
NOTE
The vector locations and the FLASH Block Protect Registers are located in
the same page. FL1BPR and FL2BPR are not protected with special
hardware or software; therefore, if this page is not protected by FL1BPR
and the vector locations are erased by either a page or a mass erase
operation, both FL1BPR and FL2BPR will also get erased.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
54Freescale Semiconductor
FLASH-1 Mass Erase Operation
4.5 FLASH-1 Mass Erase Operation
Use this step-by-step procedure to erase the entire FLASH-1 memory to read as logic 1:
1.Set both the ERASE bit and the MASS bit in the FLASH-1 Control Register (FL1CR).
2.Read the FLASH-1 Block Protect Register (FL1BPR).
3.Write to any FLASH-1 address within the FLASH-1 array with any data.
NOTE
If the address written to in Step 3 is within address space protected by the
FLASH-1 Block Protect Register (FL1BPR), no erase will occur.
4.Wait for a time, t
NVS
5.Set the HVEN bit.
6.Wait for a time, t
MERASE
7.Clear the ERASE bit.
8.Wait for a time, t
NVHL
9.Clear the HVEN bit.
10.Wait for a time, t
RCV
A. Programming and erasing of FLASH locations can not be performed by
code being executed from the same FLASH array.
B. While these operations must be performed in the order shown, other
unrelated operations may occur between the steps. Care must be taken
however to ensure that these operations do not access any address within
the FLASH array memory space such as the COP Control Register
(COPCTL) at $FFFF.
C. It is highly recommended that interrupts be disabled during
program/erase operations.
.
.
.
, after which the memory can be accessed in normal read mode.
NOTE
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor55
FLASH-1 Memory
4.6 FLASH-1 Page Erase Operation
Use this step-by-step procedure to erase a page (128 bytes) of FLASH-1 memory to read as logic 1:
1.Set the ERASE bit and clear the MASS bit in the FLASH-1 Control Register (FL1CR).
2.Read the FLASH-1 Block Protect Register (FL1BPR).
3.Write any data to any FLASH-1 address within the address range of the page (128 byte block) to
be erased.
4.Wait for time, t
5.Set the HVEN bit.
6.Wait for time, t
7.Clear the ERASE bit.
8.Wait for time, t
9.Clear the HVEN bit.
10.Wait for a time, t
A. Programming and erasing of FLASH locations can not be performed by
code being executed from the same FLASH array.
B. While these operations must be performed in the order shown, other
unrelated operations may occur between the steps. Care must be taken
however to ensure that these operations do not access any address within
the FLASH array memory space such as the COP Control Register
(COPCTL) at $FFFF.
.
NVS
ERASE
NVH
.
.
, after which the memory can be accessed in normal read mode.
RCV
NOTE
C. It is highly recommended that interrupts be disabled during
program/erase operations.
4.7 FLASH-1 Program Operation
Programming of the FLASH memory is done on a row basis. A row consists of 64 consecutive bytes with
address ranges as follows:
•$XX00 to $XX3F
•$XX40 to $XX7F
•$XX80 to $XXBF
•$XXC0 to $XXFF
During the programming cycle, make sure that all addresses being written to fit within one of the ranges
specified above. Attempts to program addresses in different row ranges in one programming cycle will fail.
Use this step-by-step procedure to program a row of FLASH-1 memory.
NOTE
In order to avoid program disturbs, the row must be erased before any byte
on that row is programmed.
1.Set the PGM bit in the FLASH-1 Control Register (FL1CR). This configures the memory for
program operation and enables the latching of address and data programming.
2.Read the FLASH-1 Block Protect Register (FL1BPR).
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
56Freescale Semiconductor
FLASH-1 Program Operation
3.Write to any FLASH-1 address within the row address range desired with any data.
4.Wait for time, t
NVS
.
5.Set the HVEN bit.
6.Wait for time, t
PGS
.
7.Write data byte to the FLASH-1 address to be programmed.
8.Wait for time, t
PROG
.
9.Repeat step 7 and 8 until all the bytes within the row are programmed.
10.Clear the PGM bit.
11.Wait for time, t
NVH
.
12.Clear the HVEN bit.
13.Wait for a time, t
, after which the memory can be accessed in normal read mode.
RCV
The FLASH Programming Algorithm Flowchart is shown in Figure 4-4.
NOTE
A. Programming and erasing of FLASH locations can not be performed by
code being executed from the same FLASH array.
B. While these operations must be performed in the order shown, other
unrelated operations may occur between the steps. Care must be taken
however to ensure that these operations do not access any address within
the FLASH array memory space such as the COP Control Register
(COPCTL) at $FFFF.
C. It is highly recommended that interrupts be disabled during
program/erase operations.
D. Do not exceed t
PROG
maximum or t
maximum. t
HV
is defined as the
HV
cumulative high voltage programming time to the same row before next
erase. t
must satisfy this condition: t
HV
NVS
+ t
NVH
+ t
PGS
+ (t
PROG
X 64) ≤ t
HV
max. Please also see 28.1.14 FLASH Memory Characteristics.
E. The time between each FLASH address change (step 7 to step 7), or the
time between the last FLASH address programmed to clearing the PGM bit
(step 7 to step 10) must not exceed the maximum programming time, t
PROG
max.
F. Be cautious when programming the FLASH-1 array to ensure that
non-FLASH locations are not used as the address that is written to when
selecting either the desired row address range in step 3 of the algorithm or
the byte to be programmed in step 7 of the algorithm. This applies
particularly to:
$FFD2-$FFD3 and $FFDA-$FFFF: Vector area on
MC68HC908AS60A (40 bytes)
$FFCC-$FFFF: Vector area on MC68HC908AZ60A (52 bytes)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor57
FLASH-1 Memory
Algorithm for programming
a row (64 bytes) of FLASH memory
1
2
Read the FLASH block protect register
3
Write any data to any FLASH address
Set PGM bit
within the row address range desired
4
5
6
7
Wait for a time, t
Set HVEN bit
Wait for a time, t
Write data to the FLASH address
to be programmed
8
Wait for a time, t
nvs
pgs
PROG
Completed
programming
this row?
NOTE:
The time between each FLASH address change (step 7 to step 7), or
the time between the last FLASH address programmed
to clearing PGM bit (step 7 to step 10)
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-4. FLASH Programming Algorithm Flowchart
Y
N
10
11
12
13
Clear PGM bit
Wait for a time, t
Clear HVEN bit
Wait for a time, t
nvh
rcv
End of programming
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
58Freescale Semiconductor
Low-Power Modes
4.8 Low-Power Modes
The WAIT and STOP instructions will place the MCU in low power consumption standby modes.
4.8.1 WAIT Mode
Putting the MCU into wait mode while the FLASH is in read mode does not affect the operation of the
FLASH memory directly; however, no memory activity will take place since the CPU is inactive.
The WAIT instruction should not be executed while performing a program or erase operation on the
FLASH. Wait mode will suspend any FLASH program/erase operations and leave the memory in a
Standby Mode.
4.8.2 STOP Mode
Putting the MCU into stop mode while the FLASH is in read mode does not affect the operation of the
FLASH memory directly; however, no memory activity will take place since the CPU is inactive.
The STOP instruction should not be executed while performing a program or erase operation on the
FLASH. Stop mode will suspend any FLASH program/erase operations and leave the memory in a
Standby Mode.
NOTE
Standby Mode is the power saving mode of the FLASH module, in which all
internal control signals to the FLASH are inactive and the current
consumption of the FLASH is minimum.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor59
FLASH-1 Memory
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
60Freescale Semiconductor
Chapter 5
FLASH-2 Memory
5.1 Introduction
This chapter describes the operation of the embedded FLASH-2 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.
5.2 Functional Description
The FLASH-2 memory is a non-continuos array consisting of a total of 29,616 bytes on the
MC68HC908AS60A and 29,488 bytes on the MC68HC908AZ60A. An erased bit reads as a logic 1 and
a programmed bit reads as a logic 0.
Memory in the FLASH-2 array is organized into rows within pages. There are two rows of memory per
page with 64 bytes per row. The minimum erase block size is a single page,128 bytes. Programming is
performed on a per-row basis, 64 bytes at a time. Program and erase operations are facilitated through
control bits in the FLASH-2 Control Register (FL2CR). Details for these operations appear later in this
chapter.
The FLASH-2 memory map consists of:
•$0450–$05FF: User Memory on MC68HC908AS60A (432 bytes)
•$0450–$04FF: User Memory on MC68HC908AZ60A (176 bytes)
•$0580–$05FF: User Memory on MC68HC908AZ60A (128 bytes)
•$0E00–$7FFF: User Memory (29,616 bytes)
•$FF81: FLASH-2 Block Protect Register (FL2BPR)
NOTE
FL2BPR physically resides within FLASH-1 memory addressing space
•$FE08: FLASH-2 Control Register (FL2CR)
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 is to make reading or copying the FLASH difficult for
unauthorized users.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor61
(1)
FLASH-2 Memory
5.3 FLASH-2 Control and Block Protect Registers
The FLASH-2 array has two registers that control its operation, the FLASH-2 Control Register (FL2CR)
and the FLASH-2 Block Protect Register (FL2BPR).
5.3.1 FLASH-2 Control Register
The FLASH-2 Control Register (FL2CR) controls FLASH-2 program and erase operations.
Address:$FE08
Bit 7654321Bit 0
Read:0000
Write:
Reset:00000000
= Unimplemented
HVENMASSERASEPGM
Figure 5-1. FLASH-2 Control Register (FL2CR)
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
Setting this read/write bit configures the FLASH-2 array for mass or page erase operation.
This read/write bit configures the memory for erase operation. ERASE is interlocked with the PGM bit
such that both bits cannot be set 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 unselected
5.3.2 FLASH-2 Block Protect Register
The FLASH-2 Block Protect Register (FL2BPR) is implemented as a byte within the FLASH-1 memory
and therefore can only be written during a FLASH programming sequence. The value in this register
determines the starting location of the protected range within the FLASH-2 memory.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
The FLASH-2 Block Protect Register (FL2BPR) controls the block
protection for the FLASH-2 array. However, FL2BPR is implemented within
the FLASH-1 memory array and therefore, the FLASH-1 Control Register
(FL1CR) must be used to program/erase FL2BPR.
FL2BPR[7:0] — Block Protect Register Bit 7 to Bit 0
These eight bits represent bits [14:7] of a 16-bit memory address. Bit 15 is logic 1 and bits [6:0] are
logic 0s.
The resultant 16-bit address is used for specifying the start address of the FLASH-2 memory for block
protection. FLASH-2 is protected from this start address to the end of FLASH-2 memory at $7FFF.
With this mechanism, the protect start address can be $XX00 and $XX80 (128 byte page boundaries)
within the FLASH-2 array.
Start address of FLASH block protect
Figure 5-3. FLASH-2 Block Protect Start Address
FLASH-2 Protected Ranges:
FL2BPR[7:0]Protected Range
16-bit memory address
1
$FFNo Protection
$FE$7F00 – $7FFF
$FD$7E80 – $7FFF
$0B$0580 – $7FFF
$0A$0500 – $7FFF
$09$0480 – $7FFF
$08$0450 – $7FFF
$04$0450 – $7FFF
$03$0450 – $7FFF
$02$0450 – $7FFF
$01$0450 – $7FFF
$00$0450 – $7FFF
FLBPR value
0000000
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor63
FLASH-2 Memory
Decreasing the value in FL2BPR by one increases the protected range by one page (128 bytes).
However, programming the block protect register with $FE protects a range twice that size, 256 bytes, in
the corresponding array. $FE means that locations $7F00–$7FFF are protected in FLASH-2.
The FLASH memory does not exist at some locations. The block protection range configuration is
unaffected if FLASH memory does not exist in that range. Refer to the memory map and make sure that
the desired locations are protected.
5.4 FLASH-2 Block 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 for protecting blocks of memory from unintentional erase or program
operations due to system malfunction. This protection is done by using the FLASH-2 Block Protection
Register (FL2BPR). FL2BPR determines the range of the FLASH-2 memory which is to be protected. The
range of the protected area starts from a location defined by FL2BPR and ends at the bottom of the
FLASH-2 memory ($7FFF). When the memory is protected, the HVEN bit can not be set in either ERASE
or PROGRAM operations.
NOTE
In performing a program or erase operation, the FLASH-2 Block Protect
Register must be read after setting the PGM or ERASE bit and before
asserting the HVEN bit.
When the FLASH-2 Block Protect Register is programmed with all 0’s, the entire memory is protected
from being programmed and erased. When all the bits are erased (all 1’s), the entire memory is accessible
for program and erase.
When bits within FL2BPR are programmed (logic 0), they lock a block of memory address ranges as
shown in 5.3.2 FLASH-2 Block Protect Register. If FL2BPR is programmed with any value other than $FF,
the protected block of FLASH memory can not be erased or programmed.
NOTE
The vector locations and the FLASH Block Protect Registers are located in
the same page. FL1BPR and FL2BPR are not protected with special
hardware or software; therefore, if this page is not protected by FL1BPR
and the vector locations are erased by either a page or a mass erase
operation, both FL1BPR and FL2BPR will also get erased.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
64Freescale Semiconductor
FLASH-2 Mass Erase Operation
5.5 FLASH-2 Mass Erase Operation
Use this step-by-step procedure to erase the entire FLASH-2 memory to read as logic 1:
1.Set both the ERASE bit and the MASS bit in the FLASH-2 Control Register (FL2CR).
2.Read the FLASH-2 Block Protect Register (FL2BPR).
3.Write to any FLASH-2 address within the FLASH-2 array with any data.
NOTE
If the address written to in Step 3 is within address space protected by the
FLASH-2 Block Protect Register (FL2BPR), no erase will occur.
4.Wait for a time, t
NVS
5.Set the HVEN bit.
6.Wait for a time, t
MERASE
7.Clear the ERASE bit.
8.Wait for a time, t
NVHL
9.Clear the HVEN bit.
10.Wait for a time, t
RCV
A. Programming and erasing of FLASH locations can not be performed by
code being executed from the same FLASH array.
B. While these operations must be performed in the order shown, other
unrelated operations may occur between the steps. Care must be taken
however to ensure that these operations do not access any address within
the FLASH array memory space such as the COP Control Register
(COPCTL) at $FFFF.
C. It is highly recommended that interrupts be disabled during
program/erase operations.
.
.
.
, after which the memory can be accessed in normal read mode.
NOTE
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor65
FLASH-2 Memory
5.6 FLASH-2 Page Erase Operation
Use this step-by-step procedure to erase a page (128 bytes) of FLASH-2 memory to read as logic 1:
1.Set the ERASE bit and clear the MASS bit in the FLASH-2 Control Register (FL2CR).
2.Read the FLASH-2 Block Protect Register (FL2BPR).
3.Write any data to any FLASH-2 address within the address range of the page (128 byte block) to
be erased.
4.Wait for time, t
5.Set the HVEN bit.
6.Wait for time, t
7.Clear the ERASE bit.
8.Wait for time, t
9.Clear the HVEN bit.
10.Wait for a time, t
A. Programming and erasing of FLASH locations can not be performed by
code being executed from the same FLASH array.
B. While these operations must be performed in the order shown, other
unrelated operations may occur between the steps. Care must be taken
however to ensure that these operations do not access any address within
the FLASH array memory space such as the COP Control Register
(COPCTL) at $FFFF.
.
NVS
ERASE
NVH
.
.
, after which the memory can be accessed in normal read mode.
RCV
NOTE
C. It is highly recommended that interrupts be disabled during
program/erase operations.
5.7 FLASH-2 Program Operation
Programming of the FLASH memory is done on a row basis. A row consists of 64 consecutive bytes with
address ranges as follows:
•$XX00 to $XX3F
•$XX40 to $XX7F
•$XX80 to $XXBF
•$XXC0 to $XXFF
During the programming cycle, make sure that all addresses being written to fit within one of the ranges
specified above. Attempts to program addresses in different row ranges in one programming cycle will fail.
•Use this step-by-step procedure to program a row of FLASH-2 memory.
NOTE
In order to avoid program disturbs, the row must be erased before any byte
on that row is programmed.
1.Set the PGM bit in the FLASH-2 Control Register (FL2CR). This configures the memory for
program operation and enables the latching of address and data programming.
2.Read the FLASH-2 Block Protect Register (FL2BPR).
3.Write to any FLASH-2 address within the row address range desired with any data.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
66Freescale Semiconductor
FLASH-2 Program Operation
4.Wait for time, t
NVS
.
5.Set the HVEN bit.
6.Wait for time, t
PGS
.
7.Write data byte to the FLASH-2 address to be programmed.
8.Wait for time, t
PROG
.
9.Repeat step 7 and 8 until all the bytes within the row are programmed.
10.Clear the PGM bit.
11.Wait for time, t
NVH
.
12.Clear the HVEN bit.
13.Wait for a time, t
, after which the memory can be accessed in normal read mode.
RCV
The FLASH Programming Algorithm Flowchart is shown in Figure 5-4.
NOTE
A. Programming and erasing of FLASH locations can not be performed by
code being executed from the same FLASH array.
B. While these operations must be performed in the order shown, other
unrelated operations may occur between the steps. Care must be taken
however to ensure that these operations do not access any address within
the FLASH array memory space such as the COP Control Register
(COPCTL) at $FFFF.
C. It is highly recommended that interrupts be disabled during
program/erase operations.
D. Do not exceed t
PROG
maximum or t
maximum. t
HV
is defined as the
HV
cumulative high voltage programming time to the same row before next
erase. t
must satisfy this condition: t
HV
NVS
+ t
NVH
+ t
PGS
+ (t
PROG
X 64) ≤ t
HV
max. Please also see 28.1.14 FLASH Memory Characteristics.
E. The time between each FLASH address change (step 7 to step 7), or the
time between the last FLASH address programmed to clearing the PGM bit
(step 7 to step 10) must not exceed the maximum programming time, t
PROG
max.
F. Be cautious when programming the FLASH-2 array to ensure that
non-FLASH locations are not used as the address that is written to when
selecting either the desired row address range in step 3 of the algorithm or
the byte to be programmed in step 7 of the algorithm. This applies
particularly to:
$0450-$047F: First row of FLASH-2 (48 bytes)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor67
FLASH-2 Memory
Algorithm for programming
a row (64 bytes) of FLASH memory
1
2
Read the FLASH block protect register
3
Write any data to any FLASH address
Set PGM bit
within the row address range desired
4
5
6
7
Wait for a time, t
Set HVEN bit
Wait for a time, t
Write data to the FLASH address
to be programmed
8
Wait for a time, t
nvs
pgs
PROG
Completed
programming
this row?
NOTE:
The time between each FLASH address change (step 7 to step 7), or
the time between the last FLASH address programmed
to clearing PGM bit (step 7 to step 10)
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 5-4. FLASH Programming Algorithm Flowchart
Y
N
10
11
12
13
Clear PGM bit
Wait for a time, t
Clear HVEN bit
Wait for a time, t
nvh
rcv
End of programming
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
68Freescale Semiconductor
Low-Power Modes
5.8 Low-Power Modes
The WAIT and STOP instructions will place the MCU in low power consumption standby modes.
5.8.1 WAIT Mode
Putting the MCU into wait mode while the FLASH is in read mode does not affect the operation of the
FLASH memory directly; however, no memory activity will take place since the CPU is inactive.
The WAIT instruction should not be executed while performing a program or erase operation on the
FLASH. Wait mode will suspend any FLASH program/erase operations and leave the memory in a
Standby Mode.
5.8.2 STOP Mode
Putting the MCU into stop mode while the FLASH is in read mode does not affect the operation of the
FLASH memory directly; however, no memory activity will take place since the CPU is inactive.
The STOP instruction should not be executed while performing a program or erase operation on the
FLASH. Stop mode will suspend any FLASH program/erase operations and leave the memory in a
Standby Mode.
NOTE
Standby Mode is the power saving mode of the FLASH module, in which all
internal control signals to the FLASH are inactive and the current
consumption of the FLASH is minimum.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor69
FLASH-2 Memory
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
70Freescale Semiconductor
Chapter 6
EEPROM-1 Memory
6.1 Introduction
This chapter describes the 512 bytes of electrically erasable programmable read-only memory
(EEPROM) residing at address range $0800 to $09FF. There are 1024 bytes of EEPROM available on
the MC68HC908AS60A and MC68HC908AZ60A which are physically located in two 512 byte arrays. For
information relating to the array covering address range $0600 to $07FF please see Chapter 7
EEPROM-2 Memory.
6.2 Features
Features of the EEPROM-1 include the following:
•512 bytes Nonvolatile Memory
•Byte, Block, or Bulk Erasable
•Nonvolatile EEPROM Configuration and Block Protection Options
•On-chip Charge Pump for Programming/Erasing
•Security Option
•AUTO Bit Driven Programming/Erasing Time Feature
6.3 EEPROM-1 Register Summary
The EEPROM-1 Register Summary is shown in Figure 6-1.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor71
EEPROM-1 Memory
Addr.Register NameBit 7654321Bit 0
Read:
$FE10
EE1DIV Nonvolatile
Register High
(EE1DIVHNVR)
(1)
Reset:Unaffected by reset; $FF when blank
Write:
EEDIVS-
ECD
RRRREEDIV10EEDIV9EEDIV8
$FE11
$FE1A
$FE1B
$FE1C
$FE1D
$FE1F
EE1DIV Nonvolatile
Register Low
(EE1DIVLNVR)
EE1 Divider Register High
(EE1DIVH)
EE1 Divider Register Low
(EE1DIVL)
EEPROM-1 Nonvolatile
Register (EE1NVR)
EEPROM-1 Control
Register
(EE1CR)
EEPROM-1 Array
Configuration Register
(EE1ACR)
Read:
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
Write:
(1)
Reset:Unaffected by reset; $FF when blank
Read:
Write:
EEDIVS-
ECD
0000
EEDIV10EEDIV9EEDIV8
Reset:Contents of EE1DIVHNVR ($FE10), Bits [6:3] = 0
Read:
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
Write:
Reset:Contents of EE1DIVLNVR ($FE11)
Read:
UNUSEDUNUSEDUNUSEDEEPRTCTEEBP3EEBP2EEBP1EEBP0
Write:
(1)
Reset:Unaffected by reset; $FF when blank; factory programmed $F0
1. Nonvolatile EEPROM register; write by programming.
= UnimplementedR = ReservedUNUSED = Unused
Figure 6-1. EEPROM-1 Register Summary
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
72Freescale Semiconductor
Functional Description
6.4 Functional Description
The 512 bytes of EEPROM-1 are located at $0800-$09FF and can be programmed or erased without an
additional external high voltage supply. The program and erase operations are enabled through the use
of an internal charge pump. For each byte of EEPROM, the write/erase endurance is 10,000 cycles.
6.4.1 EEPROM-1 Configuration
The 8-bit EEPROM-1 Nonvolatile Register (EE1NVR) and the 16-bit EEPROM-1 Timebase Divider
Nonvolatile Register (EE1DIVNVR) contain the default settings for the following EEPROM configurations:
•EEPROM-1 Timebase Reference
•EEPROM-1 Security Option
•EEPROM-1 Block Protection
EE1NVR and EE1DIVNVR are nonvolatile EEPROM registers. They are programmed and erased in the
same way as EEPROM bytes. The contents of these registers are loaded into their respective volatile
registers during a MCU reset. The values in these read/write volatile registers define the EEPROM-1
configurations.
For EE1NVR, the corresponding volatile register is the EEPROM-1 Array Configuration Register
(EE1ACR). For the EE1DIVNCR (two 8-bit registers: EE1DIVHNVR and EE1DIVLNVR), the
corresponding volatile register is the EEPROM-1 Divider Register (EE1DIV: EE1DIVH and EE1 DIVL).
6.4.2 EEPROM-1 Timebase Requirements
A 35µs timebase is required by the EEPROM-1 control circuit for program and erase of EEPROM content.
This timebase is derived from dividing the CGMXCLK or bus clock (selected by EEDIVCLK bit in
CONFIG-2 Register) using a timebase divider circuit controlled by the 16-bit EEPROM-1 Timebase
Divider EE1DIV Register (EE1DIVH and EE1DIVL).
As the CGMXCLK or bus clock is user selected, the EEPROM-1 Timebase Divider Register must be
configured with the appropriate value to obtain the 35 µs. The timebase divider value is calculated by
using the following formula:
EE1DIV= INT[Reference Frequency(Hz) x 35 x10
This value is written to the EEPROM-1 Timebase Divider Register (EE1DIVH and EE1DIVL) or
programmed into the EEPROM-1 Timebase Divider Nonvolatile Register prior to any EEPROM program
or erase operations (6.4.1 EEPROM-1 Configuration and 6.4.2 EEPROM-1 Timebase Requirements).
-6
+0.5]
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor73
EEPROM-1 Memory
6.4.3 EEPROM-1 Program/Erase Protection
The EEPROM has a special feature that designates the 16 bytes of addresses from $08F0 to $08FF to
be permanently secured. This program/erase protect option is enabled by programming the EEPRTCT
bit in the EEPROM-1 Nonvolatile Register (EE1NVR) to a logic zero.
Once the EEPRTCT bit is programmed to 0 for the first time:
•Programming and erasing of secured locations $08F0 to $08FF is permanently disabled.
•Secured locations $08F0 to $08FF can be read as normal.
•Programming and erasing of EE1NVR is permanently disabled.
•Bulk and Block Erase operations are disabled for the unprotected locations $0800-$08EF,
$0900-$09FF.
•Single byte program and erase operations are still available for locations $0800-$08EF and
$0900-$09FF for all bytes that are not protected by the EEPROM-1 Block Protect EEBPx bits (see
6.4.4 EEPROM-1 Block Protection and 6.5.2 EEPROM-1 Array Configuration Register)
NOTE
Once armed, the protect option is permanently enabled. As a consequence,
all functions in the EE1NVR will remain in the state they were in
immediately before the security was enabled.
6.4.4 EEPROM-1 Block Protection
The 512 bytes of EEPROM-1 are divided into four 128-byte blocks. Each of these blocks can be protected
from erase/program operations by setting the EEBPx bit in the EE1NVR. Table 6-1 shows the address
ranges for the blocks.
Table 6-1. EEPROM-1 Array Address Blocks
Block Number (EEBPx)Address Range
EEBP0$0800–$087F
EEBP1$0880–$08FF
EEBP2$0900–$097F
EEBP3$0980–$09FF
These bits are effective after a reset or a upon read of the EE1NVR register. The block protect
configuration can be modified by erasing/programming the corresponding bits in the EE1NVR register
and then reading the EE1NVR register. Please see 6.5.2 EEPROM-1 Array Configuration Register for
more information.
NOTE
Once EEDIVSECD in the EE1DIVHNVR is programmed to 0 and after a
system reset, the EE1DIV security feature is permanently enabled because
the EEDIVSECD bit in the EE1DIVH is always loaded with 0 thereafter.
Once this security feature is armed, erase and program mode are disabled
for EE1DIVHNVR and EE1DIVLNVR. Modifications to the EE1DIVH and
EE1DIVL registers are also disabled. Therefore, be cautious on
programming a value into the EE1DIVHNVR.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
74Freescale Semiconductor
Functional Description
6.4.5 EEPROM-1 Programming and Erasing
The unprogrammed or erase state of an EEPROM bit is a logic 1. The factory default for all bytes within
the EEPROM-1 array is $FF.
The programming operation changes an EEPROM bit from logic 1 to logic 0 (programming cannot change
a bit from logic 0 to a logic 1). In a single programming operation, the minimum EEPROM programming
size is one bit; the maximum is eight bits (one byte).
The erase operation changes an EEPROM bit from logic 0 to logic 1. In a single erase operation, the
minimum EEPROM erase size is one byte; the maximum is the entire EEPROM-1 array.
The EEPROM can be programmed such that one or multiple bits are programmed (written to a logic 0) at
a time. However, the user may never program the same bit location more than once before erasing the
entire byte. In other words, the user is not allowed to program a logic 0 to a bit that is already programmed
(bit state is already logic 0).
For some applications it might be advantageous to track more than 10K events with a single byte of
EEPROM by programming one bit at a time. For that purpose, a special selective bit programming
technique is available. An example of this technique is illustrated in Table 6-2.
Table 6-2. Example Selective Bit Programming Description
Description
Original state of byte (erased)n/a1111:1111
First event is recorded by programming bit position 01111:11101111:1110
Second event is recorded by programming bit position 11111:11011111:1100
Third event is recorded by programming bit position 21111:10111111:1000
Fourth event is recorded by programming bit position 31111:01111111:0000
Events five through eight are recorded in a similar fashion
Program Data
in Binary
Result
in Binary
Note that none of the bit locations are actually programmed more than once although the byte was
programmed eight times.
When this technique is utilized, a program/erase cycle is defined as multiple program sequences (up to
eight) to a unique location followed by a single erase operation.
6.4.5.1 Program/Erase Using AUTO Bit
An additional feature available for EEPROM-1 program and erase operations is the AUTO mode. When
enabled, AUTO mode will activate an internal timer that will automatically terminate the program/erase
cycle and clear the EEPGM bit. Please see 6.4.5.2 EEPROM-1 Programming, 6.4.5.3 EEPROM-1
Erasing, and 6.5.1 EEPROM-1 Control Register for more information.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor75
EEPROM-1 Memory
6.4.5.2 EEPROM-1 Programming
The unprogrammed or erase state of an EEPROM bit is a logic 1. Programming changes the state to a
logic 0. Only EEPROM bytes in the non-protected blocks and the EE1NVR register can be programmed.
Use the following procedure to program a byte of EEPROM:
1.Clear EERAS1 and EERAS0 and set EELAT in the EE1CR.
(A)
NOTE
If using the AUTO mode, also set the AUTO bit during Step 1.
2.Write the desired data to the desired EEPROM address.
EEPGM
(C)
Go to Step 7 if AUTO is set.
, to program the byte.
3.Set the EEPGM bit.
4.Wait for time, t
5.Clear EEPGM bit.
6.Wait for time, t
, for the programming voltage to fall. Go to Step 8.
EEFPV
7.Poll the EEPGM bit until it is cleared by the internal timer.
8.Clear EELAT bits.
(E)
NOTE
A. EERAS1 and EERAS0 must be cleared for programming. Setting the
EELAT bit configures the address and data buses to latch data for
programming the array. Only data with a valid EEPROM-1 address will be
latched. If EELAT is set, other writes to the EE1CR will be allowed after a
valid EEPROM-1 write.
B. If more than one valid EEPROM write occurs, the last address and data
will be latched overriding the previous address and data. Once data is
written to the desired address, do not read EEPROM-1 locations other than
the written location. (Reading an EEPROM location returns the latched data
and causes the read address to be latched).
C. The EEPGM bit cannot be set if the EELAT bit is cleared or a non-valid
EEPROM address is latched. This is to ensure proper programming
sequence. Once EEPGM is set, do not read any EEPROM-1 locations;
otherwise, the current program cycle will be unsuccessful. When EEPGM
is set, the on-board programming sequence will be activated.
(B)
(D)
D. The delay time for the EEPGM bit to be cleared in AUTO mode is less
than t
EEPGM
. However, on other MCUs, this delay time may be different.
For forward compatibility, software should not make any dependency on
this delay time.
E. Any attempt to clear both EEPGM and EELAT bits with a single
instruction will only clear EEPGM. This is to allow time for removal of high
voltage from the EEPROM-1 array.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
76Freescale Semiconductor
Functional Description
6.4.5.3 EEPROM-1 Erasing
The programmed state of an EEPROM bit is logic 0. Erasing changes the state to a logic 1. Only
EEPROM-1 bytes in the non-protected blocks and the EE1NVR register can be erased.
Use the following procedure to erase a byte, block or the entire EEPROM-1 array:
1.Configure EERAS1 and EERAS0 for byte, block or bulk erase; set EELAT in EE1CR.
(A)
NOTE
If using the AUTO mode, also set the AUTO bit in Step 1.
2.Byte erase: write any data to the desired address.
(B)
Block erase: write any data to an address within the desired block.
Bulk erase: write any data to an address within the array.
3.Set the EEPGM bit.
4.Wait for a time: t
(C)
Go to Step 7 if AUTO is set.
EEBYTE
for byte erase; t
EEBLOCK
for block erase; t
5.Clear EEPGM bit.
6.Wait for a time, t
, for the erasing voltage to fall. Go to Step 8.
EEFPV
7.Poll the EEPGM bit until it is cleared by the internal timer.
8.Clear EELAT bits.
(E)
NOTE
A. Setting the EELAT bit configures the address and data buses to latch
data for erasing the array. Only valid EEPROM-1 addresses will be latched.
If EELAT is set, other writes to the EE1CR will be allowed after a valid
EEPROM-1 write.
B. If more than one valid EEPROM write occurs, the last address and data
will be latched overriding the previous address and data. Once data is
written to the desired address, do not read EEPROM-1 locations other than
the written location. (Reading an EEPROM location returns the latched data
and causes the read address to be latched).
(B)
(D)
(B)
EEBULK.
for bulk erase.
C. The EEPGM bit cannot be set if the EELAT bit is cleared or a non-valid
EEPROM address is latched. This is to ensure proper programming
sequence. Once EEPGM is set, do not read any EEPROM-1 locations;
otherwise, the current program cycle will be unsuccessful. When EEPGM
is set, the on-board programming sequence will be activated.
D. The delay time for the EEPGM bit to be cleared in AUTO mode is less
than t
EEBYTE /tEEBLOCK/tEEBULK
. However, on other MCUs, this delay time
may be different. For forward compatibility, software should not make any
dependency on this delay time.
E. Any attempt to clear both EEPGM and EELAT bits with a single
instruction will only clear EEPGM. This is to allow time for removal of high
voltage from the EEPROM-1 array.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor77
EEPROM-1 Memory
6.5 EEPROM-1 Register Descriptions
Four I/O registers and three nonvolatile registers control program, erase and options of the EEPROM-1
array.
6.5.1 EEPROM-1 Control Register
This read/write register controls programming/erasing of the array.
Address:$FE1D
Bit 7654321Bit 0
Read:
UNUSED
Write:
Reset:00000000
Figure 6-2. EEPROM-1 Control Register (EE1CR)
Bit 7— Unused bit
This read/write bit is software programmable but has no functionality.
EEOFF — EEPROM-1 power down
This read/write bit disables the EEPROM-1 module for lower power consumption. Any attempts to
access the array will give unpredictable results. Reset clears this bit.
EERAS1 and EERAS0 — Erase/Program Mode Select Bits
These read/write bits set the erase modes. Reset clears these bits.
Table 6-3. EEPROM-1 Program/Erase Mode Select
EEBPxEERAS1EERAS0MODE
000Byte Program
001Byte Erase
010Block Erase
011Bulk Erase
1XXNo Erase/Program
X = don’t care
EELAT — EEPROM-1 Latch Control
This read/write bit latches the address and data buses for programming the EEPROM-1 array. EELAT
cannot be cleared if EEPGM is still set. Reset clears this bit.
1 = Buses configured for EEPROM-1 programming or erase operation
0 = Buses configured for normal operation
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
78Freescale Semiconductor
EEPROM-1 Register Descriptions
AUTO — Automatic Termination of Program/Erase Cycle
When AUTO is set, EEPGM is cleared automatically after the program/erase cycle is terminated by
the internal timer.
(See note D for 6.4.5.2 EEPROM-1 Programming, 6.4.5.3 EEPROM-1 Erasing, and 28.1.13 EEPROM
Memory Characteristics)
1 = Automatic clear of EEPGM is enabled
0 = Automatic clear of EEPGM is disabled
EEPGM — EEPROM-1 Program/Erase Enable
This read/write bit enables the internal charge pump and applies the programming/erasing voltage to
the EEPROM-1 array if the EELAT bit is set and a write to a valid EEPROM-1 location has occurred.
Reset clears the EEPGM bit.
1 = EEPROM-1 programming/erasing power switched on
0 = EEPROM-1 programming/erasing power switched off
NOTE
Writing logic 0s to both the EELAT and EEPGM bits with a single instruction
will clear EEPGM only to allow time for the removal of high voltage.
6.5.2 EEPROM-1 Array Configuration Register
The EEPROM-1 array configuration register configures EEPROM-1 security and EEPROM-1 block
protection.
This read-only register is loaded with the contents of the EEPROM-1 nonvolatile register (EE1NVR) after
a reset.
The EE1NVR will leave the factory programmed with $F0 such that the full
array is available and unprotected.
6.5.4 EEPROM-1 Timebase Divider Register
The 16-bit EEPROM-1 timebase divider register consists of two 8-bit registers: EE1DIVH and EE1DIVL.
The 11-bit value in this register is used to configure the timebase divider circuit to obtain the 35 µs
timebase for EEPROM-1 control.
These two read/write registers are respectively loaded with the contents of the EEPROM-1 timebase
divider nonvolatile registers (EE1DIVHNVR and EE1DIVLNVR) after a reset.
Address:$FE1A
Bit 7654321Bit 0
Read:
EEDIVS-
Write:
Reset:Contents of EE1DIVHNVR ($FE10), Bits [6:3] = 0
ECD
0000
= Unimplemented
EEDIV10EEDIV9EEDIV8
Figure 6-5. EE1DIV Divider High Register (EE1DIVH)
Address:$FE1B
Bit 7654321Bit 0
Read:
Write:
Reset:Contents of EE1DIVLNVR ($FE11)
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
Figure 6-6. EE1DIV Divider Low Register (EE1DIVL)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor81
EEPROM-1 Memory
EEDIVSECD — EEPROM-1 Divider Security Disable
This bit enables/disables the security feature of the EE1DIV registers. When EE1DIV security feature
is enabled, the state of the registers EE1DIVH and EE1DIVL are locked (including EEDIVSECD bit).
The EE1DIVHNVR and EE1DIVLNVR nonvolatile memory registers are also protected from being
erased/programmed.
These prescaler bits store the value of EE1DIV which is used as the divisor to derive a timebase of
35µs from the selected reference clock source (CGMXCLK or bus block in the CONFIG-2 register) for
the EEPROM-1 related internal timer and circuits. EEDIV[10:0] bits are readable at any time. They are
writable when EELAT = 0 and EEDIVSECD = 1.
The EE1DIV value is calculated by the following formula:
EE1DIV= INT[Reference Frequency(Hz) x 35 x10
-6
+0.5]
Where the result inside the bracket is rounded down to the nearest integer value
For example, if the reference frequency is 4.9152MHz, the EE1DIV value is 172
NOTE
Programming/erasing the EEPROM with an improper EE1DIV value may
result in data lost and reduce endurance of the EEPROM device.
The 16-bit EEPROM-1 timebase divider nonvolatile register consists of two 8-bit registers: EE1DIVHNVR
and EE1DIVLNVR. The contents of these two registers are respectively loaded into the EEPROM-1
timebase divider registers, EE1DIVH and EE1DIVL, after a reset.
These two registers are erased and programmed in the same way as an EEPROM-1 byte.
Address:$FE10
Bit 7654321Bit 0
Read:
EEDIVS-
Write:
Reset:Unaffected by reset; $FF when blank
ECD
R=Reserved
Figure 6-7. EEPROM-1 Divider Nonvolatile Register High (EE1DIVHNVR))
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
82Freescale Semiconductor
Low-Power Modes
These two registers are protected from erase and program operations if the EEDIVSECD is set to logic 1
in the EE1DIVH (see EEPROM-1 Timebase Divider Register) or programmed to a logic 1 in the
EE1DIVHNVR.
NOTE
Once EEDIVSECD in the EE1DIVHNVR is programmed to 0 and after a
system reset, the EE1DIV security feature is permanently enabled because
the EEDIVSECD bit in the EE1DIVH is always loaded with 0 thereafter.
Once this security feature is armed, erase and program mode are disabled
for EE1DIVHNVR and EE1DIVLNVR. Modifications to the EE1DIVH and
EE1DIVL registers are also disabled. Therefore, care should be taken
before programming a value into the EE1DIVHNVR.
6.6 Low-Power Modes
The WAIT and STOP instructions can put the MCU in low power-consumption standby modes.
6.6.1 Wait Mode
The WAIT instruction does not affect the EEPROM. It is possible to start the program or erase sequence
on the EEPROM and put the MCU in wait mode.
6.6.2 Stop Mode
The STOP instruction reduces the EEPROM power consumption to a minimum. The STOP instruction
should not be executed while a programming or erasing sequence is in progress.
If stop mode is entered while EELAT and EEPGM are set, the programming sequence will be stopped
and the programming voltage to the EEPROM array removed. The programming sequence will be
restarted after leaving stop mode; access to the EEPROM is only possible after the programming
sequence has completed.
If stop mode is entered while EELAT and EEPGM is cleared, the programming sequence will be
terminated abruptly.
In either case, the data integrity of the EEPROM is not guaranteed.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor83
EEPROM-1 Memory
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
84Freescale Semiconductor
Chapter 7
EEPROM-2 Memory
7.1 Introduction
This chapter describes the 512 bytes of electrically erasable programmable read-only memory
(EEPROM) residing at address range $0600 to $07FF. There are 1024 bytes of EEPROM available on
the MC68HC908AS60A and MC68HC908AZ60A which are physically located in two 512 byte arrays. For
information relating to the array covering address range $0800 to $09FF please see Chapter 6
EEPROM-1 Memory.
7.2 Features
Features of the EEPROM-2 include the following:
•512 bytes Nonvolatile Memory
•Byte, Block, or Bulk Erasable
•Nonvolatile EEPROM Configuration and Block Protection Options
•On-chip Charge Pump for Programming/Erasing
•Security Option
•AUTO Bit Driven Programming/Erasing Time Feature
7.3 EEPROM-2 Register Summary
The EEPROM-2 Register Summary is shown in Figure 7-1.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor85
EEPROM-2 Memory
Addr.Register NameBit 7654321Bit 0
Read:
$FF70
EE2DIV Nonvolatile
Register High
(EE2DIVHNVR)*
Reset:Unaffected by reset; $FF when blank
Write:
EEDIVS-
ECD
RRRREEDIV10EEDIV9EEDIV8
$FF71
$FF7A
$FF7B
$FF7C
$FF7D
$FF7F
EE2DIV Nonvolatile
Register Low
(EE2DIVLNVR)*
EE2 Divider Register High
(EE2DIVH)
EE2 Divider Register Low
(EE2DIVL)
EEPROM-2 Nonvolatile
Register (EE2NVR)*
EEPROM-2 Control
Register
(EE2CR)
EEPROM-2 Array
Configuration Register
(EE2ACR)
Read:
Write:
Reset:Unaffected by reset; $FF when blank
Read:
Write:
Reset:Contents of EE2DIVHNVR ($FF70); Bits[6:3] = 0
Read:
Write:
Reset:Contents of EE2DIVLNVR ($FF71)
Read:
Write:
Reset:Unaffected by reset; $FF when blank; factory programmed $F0
* Nonvolatile EEPROM register; write by programming.
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
EEDIVS-
ECD
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
UNUSEDUNUSEDUNUSEDEEPRTCTEEBP3EEBP2EEBP1EEBP0
UNUSED
0000
EEDIV10EEDIV9EEDIV8
0
EEOFFEERAS1EERAS0EELATAUTOEEPGM
= UnimplementedR = ReservedUNUSED = Unused
Figure 7-1. EEPROM-2 Register Summary
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
86Freescale Semiconductor
Functional Description
7.4 Functional Description
The 512 bytes of EEPROM-2 are located at $0600-$07FF and can be programmed or erased without an
additional external high voltage supply. The program and erase operations are enabled through the use
of an internal charge pump. For each byte of EEPROM, the write/erase endurance is 10,000 cycles.
7.4.1 EEPROM-2 Configuration
The 8-bit EEPROM-2 Nonvolatile Register (EE2NVR) and the 16-bit EEPROM-2 Timebase Divider
Nonvolatile Register (EE2DIVNVR) contain the default settings for the following EEPROM configurations:
•EEPROM-2 Timebase Reference
•EEPROM-2 Security Option
•EEPROM-2 Block Protection
EE2NVR and EE2DIVNVR are nonvolatile EEPROM registers. They are programmed and erased in the
same way as EEPROM bytes. The contents of these registers are loaded into their respective volatile
registers during a MCU reset. The values in these read/write volatile registers define the EEPROM-2
configurations.
For EE2NVR, the corresponding volatile register is the EEPROM-2 Array Configuration Register
(EE2ACR). For the EE2DIVNCR (two 8-bit registers: EE2DIVHNVR and EE2DIVLNVR), the
corresponding volatile register is the EEPROM-2 Divider Register (EE2DIV: EE2DIVH and EE2 DIVL).
7.4.2 EEPROM-2 Timebase Requirements
A 35µs timebase is required by the EEPROM-2 control circuit for program and erase of EEPROM content.
This timebase is derived from dividing the CGMXCLK or bus clock (selected by EEDIVCLK bit in
CONFIG-2 Register) using a timebase divider circuit controlled by the 16-bit EEPROM-2 Timebase
Divider EE2DIV Register (EE2DIVH and EE2DIVL).
As the CGMXCLK or bus clock is user selected, the EEPROM-2 Timebase Divider Register must be
configured with the appropriate value to obtain the 35 µs. The timebase divider value is calculated by
using the following formula:
EE2DIV= INT[Reference Frequency(Hz) x 35 x10
This value is written to the EEPROM-2 Timebase Divider Register (EE2DIVH and EE2DIVL) or
programmed into the EEPROM-2 Timebase Divider Nonvolatile Register prior to any EEPROM program
or erase operations (7.4.1 EEPROM-2 Configuration and 7.4.2 EEPROM-2 Timebase Requirements).
-6
+0.5]
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor87
EEPROM-2 Memory
7.4.3 EEPROM-2 Program/Erase Protection
The EEPROM has a special feature that designates the 16 bytes of addresses from $06F0 to $06FF to
be permanently secured. This program/erase protect option is enabled by programming the EEPRTCT
bit in the EEPROM-2 Nonvolatile Register (EE2NVR) to a logic zero.
Once the EEPRTCT bit is programmed to 0 for the first time:
•Programming and erasing of secured locations $06F0 to $06FF is permanently disabled.
•Secured locations $06F0 to $06FF can be read as normal.
•Programming and erasing of EE2NVR is permanently disabled.
•Bulk and Block Erase operations are disabled for the unprotected locations $0600-$06EF,
$0700-$07FF.
•Single byte program and erase operations are still available for locations $0600-$06EF and
$0700-$07FF for all bytes that are not protected by the EEPROM-2 Block Protect EEBPx bits (see
7.4.4 EEPROM-2 Block Protection and 7.5.2 EEPROM-2 Array Configuration Register)
NOTE
Once armed, the protect option is permanently enabled. As a consequence,
all functions in the EE2NVR will remain in the state they were in
immediately before the security was enabled.
7.4.4 EEPROM-2 Block Protection
The 512 bytes of EEPROM-2 are divided into four 128-byte blocks. Each of these blocks can be protected
from erase/program operations by setting the EEBPx bit in the EE2NVR. Table 7-1 shows the address
ranges for the blocks.
Table 7-1. EEPROM-2 Array Address Blocks
Block Number (EEBPx)Address Range
EEBP0$0600–$067F
EEBP1$0680–$06FF
EEBP2$0700–$077F
EEBP3$0780–$07FF
These bits are effective after a reset or a upon read of the EE2NVR register. The block protect
configuration can be modified by erasing/programming the corresponding bits in the EE2NVR register
and then reading the EE2NVR register. Please see 7.5.2 EEPROM-2 Array Configuration Register for
more information.
NOTE
Once EEDIVSECD in the EE2DIVHNVR is programmed to 0 and after a
system reset, the EE2DIV security feature is permanently enabled because
the EEDIVSECD bit in the EE2DIVH is always loaded with 0 thereafter.
Once this security feature is armed, erase and program mode are disabled
for EE2DIVHNVR and EE2DIVLNVR. Modifications to the EE2DIVH and
EE2DIVL registers are also disabled. Therefore, be cautious on
programming a value into the EE2DIVHNVR.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
88Freescale Semiconductor
Functional Description
7.4.5 EEPROM-2 Programming and Erasing
The unprogrammed or erase state of an EEPROM bit is a logic 1. The factory default for all bytes within
the EEPROM-2 array is $FF.
The programming operation changes an EEPROM bit from logic 1 to logic 0 (programming cannot change
a bit from logic 0 to a logic 1). In a single programming operation, the minimum EEPROM programming
size is one bit; the maximum is eight bits (one byte).
The erase operation changes an EEPROM bit from logic 0 to logic 1. In a single erase operation, the
minimum EEPROM erase size is one byte; the maximum is the entire EEPROM-2 array.
The EEPROM can be programmed such that one or multiple bits are programmed (written to a logic 0) at
a time. However, the user may never program the same bit location more than once before erasing the
entire byte. In other words, the user is not allowed to program a logic 0 to a bit that is already programmed
(bit state is already logic 0).
For some applications it might be advantageous to track more than 10K events with a single byte of
EEPROM by programming one bit at a time. For that purpose, a special selective bit programming
technique is available. An example of this technique is illustrated in Table 7-2.
Table 7-2. Example Selective Bit Programming Description
Description
Original state of byte (erased)n/a1111:1111
First event is recorded by programming bit position 01111:11101111:1110
Second event is recorded by programming bit position 11111:11011111:1100
Third event is recorded by programming bit position 21111:10111111:1000
Fourth event is recorded by programming bit position 31111:01111111:0000
Events five through eight are recorded in a similar fashion
Program Data
in Binary
Result
in Binary
NOTE
None of the bit locations are actually programmed more than once although
the byte was programmed eight times.
When this technique is utilized, a program/erase cycle is defined as multiple program sequences (up to
eight) to a unique location followed by a single erase operation.
7.4.5.1 Program/Erase Using AUTO Bit
An additional feature available for EEPROM-2 program and erase operations is the AUTO mode. When
enabled, AUTO mode will activate an internal timer that will automatically terminate the program/erase
cycle and clear the EEPGM bit. Please see 7.4.5.2 EEPROM-2 Programming, 7.4.5.3 EEPROM-2
Erasing, and 7.5.1 EEPROM-2 Control Register for more information.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor89
EEPROM-2 Memory
7.4.5.2 EEPROM-2 Programming
The unprogrammed or erase state of an EEPROM bit is a logic 1. Programming changes the state to a
logic 0. Only EEPROM bytes in the non-protected blocks and the EE2NVR register can be programmed.
Use the following procedure to program a byte of EEPROM:
1.Clear EERAS1 and EERAS0 and set EELAT in the EE2CR.
(A)
NOTE
If using the AUTO mode, also set the AUTO bit during Step 1.
2.Write the desired data to the desired EEPROM address.
EEPGM
(C)
Go to Step 7 if AUTO is set.
, to program the byte.
3.Set the EEPGM bit.
4.Wait for time, t
5.Clear EEPGM bit.
6.Wait for time, t
, for the programming voltage to fall. Go to Step 8.
EEFPV
7.Poll the EEPGM bit until it is cleared by the internal timer.
8.Clear EELAT bits.
(E)
NOTE
A. EERAS1 and EERAS0 must be cleared for programming. Setting the
EELAT bit configures the address and data buses to latch data for
programming the array. Only data with a valid EEPROM-2 address will be
latched. If EELAT is set, other writes to the EE2CR will be allowed after a
valid EEPROM-2 write.
B. If more than one valid EEPROM write occurs, the last address and data
will be latched overriding the previous address and data. Once data is
written to the desired address, do not read EEPROM-2 locations other than
the written location. (Reading an EEPROM location returns the latched data
and causes the read address to be latched).
C. The EEPGM bit cannot be set if the EELAT bit is cleared or a non-valid
EEPROM address is latched. This is to ensure proper programming
sequence. Once EEPGM is set, do not read any EEPROM-2 locations;
otherwise, the current program cycle will be unsuccessful. When EEPGM
is set, the on-board programming sequence will be activated.
(B)
(D)
D. The delay time for the EEPGM bit to be cleared in AUTO mode is less
than t
EEPGM
. However, on other MCUs, this delay time may be different.
For forward compatibility, software should not make any dependency on
this delay time.
E. Any attempt to clear both EEPGM and EELAT bits with a single
instruction will only clear EEPGM. This is to allow time for removal of high
voltage from the EEPROM-2 array.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
90Freescale Semiconductor
Functional Description
7.4.5.3 EEPROM-2 Erasing
The programmed state of an EEPROM bit is logic 0. Erasing changes the state to a logic 1. Only
EEPROM-2 bytes in the non-protected blocks and the EE2NVR register can be erased.
Use the following procedure to erase a byte, block or the entire EEPROM-2 array:
1.Configure EERAS1 and EERAS0 for byte, block or bulk erase; set EELAT in EE2CR.
(A)
NOTE
If using the AUTO mode, also set the AUTO bit in Step 1.
2.Byte erase: write any data to the desired address.
(B)
Block erase: write any data to an address within the desired block.
Bulk erase: write any data to an address within the array.
3.Set the EEPGM bit.
4.Wait for a time: t
(C)
Go to Step 7 if AUTO is set.
EEBYTE
for byte erase; t
EEBLOCK
for block erase; t
5.Clear EEPGM bit.
6.Wait for a time, t
, for the erasing voltage to fall. Go to Step 8.
EEFPV
7.Poll the EEPGM bit until it is cleared by the internal timer.
8.Clear EELAT bits.
(E)
NOTE
A. Setting the EELAT bit configures the address and data buses to latch
data for erasing the array. Only valid EEPROM-2 addresses will be latched.
If EELAT is set, other writes to the EE2CR will be allowed after a valid
EEPROM-2 write.
B. If more than one valid EEPROM write occurs, the last address and data
will be latched overriding the previous address and data. Once data is
written to the desired address, do not read EEPROM-2 locations other than
the written location. (Reading an EEPROM location returns the latched data
and causes the read address to be latched).
(B)
(D)
(B)
EEBULK.
for bulk erase.
C. The EEPGM bit cannot be set if the EELAT bit is cleared or a non-valid
EEPROM address is latched. This is to ensure proper programming
sequence. Once EEPGM is set, do not read any EEPROM-2 locations;
otherwise, the current program cycle will be unsuccessful. When EEPGM
is set, the on-board programming sequence will be activated.
D. The delay time for the EEPGM bit to be cleared in AUTO mode is less
than t
EEBYTE /tEEBLOCK/tEEBULK
. However, on other MCUs, this delay time
may be different. For forward compatibility, software should not make any
dependency on this delay time.
E. Any attempt to clear both EEPGM and EELAT bits with a single
instruction will only clear EEPGM. This is to allow time for removal of high
voltage from the EEPROM-2 array.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor91
EEPROM-2 Memory
7.5 EEPROM-2 Register Descriptions
Four I/O registers and three nonvolatile registers control program, erase and options of the EEPROM-2
array.
7.5.1 EEPROM-2 Control Register
This read/write register controls programming/erasing of the array.
Address:$FF7D
Bit 7654321Bit 0
Read:
UNUSED
Write:
Reset:00000000
Figure 7-2. EEPROM-2 Control Register (EE2CR)
Bit 7— Unused bit
This read/write bit is software programmable but has no functionality.
EEOFF — EEPROM-2 power down
This read/write bit disables the EEPROM-2 module for lower power consumption. Any attempts to
access the array will give unpredictable results. Reset clears this bit.
EERAS1 and EERAS0 — Erase/Program Mode Select Bits
These read/write bits set the erase modes. Reset clears these bits.
Table 7-3. EEPROM-2 Program/Erase Mode Select
EEBPxEERAS1EERAS0MODE
000Byte Program
001Byte Erase
010Block Erase
011Bulk Erase
1XXNo Erase/Program
X = don’t care
EELAT — EEPROM-2 Latch Control
This read/write bit latches the address and data buses for programming the EEPROM-2 array. EELAT
cannot be cleared if EEPGM is still set. Reset clears this bit.
1 = Buses configured for EEPROM-2 programming or erase operation
0 = Buses configured for normal operation
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
92Freescale Semiconductor
EEPROM-2 Register Descriptions
AUTO — Automatic Termination of Program/Erase Cycle
When AUTO is set, EEPGM is cleared automatically after the program/erase cycle is terminated by
the internal timer.
(See note D for 7.4.5.2 EEPROM-2 Programming, 7.4.5.3 EEPROM-2 Erasing, and 28.1.13 EEPROM
Memory Characteristics)
1 = Automatic clear of EEPGM is enabled
0 = Automatic clear of EEPGM is disabled
EEPGM — EEPROM-2 Program/Erase Enable
This read/write bit enables the internal charge pump and applies the programming/erasing voltage to
the EEPROM-2 array if the EELAT bit is set and a write to a valid EEPROM-2 location has occurred.
Reset clears the EEPGM bit.
1 = EEPROM-2 programming/erasing power switched on
0 = EEPROM-2 programming/erasing power switched off
NOTE
Writing logic 0s to both the EELAT and EEPGM bits with a single instruction
will clear EEPGM only to allow time for the removal of high voltage.
7.5.2 EEPROM-2 Array Configuration Register
The EEPROM-2 array configuration register configures EEPROM-2 security and EEPROM-2 block
protection.
This read-only register is loaded with the contents of the EEPROM-2 nonvolatile register (EE2NVR) after
a reset.
The EE2NVR will leave the factory programmed with $F0 such that the full
array is available and unprotected.
7.5.4 EEPROM-2 Timebase Divider Register
The 16-bit EEPROM-2 timebase divider register consists of two 8-bit registers: EE2DIVH and EE2DIVL.
The 11-bit value in this register is used to configure the timebase divider circuit to obtain the 35 µs
timebase for EEPROM-2 control.
These two read/write registers are respectively loaded with the contents of the EEPROM-2 timebase
divider nonvolatile registers (EE2DIVHNVR and EE2DIVLNVR) after a reset.
Address:$FF7A
Bit 7654321Bit 0
Read:
EEDIVS-
Write:
Reset:Contents of EE2DIVHNVR ($FF70); Bits[6:3] = 0
ECD
0000
= Unimplemented
EEDIV10EEDIV9EEDIV8
Figure 7-5. EE2DIV Divider High Register (EE2DIVH)
Address:$FF7B
Bit 7654321Bit 0
Read:
Write:
Reset:Contents of EE2DIVLNVR ($FF71)
EEDIV7EEDIV6EEDIV5EEDIV4EEDIV3EEDIV2EEDIV1EEDIV0
Figure 7-6. EE2DIV Divider Low Register (EE2DIVL)
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor95
EEPROM-2 Memory
EEDIVSECD — EEPROM-2 Divider Security Disable
This bit enables/disables the security feature of the EE2DIV registers. When EE2DIV security feature
is enabled, the state of the registers EE2DIVH and EE2DIVL are locked (including EEDIVSECD bit).
The EE2DIVHNVR and EE2DIVLNVR nonvolatile memory registers are also protected from being
erased/programmed.
These prescaler bits store the value of EE2DIV which is used as the divisor to derive a timebase of
35µs from the selected reference clock source (CGMXCLK or bus block in the CONFIG-2 register) for
the EEPROM-2 related internal timer and circuits. EEDIV[10:0] bits are readable at any time. They are
writable when EELAT = 0 and EEDIVSECD = 1.
The EE2DIV value is calculated by the following formula:
EE2DIV= INT[Reference Frequency(Hz) x 35 x10
-6
+0.5]
Where the result inside the bracket is rounded down to the nearest integer value
For example, if the reference frequency is 4.9152MHz, the EE2DIV value is 172
NOTE
Programming/erasing the EEPROM with an improper EE2DIV value may
result in data lost and reduce endurance of the EEPROM device.
The 16-bit EEPROM-2 timebase divider nonvolatile register consists of two 8-bit registers: EE2DIVHNVR
and EE2DIVLNVR. The contents of these two registers are respectively loaded into the EEPROM-2
timebase divider registers, EE2DIVH and EE2DIVL, after a reset.
These two registers are erased and programmed in the same way as an EEPROM-2 byte.
Address:$FF70
Bit 7654321Bit 0
Read:
EEDIVS-
Write:
Reset:Unaffected by reset; $FF when blank
ECD
R=Reserved
Figure 7-7. EEPROM-2 Divider Nonvolatile Register High (EE2DIVHNVR))
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
96Freescale Semiconductor
Low-Power Modes
These two registers are protected from erase and program operations if the EEDIVSECD is set to logic 1
in EE2DIVH or programmed to a logic 1 in EE2DIVHNVR.
NOTE
Once EEDIVSECD in the EE2DIVHNVR is programmed to 0 and after a
system reset, the EE2DIV security feature is permanently enabled because
the EEDIVSECD bit in the EE2DIVH is always loaded with 0 thereafter.
Once this security feature is armed, erase and program mode are disabled
for EE2DIVHNVR and EE2DIVLNVR. Modifications to the EE2DIVH and
EE2DIVL registers are also disabled. Therefore, care should be taken
before programming a value into the EE2DIVHNVR.
7.6 Low-Power Modes
The WAIT and STOP instructions can put the MCU in low power-consumption standby modes.
7.6.1 Wait Mode
The WAIT instruction does not affect the EEPROM. It is possible to start the program or erase sequence
on the EEPROM and put the MCU in wait mode.
7.6.2 Stop Mode
The STOP instruction reduces the EEPROM power consumption to a minimum. The STOP instruction
should not be executed while a programming or erasing sequence is in progress.
If stop mode is entered while EELAT and EEPGM are set, the programming sequence will be stopped
and the programming voltage to the EEPROM array removed. The programming sequence will be
restarted after leaving stop mode; access to the EEPROM is only possible after the programming
sequence has completed.
If stop mode is entered while EELAT and EEPGM is cleared, the programming sequence will be
terminated abruptly.
In either case, the data integrity of the EEPROM is not guaranteed.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor97
EEPROM-2 Memory
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
98Freescale Semiconductor
Chapter 8
Central Processor Unit (CPU)
8.1 Introduction
The M68HC08 CPU (central processor unit) is an enhanced and fully object-code-compatible version of
the M68HC05 CPU. The CPU08 Reference Manual (document order number CPU08RM/AD) contains a
description of the CPU instruction set, addressing modes, and architecture.
8.2 Features
Features 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
8.3 CPU Registers
Figure 8-1 shows the five CPU registers. CPU registers are not part of the memory map.
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
Freescale Semiconductor99
Central Processor Unit (CPU)
7
15
HX
15
15
70
V11H I NZC
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 8-1. CPU Registers
8.3.1 Accumulator
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 8-2. Accumulator (A)
8.3.2 Index Register
The 16-bit index register allows indexed addressing of a 64-Kbyte 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.
Bit
151413121110987654321
Read:
Write:
Reset:00000000XXXXXXXX
X = Indeterminate
Figure 8-3. Index Register (H:X)
Bit
0
MC68HC908AZ60A • MC68HC908AS60A Data Sheet, Rev. 5
100Freescale 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.