MCF51QE64 MCF51QE32
Page
MCF51QE128 Series Features
Page
MCF51QE128 Reference Manual
MCF51QE128 MCU Series Reference Manual, Rev
Contents
Section Number Title
Chapter Resets, Interrupts, and General System Control
Freescale Semiconductor
Title Chapter Parallel Input/Output Control
127
ColdFire Core
Chapter Interrupt Controller CF1INTC
Analog Comparator 3V ACMPVLPV1
11.1.5
Internal Clock Source S08ICSV3
Section Number Title
Chapter Inter-Integrated Circuit S08IICV2
Real-Time Counter S08RTCV1
Serial Peripheral Interface S08SPIV3
Chapter Timer/Pulse-Width Modulator S08TPMV3
Chapter Version 1 ColdFire Debug CF1DEBUG
Appendix a Revision History
MCF51QE128 Series Features by MCU and Package
Feature MCF51QE128
Chapter Device Overview
Devices in the MCF51QE128/64/32 Series
MCU Block Diagram
Xosc
MCF51QE128/64/32 Block Diagram
V1 ColdFire Core
System Clocks
Internal Clock Source ICS Module
Module Versions
Simplified ICS Block Diagram
System Clock Distribution
Icsirclk
FLL Bypassed Internal Low-Power Fbilp
ICS Modes of Operation
FLL Engaged Internal FEI
FLL Engaged External FEE
FLL Bypassed External Low-Power Fbelp
Stop Stop
Get the latest version from freescale.com
Get the latest version from freescale.com
Chapter Pins and Connections
Device Pin Assignment
Pins in bold are added from the next smaller package
Pin Lqfp
Recommended System Connections
Basic System Connections
Reset and Rsto
Power
Oscillator
Background / Mode Select BKGD/MS
ADC Reference Pins VREFH, Vrefl
General-Purpose I/O and Peripheral Ports
Pin Assignment by Package and Pin Sharing Priority
Pin
Priority
Number Port Pin Alt
Number
Port Pin Alt
Get the latest version from freescale.com
Chapter Modes of Operation
Features
Introduction
MCF51QE128/64/32 Power Modes Conceptual Drawing
Overview
CPU / Power Mode Selections
PMC
Mode Regulator State
Stop3
Full On
Run Stop2 LPrun
Triggers for Transitions Shown in Figure
Transition # From Trigger
Debug Mode
Secure Mode
Run Mode
Low-Power Run Mode LPrun
BDM in Low-Power Run Mode
Run Modes
Wait Mode
Low-Power Wait Mode LPwait
BDM in Low-Power Wait Mode
Wait Modes
Stop2 Mode
Stop4 Low Voltage Detect or BDM Enabled in Stop Mode
Stop3 Mode
Low-Range Oscillator Considerations for Stop2
On-Chip Peripheral Modules in Stop and Low-Power Modes
Low-Power Mode Behavior
Abbreviations used in Table
CF1CORE
BDC
COP
ICS
IRQ
Get the latest version from freescale.com
Get the latest version from freescale.com
Chapter Memory
MCF51QE128/64/32 Memory Map
Kbytes
RAM
CPU Access Type Allowed by Region
Register Addresses and Bit Assignments
Read Write Base Address Region Byte
Long Byte
ColdFire Memory Organization
Direct-Page Register Summary Sheet 1
Direct-Page Register Summary Sheet 2
Register Address Name
Direct-Page Register Summary Sheet 3
Direct-Page Register Summary Sheet 4
High-Page Register Summary Sheet 1
High-Page Register Summary Sheet 2
High-Page Register Summary Sheet 3
High-Page Register Summary Sheet 4
Flash Module Reserved Memory Locations
High-Page Register Summary Sheet 5
Reserved Flash Memory Addresses
0x0 0x1 0x2 0x3
0x0 0x1 0x2 0x3 0x00000408
0x0000040C
Reserved Flash Memory Addresses Register
Nvprot
ColdFire Rapid Gpio Memory Map
ColdFire Interrupt Controller Memory Map
V1 ColdFire Rapid Gpio Memory Map
V1 ColdFire Interrupt Controller Memory Map
RAM
Flash
Intcsfrc
Intccfrc
Lov-Voltage Programming Sequence Example
Features
Addresses Desired Value Values Programmed
Register Descriptions
Flash Clock Divider Register Fcdiv
Flash Options Register Fopt and Nvopt
Fcdiv Field Descriptions
Flash Configuration Register Fcnfg
10. Fopt Field Descriptions
Flash Protection Register Fprot and Nvprot
11. Fcnfg Field Descriptions
12. Fprot Field Descriptions
13. Flash Protection Address Range
0x00-0x3F
0x40
0x41 0x00000-0x1EFFF
0x42
Command buffers are full
Flash Status Register Fstat
Fcbef Fccf Fpviol Faccerr Fblank
W1c
Flash Command Operations
Flash Command Register Fcmd
Function Description
15. Fcmd Field Descriptions
Writing the Fcdiv Register
200 195 ⎟ 200 = 3%
Command Write Sequence
Commands Impossible
Start
ALL Program and Erase
Flash Commands
Erase Verify Command
16. Flash Command Description
Fcmd NVM
Program Command
11. Example Program Command Flow
Burst Program Command
Sector Erase Command
Command Buffer Empty
Sequential
Programming
13. Example Sector Erase Command Flow
Mass Erase Command
14. Example Mass Erase Command Flow
Flash Access Violations
Illegal Flash Operations
Wait Mode
Background Debug Mode
Operating Modes
Flash Protection Violations
Unsecuring the MCU using Backdoor Key Access
Security
Resets
Flash Reset Sequence
Reset While Flash Command Active
Program and Erase Times
Security
Sync
Set PRDIV8 and clock divider fields in CSR3
Stop
Device is unsecure
Chapter Resets, Interrupts, and General System Control
Microcontroller Reset
COP Configuration Options
Computer Operating Properly COP Watchdog
Control Bits Clock Source COP Overflow Count
Copclks Copt
Illegal Operation Reset
Illegal Address Reset
Pin Configuration Options
Interrupts and Exceptions
Power-On Reset Operation
Low-Voltage Detect LVD System
Edge and Level Sensitivity
External Interrupt Initialization
LVD Reset Operation
Peripheral Clock Gating
LVD Interrupt Operation
Low-Voltage Warning LVW Interrupt Operation
Interrupt Pin Request Status and Control Register Irqsc
Irqsc Register Field Descriptions
Irqpdd Irqedg Irqpe Irqf Irqie Irqmod Irqack
Irqpdd
System Reset Status Register SRS
POR
System Options Register 1 SOPT1
POR LVR
System Options Register 2 SOPT2
SOPT1 Register Field Descriptions
System Device Identification Register SDIDH, Sdidl
SOPT2 Register Field Descriptions
SPI1PS SPSCLK1 MOSI1 MISO1 SS1
IIC1PS SDA1 SCL1
Sdidl Register Field Descriptions
Sdidh Register Field Descriptions
Lvdf Lvdie LVDRE2 Lvdse LVDE2 Bgbe Lvdack
SPMSC1 Register Field Descriptions
LPR Lprs Lpwui Ppde Ppdc Ppdack
SPMSC2 Register Field Descriptions
11. LVD and LVW Trip Point Typical Values1
Lvwf Lvdv Lvwv Lvwie
Lvwf
Lvdvlvwv
System Clock Gating Control 1 Register SCGC1
System Clock Gating Control 2 Register SCGC2
12. SCGC1 Register Field Descriptions
TPM3
RTC SPI2 SPI1
13. SCGC2 Register Field Descriptions
FLS
Freescale Semiconductor 109
110 Freescale Semiconductor
Freescale Semiconductor 111
112 Freescale Semiconductor
Port Data and Data Direction
Chapter Parallel Input/Output Control
Freescale Semiconductor 113
Port Internal Pull-up Enable
Port Slew Rate Enable
Pull-up, Slew Rate, and Drive Strength
Data Direction Control Port Data Register Port Read
Port Drive Strength Select
Port Data Set, Clear and Toggle Data Registers
Freescale Semiconductor 115
V1 ColdFire Rapid Gpio Functionality
Keyboard Interrupts
Port Data Set Registers
Port Data Clear Registers
Edge Only Sensitivity
Edge and Level Sensitivity
Pull-up/Pull-down Resistors
Freescale Semiconductor 117
Pin Behavior in Stop Modes
Parallel I/O, Keyboard Interrupt, and Pin Control Registers
Keyboard Interrupt Initialization
Port a Registers
Port a Pull Enable Register Ptape
Port a Data Register Ptad
Port a Data Direction Register Ptadd
PTAD7 PTAD6 PTAD5 PTAD41 PTAD3 PTAD2 PTAD1 PTAD0
Port a Slew Rate Enable Register Ptase
Port a Drive Strength Selection Register Ptads
PTAPE7 PTAPE6 PTAPE5 PTAPE4 PTAPE3 PTAPE2 PTAPE1 PTAPE0
PTASE7 PTASE6 PTASE5 PTASE4 PTASE3 PTASE2 PTASE1 PTASE0
Port B Registers
Port B Data Register Ptbd
Port B Data Direction Register Ptbdd
Ptads Register Field Descriptions
Port B Pull Enable Register Ptbpe
Port B Slew Rate Enable Register Ptbse
Ptbdd Register Field Descriptions
Ptbpe Register Field Descriptions
Port C Registers
Port B Drive Strength Selection Register Ptbds
Port C Data Register Ptcd
10. Ptbds Register Field Descriptions
Port C Data Direction Register Ptcdd
Port C Data Set Register Ptcset
Port C Data Clear Register Ptcclr
12. Ptcdd Register Field Descriptions
Port C Pull Enable Register Ptcpe
Port C Toggle Register Ptctog
14. Ptcclr Register Field Descriptions
16. Ptcpe Register Field Descriptions
Port C Slew Rate Enable Register Ptcse
Port D Registers
Port C Drive Strength Selection Register Ptcds
Port D Data Register Ptdd
Port D Pull Enable Register Ptdpe
Port D Data Direction Register Ptddd
19. Ptdd Register Field Descriptions
20. Ptddd Register Field Descriptions
Port D Slew Rate Enable Register Ptdse
Port E Registers
Port D Drive Strength Selection Register Ptdds
Port E Data Register Pted
Port E Data Direction Register Ptedd
Port E Data Set Register Pteset
24. Pted Register Field Descriptions
25. Ptedd Register Field Descriptions
Port E Pull Enable Register Ptepe
Port E Data Clear Register Pteclr
Port E Toggle Register Ptetog
PTEPE7 PTEPE6 PTEPE5 PTEPE4 PTEPE3 PTEPE2 PTEPE1 PTEPE0
Port E Slew Rate Enable Register Ptese
Port E Drive Strength Selection Register Pteds
29. Ptepe Register Field Descriptions
30. Ptese Register Field Descriptions
Port F Pull Enable Register Ptfpe
Port F Registers
Port F Data Register Ptfd
Port F Data Direction Register Ptfdd
Port F Slew Rate Enable Register Ptfse
Port F Drive Strength Selection Register Ptfds
34. Ptfpe Register Field Descriptions
35. Ptfse Register Field Descriptions
Port G Registers
Port G Data Register Ptgd
Port G Data Direction Register Ptgdd
36. Ptfds Register Field Descriptions
Port G Pull Enable Register Ptgpe
Port G Slew Rate Enable Register Ptgse
Port G Drive Strength Selection Register Ptgds
39. Ptgpe Register Field Descriptions
Port H Registers
Port H Data Register Pthd
Port H Data Direction Register Pthdd
41. Ptgds Register Field Descriptions
Port H Pull Enable Register Pthpe
Port H Slew Rate Enable Register Pthse
Port H Drive Strength Selection Register Pthds
44. Pthpe Register Field Descriptions
Port J Data Register Ptjd
Port J Registers
Port J Data Direction Register Ptjdd
Port J Pull Enable Register Ptjpe
Port J Slew Rate Enable Register Ptjse
Port J Drive Strength Selection Register Ptjds
49. Ptjpe Register Field Descriptions
Keyboard Interrupt 1 KBI1 Registers
10.1 KBI1 Interrupt Status and Control Register KBI1SC
51. Ptjds Register Field Descriptions
52. KBI1 Pin Mapping
10.2 KBI1 Interrupt Pin Select Register KBI1PE
Keyboard Interrupt 1 KBI2 Registers
10.3 KBI1 Interrupt Edge Select Register KBI1ES
11.1 KBI2 Interrupt Status and Control Register KBI2SC
11.2 KBI2 Interrupt Pin Select Register KBI2PE
57. KBI2SC Register Field Descriptions
58. KBI2PE Register Field Descriptions
59. KBI2ES Register Field Descriptions
11.3 KBI2 Interrupt Edge Select Register KBI2ES
Freescale Semiconductor 143
144 Freescale Semiconductor
Chapter ColdFire Core
Overview
Memory Map/Register Description
Supervisor/User Access Registers
Supervisor Access Only Registers
Data Registers D0-D7
ColdFire Core Programming Model
Supervisor/User Stack Pointers A7 and OTHERA7
Address Registers A0-A6
Data
Condition Code Register CCR
Freescale Semiconductor 149
Vector Base Register VBR
Program Counter PC
CCR Field Descriptions
CPU Configuration Register Cpucr
SR Field Descriptions
Status Register SR
BWD
Functional Description
Instruction Set Architecture Isac
Instruction Enhancements over Revision Isaa
Instruction Description
Exception Processing Overview
Vector Stacked
Exception Vector Assignments
Assignment Numbers Offset Hex Counter
Exception Stack Frame Definition
Assignment
Numbers Offset Hex Counter
SSP →
Fault Status Encodings
2.2 S08 and ColdFire Exception Processing Comparison
Format Field Encodings
FS30 Definition
Attribute S08 V1 ColdFire
Exception Processing Comparison
RTI RTE
Access Error Exception
Address Error Exception
Processor Exceptions
Freescale Semiconductor 159
Illegal Instruction Exception
10. ColdFire Opword Line Definition
Line OpMode Effective Address
OpwordLine Instruction Class
Trace Exception
Privilege Violation
Freescale Semiconductor 161
RTE and Format Error Exception
Unimplemented Line-A Opcode
Unimplemented Line-F Opcode
Debug Interrupt
Fault-on-Fault Halt
Trap Instruction Exception
Unsupported Instruction Exception
Interrupt Exception
Reset Exception
Access User read-only BDM read-only
BDM Load 0x60 D0 Store 0x40 D0
VER REV
11. D0 Hardware Configuration Info Field Description
Flashsz
12. D1 Hardware Configuration Information Field Description
Sramsz
Instruction Execution Timing
Timing Assumptions
13. Misaligned Operand References
Address10 Size Bus Additional Operations CR/W
Move Instruction Execution Times
14. Move Byte and Word Execution Times
15. Move Long Execution Times
Source Destination Ax+ D16,Ax D8,Ax,Xi*SF Xxx.wl
16. One Operand Instruction Execution Times
Standard One Operand Instruction Execution Times
Effective Address Opcode An+ D16,An D8,An,Xn*SF Xxx.wl #xxx
Standard Two Operand Instruction Execution Times
17. Two Operand Instruction Execution Times
18. Miscellaneous Instruction Execution Times
Miscellaneous Instruction Execution Times
Opcode Effective Address An+ D16,An D8,An,Xn*SF Xxx.wl #xxx
19. General Branch Instruction Execution Times
Branch Instruction Execution Times
20. Bcc Instruction Execution Times
Attribute
Chapter Interrupt Controller CF1INTC
HCS08
Interrupt Controller CF1INTC
V1 ColdFire Exception Vector Table
0x134 Next SCI1rx 0x138 SCI1tx 0x13C IICx 0x140 KBIx 0x144
0x148 Next ACMPx 0x14C
0x150 Next SCI2rx 0x154 SCI2tx 0x158
0x180 Next
To V1 ColdFire core
Interrupt Source Number
Freescale Semiconductor 177
Memory Map and Register Definition
External Signal Description
Modes of Operation
Intc Force Interrupt Register Intcfrc
Memory Map
CF1INTC Memory Map
Intcfrc Field Descriptions
INTCPL6P7,6 Field Descriptions
Intc Wake-up Control Register Intcwcr
Freescale Semiconductor 181
Intcwcr Field Descriptions
Intc Set Interrupt Force Register Intcsfrc
ENB
Intc Clear Interrupt Force Register Intccfrc
Intcsfrc Field Descriptions
Intccfrc Field Descriptions
Offset CF1INTCBASE + 0x1F Intccfrc
Intc Software and Level-nIACK Registers n = 1,2,3,...,7
Vecn Swiack
Interrupt Request Level and Priority Assignments
INTCSWIACK, INTCLVLnIACK Field Descriptions
10. Legend for Table
Priority within Level Midpoint
TPM1ch0 TPM1ch1 TPM1ch2 TPM1ovfl
12. V1 ColdFire Interrupt Assignments
TPM2ch0 TPM2ch1 TPM2ch2 TPM2ovfl
Handling of Non-Maskable Level 7 Interrupt Requests
Application Information
Initialization Information
Emulation of the HCS08’s 1-Level IRQ Handling
More on Software IACKs
Using INTCPL6P7,6 Registers
Freescale Semiconductor 189
ISR Code Snippet with Swiack
Freescale Semiconductor 191
192 Freescale Semiconductor
Chapter Rapid Gpio Rgpio
Freescale Semiconductor 193
V1 ColdFire Core
Freescale Semiconductor 195
IFP
Core
OEP Dsoc
RAM Rgpio
Rgpio
Module
Pin Muxing + Pad Logic On-platform Bus
RGPIODATA150
Rgpio Module External I/O Signals
Detailed Signal Descriptions
Rgpio Detailed Signal Descriptions
Rgpio Write Memory Map
Memory Map/Register Definition
Rgpio Read Memory Map
Rgpio Data Direction Rgpiodir
Rgpio Data Rgpiodata
Rgpiodir Field Descriptions
DIR
Rgpio Pin Enable Rgpioenb
Rgpio Clear Data Rgpioclr
Rgpio Set Data Rgpioset
Rgpio Toggle Data Rgpiotog
Rgpioclr Field Descriptions
Rgpioset Field Descriptions
Application 1 Simple Square-Wave Generation
10. Rgpiotog Field Descriptions
TOG
Field Description 15-0 Rgpio Toggle Data
11. Square-Wave Output Performance
12. Emulated SPI Performance using Gpio Outputs
SPI Speed @ Relative CPU f = 50 MHz
29x
Freescale Semiconductor 205
206 Freescale Semiconductor
Acmp Configuration Information
ACMP/TPM Configuration Information
Chapter Analog Comparator 3V ACMPVLPV1
Acmp Clock Gating
Interrupt Vectors
Freescale Semiconductor 209
210 Freescale Semiconductor
Block Diagram
Wait Mode Operation
Stop3 Mode Operation
Stop2 Mode Operation
Register Definition
Status and Control Register ACMPxSC
Acbgs Acpe
Acie ACF AC IRQ ACMP1 ACMP0 ACO ACMOD1 ACMOD2 SET ACF
Interrupts
ACMPxSC Field Descriptions
Acme
Acmod
214 Freescale Semiconductor
ADC Clock Gating
Chapter Analog-to-Digital Converter S08ADC12V1
Freescale Semiconductor 215
Analog-to-Digital Converter S08ADC12V1
Module Configurations
Channel Assignments
Alternate Clock
ADC Channel Assignment
Temperature Sensor
Hardware Trigger
2provides a block diagram of the ADC module
Freescale Semiconductor 219
Name Function
Signal Properties
AD27-AD0
Analog Power Vddad
Analog Ground Vssad
Voltage Reference High Vrefh
Voltage Reference Low Vrefl
Input Channel Select
Coco
Input Select
Status and Control Register 2 ADCSC2
Data Result High Register Adcrh
ADCSC2 Register Field Descriptions
Adact
Data Result Low Register Adcrl
Compare Value High Register Adccvh
ADR10 ADR9 ADR8
ADCV11 ADCV10 ADCV9 ADCV8
Configuration Register Adccfg
Compare Value Low Register Adccvl
Adccfg Register Field Descriptions
Adlpc
Pin Control 1 Register APCTL1
Clock Divide Select
Conversion Modes
Input Clock Select
10. APCTL1 Register Field Descriptions
Pin Control 2 Register APCTL2
ADPC15 ADPC14 ADPC13 ADPC12 ADPC11 ADPC10 ADPC9 ADPC8
Pin Control 3 Register APCTL3
11. APCTL2 Register Field Descriptions
ADPC15
ADPC23
12. APCTL3 Register Field Descriptions
ADPC21
ADPC20
ADPC16
Clock Select and Divide Control
Input Select and Pin Control
Hardware Trigger
Conversion Control
Initiating Conversions
Completing Conversions
Aborting Conversions
Freescale Semiconductor 231
Power Control
Sample Time and Total Conversion Time
13. Total Conversion Time vs. Control Conditions
Adiclk Adlsmp
MCU Wait Mode Operation
Automatic Compare Function
MCU Stop3 Mode Operation
MCU Stop2 Mode Operation
Stop3 Mode With Adack Disabled
Stop3 Mode With Adack Enabled
ADC Module Initialization Example
Initialization Sequence
Pseudo-Code Example
Freescale Semiconductor 235
External Pins and Routing
Reset Initialize ADC Adccfg = ADCSC2 = ADCSC1 = Check No
COCO=1?
Yes Read Adcrh Then Adcrl To Clear Coco Bit Continue
Analog Supply Pins
Analog Reference Pins
Analog Input Pins
Freescale Semiconductor 237
Sources of Error
Sampling Error
Pin Leakage Error
Noise-Induced Errors
Code Width and Quantization Error
Linearity Errors
Lsb =
Freescale Semiconductor 239
Code Jitter, Non-Monotonicity, and Missing Codes
Freescale Semiconductor 241
242 Freescale Semiconductor
Stop2 Mode Considerations
Chapter Internal Clock Source S08ICSV3
External Oscillator
Freescale Semiconductor 243
Internal Clock Source S08ICSV3
Freescale Semiconductor 245
246 Freescale Semiconductor
HGO, RANGE, EREFS, ERCLKEN, Erefsten
Freescale Semiconductor 247
2is the ICS block diagram
FLL Bypassed Internal Low Power Fbilp
FLL Bypassed External Low Power Fbelp
ICS Register Summary
Rdiv Irefs
ICS Control Register 1 ICSC1
ICSC1 Field Descriptions
Clks Rdiv Irefs Irclken Irefsten
Reference Divide Factor
ICS Control Register 2 ICSC2
ICS Trim Register Icstrm
ICSC2 Field Descriptions
Bdiv Range HGO Erefs Erclken Erefsten
ICS Status and Control Icssc
Icstrm Field Descriptions
Icssc Field Descriptions
DMX32 Irefst Clkst Oscinit FTRIM1 DRS
Reference range FLL factor DCO range
512 16 20 MHz
608 19.92 MHz
1024 32 40 MHz
Operational Modes
FLL Engaged Internal FEI
IREFS=1 CLKS=00 IREFS=0
IREFS=0 CLKS=10
FLL Bypassed Internal Low Power Fbilp
FLL Engaged External FEE
FLL Bypassed Internal FBI
FLL Bypassed External FBE
Mode Switching
FLL Bypassed External Low Power Fbelp
Bus Frequency Divider
Stop
Low Power Bit Usage
DCO Maximum Frequency with 32.768 kHz Oscillator
Internal Reference Clock
External Reference Clock
Fixed Frequency Clock
Local Clock
Module Configuration
Chapter Inter-Integrated Circuit S08IICV2
IIC1 Position Options
SOPT2IIC1PS
MCF51QE128 Series Block Diagram Highlighting the IIC Modules
Freescale Semiconductor 261
262 Freescale Semiconductor
SDA Serial Data Line
SCL Serial Clock Line
Freescale Semiconductor 263
IIC Address Register Iica
IIC Frequency Divider Register Iicf
Iica Field Descriptions
= Unimplemented or Reserved
Iicf Field Descriptions
Hold Time Values for 8 MHz Bus Speed
Hold Times μs
Mult ICR SDA
IIC Divider and Hold Values
ICR SCL
IIC Control Register IICC1
IICC1 Field Descriptions
Iics Field Descriptions
IIC Status Register Iics
TCF
IIC Data I/O Register Iicd
IIC Control Register 2 IICC2
Iicd Field Descriptions
Freescale Semiconductor 269
IICC2 Field Descriptions
IIC Protocol
Gcaen
Slave Address Transmission
Start Signal
Freescale Semiconductor 271
Stop Signal
Repeated Start Signal
Arbitration Procedure
Data Transfer
Clock Synchronization
Handshaking
Clock Stretching
Freescale Semiconductor 273
Master-Transmitter Addresses a Slave-Receiver
13.4.2 10-bit Address
Master-Receiver Addresses a Slave-Transmitter
Resets
General Call Address
Byte Transfer Interrupt
Address Detect Interrupt
276 Freescale Semiconductor
Initialization/Application Information
Module Initialization Slave
Module Initialization Master
Module Use
12. Typical IIC Interrupt Routine
Freescale Semiconductor 279
280 Freescale Semiconductor
Chapter Real-Time Counter S08RTCV1
ADC Hardware Trigger
RTC Clock Sources
RTC Modes of Operation
Interrupt Vector
MCF51QE128 Block Diagram Highlighting RTC Block and Pins
Freescale Semiconductor 283
Active Background Mode
RTC Register Summary
LPO
Erclk
Irclk
RTC Status and Control Register Rtcsc
Rtcsc Field Descriptions
RTC Prescaler Divide-by values
Rtif
RTC Counter Register Rtccnt
RTC Modulo Register Rtcmod
Rtccnt Field Descriptions
Rtcmod Field Descriptions
RTC Operation Example
Prescaler Period
Rtcps
KHz Internal Clock MHz External Clock Rtclks =
Internal 1-kHz Clock Source RTC Clock Rtcps =
Rtccnt Rtif
0x52 0x53 0x54 0x55 0x00 0x01
Freescale Semiconductor 289
290 Freescale Semiconductor
SCI Clock Gating
Chapter Serial Communications Interface S08SCIV4
Freescale Semiconductor 291
Serial Communications Interface S08SCIV4
Module Initialization
294 Freescale Semiconductor
Freescale Semiconductor 295
3shows the transmitter portion of the SCI
SCI Receiver Block Diagram
Freescale Semiconductor 297
SCIxBDH Field Descriptions
SCI Baud Rate Registers SCIxBDH, SCIxBDL
Lbkdie
SCI Control Register 1 SCIxC1
SCIxBDL Field Descriptions
Loops Sciswai Rsrc Wake ILT
Loops
SCIxC2 Field Descriptions
SCI Control Register 2 SCIxC2
TIE
SCI Status Register 1 SCIxS1
Tdre Rdrf Idle
Framing error
No parity error
Parity error
SCIxD
SCI Status Register 2 SCIxS2
SCIxS2 Field Descriptions
Lbkdif Rxedgif Rxinv Rwuid BRK13 Lbkde RAF
RXINV1
SCI Control Register 3 SCIxC3
SCIxC3 Field Descriptions
Txdir
TXINV1
Baud Rate Generation
SCI Data Register SCIxD
Freescale Semiconductor 305
Transmitter Functional Description
Send Break and Queued Idle
Receiver Functional Description
Data Sampling Technique
Break Character Length
BRK13
Receiver Wakeup Operation
Idle-Line Wakeup
Interrupts and Status Flags
Freescale Semiconductor 309
Stop Mode Operation
Loop Mode
Additional SCI Functions
15.3.5.1 8- and 9-Bit Data Modes
Single-Wire Operation
Freescale Semiconductor 311
312 Freescale Semiconductor
SPI Clock Gating
Chapter Serial Peripheral Interface S08SPIV3
Freescale Semiconductor 313
MCF51QE128 Block Diagram Highlighting SPI Block and Pins
Freescale Semiconductor 315
316 Freescale Semiconductor
SPI System Block Diagram
Block Diagrams
Freescale Semiconductor 317
SPI Module Block Diagram
SPI Baud Rate Generation
Freescale Semiconductor 319
Spsck SPI Serial Clock
Mosi Master Data Out, Slave Data
Miso Master Data In, Slave Data Out
SS Slave Select
Modes of Operation
SPI in Stop Modes
SPI Control Register 1 SPIxC1
SPIxC1 Field Descriptions
Master Mode Slave Mode
SPI Control Register 2 SPIxC2
SS Pin Function
Modfen Ssoe
SPI Stop in Wait Mode
SPI Baud Rate Register SPIxBR
SPIxC2 Register Field Descriptions
Modfen Bidiroe Spiswai
SPI Status Register SPIxS
SPIxBR Register Field Descriptions
Sppr
SPR
SPI Data Register SPIxD
SPI Clock Formats
10. SPI Clock Formats Cpha =
Freescale Semiconductor 327
SPI Interrupts
11. SPI Clock Formats Cpha =
Mode Fault Detection
Freescale Semiconductor 329
330 Freescale Semiconductor
TPM Clock Gating
Chapter Timer/Pulse-Width Modulator S08TPMV3
Freescale Semiconductor 331
Timer/Pulse-Width Modulator S08TPMV3
Freescale Semiconductor 333
334 Freescale Semiconductor
Freescale Semiconductor 335
336 Freescale Semiconductor
TPM Block Diagram
Freescale Semiconductor 337
Signal Description
Extclk
Extclk External Clock Source
TPMxCHn TPM Channel n I/O Pins
Freescale Semiconductor 339
High-True Pulse of an Edge-Aligned PWM
TPM Status and Control Register TPMxSC
TPMxSC Field Descriptions
TOF Toie Cpwms Clksb Clksa PS2 PS1
TOF
TPM Counter Registers TPMxCNTHTPMxCNTL
TPM-Clock-Source Selection
Prescale Factor Selection
Clksbclksa
TPM Counter Modulo Registers TPMxMODHTPMxMODL
TPMxCNT158 Any write to TPMxCNTH clears the 16-bit counter
TPMxCNT70 Any write to TPMxCNTL clears the 16-bit counter
Freescale Semiconductor 343
TPM Channel n Status and Control Register TPMxCnSC
TPMxMOD158
TPMxMOD70
CHnF CHnIE MSnB MSnA ELSnB ELSnA
MSnBMSnA ELSnBELSnA Mode Configuration
TPMxCnSC Field Descriptions
Mode, Edge, and Level Selection
Cpwms
TPM Channel Value Registers TPMxCnVHTPMxCnVL
Mode, Edge, and Level Selection
TPMxCnV158
TPMxCnV70
Counter Clock Source
Counter
Freescale Semiconductor 347
Counter Overflow and Modulo Reset
TPM Clock Source Selection
Channel Mode Selection
Manual Counter Reset
Input Capture Mode
Output Compare Mode
Edge-Aligned PWM Mode
15. PWM Period and Pulse Width ELSnA=0
Center-Aligned PWM Mode
Freescale Semiconductor 351
Description of Reset Operation
Reset Overview
General
Timer Overflow Interrupt TOF Description
Interrupt Local Source Description Enable
Description of Interrupt Operation
Interrupt Summary
Channel Event Interrupt Description
Center-Aligned PWM Case
Chapter Version 1 ColdFire Debug CF1DEBUG
Freescale Semiconductor 355
Version 1 ColdFire Core CF1Core
OEP
PST
Bkgd BDC
Modes of Operations
Debug Revision Summary
Revision
Csrhrl CSR2D1HRL
BDM Command Types
Command Type Flash
Core Status Command Set
BDM?
Debug Module Signals Description
External Signal Descriptions
BDM GO
Debug Module Memory Map
DRc Register Name Width Access Reset Value Section Bits
CPU
Configuration/Status Register CSR
Bstat FOF TRG Halt Bkpt HRL BKD IPW
CSR Field Descriptions
TRC DDC UHE BTB NPL IPI SSM FID DDH
TRC
Xcsr Reference Summary
Extended Configuration/Status Register Xcsr
Method Reference Details
CPU Cstat Halt Stop Eseqc Clksw SEC Erase Enbdm
Apcsc Apce
Xcsr
CPU State
SEC R
Eseqc W
Erase W
Configuration/Status Register 2 CSR2
CSR2 Reference Summary
Xcsr CSR2
Syncpc Interval
CSR2 Field Descriptions
PSTBWA7
Pstb Valid Data Locations Oldest to Newest
Configuration/Status Register 3 CSR3
10. CSR3 Reference Summary
Pstbss
Start Condition Stop Condition
BFC Bfcdiv DIV8
BDM Address Attribute Register Baar
BFCDIV8
Address Attribute Trigger Register Aatr
SZM TTM TMM
Signal of the processor’s local bus
BDM memory commands Normal processor access Else Reserved
Trigger Definition Register TDR
SZM
L2ED
L2EA
L2T L1T
L1EA
L2T
Program Counter Breakpoint/Mask Registers PBR0-3, Pbmr
Three bits disables the address breakpoint
No inversion Invert data breakpoint comparators
Mask Reset
15. PBR0 Field Descriptions
DRc 0x08 PBR0
DRc 0x09 Pbmr
Address Breakpoint Registers ABLR, Abhr
17. Pbmr Field Descriptions
Abhr
Ablr
19. Abhr Field Description
Data Breakpoint and Mask Registers DBR, Dbmr
21. Dbmr Field Descriptions
Background Debug Mode BDM
22. Access Size and Operand Data Location
Address1 Access Size Operand Location
Resulting Set of Possible Trigger Combinations
CPU Halt
23. CPU Halt Sources
Halt Source Halt Timing Description
Cpucrard =
Cpucrird =
Background Debug Serial Interface Controller BDC
BDM Communication Details
15. BDC Host-to-Target Serial Bit Timing
Freescale Semiconductor 385
16. BDC Target-to-Host Serial Bit Timing Logic
BDM Command Set Descriptions
Freescale Semiconductor 387
Miscellaneous Commands
Memory Commands
Core Register Commands
PST Trace Buffer Read Commands
24. BDM Command Code Field Descriptions
CRG
CRG CRN
VBR
BDM Command Set Summary
25. BDM Command Summary
Ackdisable
Ackenable
Readdreg
Readcreg
Readpstb
Syncpc
Writecreg
Disable host/target handshake protocol Always Available
Enable host/target handshake protocol Always Available
0x03
Freescale Semiconductor 393
Enter active background mode if enabled Non-intrusive
0x32 Host → Target Memory data7-0 Target → 0x36
Data7-0
0x3A Memory
0x33
Xcsrsb
0x37
0x3B
0x12 Memory data7-0
Target 0x16 Memory Data15-8 Memory data7-0
0x12 Memory
Target → Host 0x16 Memory
No operation Non-intrusive
Read CPU control register Active Background
Read debug control register Non-intrusive
0xA0+CRN Host → Target Dreg data
0x30 Address23-0
Target Memory data7-0 Target → Host
0x31
0x35
0x39
0x50+CRN Host → Target Pstb data
Read general-purpose CPU register Active Background
Read Xcsr Status Byte Always Available
Read CSR2 Status Byte Always Available
Read CSR3 Status Byte Always Available
Synchronize PC to PST/DDATA Signals Non-intrusive
Write CPU control register Active Background
0xC0+CRN Creg data
Freescale Semiconductor 401
Write debug control register Non-intrusive
0x80+CRN Dreg data
0x10 Address23-0 Memory Data7-0
Host → target
Write general-purpose CPU register Active Background
Serial Interface Hardware Handshake Protocol
Write Xcsr Status Byte Always Available
Write CSR2 Status Byte Always Available
Write CSR3 Status Byte Always Available
19. Target Acknowledge Pulse ACK
Freescale Semiconductor 405
Hardware Handshake Abort Procedure
20. Handshake Protocol at Command Level
21signal timing is not drawn to scale
Freescale Semiconductor 407
21. ACK Abort Procedure at the Command Level
Real-Time Trace Support
Real-Time Debug Support
Freescale Semiconductor 409
Enter user mode
26. Processor Status Encodings
PST40 Definition
Instructions, generate different encodings
0x08-0x0B
Begin Execution of Taken Branch PST =
Freescale Semiconductor 411
23. Example JMP Instruction Output in Pstb
PST Values Description
PST Trace Buffer Pstb
18.4.3.3 PST/DDATA Example
Pstbpst
Pstbddata
Processor Status, Debug Data Definition
27. PST/DDATA Specification for User-Mode Instructions
Instruction Operand Syntax
PST/DDATA
Freescale Semiconductor 415
416 Freescale Semiconductor
Freescale Semiconductor 417
Supervisor Instruction Set
GND Reset
Freescale-Recommended BDM Pinout
No Connect
Freescale Semiconductor 419
420 Freescale Semiconductor
Appendix a Revision History
Changes between Rev and Rev
MCF51QE128RM Rev to Rev Changes
Chapter Description
Revision History
Page
How to Reach Us