Freescale Semiconductor
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130
[email protected]
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064, Japan
0120 191014 or +81 3 5437 9125
[email protected]
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 26668334
[email protected]
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-441-2447 or 303-675-2140
Fax: 303-675-2150
[email protected]
Information in this document is provided solely to enable system and
software implementers to use Freescale Semiconductor products. There are
no express or implied copyright licenses granted hereunder to design or
fabricate any integrated circuits or integrated circuits based on the
information in this document.
Freescale Semiconductor reserves the right to make changes without further
notice to any products herein. Freescale Semiconductor makes no warranty,
representation or guarantee regarding the suitability of its products for any
particular pur pose, nor does Freescale Semiconductor assume any liability
arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or
incidental damages. “Typical” parameters that may be provided in Freescale
Semiconductor data sheets and/or specifications can and do vary in different
applications and actual performance may vary over time. All operating
parameters, including “Typicals”, must be validated for each customer
application by customer’s technical exper ts. Freescale Semiconductor does
not convey any license under its patent rights nor the rights of others.
Freescale Semiconductor products are not designed, intended, or authorized
for use as components in systems intended for surgical implant into the body,
or other applications intended to support or sustain life, or for any other
application in which the failure of the Freescale Semico nductor product could
create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semicondu ctor products for any such unintended
or unauthorized application, Buyer shall indemnify and hold Freescale
Semiconductor and its officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs, damages, and expenses, and
reasonable attorney fees arising out of, directly or indirectly, any claim of
personal injury or death associated with such unintended or unauthorized
use, even if such claim alleges that Freescale Semiconductor was negligent
regarding the design or manufacture of the part.
The primary objective of this reference manual is to define the MCF52277 processor for software and
hardware developers. In addition, this manual supports the MCF52274. This book is written from the
perspective of the MCF52277, and unless otherwise noted, the information applies also to the MCF52274.
This device has the same functionality as the MCF52277; any differences in data regarding bus timing,
signal behavior, and AC, DC, and thermal characteristics are detailed in the device data sheet
(MCF52277DS). Refer to Table 1-1 for a summary of the differences.
The information in this book is subject to change without notice, as described in the disclaimers on the title
page. As with any technical documentation, the reader needs to make sure to use the most recent version
of the documentation.
To locate any published errata or updates for this document, refer to the world-wide web at
This manual is intended for system software and hardware developers and applications programmers who
want to develop products with the MCF52277 processor. It is assumed that the reader understands
operating systems, microprocessor system design, basic principles of software and hardware, and basic
®
details of the ColdFire
architecture.
Organization
Following is a summary and brief description of the major sections of this manual:
•Chapter 1, “Overview,” includes general descriptions of the modules and features incorporated in
the device while focusing on new features.
•Chapter 2, “Signal Descriptions,” describes device signals. It includes a listing of signals
characterizing each signal as an input or output, defines its state at reset, and identifies whether a
pull-up resistor should be used.
•Chapter 3, “ColdFire Core,” provides microprocessor core overview. The chapter describes the
organization of the Version 2 (V2) ColdFire processor core and an overview of the programming
models as they are implemented on the device.
MCF52277 Reference Manual, Rev. 0
Freescale Semiconductorxxiii
Page 24
•Chapter 4, “Enhanced Multiply-Accumulate Unit (EMAC),” describes the multiply/accumulate
unit, which executes integer multiply, multiply-accumulate, and miscellaneous register
instructions. The EMAC is integrated into the operand execution pipeline (OEP).
•Chapter 5, “Cache,” describes cache implementation, including organization, configuration, and
coherency. It describes cache operations and how the cache interacts with other memory structures.
•Chapter 6, “Static RAM (SRAM),” describes the on-chip static RAM (SRAM) implementation,
covers general operations, configuration, and initialization. It also provides information and
examples of how to minimize power consumption when using the SRAM.
•Chapter 7, “Clock Module,” describes the device’s different clocking methods. It also describes
clock-module operation in low power modes.
•Chapter 8, “Power Management,” describes the low power operation of the device and peripheral
behavior in low-power modes.
•Chapter 9, “Chip Configuration Module (CCM),” details the various devices operating
configurations and provides a description of signals used by the CCM and a programming model.
•Chapter 10, “Serial Boot Facility (SBF),” describes the interface to an external SPI memory that
reads configuration data and boot code during the processor-reset sequence.
•Chapter 11, “Reset Controller Module,” describes the operation of the reset controller module,
detailing the different types of reset that can occur.
•Chapter 12, “System Control Module (SCM),” describes the functionality of the SCM, which
provides the programming model for peripheral-access control, the software core watchdog timer
(CWT), and the generic access error information.
•Chapter 13, “Crossbar Switch (XBS),” details the interaction between bus masters and bus slaves
within the device, including arbitration schemes.
•Chapter 14, “General Purpose I/O Module,” describes the operation and programming model of
the general purpose I/O (GPIO) ports on the device.
•Chapter 15, “Interrupt Controller Modules,” describes interrupt controller operation. Includes
descriptions of the registers in the interrupt controller memory map and the interrupt priority
scheme.
•Chapter 16, “Edge Port Module (EPORT),” describes EPORT module functionality, including
operation in low-power mode.
•Chapter 17, “Enhanced Direct Memory Access (eDMA),” describes the direct memory access
(DMA) controller module and provides an overview of the module and describes in detail its
signals and registers. The latter sections of this chapter describe operations, features, and supported
data transfer modes in detail.
•Chapter 18, “FlexBus,” describes data-transfer operations, chip-select operation, error conditions,
bus arbitration, and reset operations.
•Chapter 19, “SDRAM Controller (SDRAMC),” describes the configuration and operation of the
SDRAM controller. It begins with a general description and includes a description of signals
involved in DRAM operations. The remainder of the chapter describes the programming model
and signal timing, as well as the command set required for synchronous operations.
MCF52277 Reference Manual, Rev. 0
xxivFreescale Semiconductor
Page 25
•Chapter 20, “Universal Serial Bus Interface – On-The-Go Module,” provides an overview of the
universal serial bus (USB) On-the-Go module. The USB Specification, Revision 2.0 is a
recommended supplement to this chapter.
•Chapter 21, “Liquid Crystal Display Controller (LCDC),” describes the operation and
programming model of the LCD controller.
•Chapter 22, “Touchscreen Controller/Analog-to-Digital Converter,” describes operation of the
analog signal processor that may be configured as a touchscreen controller or general-purpose
ADC.
•Chapter 23, “FlexCAN,” describes the implementation of the controller area network (CAN)
protocol. This chapter describes FlexCAN module operation and provides a programming model.
•Chapter 24, “Pulse-Width Modulation (PWM) Module,” describes the configuration and operation
of the pulse width modulation (PWM) module. It includes a block diagram, programming model,
and functional description.
•Chapter 25, “Synchronous Serial Interface (SSI),” describes SSI module operation and provides a
programming model.
•Chapter 26, “Real-Time Clock,” describes the real-time clock module operation and provides a
programming model.
•Chapter 27, “Programmable Interrupt Timers (PIT0–PIT1),” describes the functionality of the PIT
timers, including operation in low-power mode.
•Chapter 28, “DMA Timers (DTIM0–DTIM3),” describes the configuration and operation of the
DMA timer modules. These 32-bit timers provide input-capture and reference-compare
capabilities with optional signaling of events using interrupts or triggers. This chapter also provides
programming examples.
•Chapter 29, “DMA Serial Peripheral Interface (DSPI),” provides a feature-set overview and an
operation description, including details of the DSPI’s internal storage organization. The chapter
concludes with the programming model and a timing diagram.
•Chapter 30, “UART Modules,” describes the use of the universal asynchronous
receiver/transmitters (UARTs) implemented on the device and includes programming examples.
2
•Chapter 31, “I2C Interface,” describes the I
C module, including I2C protocol, clock
synchronization, and I2C programming model registers.
•Chapter 32, “Debug Module,” describes the hardware debug support in the device.
•Chapter 33, “IEEE 1149.1 Test Access Port (JTAG),” describes configuration and operation of the
Joint Test Action Group (JTAG) implementation. It describes those items required by the IEEE
1149.1 standard and provides additional information specific to the device. For internal details and
sample applications, see the IEEE 1149.1 document.
Suggested Reading
This section lists additional reading that provides background for the information in this manual as well as
general information about ColdFire architecture.
MCF52277 Reference Manual, Rev. 0
Freescale Semiconductorxxv
Page 26
General Information
Useful information about the ColdFire architecture and computer architecture in general:
•Using Microprocessors and Microcomputers: The Motorola Family, William C. Wray, Ross
Bannatyne, Joseph D. Greenfield
•Computer Architecture: A Quantitative Approach, Second Edition, by John L. Hennessy and David
A. Patterson.
•Computer Organization and Design: The Hardware/Software Interface, Second Edition, David A.
Patterson and John L. Hennessy.
ColdFire Documentation
ColdFire documentation is available from the sources listed on the back cover of this manual, as well as
our web site, http://www.freescale.com/coldfire.
•Reference manuals (formerly called user’s manuals)—These books provide details about
individual ColdFire implementations and are intended to be used in conjunction with the ColdFire
Programmers Reference Manual.
•Addenda/errata to reference manuals—Because some processors have follow-on parts, an
addendum is provided that describes the additional features and functionality changes. Also, if
mistakes are found within a reference manual, an errata document will be issued before the next
published release of the reference manual. These addenda/errata are intended for use with the
corresponding reference manuals.
•Data sheets—Data sheets provide specific information regarding pin-out diagrams, bus timing,
signal behavior, and AC, DC, and thermal characteristics, as well as other design considerations.
•Product briefs—Each device has a product brief that provides an overview of its features. This
document is roughly equivalent to the overview (Chapter 1) of a device’s reference manual.
•Application notes—These short documents address specific design issues useful to programmers
and engineers working with Freescale Semiconductor processors.
Additional literature is published as new processors become available. For a current list of ColdFire
documentation, refer to http://www.freescale.com/coldfire.
Conventions
This document uses the following notational conventions:
cleared/setWhen a bit takes the value zero, it is said to be cleared; when it takes a value of
one, it is said to be set.
MNEMONICSIn text, instruction mnemonics are shown in uppercase.
mnemonicsIn code and tables, instruction mnemonics are shown in lowercase.
Table ii shows terminology conventions used throughout this document.
Table ii. Notational Conventions
InstructionOperand Syntax
Opcode Wildcard
ccLogical condition (example: NE for not equal)
Register Specifications
AnAny address register n (example: A3 is address register 3)
Ay,AxSource and destination address registers, respectively
DnAny data register n (example: D5 is data register 5)
Dy,DxSource and destination data registers, respectively
RcAny control register (example VBR is the vector base register)
RmMAC registers (ACC, MAC, MASK)
RnAny address or data register
RwDestination register w (used for MAC instructions only)
Ry,RxAny source and destination registers, respectively
MCF52277 Reference Manual, Rev. 0
Freescale Semiconductorxxix
Page 30
Table ii. Notational Conventions (continued)
InstructionOperand Syntax
XiIndex register i (can be an address or data register: Ai, Di)
Miscellaneous Operands
#<data>Immediate data following the 16-bit operation word of the instruction
<ea>Effective address
<ea>y,<ea>xSource and destination effective addresses, respectively
<label>Assembly language program label
<list>List of registers for MOVEM instruction (example: D3–D0)
<shift>Shift operation: shift left (<<), shift right (>>)
<size>Operand data size: byte (B), word (W), longword (L)
bcInstruction and data caches
dcData cache
icInstruction cache
# <vector>Identifies the 4-bit vector number for trap instructions
<>identifies an indirect data address referencing memory
<xxx>identifies an absolute address referencing memory
dnSignal displacement value, n bits wide (example: d16 is a 16-bit displacement)
SFScale factor (x1, x2, x4 for indexed addressing mode, <<1n>> for MAC operations)
Operations
+Arithmetic addition or postincrement indicator
–Arithmetic subtraction or predecrement indicator
xArithmetic multiplication
MCF52277 Reference Manual, Rev. 0
xxxFreescale Semiconductor
Page 31
Table ii. Notational Conventions (continued)
InstructionOperand Syntax
/Arithmetic division
~Invert; operand is logically complemented
&Logical AND
|Logical OR
^Logical exclusive OR
<<Shift left (example: D0 << 3 is shift D0 left 3 bits)
>>Shift right (example: D0 >> 3 is shift D0 right 3 bits)
→Source operand is moved to destination operand
←→Two operands are exchanged
sign-extendedAll bits of the upper portion are made equal to the high-order bit of the lower portion
If <condition>
then
<operations>
else
<operations>
{}Optional operation
()Identifies an indirect address
d
n
AddressCalculated effective address (pointer)
BitBit selection (example: Bit 3 of D0)
lsbLeast significant bit (example: lsb of D0)
LSBLeast significant byte
LSWLeast significant word
msbMost significant bit
MSBMost significant byte
MSWMost significant word
Test the condition. If true, the operations after then are performed. If the condition is false and the
optional else clause is present, the operations after else are performed. If the condition is false and
else is omitted, the instruction performs no operation. Refer to the Bcc instruction description as an
example.
Subfields and Qualifiers
Displacement value, n-bits wide (example: d16 is a 16-bit displacement)
Revision History
Table iii provides a revision history for this document.
Table iii. MCF52277RM Revision History
Revision
Number
104/2008First public revision of this document.
Freescale Semiconductorxxxi
Revision
Date
Description of Changes
MCF52277 Reference Manual, Rev. 0
Page 32
MCF52277 Reference Manual, Rev. 0
xxxiiFreescale Semiconductor
Page 33
Chapter 1
Overview
The MCF5227x devices are a family of highly-integrated 32-bit microprocessors based on the Version 2
ColdFire microarchitecture. All MCF5227x devices contain a 128-Kbyte internal SRAM, an LCD
controller, a touchscreen controller, a USB On-the-Go controller, a two-bank SDR/DDR SDRAM
controller, a 16-channel DMA controller, a serial boot facility, CAN module, a SSI interface, up to three
UARTs, a DMA SPI, as well as other peripherals that enable the MCF5227x family for use in .
This document provides details of the MCF5227x microprocessor family, focusing on its highly diverse
feature set. It was written from the perspective of the MCF52277 device. However, it also pertains to the
MCF52274. See the following section for a summary of differences between the various devices of the
MCF5227x family.
1.1MCF5227x Family Comparison
The following table compares the various device derivatives available within the MCF5227x family.
Table 1-1 . MCF5 227x Family Configurations
ModuleMCF52274MCF52277
ColdFire Version 2 Core with EMAC (Enhanced
Multiply-Accumulate Unit)
Core (System) Clockup to 120 MHzup to 160 MHz
Peripheral and External Bus Clock
(Core clock ÷ 2)
Performance (Dhrystone/2.1 MIPS)up to 114up to 152
Table 1-1. MCF5227x Family Configurations (continued)
ModuleMCF52274MCF52277
Interrupt Controllers (INTC)11
Synchronous Serial Interface (SSI)••
2
C••
I
DSPI••
UARTs33
32-bit DMA Timers44
Periodic Interrupt Timers (PIT)22
PWM Module••
Edge Port Module (EPORT)••
General Purpose I/O Module (GPIO)••
®
JTAG - IEEE
Package176 LQFP196 MAPBGA
1149.1 Test Access Port••
MCF52277 Reference Manual, Rev. 1
1-2Freescale Semiconductor
Page 35
1.2Block Diagram
Version 2 ColdFire Core
LEGEND
INTC
Data BusInstruction Bus
Oscillator
PLL
DSPI
EPORT
3 UARTs
I
2
C
To u ch
4 DMA
RTC
BDM– Background debug module
DSPI– DMA serial peripheral interface
eDMA– Enhanced direct memory access
EMAC– Enchance multiply-accumulate unit
EPORT– Edge port module
GPIO– General Purpose Input/Output Module
I
2
C– Inter-Intergrated Circuit
INTC– Interrupt controller
JTAG– Joint Test Action Group interface
LCD– Liquid-crystal display
PIT– Programmable interrupt timer
PLL– Phase locked loop module
PWM– Pulse-width modulator
RTC– Real time clock
SSI– Synchronous Serial Interface
UART– Universal asynchronous receiver/transmitter
USB OTG – Universal Serial Bus On-the-Go controller
MCF52277
EMAC
JTAG
Crossbar Switch (XBS)
Peripheral Bridge
8K
Configurable
Cache
Timers
BDM
LCD
SDRAM
Controller
eDMA
FlexBus
2 PITs
SSIFlexCANGPIO
Hardware
Divide
Screen
Controller
PWM
Serial Boot
Facility
128 K
SRAM
USB OTG
Figure 1-1 shows a top-level block diagram of the MCF52277 superset device.
Overview
Figure 1-1. MCF52277 Block Diagram
Freescale Semiconductor1-3
MCF52277 Reference Manual, Rev. 1
Page 36
Overview
1.3Features
The following is a brief summary of the functional blocks in the MCF52277 superset device followed by
a module-by-module feature list.
®
•Version 2 ColdFire
•Up to 159 Dhrystone 2.1 MIPS @ 166.67 MHz
•8 Kbytes configurable cache (instruction only, data only, or split instruction/data)
•128 Kbytes internal SRAM
•Support for booting from SPI-compatible flash, EEPROM, and FRAM devices
•Cross-bar switch technology (XBS) for concurrent access to peripherals or RAM from multiple bus
masters
•16 channel DMA controller
•16- or 32-bit SDR/DDR controller
•USB 2.0 On-the-Go controller
•Liquid crystal display controller with support up to 4096 × 4096 pixels
•Maximum 166.67 MHz processor core and 83.33 MHz bus frequency
•Sixteen general-purpose 32-bit data and address registers
•Enhanced multiply-accumulate unit (EMAC) for DSP and fast multiply operations
•Hardware divide execution unit supporting various 32-bit operations
•Implements the ColdFire Instruction Set Architecture, ISA_A+
1.3.2On-chip Memories
•128 Kbyte dual-ported SRAM on CPU internal bus
MCF52277 Reference Manual, Rev. 1
1-4Freescale Semiconductor
Page 37
— Accessible to non-core bus masters (e.g. DMA, USB OTG, and LCD controller) via the
crossbar switch
•8 Kbyte unified cache configurable as instruction-only, data-only, or split I-/D-cache
1.3.3Phase Locked Loop (PLL)
•16–66.66 MHz reference crystal
•Loss-of-lock detection
1.3.4Power Management
•Fully static operation with processor sleep and whole chip stop modes
•Very rapid response to interrupts from the low-power sleep mode (wake-up feature)
•Peripheral power management register to enable/disable clocks to most modules
•Software controlled disable of external clock input for low power consumption
1.3.5Chip Configuration Module (CCM)
•System configuration during reset
Overview
•Bus monitor
•Configurable output pad drive strength control
•Unique part identification and part revision numbers
•Serial boot capability
— Supports SPI-compatible EEPROM, flash, and FRAM
— Configurable boot clock frequency
1.3.6Reset Controller
•Separate reset in and reset out signals
•Six sources of reset: power-on reset (POR), external, software, watchdog timer, loss of lock, JTAG
instruction
•Status flag indication of source of last reset
1.3.7System Control Module
•Access control registers
n
•Core watchdog timer with a 2
•Core fault reporting
(where n = 8–31) clock cycle selectable timeout period
1.3.8Crossbar Switch Module
•Concurrent access from different masters to different slaves
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor1-5
Page 38
Overview
•Slave arbitration attributes configured on a slave by slave basis
•Fixed or round-robin arbitration
1.3.9Liquid Crystal Display Controller (LCDC)
•Support for single (non-split) screen monochrome/color LCD panels and self-refresh type LCD
panels
•16 simultaneous gray-scale levels from a palette of 16 for monochrome display
•Maximum supported panel size of 4096 × 4096 pixels
•4(mapped to RGB444)/8(RGB444)/12 bits per pixel (bpp) for passive color panel
•4(mapped to RGB666)/8(mapped to RGB666)/12(RGB444)/16(RGB565)/18 bpp for TFT
1.3.10ADC and Touch Screen Controller
•12-bit 125 kS/s ADC for touch screen and general purpose measurements
•Unsigned 12-bit binary output with ±2 LSB INL, ±1 LSB DNL, ±2 LSB offset error, and ±4 LSB
gain error
•Ratiometric measurements drivers
•Touch/pressure measurements
•Supports 4/5/7 and 8-wire touch screen configurations
•Up to 8 auxiliary input channels are available for general purpose ADC measurements (the number
of the auxiliary input channels are defined by the touch-screen topology)
•Can work as an 8-channel general purpose ADC, when no touch-screen is connected
•Embedded touch screen circuitry
•Supports automatic sampling, single-round sampling, and manual sampling modes
•Provides data-ready and FIFO-full interrupts
•Pen-down detection circuitry to generate pen interrupt request
•True differential input
•Built-in selectable reference generator
•Support for temperature compensation by software
•Power-down capability
•1.5/3.3 V dual power supply
•Internal or external reference
•Conversion executed synchronously to bus clock
•Triggerable through software and/or external hardware
1.3.11Universal Serial Bus (USB) 2.0 On-The-Go (OTG) Controller
•Support for full speed (FS) and low speed (LS) via an on-chip FS/LS transceiver
•Uses 60 MHz reference clock based off of the system clock or from an external pin
MCF52277 Reference Manual, Rev. 1
1-6Freescale Semiconductor
Page 39
1.3.12SDR/DDR SDRAM Controller
•Supports a glueless interface to SDR and DDR SDRAM devices
•Support for 16- or 32-bit fixed memory port width for SDR SDRAM devices; 16-bit fixed memory
port width for DDR SDRAM devices.
•16-byte critical word first burst transfer
•Up to 13 lines of row address, up to 12 (32-bit bus) or 13 (16-bit bus) column address lines, 2 bits
of bank address, and two pinned-out chip selects. The maximum row bits plus column bits equals
24 in 32-bit bus mode or 25 in 16-bit bus mode.
•Supports up to 512 MByte of memory; minimum memory configuration of 8 MByte
•Supports page mode to maximize the data rate
•Supports sleep mode and self-refresh mode
1.3.13FlexBus (External Interface)
•Glueless connections to 8-, 16-, and 32-bit external memory devices (SRAM, flash, ROM, etc.)
•Support for independent primary and secondary wait states per chip select
•Programmable address setup and hold time with respect to chip-select assertion, per transfer
direction
•Glueless interface to SRAM devices with or without byte strobe inputs
Overview
•Programmable wait state generator
•32-bit external bidirectional data bus and 24-bit address bus
•Up to six chip selects available
•Byte/write enables (byte strobes)
•Ability to boot from external memories that are 8, 16, or 32 bits wide
1.3.14Synchronous Serial Interface (SSI)
•Supports shared (synchronous) transmit and receive sections
•Normal mode operation using frame sync
•Network mode operation allowing multiple devices to share the port with as many as 32 time slots
•Gated clock mode operation requiring no frame sync
•Programmable data interface modes such as I2S, LSB aligned, and MSB aligned
•Programmable word length up to 24 bits
•AC97 support
1.3.15FlexCAN Module
•Full implementation of the CAN protocol specification version 2.0B
— Standard data and remote frames (up to 109 bits long)
— Extended data and remote frames (up to 127 bits long)
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor1-7
Page 40
Overview
— 0–8 bytes data length
— Programmable bit rate up to 1 Mbit/sec
•Flexible Message Buffers (MBs), totalling up to 16 message buffers of 0–8 bytes data length each,
configurable as Rx or Tx, all supporting standard and extended messages
•Unused MB space can be used as general purpose RAM space
•Listen-only mode capability
•Content-related addressing
•Three programmable mask registers: global (for MBs 0-13), special for MB14 and special for
MB15
•Programmable transmit-first scheme: lowest ID or lowest buffer number
•Time stamp based on 16-bit free-running timer
•Global network time, synchronized by a specific message
1.3.16Real Time Clock
•Full clock: days, hours, minutes, seconds
•Minute countdown timer with interrupt
•Programmable daily alarm with interrupt
•Sampling timer with interrupt
•Once-per-day, once-per-hour, once-per-minute, and once-per-second interrupts
•Operation determined by reference input oscillator clock frequency and value programmed into
user-accessible registers
— Minimum supported oscillator frequency of 2 Hz
•Ability to wake the processor from low-power modes (wait, doze, and stop) via the RTC interrupts
— The RTC is enabled during stop mode
1.3.17Programmable Interrupt Timers (PIT)
•Two programmable interrupt timers each with a 16-bit counter
•Configurable as a down counter or free-running counter
1.3.18DMA Timers
•Four 32-bit timers with DMA and interrupt request trigger capability
•Input capture and reference compare modes
1.3.19DMA Serial Peripheral Interface (DSPI)
•Full-duplex, three-wire synchronous transfer
•Up to three chip selects available
•Master and slave modes with programmable master bit-rates
MCF52277 Reference Manual, Rev. 1
1-8Freescale Semiconductor
Page 41
•Up to 16 pre-programmed transfers
1.3.20Pulse Width Modulation (PWM) Module
•Four independent PWM channels with programmable period and duty cycle
•Dedicated counter for each PWM channel
•Programmable PWM enable/disable for each channel
•Software selection of PWM duty pulse polarity for each channel
The actual size of the SRAM is 128 KByte. However, it may be placed anywhere within the 256 MB space
using the RAMBAR register.
MCF52277 Reference Manual, Rev. 1
1-10Freescale Semiconductor
Page 43
Overview
NOTE
This memory map provides two disjointed regions mapped to the FlexBus
controller. The first region gives support for glueless connections to
external memories (flash and SRAM). The second space (starting at
0xC000_0000) gives support for one (or more) unique chip-selects that can
be used for non-cacheable, non-memory devices. Additionally, this
mapping is selected because it easily maps into the ColdFire access control
registers, which provide a coarse association between memory addresses
and their attributes (cacheable, non-cacheable). For this device, one possible
configuration defines the default memory attribute as non-chacheable, and
one ACR is then used to identify cacheable addresses, e.g., ADDR[31] set
to zero identifies the cacheable space.
1.4.1Internal Peripheral Space
The internal peripheral space contains locations for all internal registers used to program and control the
device’s functional blocks and external interfaces. Table 1-3 summarizes the various register spaces and
their base addresses. Each slot is 16 kB in size, which is not necessarily taken up entirely by the functional
blocks. Any slot not illustrated is reserved. See corresponding chapter for details on their individual
memory maps.
Table 1-3. Internal Peripheral Space Memory Map
Base AddressSlot NumberPeripheral
0xFC00_00000SCM (MPR & PACRs)
0xFC00_40001Crossbar switch
0xFC00_80002FlexBus
0xFC02_00008FlexCAN
0xFC03_C00015Real-Time Clock
0xFC04_000016SCM (CWT & Core Fault Registers)
0xFC04_400017eDMA Controller
0xFC04_800018Interrupt Controller 0
0xFC04_C00019Interrupt Controller 1
0xFC05_400021Interrupt Controller IACK
2
0xFC05_800022I
0xFC05_C00023DSPI
0xFC06_000024UART0
0xFC06_400025UART1
C
0xFC06_800026UART2
0xFC07_000028DMA Timer 0
0xFC07_400029DMA Timer 1
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor1-11
Page 44
Overview
Table 1-3. Internal Peripheral Space Memory Map (continued)
Base AddressSlot NumberPeripheral
0xFC07_800030DMA Timer 2
0xFC07_C00031DMA Timer 3
0xFC08_000032PIT 0
0xFC08_400033PIT 1
0xFC09_000036PWM
0xFC09_400037Edge Port
0xFC0A_000040CCM, Reset Controller, Power Management
0xFC0A_400041GPIO Module
0xFC0A_800042ADC and Touchscreen Controller
0xFC0A_C00043LCD Controller
0xFC0B_000044USB On-the-Go
0xFC0B_800046SDRAM Controller
0xFC0B_C00047SSI
0xFC0C_000048PLL
1.5Documentation
Documentation is available from a local Freescale distributor, a Freescale sales office, the Freescale
Literature Distribution Center, or through the Freescale world-wide web address at
http://www.freescale.com/coldfire.
MCF52277 Reference Manual, Rev. 1
1-12Freescale Semiconductor
Page 45
Chapter 2
Signal Descriptions
2.1Introduction
This chapter describes the external signals on the device. It includes an alphabetical signal listing of signals
that characterizes each signal as an input or output, defines its state at reset, and identifies whether a
pull-up resistor should be used.
NOTE
The terms assertion and negation are used to avoid confusion when dealing
with a mixture of active-low and active-high signals. The term asserted
indicates that a signal is active, independent of the voltage level. The term
negated indicates that a signal is inactive.
Active-low signals, such as SD_SRAS and TA, are indicated with an
overbar.
2.2Signal Properties Summary
The below table lists the signals grouped by functionality.
NOTE
In this table and throughout this document a single signal within a group is
designated without square brackets (i.e., FB_A23), while designations for
multiple signals within a group use brackets (i.e., FB_A[23:21]) and is
meant to include all signals within the two bracketed numbers when these
numbers are separated by a colon.
NOTE
The primary functionality of a pin is not necessarily its default functionality.
Most pins that are muxed with GPIO will default to their GPIO
functionality. See Ta ble 2- 1 for a list of the exceptions.
Table 2-1. Special-Case Default Signal Functionality
PinDefault Signal
FB_BE/BWE
FB_CS
FB_OEFB_OE
FB_TAFB_TA
[3:0]FB_BE/BWE[3:0]
[3:0]FB_CS[3:0]
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor2-1
Page 46
Signal Descriptions
Table 2-1. Special-Case Default Signal Functionality (continued)
PinDefault Signal
FB_R/W
FB_R/W
FB_TSFB_TS
Table 2-2 . MCF5 227x Signal Information and Muxing
1
Signal NameGPIOAlternate 1Alternate 2
Reset
RESET
—— —U
RSTOUT—— ——
Clock
EXTAL————
XTAL———U
Mode Selection
BOOTMOD[1:0]————
2
Pull-up (U)
Direction
Pull-down (D)
IEVDD103J11
OEVDD102K11
IEVDD106F14
3
OEVDD105G14
IEVDD110, 109G10, H10
Vol tag e
Domain
MCF52274
176 LQFP
MCF52277
196 MAPBGA
FlexBus
FB_A[23:22]—FB_CS[5:4]——
FB_A[21:16]————
FB_A[15:14]—SD_BA[1:0]——
FB_A[13:11]—SD_A[13:11]——
FB_A10———
FB_A[9:0]—SD_A[9:0]—
FB_D[31:16]—SD_D[31:16]—
FB_D[15:0]—FB_D[31:16]—
FB_CLK———
FB_BE/BWE[3:0]PBE[3:0]SD_DQM[3:0]——
FB_CS[3:2]PCS[3:2]———
FB_CS1PCS1SD_CS1——
OSDVDD143, 142C11, D11
OSDVDD141–139,
OSDVDD131, 130B14, C13
OSDVDD129–127C14, D12, D13
OSDVDD126D14
OSDVDD125–116E11–E14,
I/O SDVDD30–37, 49–56J4, K1–K4, L1–L3,
I/O SDVDD19–26, 60–67G1–G4, H1–H4,
OSDVDD42P1
OSDVDD29, 57, 27, 59J3, N5, J1, L6
OSDVDD
OSDVDD144D10
137–135
—
A12, B12, C12,
B13, A13, A14
F11–F13, G11,
G12, H11
M3, N3, P3,M4,
N4, P4, L5, M5
M6, N6, P6, L7,
M7, N7, P7, L8
B11, A11
MCF52277 Reference Manual, Rev. 1
2-2Freescale Semiconductor
Page 47
Table 2-2. MCF5227x Signal Information and Muxing (continued)
Signal Descriptions
1
2
Signal NameGPIOAlternate 1Alternate 2
Pull-up (U)
FB_CS0
PCS0———
FB_OEPFBCTL3———
FB_TAPFBCTL2——U
FB_R/WPFBCTL1———
FB_TSPFBCTL0DACK0——
Direction
Pull-down (D)
OSDVDD145C10
OSDVDD69N8
ISDVDD115H12
OSDVDD68M8
OSDVDD15F4
SDRAM Controller
SD_A10————
SD_CAS—— ——
SD_CKE————
SD_CLK————
SD_CLK—— ——
SD_CS0—— ——
SD_DQS[3:2]————
SD_RAS—— ——
SD_SDR_DQS————
SD_WE—— ——
External Interrupts Port
4
OSDVDD46L4
OSDVDD47N2
OSDVDD17F2
OSDVDD40M1
OSDVDD41N1
OSDVDD18F1
I/O SDVDD28, 58J2, P5
OSDVDD48P2
OSDVDD38M2
OSDVDD16F3
Volt ag e
Domain
MCF52274
176 LQFP
MCF52277
196 MAPBGA
IRQ7PIRQ7———
IRQ4PIRQ4DREQ0DSPI_PCS4
IRQ1PIRQ1USB_CLKINSSI_CLKIN—
6
LCD_D[17:16]
LCD_D[15:14]
LCD Controller
6
PLCDDH[1:0]LCD_D[11:10]——O
6
PLCDDM[7:6]LCD_D[9:8]——O
LCD_D13PLCDDM5CANTX——O
LCD_D12PLCDDM4CANRX——O
LCD_D[11:8]
6
PLCDDM[3:0]LCD_D[7:4]——O
LCD_D7PLCDDL7PWM7——O
LCD_D6PLCDDL6PWM5——O
LCD_D[5:2]
6
PLCDDL[5:2]LCD_D[3:0]——O
IEVDD162D7
5
IEVDD161C7
IEVDD160B7
EVDD
EVDD
EVDD
EVDD
EVDD
EVDD
EVDD
EVDD
9, 8E3, E4
7, 6D1, D2
—C1
—C2
5–2D3, C3, D4, B1
—B2
—A1
175–172A2, A3, B3, A4
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor2-3
Page 48
Signal Descriptions
Table 2-2. MCF5227x Signal Information and Muxing (continued)
1
Signal NameGPIOAlternate 1Alternate 2
Pull-up (U)
Pull-down (D)
LCD_D1PLCDDL1PWM3——O
LCD_D0PLCDDL0PWM1——O
LCD_ACD/
PLCDCTL3LCD_SPL_SPR——O
LCD_OE
LCD_FLM/
PLCDCTL2———O
LCD_VSYNC
LCD_LP/
PLCDCTL1———O
LCD_HSYNC
LCD_LSCLKPLCDCTL0———O
USB On-the-Go
USB_DM————
USB_DP————
Real Time Clock
2
Volt ag e
Direction
OUSB
OUSB
Domain
EVDD
EVDD
EVDD
EVDD
EVDD
EVDD
VDD
VDD
MCF52274
176 LQFP
—B4
—C4
169B5
10E2
11E1
170A5
149A9
150A10
MCF52277
196 MAPBGA
RTC_EXTAL————
RTC_XTAL————
IEVDD100J14
OEVDD99K14
ADC
ADC_IN[7:0]————
ADC_REF————
IVDD_
IVDD_
I2C
I2C_SCLPI2C1CANTXU2TXDU
I2C_SDAPI2C0CANRXU2RXDU
7
DSPI
DSPI_PCS0/SSPDSPI3U2RTS—U
DSPI_SINPDSPI2U2RXDSBF_DI
DSPI_SOUTPDSPI1U2TXDSBF_D0—
DSPI_SCKPDSPI0U2CTSSBF_CK—
I/OEVDD168C5
I/OEVDD167D5
I/OEVDD152B9
8
IEVDD155D8
OEVDD154D9
I/OEVDD153C9
UARTs
U1CTS
PUART7SSI_BCLKLCD_CLS—
IEVDD156C8
ADC
ADC
82–85, 87–90P12, N12, P13,
86M12
N13, P14, N14,
M13, M14
MCF52277 Reference Manual, Rev. 1
2-4Freescale Semiconductor
Page 49
Table 2-2. MCF5227x Signal Information and Muxing (continued)
Signal Descriptions
Signal NameGPIOAlternate 1Alternate 2
U1RTS
PUART6SSI_FSLCD_PS—
U1RXDPUART5SSI_RXD——
U1TXDPUART4SSI_TXD——
U0CTSPUART3DT1OUTUSB_VBUS_EN—
U0RTSPUART2DT1INUSB_VBUS_OC—
U0RXDPUART1CANRX——
U0TXDPUART0CANTX——
DMA Timers
DT3INPTIMER3DT3OUTSSI_MCLK—
DT2IN/SBF_CS
7
PTIMER2DT2OUTDSPI_PCS2—
DT1INPTIMER1DT1OUTLCD_CONTRAST—
DT0INPTIMER0DT0OUTLCD_REV—
BDM/JTAG
9
1
2
Pull-up (U)
Pull-down (D)
OEVDD157B8
IEVDD158A8
OEVDD159A7
IEVDD97K12
OEVDD98J12
IEVDD96K13
OEVDD95L12
IEVDD163D6
IEVDD164C6
IEVDD165B6
IEVDD166A6
Direction
Volt ag e
Domain
MCF52274
176 LQFP
MCF52277
196 MAPBGA
PST[3:0]————
DDATA[3:0]————
ALLPST————
JTAG_EN———D
PSTCLK—TCLK—U
DSI—TDI—U
DSO—TDO——
BKPT—TMS —U
DSCLK—TRST—U
OEVDD—L9, M9, N9, P9
OEVDD—L10, M10, N10,
OEVDD76—
IEVDD79K10
OEVDD74P8
IEVDD78M11
OEVDD81L11
IEVDD80N11
IEVDD77P11
Test
TEST———D
IEVDD134E10
Power Supplies
IVDD——————
EVDD——————
SD_VDD——————
39, 75, 114, 138,
171
12, 72, 73, 94,
111, 148, 176
14, 43, 44, 70,
113, 132, 146
P10
K5, F10, E5, J10
E6, E7, F5, F6,
G5, H9, J9, K8, K9
E8, E9, F9, G9,
H5, J5, J6, K6, K7
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor2-5
Page 50
Signal Descriptions
Table 2-2. MCF5227x Signal Information and Muxing (continued)
1
Signal NameGPIOAlternate 1Alternate 2
VDD_OSC——————
VDD_PLL——————
VDD_USB——————
VDD_RTC——————
VDD_ADC——————
VSS——————
VSS_OSC——————
VSS_ADC——————
1
Pull-ups are generally only enabled on pins with their primary function, except as noted.
2
Refers to pin’s primary function.
3
Enabled only in oscillator bypass mode (internal crystal oscillator is disabled).
4
GPIO functionality is determined by the edge port module. The GPIO module is only responsible for assigning the alternate functions.
5
Pull-up when DREQ controls the pin.
6
The 176 LQFP device only supports a 12-bit LCD data bus.
7
DSPI or SBF signal functionality is controlled by RESET. When asserted, these pins are configured for serial boot; when negated, the
2
Pull-down (D)
Direction
Pull-up (U)
Volt ag e
Domain
1, 13, 45, 71, 93,
MCF52274
176 LQFP
108G13
104H14
151B10
101J13
91L13
112, 133, 147
107H13
92L14
MCF52277
196 MAPBGA
F7, F8, G6–G8,
H6–H8, J7, J8
pins are configured for DSPI.
8
Pull-up when the serial boot facility (SBF) controls the pin.
9
If JTAG_EN is asserted, these pins default to alternate 1 (JTAG) functionality. The GPIO module is not responsible for assigning these
pins.
2.3Signal Primary Functions
2.3.1Reset Signals
Table 2-3 describes signals used to reset the chip or to indicate a reset.
Table 2-3. Reset Signals
Signal NameAbbreviationFunctionI/O
Reset InRESET
Primary reset input to the device. Asserting RESET resets the core and
peripherals after four FB_CLK cycles. Asserting RESET
RSTOUT
to be asserted.
also causes
Reset OutRSTOUTReset output is an indicator that the chip is in reset. RSTOUT is
asserted at least 512 internal system bus clock cycles in response to
any internal or external reset. (The exact time depends on how long it
takes for the PLL to lock and/or the serial boot sequence to complete.)
MCF52277 Reference Manual, Rev. 1
2-6Freescale Semiconductor
I
O
Page 51
2.3.2PLL and Clock Signals
Table 2-4 describes signals that are used to support the on-chip clock generation circuitry.
Table 2-4. PLL and Clock Signals
Signal NameAbbreviationFunctionI/O
Signal Descriptions
External Clock InEXTALAlways driven by an external clock input except when used as a
connection to the external crystal if the internal oscillator circuit is
used. Clock source may be configured during reset. See Chapter 9,
“Chip Configuration Module (CCM),” for more details.
CrystalXTALUsed as a connection to the external crystal when the internal
oscillator circuit is used to drive the crystal.
RTC External Clock In RTC_EXTAL Crystal input clock for the real-time clock module. I
RTC CrystalRTC_XTALOscillator output to RTC crystal.O
FlexBus Clock OutFB_CLKReflects the internal bus clock (or one-half the core/system clock).
)
(f
sys/2
USB Clock InUSB_CLKINThis pin allows the user to drive the reference clock to the USB module
as an alternate method of generating the USB reference clock during
FS/LS operation. This pin should be driven only with a 60 MHz clock.
SSI Clock InSSI_CLKINThis pin allows the user to drive a specific clock frequency to the SSI
module.
2.3.3Mode Selection
Table 2-5. Mode Selection Signals
Signal NameAbbreviationFunctionI/O
I
O
O
I
I
Boot ModeBOOTMOD[1:0] Indicates the device’s boot mode and chip configuration at reset. See
Chapter 9, “Chip Configuration Module (CCM),” for the signal
encodings.
2.3.4FlexBus Signals
Table 2-6 describes signals that are used for performing transactions on the external bus.
Table 2-6 . FlexB u s Sig n als
Signal NameAbbreviationFunctionI/O
Address BusFB_A[23:0]Defines address of external byte, word, and longword accesses.
These three-state outputs are the 24 lsbs of the internal 32-bit
address bus.
Data BusFB_D[31:0]These three-state bidirectional signals provide the general purpose
data path between the processor and all other devices.
MCF52277 Reference Manual, Rev. 1
I
O
I/O
Freescale Semiconductor2-7
Page 52
Signal Descriptions
Signal NameAbbreviationFunctionI/O
Table 2-6. FlexBus Signals (continued)
Byte EnablesFB_BE/BWE[3:0] Defines flow of data on data bus. During peripheral accesses, these
output signals indicate that data is to be latched or driven onto a byte
of the data bus when driven low. The BE/BWE
asserted only to the memory bytes used during a read or write access.
BE/BWE
and BE/BWE3 controls access to the least significant byte lane of
data.
For SRAM or Flash devices, the BE/BWE
connected to individual byte strobe signals.
Chip SelectsFB_CS
Output EnableFB_OEIndicates when an external device can drive data during external read
Transfer AcknowledgeFB_TAIndicates external data transfer is complete. During a read cycle, when
Read/WriteFB_R/WIndicates direction of the data transfer on the bus for SRAM accesses.
Transfer StartFB_TS
[5:0]Select external devices for external bus transactions.O
cycles.
the processor recognizes FB_TA, it latches the data and then
terminates the bus cycle. During a write cycle, when the processor
recognizes FB_TA
A logic 1 indicates a read from a slave device and a logic 0 indicates
a write to a slave device.
Bus control output signal indicating the start of a transfer.O
0 controls access to the most significant byte lane of data,
, the bus cycle is terminated.
[3:0] signals are
n outputs should be
2.3.5SDRAM Controller Signals
O
O
I
O
Table 2-7 describes signals used for SDRAM accesses.
Table 2-7. SDRAM Controller Signals
Signal NameAbbreviationFunctionI/O
Address BusSD_A[13:0]Address bus used for multiplexed row and column addresses during
SDRAM bus cycles.
Data BusSD_D[31:16]Bidirectional, non-multiplexed data bus for SDRAM accesses.I/O
Bank AddressSD_BA[1:0]Selects one of the four SDRAM row banks.O
Clock EnableSD_CKESDRAM clock enable.O
DDR ClockSD_CLKOutput clock for DDR SDRAM.O
DDR ClockSD_CLK
Chip SelectsSD_CS[1:0]SDRAM chip select signals.O
DDR Data StrobesSD_DQS[3:2] Indicates when valid data is on data bus.I/O
Write Data Byte MaskSD_DQM[3:0] Used to determine which byte lanes of data bus should be latched
Inverted output clock for DDR SDRAM.O
during a write cycle.
The SD_DQMn should be connected to individual SDRAM DQM
signals. Most SDRAMs associate DQM3 with the MSB, in which case
SD_DQM3 should be connected to the SDRAM's DQM3 input.
SDR Data StrobeSD_SDRDQS Generated by the memory controller in SDR mode, to mimic the DQS
Write EnableSD_WE
SDRAM row address strobe.O
signal generated by DDR memories during reads. It is routed out and
connected back to SD_DQS inputs.
Indicates direction of data transfer on bus for SDRAM accesses. A
logic 1 indicates a read from a slave device and a logic 0 indicates a
write to a slave device.
2.3.6Serial Boot Facility Signals
Table 2-8. SBF Signals
Signal NameAbbreviationFunctionI/O
Chip SelectSBF_CSChip select used to access external SPI memory.O
ClockSBF_CK25 MHz clock source for external SPI memory.O
Data InSBF_DIData being driven by SPI memory.I
Data OutSBF_DOData out to SPI memory. SBF uses this output solely for the purpose
of issuing the SPI memory
to SPI memory.
READ command. SBF does not write data
2.3.7External Interrupt Signals
O
O
O
Table 2-9. External Interrupt Signals
Signal NameAbbreviationFunctionI/O
External InterruptsIRQ
[7,4,1]External interrupt sources.I
2.3.8DMA Signals
Table 2-10. DMA Signals
Signal NameAbbreviationFunctionI/O
DMA RequestDREQ0
DMA AcknowledgeDACK0Asserted by processor to indicate DMA request has been recognized.O
Asserted by an external device to request a DMA transfer.I
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor2-9
Page 54
Signal Descriptions
2.3.9LCD Controller Signals
Table 2-10 describes the LCD controller signals.
Table 2-11. LCD Signals
Signal NameAbbreviationFunctionI/O
Line DataLCD_D[17:0]LCD data bus.O
First Line Marker/
Vertical Sync
Line Pulse/
Horizontal Sync
Shift ClockLCD_LSCLKClock for latching data into the display driver’s internal shift register.O
Alt. Crystal Direction/
Output Enable
ContrastLCD_CONTRAST Controls the LCD bias voltage for contrast control.O
Power SaveLCD_PSControls signal output for source driver (Sharp HR-TFT 240x320
Gate Driver Clock
Signal
Reverse ControlLCD_REVSignal for common electrode driving signal preparation (Sharp
Sampling Start SignalLCD_SPL_SPRSets the horizontal scan direction (Sharp HR-TFT 240x320 panels
LCD_FLM/
LCD_VSYNC
LCD_LP/
LCD_HSYNC
LCD_ACD/
LCD_OE
LCD_CLSStart signal output for gate driver, inverted version of LCD_PS (Sharp
Passive matrix: First line marker
Active matrix: Vertical sync pulse. Indicates start of next frame.
Passive matrix: Line pulse
Active matrix: Horizontal sync pulse. Indicates start of next line.
Passive matrix: Alternate crystal direction
Active matrix: Output enable to enable data to be shifted onto the
display.
panels only).
HR-TFT 240x320 panels only).
HR-TFT 240x320 panels only).
only).
2.3.10FlexCAN Signals
Table 2-12 describes the FlexCAN module signals.
O
O
O
O
O
O
O
Table 2-12. FlexCAN Signals
Signal NameAbbreviationFunctionI/O
FlexCAN TransmitCANTXController area network transmit data output.O
FlexCAN ReceiveCANRXController area network receive data input.I
2.3.11Pulse Width Modulation (PWM) Module Signals
The following table describes the signals for the PWM module.
Table 2-13. PWM Module Signals
Signal NameAbbreviationFunctionI/O
PWM7 OutputPWM7Waveform output for channel 7 of the PWM module. Also functions as
an input for the emergency shutdown feature of the PWM.
PWM[5,3,1,0] OutputsPWM[5,3,1,0]Waveform output for channels 5, 3, 1, and 0 respectively.O
MCF52277 Reference Manual, Rev. 1
2-10Freescale Semiconductor
I/O
Page 55
Signal Descriptions
2.3.12Universal Serial Bus (USB) On-the-Go Signals
Table 2-14. USB Module Signals
Signal NameAbbreviationFunctionI/O
USB D-USB_DMD- output of the dual-speed transceiver for the On-the-Go module.O
USB D+USB_DPD+ output of the dual-speed transceiver for the On-the-Go module.O
USB VBUS EnableUSB_VBUS_ENEnables the off-chip VBUS charge pump when USB OTG module is
configured as a host.
USB VBUS over-current USB_VBUS_OCIndicates to the processor that a short has occurred on USB data
ADC InputsADC_IN[7:0] Touchscreen and/or ADC inputs. ADC_IN[7:0] serves as a
touchscreen interface or generic ADC interface.
2
2.3.14I
Serial ClockI2C_SCLOpen-drain clock signal. It is driven by the I2C module when the bus
Serial DataI2C_SDAOpen-drain signal serving as the I
C I/O Signals
Table 2-16. I2C I/O Signals
Signal NameAbbreviationFunctionI/O
is in master mode, or it becomes the clock input when the I2C is in
slave mode.
2
C data input/output.I/O
O
I
I
I/O
2.3.15DMA Serial Peripheral Interface (DSPI) Signals
Table 2-17. DMA Serial Peripheral Interface (DSPI) Signals
Signal NameAbbreviationFunctionI/O
Synchronous Serial
Output
Freescale Semiconductor2-11
DSPI_SOUTProvides the serial data from the DSPI, which may be driven on the
rising or falling edge of DSPI_SCK. Each byte is sent msb first.
MCF52277 Reference Manual, Rev. 1
O
Page 56
Signal Descriptions
Signal NameAbbreviationFunctionI/O
Table 2-17. DMA Serial Peripheral Interface (DSPI) Signals (continued)
Synchronous Serial Data
Input
Serial ClockDSPI_SCKProvides the serial clock from the DSPI. In master mode, the
Peripheral Chip Selects DSPI_PCS[4,2] Provide DSPI peripheral chip selects, which may be active high or low.O
Peripheral Chip Select 0/
Slave Select
DSPI_SINProvides the serial data to the DSPI, which may be sampled on the
rising or falling edge of DSPI_SCK. Each byte is written to RAM lsb
first.
processor generates DSPI_SCK; in slave mode, DSPI_SCK is an
input from an external bus master.
DSPI_PCS0/
DSPI_SS
In master mode, DSPI_PCS0 is a peripheral chip select output that
selects which slave device the current transmission is intended.
In slave mode, the SS signal is a slave select input that an SPI master
uses to select the processor as the target for transmission.
I
I/O
I/O
2.3.16UART Module Signals
Table 2-18 describes the signals of the three UART modules, where n equals 0–2. Baud-rate clock inputs
are not supported.
Table 2-18. UART Module Signals
Signal NameAbbreviationFunctionI/O
Transmit Serial Data
Output
UnTXDData is shifted out lsb first at the falling edge of the serial clock source.
Output is held high when transmitter is disabled, idle, or in local
loopback mode.
O
Receive Serial Data
Input
Request-to-SendU
Clear-to-SendUnCTSIndicates UART modules can begin data transmissionI
UnRXDData is sampled Isb first at the serial clock source’s rising edge. When
the UART clock is stopped for power-down mode, any transition on this
pin restarts it.
nRTSAutomatic request-to-send outputs from UART modules. They may
also be asserted and negated as a function of the received FIFO level.
2.3.17Synchronous Serial Interface (SSI) Signals
Table 2-19. SSI Module Signals
Signal NameAbbreviationFunctionI/O
Serial Bit ClockSSI_BCLKUsed by the receive and transmit blocks. In gated clock mode,
SSI_BCLK is only valid during transmission of data; otherwise it is
pulled to an inactive state.
Serial Master ClockSSI_MCLKThis clock signal is output from the device when it is the master. When
2
S master mode, this signal is referred to as the oversampling
in I
clock. The frequency of SSI_MCLK is a multiple of the frame clock.
I
O
I/O
O
MCF52277 Reference Manual, Rev. 1
2-12Freescale Semiconductor
Page 57
Signal Descriptions
Table 2-19. SSI Module Signals (continued)
Signal NameAbbreviationFunctionI/O
Serial Frame SyncSSI_FSUsed by transmitter/receiver to synchronize the transfer of data. In
gated clock mode, this signal is not used. When configured as an
input, the external device should drive SSI_FS during the rising edge
of SSI_BCLK.
Serial Receive DataSSI_RXDReceives data into the receive data shift registerI
Serial Transmit DataSSI_TXDTransmits data from the serial transmit shift register. O
I/O
2.3.18DMA Timer Signals
Table 2-20 describes the signals of the four DMA timer modules, where n equals 0–3.
Table 2-20. DMA Timer Signals
Signal NameAbbreviationFunctionI/O
DMA Timer n InputDTnINCan be programmed to cause events in the respective timer. It can
clock the event counter or provide a trigger to the timer value capture
logic.
DMA Timer n OutputDTnOUTOutput from respective timer.O
I
2.3.19Debug Support Signals
These signals are used as the interface to the on-chip JTAG controller and the BDM logic. Pin functionality
between JTAG and BDM is dependent upon the JTAG_EN pin.
Table 2-21. Debug Support Signals
Signal NameAbbreviationFunctionI/O
JTAG EnableJTAG_ENEnables JTAG (asserted) or BDM (negated) operation.I
JTAG Signals
Test ResetTRST
Test ClockTCLKUsed to synchronize the JTAG logic.I
Test Mode SelectTMSUsed to sequence the JTAG state machine. TMS is sampled on the
Test Data InputTDISerial input for test instructions and data. TDI is sampled on the rising
Test Data OutputTDOSerial output for test instructions and data. TDO is three-stateable and
Development Serial
Clock
DSCLKClocks the serial communication port to the BDM module during
Active-low signal used to initialize the JTAG logic asynchronously.I
rising edge of TCLK.
edge of TCLK.
actively driven in the shift-IR and shift-DR controller states. TDO
changes on the falling edge of TCLK.
BDM Signals
packet transfers.
I
I
O
I
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor2-13
Page 58
Signal Descriptions
Signal NameAbbreviationFunctionI/O
Table 2-21. Debug Support Signals (continued)
BreakpointBKPT
Development Serial
Input
Development Serial
Output
Processor Status Clock PSTCLKUsed by the development system to know when to sample DDATA and
Debug DataDDATA[3:0]Display captured processor data and breakpoint status. The PSTCLK
Processor Status
Outputs
All Processor Status
Outputs
DSIInternally-synchronized signal provides data input for the serial
DSOInternally-registered signal provides serial output communication for
PST[3:0]Indicate core status, as shown in Ta bl e 2- 2 2 . Debug mode timing is
ALLPSTALLPST is a logical AND of the four PST signals and is present in
Used to request a manual breakpoint.I
communication port to the BDM module.
BDM module responses.
PST signals.
signal can be used by the development system to know when to
sample DDATA[3:0].
Only present on the BGA device (MCF52277).
synchronous with the processor clock; status is unrelated to the
current bus transfer. The PSTCLK signal can be used by the
development system to know when to sample PST[3:0].
Only present on the BGA device (MCF52277).
place of PST[3:0] and DDATA[3:0] on the LQFP device (MCF52274).
When asserted, reflects that the core is halted.
Table 2-22. Processor Status
I
O
O
O
O
O
PST[3:0]
(MCF52274)
00000Continue execution
00010Begin execution of one instruction
00100Reserved
00110Entry into user mode
01000Begin execution of PULSE and WDDATA instructions
01010Begin execution of taken branch
01100Reserved
01110Begin execution of RTE instruction
10000Begin one-byte transfer on DDATA
10010Begin two-byte transfer on DDATA
10100Begin three-byte transfer on DDATA
10110Begin four-byte transfer on DDATA
11000Exception processing
11010Reserved
ALLPST
(MCF52277)
Processor Status
MCF52277 Reference Manual, Rev. 1
2-14Freescale Semiconductor
Page 59
Table 2-22. Processor Status (continued)
Signal Descriptions
PST[3:0]
(MCF52274)
11100Processor is stopped
11111Processor is halted
ALLPST
(MCF52277)
Processor Status
2.3.20Test Signals
Table 2-23 describes test signals reserved for factory testing.
Table 2-23. Test Signals
Signal NameAbbreviationFunctionI/O
TestTESTReserved for factory testing only and in normal modes of operation
should be connected to VSS to prevent unintentional activation of test
functions.
I
2.3.21Power and Ground Pins
The pins described in Table 2-24 provide system power and ground to the device. Multiple pins are
provided for adequate current capability. All power supply pins must have adequate bypass capacitance
for high-frequency noise suppression.
Table 2-24. Power and Ground Pins
Signal NameAbbreviationFunctionI/O
PLL Analog SupplyVDD_A_PLLDedicated power supply signal to isolate the sensitive PLL analog
(VCO) circuitry from the normal levels of noise present on the digital
power supply.
OscillatorVDD_OSC
VSS_OSC
Positive I/O SupplyEVDDThese pins supply positive power to the I/O pads
Positive Core SupplyIVDDThese pins supply positive power to the core logic.—
SDRAMC SupplySD_VDDThese pins supply positive power to the SDRAM controller.—
USB SupplyVDD_USBThese pins supply positive power to the USB controller.—
Real-time clock Supply VDD_RTCThese pins supply positive power to the RTC module.—
ADC supplyVDD_ADC
VSS_ADC
GroundVSSThese pins are the negative supply (ground) for the device.—
Dedicated power supply signals to isolate the sensitive oscillator
circuitry from the normal levels of noise present on the digital power
supply.
.—
Dedicated power supply for the touchscreen controller/ADC.—
—
—
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor2-15
Page 60
Signal Descriptions
MCF52277 Reference Manual, Rev. 1
2-16Freescale Semiconductor
Page 61
Chapter 3
Instruction
Instruction
FIFO
Decode & Select,
Address
IAG
IC
IB
DSOC
AGEX
Instruction Buffer
Address
Generation
Fetch Cycle
Generation,
Execute
Operand Fetch
Instruction
Operand
Pipeline
Execution
Fetch
Pipeline
Address [:0]
31
Read Data[31:0]
Write Data[31:0]
ColdFire Core
3.1Introduction
This section describes the organization of the Version 2 (V2) ColdFire® processor core and an overview
of the program-visible registers. For detailed information on instructions, see the ISA_A+ definition in the
ColdFire Family Programmer’s Reference Manual.
3.1.1Overview
As with all ColdFire cores, the V2 ColdFire core is comprised of two separate pipelines decoupled by an
instruction buffer.
The instruction fetch pipeline (IFP) is a two-stage pipeline for prefetching instructions. The prefetched
instruction stream is then gated into the two-stage operand execution pipeline (OEP), which decodes the
Freescale Semiconductor3-1
Figure 3-1. V2 ColdFire Core Pipelines
MCF52277 Reference Manual, Rev. 1
Page 62
ColdFire Core
(described fully in Chapter 4, “Enhanced Multiply-Accumulate Unit (EMAC
instruction, fetches the required operands and then executes the required function. Because the IFP and
OEP pipelines are decoupled by an instruction buffer serving as a FIFO queue, the IFP is able to prefetch
instructions in advance of their actual use by the OEP thereby minimizing time stalled waiting for
instructions.
The V2 ColdFire core pipeline stages include the following:
— Decode and select/operand fetch cycle (DSOC)—Decodes instructions and fetches the
required components for effective address calculation, or the operand fetch cycle
— Address generation/execute cycle (AGEX)—Calculates operand address or executes the
instruction
When the instruction buffer is empty, opcodes are loaded directly from the IC cycle into the operand
execution pipeline. If the buffer is not empty, the IFP stores the contents of the fetched instruction in the
IB until it is required by the OEP.
For register-to-register and register-to-memory store operations, the instruction passes through both OEP
stages once. For memory-to-register and read-modify-write memory operations, an instruction is
effectively staged through the OEP twice: the first time to calculate the effective address and initiate the
operand fetch on the processor’s local bus, and the second time to complete the operand reference and
perform the required function defined by the instruction.
The resulting pipeline and local bus structure allow the V2 ColdFire core to deliver sustained high
performance across a variety of demanding embedded applications.
3.2Memory Map/Register Description
The following sections describe the processor registers in the user and supervisor programming models.
The programming model is selected based on the processor privilege level (user mode or supervisor mode)
as defined by the S bit of the status register (SR). Table 3-1 lists the processor registers.
The user-programming model consists of the following registers:
— Four 48-bit accumulator registers partitioned as follows:
– Four 32-bit accumulators (ACC0–ACC3)
– Eight 8-bit accumulator extension bytes (two per accumulator). These are grouped into two
32-bit values for load and store operations (ACCEXT01 and ACCEXT23).
MCF52277 Reference Manual, Rev. 1
3-2Freescale Semiconductor
Page 63
ColdFire Core
•One 32-bit memory base address register (RAMBAR)
Accumulators and extension bytes can be loaded, copied, and stored, and results from EMAC
arithmetic operations generally affect the entire 48-bit destination.
— One 16-bit mask register (MASK)
— One 32-bit Status register (MACSR) including four indicator bits signaling product or
accumulation overflow (one for each accumulator: PAV0–PAV3)
The supervisor-programming model is intended to be used only by system control software to implement
restricted operating system functions, I/O control, and memory management. All accesses that affect the
control features of ColdFire processors are in the supervisor programming model, which consists of
registers available in user mode as well as the following control registers:
•16-bit status register (SR)
•32-bit supervisor stack pointer (SSP)
•32-bit vector base register (VBR)
•32-bit cache control register (CACR)
•32-bit access control registers (ACR0, ACR1)
Table 3-1. ColdFire Core Programming Model
1
BDM
Load: 0x080
Store: 0x180
Load: 0x081
Store: 0x181
Load: 0x082–7
Store: 0x182–7
Load: 0x088–8E
Store: 0x188–8E
Load: 0x08F
Store: 0x18F
0x804MAC Status Register (MACSR)32R/W0x0000_0000No4.2.1/4-3
Table 3-1. ColdFire Core Programming Model (continued)
1
BDM
0x80FProgram Counter (PC)32R/WContents of
0x002Cache Control Register (CACR)32R/W0x0000_0000Yes3.2.6/3-7
0x004–5Access Control Register 0–1 (ACR0–1)32R/WSee SectionYes3.2.7/3-7
0x800User/Supervisor A7 Stack Pointer
(OTHER_A7)
0x801Vector Base Register (VBR)32R/W0x0000_0000Yes3.2.8/3-7
0x80EStatus Register (SR)16R/W0x27--No3.2.9/3-8
0xC05RAM Base Address Register (RAMBAR)32R/WSee SectionYes3.2.10/3-8
1
The values listed in this column represent the Rc field used when accessing the core registers via the BDM port. For more
information see Chapter 32, “Debug Module”.
Register
Supervisor Access Only Registers
Width
(bits)
AccessReset Value
location
0x0000_0004
32R/WContents of
location
0x0000_0000
Written with
MOVEC
No3.2.5/3-7
No3.2.3/3-5
Section/Page
3.2.1Data Registers (D0–D7)
D0–D7 data registers are for bit (1-bit), byte (8-bit), word (16-bit) and longword (32-bit) operations; they
can also be used as index registers.
NOTE
Registers D0 and D1 contain hardware configuration details after reset. See
Section 3.3.4.15, “Reset Exception” for more details.
These registers can be used as software stack pointers, index registers, or base address registers. They can
also be used for word and longword operations.
3.2.3Supervisor/User Stack Pointers (A7 and OTHER_A7)
This ColdFire architecture supports two independent stack pointer (A7) registers—the supervisor stack
pointer (SSP) and the user stack pointer (USP). The hardware implementation of these two
program-visible 32-bit registers does not identify one as the SSP and the other as the USP. Instead, the
hardware uses one 32-bit register as the active A7 and the other as OTHER_A7. Thus, the register contents
are a function of the processor operation mode, as shown in the following:
if SR[S] = 1
thenA7 = Supervisor Stack Pointer
OTHER_A7 = User Stack Pointer
elseA7 = User Stack Pointer
OTHER_A7 = Supervisor Stack Pointer
The BDM programming model supports direct reads and writes to A7 and OTHER_A7. It is the
responsibility of the external development system to determine, based on the setting of SR[S], the mapping
of A7 and OTHER_A7 to the two program-visible definitions (SSP and USP). This functionality is
enabled by setting the enable user stack pointer bit, CACR[EUSP]. If this bit is cleared, only a single stack
pointer (A7), defined for ColdFire ISA_A, is available. EUSP is cleared at reset.
To support dual stack pointers, the following two supervisor instructions are included in the ColdFire
instruction set architecture to load/store the USP:
move.l Ay,USP;move to USP
move.l USP,Ax;move from USP
These instructions are described in the ColdFire Family Programmer’s Reference Manual. All other
instruction references to the stack pointer, explicit or implicit, access the active A7 register.
NOTE
The SSP is loaded during reset exception processing with the contents of
location 0x0000_0000.
Figure 3-4. Stack Pointer Registers (A7 and OTHER_A7)
3.2.4Condition Code Register (CCR)
The CCR is the LSB of the processor status register (SR). Bits 4–0 act as indicator flags for results
generated by processor operations. The extend bit (X) is also an input operand during multiprecision
arithmetic computations. The CCR register must be explicitly loaded after reset and before any compare
(CMP), Bcc, or Scc instructions are executed.
BDM: LSB of Status Register (SR)Access: User read/write
BDM read/write
76543210
R000
W
XNZVC
Reset:0 0 0 —————
Figure 3-5. Condition Code Register (CCR)
Table 3-2. CCR Field Descriptions
FieldDescription
7–5Reserved, must be cleared.
4
Extend condition code bit. Set to the C-bit value for arithmetic operations; otherwise not affected or set to a specified
X
result.
3
Negative condition code bit. Set if most significant bit of the result is set; otherwise cleared.
N
2
Zero condition code bit. Set if result equals zero; otherwise cleared.
Z
1
Overflow condition code bit. Set if an arithmetic overflow occurs implying the result cannot be represented in operand
V
size; otherwise cleared.
0
Carry condition code bit. Set if a carry out of the operand msb occurs for an addition or if a borrow occurs in a
C
subtraction; otherwise cleared.
MCF52277 Reference Manual, Rev. 1
3-6Freescale Semiconductor
Page 67
ColdFire Core
3.2.5Program Counter (PC)
The PC contains the currently executing instruction address. During instruction execution and exception
processing, the processor automatically increments contents of the PC or places a new value in the PC, as
appropriate. The PC is a base address for PC-relative operand addressing.
The PC is initially loaded during reset exception processing with the contents of location 0x0000_0004.
The CACR controls operation of the instruction/data cache memories. It includes bits for enabling,
freezing, and invalidating cache contents. It also includes bits for defining the default cache mode and
write-protect fields. The CACR is described in Section 5.2.1, “Cache Control Register (CACR).”
3.2.7Access Control Registers (ACRn)
The access control registers define attributes for user-defined memory regions. These attributes include the
definition of cache mode, write protect, and buffer write enables. The ACRs are described in Section 5.2.2,
“Access Control Registers (ACR0, ACR1).”
3.2.8Vector Base Register (VBR)
The VBR contains the base address of the exception vector table in memory. To access the vector table,
the displacement of an exception vector is added to the value in VBR. The lower 20 bits of the VBR are
not implemented by ColdFire processors. They are assumed to be zero, forcing the table to be aligned on
a 1 MByte boundary.
The memory base address register is used to specify the base address of the internal SRAM module and
indicates the types of references mapped to it. The base address register includes a base address,
write-protect bit, address space mask bits, and an enable bit. RAMBAR determines the base address of
the on-chip RAM. For more information, refer to Section 6.2.1, “SRAM Base Address Register
(RAMBAR)”.
3.2.9Status Register (SR)
The SR stores the processor status and includes the CCR, the interrupt priority mask, and other control
bits. In supervisor mode, software can access the entire SR. In user mode, only the lower 8 bits (CCR) are
accessible. The control bits indicate the following states for the processor: trace mode (T bit), supervisor
or user mode (S bit), and master or interrupt state (M bit). All defined bits in the SR have read/write access
when in supervisor mode. The lower byte of the SR (the CCR) must be loaded explicitly after reset and
before any compare (CMP), Bcc, or Scc instructions execute.
BDM: 0x80E (SR)Access: Supervisor read/write
BDM read/write
System ByteCondition Code Register (CCR)
1514131211109876543210
R
W
Reset00100111000—————
0
T
SM
0
I
Figure 3-8. Status Register (SR)
Table 3-3. SR Field Descriptions
FieldDescription
000
XNZVC
15
14Reserved, must be cleared.
13
12
11Reserved, must be cleared.
10–8IInterrupt level mask. Defines current interrupt level. Interrupt requests are inhibited for all priority levels less than or
7–0
CCR
Trace enable. When set, the processor performs a trace exception after every instruction.
T
Supervisor/user state.
S
0User mode
1 Supervisor mode
Master/interrupt state. Bit is cleared by an interrupt exception and software can set it during execution of the RTE or
M
move to SR instructions.
equal to current level, except edge-sensitive level 7 requests, which cannot be masked.
Refer to Section 3.2.4, “Condition Code Register (CCR)”.
3-8Freescale Semiconductor
MCF52277 Reference Manual, Rev. 1
Page 69
ColdFire Core
IAGICIB
Core Bus
Address
Core Bus
Read Data
Opword
Extension 1
Extension 2
FIFO
IB
+4
3.3Functional Description
3.3.1Version 2 ColdFire Microarchitecture
From the block diagram in Figure 3-1, the non-Harvard architecture of the processor is readily apparent.
The processor interfaces to the local memory subsystem via a single 32-bit address and two unidirectional
32-bit data buses. This structure minimizes the core size without compromising performance to a large
degree.
A more detailed view of the hardware structure within the two pipelines is presented in Figure 3-9 and
Figure 3-10 below. In these diagrams, the internal structure of the instruction fetch and operand execution
pipelines is shown:
Figure 3-9. Version 2 ColdFire Processor Instruction Fetch Pipeline Diagram
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-9
Page 70
ColdFire Core
DSOCAGEX
Opword
Extension 1
Extension 2
Core Bus
Read Data
Core Bus
Address
Core Bus
Write Data
RGF
Figure 3-10. Version 2 ColdFire Processor Operand Execution Pipeline Diagram
The instruction fetch pipeline prefetches instructions from local memory using a two-stage structure. For
sequential prefetches, the next instruction address is generated by adding four to the last prefetch address.
This function is performed during the IAG stage and the resulting prefetch address gated onto the core bus
(if there are no pending operand memory accesses assigned a higher priority). After the prefetch address
is driven onto the core bus, the instruction fetch cycle accesses the appropriate local memory and returns
the instruction read data back to the IFP during the cycle. If the accessed data is not present in a local
memory (e.g., an instruction cache miss, or an external access cycle is required), the IFP is stalled in the
IC stage until the referenced data is available. As the prefetch data arrives in the IFP, it can be loaded into
the FIFO instruction buffer or gated directly into the OEP.
The V2 design uses a simple static conditional branch prediction algorithm (forward-assumed as
not-taken, backward-assumed as taken), and all change-of-flow operations are calculated by the OEP and
the target instruction address fed back to the IFP.
The IFP and OEP are decoupled by the FIFO instruction buffer, allowing instruction prefetching to occur
with the available core bus bandwidth not used for operand memory accesses. For the V2 design, the
instruction buffer contains three 32-bit locations.
Consider the operation of the OEP for three basic classes of non-branch instructions:
•Register-to-register:
opRy,Rx
•Embedded load:
op<mem>y,Rx
•Register-to-memory (store)
moveRy,<mem>x
For simple register-to-register instructions, the first stage of the OEP performs the instruction decode and
fetching of the required register operands (OC) from the dual-ported register file, while the actual
MCF52277 Reference Manual, Rev. 1
3-10Freescale Semiconductor
Page 71
ColdFire Core
Operand Execution Pipeline
DSOCAGEX
Opword
Extension 1
Extension 2
Core Bus
Read Data
Core Bus
Address
Core Bus
Write
Data
new Rx
Rx
Ry
RGF
instruction execution is performed in the second stage (EX) in one of the execute engines (e.g., ALU,
barrel shifter, divider, EMAC). There are no operand memory accesses associated with this class of
instructions, and the execution time is typically a single machine cycle. See Figure 3-11.
Figure 3-11. V2 OEP Register-to-Register
For memory-to-register (embedded-load) instructions, the instruction is effectively staged through the
OEP twice with a basic execution time of three cycles. First, the instruction is decoded and the components
of the operand address (base register from the RGF and displacement) are selected (DS). Second, the
operand effective address is generated using the ALU execute engine (AG). Third, the memory read
operand is fetched from the core bus, while any required register operand is simultaneously fetched (OC)
from the RGF. Finally, in the fourth cycle, the instruction is executed (EX). The heavily-used 32-bit load
instruction (
move.l <mem>y,Rx) is optimized to support a two-cycle execution time. The following example
in Figure 3-12 shows an effective address of the form <ea>y = (d16,Ay), i.e., a 16-bit signed displacement
added to a base register Ay.
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-11
Page 72
ColdFire Core
Operand Execution Pipeline
DSOCAGEX
Opword
Extension 1
Extension 2
Core Bus
Read Data
Core Bus
Address
Core Bus
Write
RGF
Data
Ay
d16
<ea>y
Operand Execution Pipeline
DSOCAGEX
Opword
Extension 1
Extension 2
Core Bus
Read Data
Core Bus
Address
Core Bus
Write
RGF
Data
Rx
new Rx
<mem>y
Figure 3-12. V2 OEP Embedded-Load Part 1
Figure 3-13. V2 OEP Embedded-Load Part 2
For register-to-memory (store) operations, the stage functions (DS/OC, AG/EX) are effectively performed
simultaneously allowing single-cycle execution. See Figure 3-14 where the effective address is of the form
<ea>x = (d16,Ax), i.e., a 16-bit signed displacement added to a base register Ax.
MCF52277 Reference Manual, Rev. 1
3-12Freescale Semiconductor
Page 73
ColdFire Core
Operand Execution Pipeline
DSOCAGEX
Opword
Extension 1
Extension 2
Core Bus
Read Data
Core Bus
Address
Core Bus
Write
RGF
Data
Ax
d16
Ry
<ea>x
For read-modify-write instructions, the pipeline effectively combines an embedded-load with a store
operation for a three-cycle execution time.
Figure 3-14. V2 OEP Register-to-Memory
The pipeline timing diagrams of Figure 3-15 depict the execution templates for these three classes of
instructions. In these diagrams, the x-axis represents time, and the various instruction operations are shown
progressing down the operand execution pipeline.
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-13
Page 74
ColdFire Core
Core clock
Register-to-Register
Core Bus
Embedded-Load
Core Bus
Register-to-Memory
op read
Core Bus
op write
OEP.DSOCOCnext
OEP.AGEXEX
OEP.DSOCDSOCnext
OEP.AGEXEXAG
OEP.DSOCDSOCnext
OEP.AGEXAGEX
(Store)
3.3.2Instruction Set Architecture (ISA_A+)
The original ColdFire Instruction Set Architecture (ISA_A) was derived from the M68000 family opcodes
based on extensive analysis of embedded application code. The ISA was optimized for code compiled
from high-level languages where the dominant operand size was the 32-bit integer declaration. This
approach minimized processor complexity and cost, while providing excellent performance for compiled
applications.
After the initial ColdFire compilers were created, developers noted there were certain ISA additions that
would enhance code density and overall performance. Additionally, as users implemented ColdFire-based
designs into a wide range of embedded systems, they found certain frequently-used instruction sequences
that could be improved by the creation of additional instructions.
The original ISA definition minimized support for instructions referencing byte- and word-sized operands.
Full support for the move byte and move word instructions was provided, but the only other opcodes
supporting these data types are CLR (clear) and TST (test). A set of instruction enhancements has been
implemented in subsequent ISA revisions, ISA_B and ISA_C. The new opcodes primarily addressed three
areas:
Figure 3-15. V2 OEP Pipeline Execution Templates
1. Enhanced support for byte and word-sized operands
2. Enhanced support for position-independent code
3. Miscellaneous instruction additions to address new functionality
3-14Freescale Semiconductor
MCF52277 Reference Manual, Rev. 1
Page 75
ColdFire Core
2. The processor determines the exception vector number. For all faults except interrupts, the
processor performs this calculation based on exception type. For interrupts, the processor
performs an interrupt-acknowledge (IACK) bus cycle to obtain the vector number from the
interrupt controller. The IACK cycle is mapped to special locations within the interrupt
controller’s address space with the interrupt level encoded in the address.
Table 3-4 summarizes the instructions added to revision ISA_A to form revision ISA_A+. For more details
see the ColdFire Family Programmer’s Reference Manual.
Table 3-4. Instruction Enhancements over Revision ISA_A
InstructionDescription
BITREVThe contents of the destination data register are bit-reversed; new Dn[31] equals old Dn[0], new
Dn[30] equals old Dn[1],..., new Dn[0] equals old Dn[31].
BYTEREVThe contents of the destination data register are byte-reversed; new Dn[31:24] equals old
Dn[7:0],..., new Dn[7:0] equals old Dn[31:24].
FF1The data register, Dn, is scanned, beginning from the most-significant bit (Dn[31]) and ending
with the least-significant bit (Dn[0]), searching for the first set bit. The data register is then
loaded with the offset count from bit 31 where the first set bit appears.
Move from USP USP → Destination register
Move to USPSource register → USP
STLDSRPushes the contents of the status register onto the stack and then reloads the status register
with the immediate data value.
3.3.3Exception Processing Overview
Exception processing for ColdFire processors is streamlined for performance. The ColdFire processors
differ from the M68000 family because they include:
•A simplified exception vector table
•Reduced relocation capabilities using the vector-base register
•A single exception stack frame format
•Use of separate system stack pointers for user and supervisor modes.
All ColdFire processors use an instruction restart exception model. However, Version 2 ColdFire
processors require more software support to recover from certain access errors. See Section 3.3.4.1,
“Access Error Exception” for details.
Exception processing includes all actions from fault condition detection to the initiation of fetch for first
handler instruction. Exception processing is comprised of four major steps:
1. The processor makes an internal copy of the SR and then enters supervisor mode by setting the S
bit and disabling trace mode by clearing the T bit. The interrupt exception also forces the M bit to
be cleared and the interrupt priority mask to set to current interrupt request level.
Freescale Semiconductor3-15
MCF52277 Reference Manual, Rev. 1
Page 76
ColdFire Core
All ColdFire processors support a 1024-byte vector table aligned on any 1 Mbyte address boundary (see
Table 3-5).
3. The processor saves the current context by creating an exception stack frame on the system stack.
The exception stack frame is created at a 0-modulo-4 address on top of the system stack pointed to
by the supervisor stack pointer (SSP). As shown in Figure 3-16, the processor uses a simplified
fixed-length stack frame for all exceptions. The exception type determines whether the program
counter placed in the exception stack frame defines the location of the faulting instruction (fault)
or the address of the next instruction to be executed (next).
4. The processor calculates the address of the first instruction of the exception handler. By definition,
the exception vector table is aligned on a 1 Mbyte boundary. This instruction address is generated
by fetching an exception vector from the table located at the address defined in the vector base
register. The index into the exception table is calculated as (4 × vector number). After the exception
vector has been fetched, the vector contents determine the address of the first instruction of the
desired handler. After the instruction fetch for the first opcode of the handler has initiated,
exception processing terminates and normal instruction processing continues in the handler.
The table contains 256 exception vectors; the first 64 are defined for the core and the remaining 192 are
device-specific peripheral interrupt vectors. See Chapter 15, “Interrupt Controller Modules” for details on
the device-specific interrupt sources.
Fault refers to the PC of the instruction that caused the exception. Next refers to the PC
of the instruction that follows the instruction that caused the fault.
Vector
Offset (Hex)
Stacked
Program
Counter
Assignment
All ColdFire processors inhibit interrupt sampling during the first instruction of all exception handlers.
This allows any handler to disable interrupts effectively, if necessary, by raising the interrupt mask level
contained in the status register. In addition, the ISA_A+ architecture includes an instruction (STLDSR)
that stores the current interrupt mask level and loads a value into the SR. This instruction is specifically
intended for use as the first instruction of an interrupt service routine that services multiple interrupt
requests with different interrupt levels. For more details, see ColdFire Family Programmer’s Reference Manual.
3.3.3.1Exception Stack Frame Definition
Figure 3-16 shows exception stack frame. The first longword contains the 16-bit format/vector word (F/V)
and the 16-bit status register, and the second longword contains the 32-bit program counter address.
The 16-bit format/vector word contains three unique fields:
•A 4-bit format field at the top of the system stack is always written with a value of 4, 5, 6, or 7 by
the processor, indicating a two-longword frame format. See Table 3-6.
Table 3-6. Format Field Encodings
Original SSP @ Time
of Exception, Bits 1:0
00Original SSP - 80100
01Original SSP - 90101
10Original SSP - 100110
11Original SSP - 110111
SSP @ 1st
Instruction of
Handler
Format Field
•There is a 4-bit fault status field, FS[3:0], at the top of the system stack. This field is defined for
access and address errors only and written as zeros for all other exceptions. See Table 3- 7.
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-17
Page 78
ColdFire Core
Table 3-7. Fault Status Encodings
FS[3:0]Definition
00xxReserved
0100Error on instruction fetch
0101Reserved
011xReserved
1000Error on operand write
1001Attempted write to write-protected space
101xReserved
1100Error on operand read
1101Reserved
111xReserved
•The 8-bit vector number, vector[7:0], defines the exception type and is calculated by the processor
for all internal faults and represents the value supplied by the interrupt controller in case of an
interrupt. See Table 3-5.
3.3.4Processor Exceptions
3.3.4.1Access Error Exception
The exact processor response to an access error depends on the memory reference being performed. For
an instruction fetch, the processor postpones the error reporting until the faulted reference is needed by an
instruction for execution. Therefore, faults during instruction prefetches followed by a change of
instruction flow do not generate an exception. When the processor attempts to execute an instruction with
a faulted opword and/or extension words, the access error is signaled and the instruction aborted. For this
type of exception, the programming model has not been altered by the instruction generating the access
error.
If the access error occurs on an operand read, the processor immediately aborts the current instruction’s
execution and initiates exception processing. In this situation, any address register updates attributable to
the auto-addressing modes, (for example, (An)+,-(An)), have already been performed, so the programming
model contains the updated An value. In addition, if an access error occurs during a MOVEM instruction
loading from memory, any registers already updated before the fault occurs contain the operands from
memory.
The V2 ColdFire processor uses an imprecise reporting mechanism for access errors on operand writes.
Because the actual write cycle may be decoupled from the processor’s issuing of the operation, the
signaling of an access error appears to be decoupled from the instruction that generated the write.
Accordingly, the PC contained in the exception stack frame merely represents the location in the program
when the access error was signaled. All programming model updates associated with the write instruction
are completed. The NOP instruction can collect access errors for writes. This instruction delays its
MCF52277 Reference Manual, Rev. 1
3-18Freescale Semiconductor
Page 79
ColdFire Core
execution until all previous operations, including all pending write operations, are complete. If any
previous write terminates with an access error, it is guaranteed to be reported on the NOP instruction.
3.3.4.2Address Error Exception
Any attempted execution transferring control to an odd instruction address (if bit 0 of the target address is
set) results in an address error exception.
Any attempted use of a word-sized index register (Xn.w) or a scale factor of eight on an indexed effective
addressing mode generates an address error, as does an attempted execution of a full-format indexed
addressing mode, which is defined by bit 8 of extension word 1 being set.
If an address error occurs on a JSR instruction, the Version 2 ColdFire processor calculates the target
address then the return address is pushed onto the stack.If an address error occurs on an RTS instruction,
the Version 2 ColdFire processor overwrites the faulting return PC with the address error stack frame.
3.3.4.3Illegal Instruction Exception
The ColdFire variable-length instruction set architecture supports three instruction sizes: 16, 32, or 48 bits.
The first instruction word is known as the operation word (or opword), while the optional words are known
as extension word 1 and extension word 2. The opword is further subdivided into three sections: the upper
four bits segment the entire ISA into 16 instruction lines, the next 6 bits define the operation mode
(opmode), and the low-order 6 bits define the effective address. See Figure 3-17. The opword line
definition is shown in Table 3-8.
1514131211109876543210
LineOpModeEffective Address
ModeRegister
Figure 3-17. ColdFire Instruction Operation Word (Opword) Format
Table 3-8. ColdFire Opword Line Definition
Opword[Line]Instruction Class
0x0Bit manipulation, Arithmetic and Logical Immediate
0x1Move Byte
0x2Move Long
0x3Move Word
0x4Miscellaneous
0x5Add (ADDQ) and Subtract Quick (SUBQ), Set according to Condition Codes (Scc)
0x6PC-relative change-of-flow instructions
Conditional (Bcc) and unconditional (BRA) branches, subroutine calls (BSR)
0x7Move Quick (MOVEQ), Move with sign extension (MVS) and zero fill (MVZ)
0x8Logical OR (OR)
0x9Subtract (SUB), Subtract Extended (SUBX)
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-19
Page 80
ColdFire Core
Table 3-8. ColdFire Opword Line Definition (continued)
Opword[Line]Instruction Class
0xAEMAC, Move 3-bit Quick (MOV3Q)
0xBCompare (CMP), Exclusive-OR (EOR)
0xCLogical AND (AND), Multiply Word (MUL)
0xDAdd (ADD), Add Extended (ADDX)
0xEArithmetic and logical shifts (ASL, ASR, LSL, LSR)
In the original M68000 ISA definition, lines A and F were effectively reserved for user-defined operations
(line A) and co-processor instructions (line F). Accordingly, there are two unique exception vectors
associated with illegal opwords in these two lines.
Any attempted execution of an illegal 16-bit opcode (except for line-A and line-F opcodes) generates an
illegal instruction exception (vector 4). Additionally, any attempted execution of any non-MAC line-A and
most line-F opcodes generate their unique exception types, vector numbers 10 and 11, respectively.
ColdFire cores do not provide illegal instruction detection on the extension words on any instruction,
including MOVEC.
3.3.4.4Divide-By-Zero
Attempting to divide by zero causes an exception (vector 5, offset equal 0x014).
3.3.4.5Privilege Violation
The attempted execution of a supervisor mode instruction while in user mode generates a privilege
violation exception. See ColdFire Programmer’s Reference Manual for a list of supervisor-mode
instructions.
There is one special case involving the HALT instruction. Normally, this opcode is a supervisor mode
instruction, but if the debug module's CSR[UHE] is set, then this instruction can be also be executed in
user mode for debugging purposes.
3.3.4.6Trace Exception
To aid in program development, all ColdFire processors provide an instruction-by-instruction tracing
capability. While in trace mode, indicated by setting of the SR[T] bit, the completion of an instruction
execution (for all but the stop instruction) signals a trace exception. This functionality allows a debugger
to monitor program execution.
The stop instruction has the following effects:
1. The instruction before the stop executes and then generates a trace exception. In the exception stack
frame, the PC points to the stop opcode.
2. When the trace handler is exited, the stop instruction executes, loading the SR with the immediate
operand from the instruction.
MCF52277 Reference Manual, Rev. 1
3-20Freescale Semiconductor
Page 81
ColdFire Core
3. The processor then generates a trace exception. The PC in the exception stack frame points to the
instruction after the stop, and the SR reflects the value loaded in the previous step.
If the processor is not in trace mode and executes a stop instruction where the immediate operand sets
SR[T], hardware loads the SR and generates a trace exception. The PC in the exception stack frame points
to the instruction after the stop, and the SR reflects the value loaded in step 2.
Because ColdFire processors do not support any hardware stacking of multiple exceptions, it is the
responsibility of the operating system to check for trace mode after processing other exception types. As
an example, consider a TRAP instruction execution while in trace mode. The processor initiates the trap
exception and then passes control to the corresponding handler. If the system requires that a trace exception
be processed, it is the responsibility of the trap exception handler to check for this condition (SR[T] in the
exception stack frame set) and pass control to the trace handler before returning from the original
exception.
3.3.4.7Unimplemented Line-A Opcode
A line-A opcode is defined when bits 15-12 of the opword are 0b1010. This exception is generated by the
attempted execution of an undefined line-A opcode.
3.3.4.8Unimplemented Line-F Opcode
A line-F opcode is defined when bits 15-12 of the opword are 0b1111. This exception is generated when
attempting to execute an undefined line-F opcode.
3.3.4.9Debug Interrupt
See Chapter 32, “Debug Module,” for a detailed explanation of this exception, which is generated in
response to a hardware breakpoint register trigger. The processor does not generate an IACK cycle, but
rather calculates the vector number internally (vector number 12). Additionally, SR[M,I] are unaffected by
the interrupt.
3.3.4.10RTE and Format Error Exception
When an RTE instruction is executed, the processor first examines the 4-bit format field to validate the
frame type. For a ColdFire core, any attempted RTE execution (where the format is not equal to {4,5,6,7})
generates a format error. The exception stack frame for the format error is created without disturbing the
original RTE frame and the stacked PC pointing to the RTE instruction.
The selection of the format value provides some limited debug support for porting code from M68000
applications. On M68000 family processors, the SR was located at the top of the stack. On those
processors, bit 30 of the longword addressed by the system stack pointer is typically zero. Thus, if an RTE
is attempted using this old format, it generates a format error on a ColdFire processor.
If the format field defines a valid type, the processor: (1) reloads the SR operand, (2) fetches the second
longword operand, (3) adjusts the stack pointer by adding the format value to the auto-incremented address
after the fetch of the first longword, and then (4) transfers control to the instruction address defined by the
second longword operand within the stack frame.
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-21
Page 82
ColdFire Core
3.3.4.11TRAP Instruction Exception
The TRAP #n instruction always forces an exception as part of its execution and is useful for implementing
system calls. The TRAP instruction may be used to change from user to supervisor mode.
3.3.4.12Unsupported Instruction Exception
If execution of a valid instruction is attempted but the required hardware is not present in the processor, an
unsupported instruction exception is generated. The instruction functionality can then be emulated in the
exception handler, if desired.
All ColdFire cores record the processor hardware configuration in the D0 register immediately after the
negation of RESET. See Section 3.3.4.15, “Reset Exception,” for details.
3.3.4.13Interrupt Exception
Interrupt exception processing includes interrupt recognition and the fetch of the appropriate vector from
the interrupt controller using an IACK cycle. See Chapter 15, “Interrupt Controller Modules,” for details
on the interrupt controller.
3.3.4.14Fault-on-Fault Halt
If a ColdFire processor encounters any type of fault during the exception processing of another fault, the
processor immediately halts execution with the catastrophic fault-on-fault condition. A reset is required to
force the processor to exit this halted state.
3.3.4.15Reset Exception
Asserting the reset input signal (RESET) to the processor causes a reset exception. The reset exception has
the highest priority of any exception; it provides for system initialization and recovery from catastrophic
failure. Reset also aborts any processing in progress when the reset input is recognized. Processing cannot
be recovered.
The reset exception places the processor in the supervisor mode by setting the SR[S] bit and disables
tracing by clearing the SR[T] bit. This exception also clears the SR[M] bit and sets the processor’s SR[I]
bit to the highest level (level 7, 0b111). Next, the VBR is initialized to zero (0x0000_0000). The control
registers specifying the operation of any memories (e.g., cache and/or RAM modules) connected directly
to the processor are disabled.
NOTE
Other implementation-specific registers are also affected. Refer to each
module in this reference manual for details on these registers.
After the processor is granted the bus, it performs two longword read-bus cycles. The first longword at
address 0x0000_0000 is loaded into the supervisor stack pointer and the second longword at address
0x0000_0004 is loaded into the program counter. After the initial instruction is fetched from memory,
program execution begins at the address in the PC. If an access error or address error occurs before the first
instruction is executed, the processor enters the fault-on-fault state.
MCF52277 Reference Manual, Rev. 1
3-22Freescale Semiconductor
Page 83
ColdFire Core
(This is the value used for this device.)
ColdFire processors load hardware configuration information into the D0 and D1 general-purpose
registers after system reset. The hardware configuration information is loaded immediately after the
reset-in signal is negated. This allows an emulator to read out the contents of these registers via the BDM
to determine the hardware configuration.
Information loaded into D0 defines the processor hardware configuration as shown in Figure 3-18.
BDM: Load: 0x080 (D0)
Store: 0x180 (D0)
31302928272625242322212019181716
RPFVERREV
W
Reset1100111100100000
1514131211109876543210
R MACDIVEMACFPUMMU000ISADEBUG
W
Reset0110000010001001
Access: User read-only
BDM read-only
Figure 3-18. D0 Hardware Configuration Info
Table 3-9. D0 Hardware Configuration Info Field Description
FieldDescription
31–24PFProcessor family. This field is fixed to a hex value of 0xCF indicating a ColdFire core is present.
23–20
VER
ColdFire core version number. Defines the hardware microarchitecture version of ColdFire core.
0001 V1 ColdFire core
0010 V2 ColdFire core (This is the value used for this device.)
0011 V3 ColdFire core
0100 V4 ColdFire core
0101 V5 ColdFire core
Else Reserved for future use
19–16
REV
MAC
EMAC
FPU
Freescale Semiconductor3-23
Processor revision number. The default is 0b0000.
15
MAC present. This bit signals if the optional multiply-accumulate (MAC) execution engine is present in processor core.
0 MAC execute engine not present in core. (This is the value used for this device.)
1 MAC execute engine is present in core.
14
Divide present. This bit signals if the hardware divider (DIV) is present in the processor core.
DIV
0 Divide execute engine not present in core.
1 Divide execute engine is present in core.
13
EMAC present. This bit signals if the optional enhanced multiply-accumulate (EMAC) execution engine is present in
processor core.
0 EMAC execute engine not present in core.
1 EMAC execute engine is present in core. (This is the value used for this device.)
12
FPU present. This bit signals if the optional floating-point (FPU) execution engine is present in processor core.
0 FPU execute engine not present in core. (This is the value used for this device.)
1 FPU execute engine is present in core.
MCF52277 Reference Manual, Rev. 1
Page 84
ColdFire Core
Table 3-9. D0 Hardware Configuration Info Field Description (continued)
FieldDescription
11
MMU present. This bit signals if the optional virtual memory management unit (MMU) is present in processor core.
MMU
10–8Reserved.
DEBUG
0 MMU execute engine not present in core. (This is the value used for this device.)
1 MMU execute engine is present in core.
7–4
ISA revision. Defines the instruction-set architecture (ISA) revision level implemented in ColdFire processor core.
ISA
0000 ISA_A
0001 ISA_B
0010 ISA_C
1000 ISA_A+ (This is the value used for this device.)
Else Reserved
3–0
Debug module revision number. Defines revision level of the debug module used in the ColdFire processor core.
0000 DEBUG_A
0001 DEBUG_B
0010 DEBUG_C
0011 DEBUG_D
0100 DEBUG_E
1001 DEBUG_B+ (This is the value used for this device.)
1011 DEBUG_D+
Else Reserved
Information loaded into D1 defines the local memory hardware configuration as shown in the figure below.
BDM: Load: 0x081 (D1)
Store: 0x181 (D1)
31302928272625242322212019181716
RCLSZ CCASCCSZ00000000
W
Reset0001010100000000
1514131211109876543210
RMBSZ 000000SRAMSZ0000
W
Reset000000010010000
Figure 3-19. D1 Hardware Configuration Info
Access: User read-only
BDM read-only
MCF52277 Reference Manual, Rev. 1
3-24Freescale Semiconductor
Page 85
Table 3-10. D1 Hardware Configuration Information Field Description
FieldDescription
ColdFire Core
31–30
CLSZ
29–28
CCAS
27–24
CCSZ
23–16Reserved.
15–14
MBSZ
13–8Reserved, resets to 0b010000
Cache line size. This field is fixed to a hex value of 0x0 indicating a 16-byte cache line size.
Configurable cache associativity.
00Four-way
01Direct mapped (This is the value used for this device)
Else Reserved for future use
Configurable cache size. Indicates the amount of instruction/data cache. The cache configuration options
available are 50% instruction/50% data, 100% instruction, or 100% data, and are specified in the CACR register.
0000 No configurable cache
0001 512B configurable cache
0010 1KB configurable cache
0011 2KB configurable cache
0100 4KB configurable cache
0101 8KB configurable cache (This is the value used for this device)
0110 16KB configurable cache
0111 32KB configurable cache
Else Reserved
Bus size. Defines the width of the ColdFire master bus datapath.
0032-bit system bus datapath (This is the value used for this device)
0164-bit system bus datapath
Else Reserved
7–4
SRAMSZ
3-0Reserved.
SRAM bank size.
0000 No SRAM
0001 512 bytes
0010 1 Kbytes
0011 2 Kbytes
0100 4 Kbytes
0101 8 Kbytes
0110 16 Kbytes
0111 32 Kbytes
1000 64 Kbytes
1001 128 Kbytes (This is the value used for this device)
Else Reserved for future use
3.3.5Instruction Execution Timing
This section presents processor instruction execution times in terms of processor-core clock cycles. The
number of operand references for each instruction is enclosed in parentheses following the number of
processor clock cycles. Each timing entry is presented as C(R/W) where:
•C is the number of processor clock cycles, including all applicable operand fetches and writes, and
all internal core cycles required to complete the instruction execution.
•R/W is the number of operand reads (R) and writes (W) required by the instruction. An operation
performing a read-modify-write function is denoted as (1/1).
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-25
Page 86
ColdFire Core
This section includes the assumptions concerning the timing values and the execution time details.
3.3.5.1Timing Assumptions
For the timing data presented in this section, these assumptions apply:
1. The OEP is loaded with the opword and all required extension words at the beginning of each
instruction execution. This implies that the OEP does not wait for the IFP to supply opwords and/or
extension words.
2. The OEP does not experience any sequence-related pipeline stalls. The most common example of
stall involves consecutive store operations, excluding the MOVEM instruction. For all STORE
operations (except MOVEM), certain hardware resources within the processor are marked as busy
for two clock cycles after the final decode and select/operand fetch cycle (DSOC) of the store
instruction. If a subsequent STORE instruction is encountered within this 2-cycle window, it is
stalled until the resource again becomes available. Thus, the maximum pipeline stall involving
consecutive STORE operations is two cycles. The MOVEM instruction uses a different set of
resources and this stall does not apply.
3. The OEP completes all memory accesses without any stall conditions caused by the memory itself.
Thus, the timing details provided in this section assume that an infinite zero-wait state memory is
attached to the processor core.
4. All operand data accesses are aligned on the same byte boundary as the operand size; for example,
16-bit operands aligned on 0-modulo-2 addresses, 32-bit operands aligned on 0-modulo-4
addresses.
The processor core decomposes misaligned operand references into a series of aligned accesses as
shown in Table 3-11.
Table 3-11. Misaligned Operand References
address[1:0]Size
01 or 11WordByte, Byte2(1/0) if read
01 or 11LongByte, Word,
10LongWord, Word2(1/0) if read
Bus
Operations
Byte
Additional
C(R/W)
1(0/1) if write
3(2/0) if read
2(0/2) if write
1(0/1) if write
3.3.5.2MOVE Instruction Execution Times
Table 3-12 lists execution times for MOVE.{B,W} instructions; Table 3-13 lists timings for MOVE.L.
NOTE
For all tables in this section, the execution time of any instruction using the
PC-relative effective addressing modes is the same for the comparable
An-relative mode.
MCF52277 Reference Manual, Rev. 1
3-26Freescale Semiconductor
Page 87
ColdFire Core
ET with {<ea> = (d16,PC)}equals ET with {<ea> = (d16,An)}
ET with {<ea> = (d8,PC,Xi*SF)}equals ET with {<ea> = (d8,An,Xi*SF)}
The nomenclature xxx.wl refers to both forms of absolute addressing, xxx.w
and xxx.l.
Table 3-12. MOVE Byte and Word Execution Times
Destination
Source
Rx(Ax)(Ax)+-(Ax)(d16,Ax) (d8,Ax,Xi*SF) xxx.wl
Dy1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
Ay1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
(Ay)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1))3(1/1)
(Ay)+3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1))3(1/1)
-(Ay)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1))3(1/1)
(d16,Ay)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)——
(d8,Ay,Xi*SF)4(1/0)4(1/1)4(1/1)4(1/1)———
xxx.w3(1/0)3(1/1)3(1/1)3(1/1)———
xxx.l3(1/0)3(1/1)3(1/1)3(1/1)———
(d16,PC)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)——
(d8,PC,Xi*SF)4(1/0)4(1/1)4(1/1)4(1/1))———
#xxx1(0/0)3(0/1)3(0/1)3(0/1)———
Table 3-13. MOVE Long Execution Times
Destination
Source
Rx(Ax)(Ax)+-(Ax)(d16,Ax)(d8,Ax,Xi*SF) xxx.wl
Dy1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
Ay1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
(Ay)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)3(1/1)2(1/1)
(Ay)+2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)3(1/1)2(1/1)
-(Ay)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)3(1/1)2(1/1)
(d16,Ay)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)——
(d8,Ay,Xi*SF)3(1/0)3(1/1)3(1/1)3(1/1)———
xxx.w2(1/0)2(1/1)2(1/1)2(1/1)———
xxx.l2(1/0)2(1/1)2(1/1)2(1/1)———
(d16,PC)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)——
(d8,PC,Xi*SF)3(1/0)3(1/1)3(1/1)3(1/1)———
#xxx1(0/0)2(0/1)2(0/1)2(0/1)———
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-27
Page 88
ColdFire Core
3.3.5.3Standard One Operand Instruction Execution Times
Table 3-14. One Operand Instruction Execution Times
Storing an accumulator requires one additional processor clock cycle when saturation is enabled, or fractional
rounding is performed (MACSR[7:4] equals 1---, -11-, --11)
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor3-31
Page 92
ColdFire Core
NOTE
The execution times for moving the contents of the Racc, Raccext[01,23],
MACSR, or Rmask into a destination location <ea>x shown in this table
represent the best-case scenario when the store instruction is executed and
there are no load or M{S}AC instructions in the EMAC execution pipeline.
In general, these store operations require only a single cycle for execution,
but if preceded immediately by a load, MAC, or MSAC instruction, the
depth of the EMAC pipeline is exposed and the execution time is four
cycles.
3.3.5.7Branch Instruction Execution Times
Table 3-18. General Branch Instruction Execution Times
Effective Address
Opcode<EA>
Rn(An)(An)+-(An)
BRA————2(0/1)———
BSR————3(0/1)———
(d16,An)
(d16,PC)
(d8,An,Xi*SF)
(d8,PC,Xi*SF)
xxx.wl#xxx
JMP<ea>—3(0/0)——3(0/0)4(0/0)3(0/0)—
JSR<ea>—3(0/1)——3(0/1)4(0/1)3(0/1)—
RTE——10(2/0)—————
RTS——5(1/0)—————
Table 3-19. Bcc Instruction Execution Times
Opcode
Bcc3(0/0)1(0/0)2(0/0)3(0/0)
Forward
Taken
Forward
Not Taken
Backward
Taken
Backward
Not Taken
MCF52277 Reference Manual, Rev. 1
3-32Freescale Semiconductor
Page 93
Chapter 4
Enhanced Multiply-Accumulate Unit (EMAC)
4.1Introduction
This chapter describes the functionality, microarchitecture, and performance of the enhanced
multiply-accumulate (EMAC) unit in the ColdFire family of processors.
4.1.1Overview
The EMAC design provides a set of DSP operations that can improve the performance of embedded code
while supporting the integer multiply instructions of baseline ColdFire architecture.
The MAC provides functionality in three related areas:
1. Signed and unsigned integer multiplication
2. Multiply-accumulate operations supporting signed and unsigned integer operands as well as
signed, fixed-point, fractional operands
3. Miscellaneous register operations
The ColdFire family supports two MAC implementations with different performance levels and
capabilities. The original MAC features a three-stage execution pipeline optimized for 16-bit operands,
with a 16x16 multiply array and a single 32-bit accumulator. The EMAC features a four-stage pipeline
optimized for 32-bit operands, with a fully pipelined 32 × 32 multiply array and four 48-bit accumulators.
The first ColdFire MAC supported signed and unsigned integer operands and was optimized for 16x16
operations, such as those found in applications including servo control and image compression. As
ColdFire-based systems proliferated, the desire for more precision on input operands increased. The result
was an improved ColdFire MAC with user-programmable control to optionally enable use of fractional
input operands.
EMAC improvements target three primary areas:
•Improved performance of 32 × 32 multiply operation.
•Addition of three more accumulators to minimize MAC pipeline stalls caused by exchanges
between the accumulator and the pipeline’s general-purpose registers
•A 48-bit accumulation data path to allow a 40-bit product, plus 8 extension bits increase the
dynamic number range when implementing signal processing algorithms
The three areas of functionality are addressed in detail in following sections. The logic required to support
this functionality is contained in a MAC module (Figure 4-1).
The MAC is an extension of the basic multiplier in most microprocessors. It is typically implemented in
hardware within an architecture and supports rapid execution of signal processing algorithms in fewer
cycles than comparable non-MAC architectures. For example, small digital filters can tolerate some
variance in an algorithm’s execution time, but larger, more complicated algorithms such as orthogonal
transforms may have more demanding speed requirements beyond scope of any processor architecture and
may require full DSP implementation.
To balance among speed, size, and functionality, the ColdFire MAC is optimized for a small set of
operations that involve multiplication and cumulative additions. Specifically, the multiplier array is
optimized for single-cycle pipelined operations with a possible accumulation after product generation.
This functionality is common in many signal processing applications. The ColdFire core architecture is
also modified to allow an operand to be fetched in parallel with a multiply, increasing overall performance
for certain DSP operations.
Consider a typical filtering operation where the filter is defined as in Equation 4-1.
Eqn. 4-1
Here, the output y(i) is determined by past output values and past input values. This is the general form of
an infinite impulse response (IIR) filter. A finite impulse response (FIR) filter can be obtained by setting
coefficients a(k) to zero. In either case, the operations involved in computing such a filter are multiplies
and product summing. To show this point, reduce Equation 4-1 to a simple, four-tap FIR filter, shown in
Equation 4-2, in which the accumulated sum is a past data values and coefficients sum.
Eqn. 4-2
4-2Freescale Semiconductor
MCF52277 Reference Manual, Rev. 1
Page 95
4.2Memory Map/Register Definition
The following table and sections explain the MAC registers:
Table 4-1. EMAC Memory Map
Enhanced Multiply-Accumulate Unit (EMAC)
1
BDM
0x804MAC Status Register (MACSR)32R/W0x0000_00004.2.1/4-3
The values listed in this column represent the Rc field used when accessing the core registers via the BDM port. For more
information see Chapter 32, “Debug Module.”
Register
Width
(bits)
AccessReset ValueSection/Page
4.2.1MAC Status Register (MACSR)
The MAC status register (MACSR) contains a 4-bit operational mode field and condition flags.
Operational mode bits control whether operands are signed or unsigned and whether they are treated as
integers or fractions. These bits also control the overflow/saturation mode and the way in which rounding
is performed. Negative, zero, and multiple overflow condition flags are also provided.
Product/accumulation overflow flags. Contains four flags, one per accumulator, that indicate if past MAC or
MSAC instructions generated an overflow during product calculation or the 48-bit accumulation. When a
MAC or MSAC instruction is executed, the PAVn flag associated with the destination accumulator is used
to form the general overflow flag, MACSR[V]. After set, each flag remains set until V is cleared by a
move.l, MACSR instruction or the accumulator is loaded directly.
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor4-3
Page 96
Enhanced Multiply-Accumulate Unit (EMAC)
Table 4-2. MACSR Field Descriptions (continued)
FieldDescription
7
OMC
6
S/U
5
F/I
Overflow saturation mode. Enables or disables saturation mode on overflow. If set, the accumulator is set
to the appropriate constant on any operation that overflows the accumulator. After saturation, the
accumulator remains unaffected by any other MAC or MSAC instructions until the overflow bit is cleared or
the accumulator is directly loaded.
Signed/unsigned operations.
In integer mode:
S/U determines whether operations performed are signed or unsigned. It also determines the accumulator
value during saturation, if enabled.
0 Signed numbers. On overflow, if OMC is enabled, an accumulator saturates to the most positive
(0x7FFF_FFFF) or the most negative (0x8000_0000) number, depending on the instruction and the
product value that overflowed.
1 Unsigned numbers. On overflow, if OMC is enabled, an accumulator saturates to the smallest value
(0x0000_0000) or the largest value (0xFFFF_FFFF), depending on the instruction.
In fractional mode:
S/U controls rounding while storing an accumulator to a general-purpose register.
0 Move accumulator without rounding to a 16-bit value. Accumulator is moved to a general-purpose
register as a 32-bit value.
1 The accumulator is rounded to a 16-bit value using the round-to-nearest (even) method when moved to
a general-purpose register. See Section 4.3.1.1, “Rounding”. The resulting 16-bit value is stored in the
lower word of the destination register. The upper word is zero-filled. This rounding procedure does not
affect the accumulator value.
Fractional/integer mode. Determines whether input operands are treated as fractions or integers.
0 Integers can be represented in signed or unsigned notation, depending on the value of S/U.
1 Fractions are represented in signed, fixed-point, two’s complement notation. Values range from -1 to
-15
for 16-bit fractions and -1 to 1 - 2
1-2
-31
for 32-bit fractions. See Section 4.3.4, “Data
Representation."
4
R/T
3
N
2
Z
Round/truncate mode. Controls rounding procedure for move.l ACCx,Rx, or MSAC.L instructions when
in fractional mode.
0 Truncate. The product’s lsbs are dropped before it is combined with the accumulator. Additionally, when
a store accumulator instruction is executed (move.l ACCx,Rx), the 8 lsbs of the 48-bit accumulator
logic are truncated.
1 Round-to-nearest (even). The 64-bit product of two 32-bit, fractional operands is rounded to the nearest
40-bit value. If the low-order 24 bits equal 0x80_0000, the upper 40 bits are rounded to the nearest even
(lsb = 0) value. See Section 4.3.1.1, “Rounding”. Additionally, when a store accumulator instruction is
executed (move.l ACCx,Rx), the lsbs of the 48-bit accumulator logic rounds the resulting 16- or 32-bit
value. If MACSR[S/U] is cleared and MACSR[R/T] is set, the low-order 8 bits are used to round the
resulting 32-bit fraction. If MACSR[S/U] is set, the low-order 24 bits are used to round the resulting 16-bit
fraction.
Negative. Set if the msb of the result is set, otherwise cleared. N is affected only by MAC, MSAC, and load
operations; it is not affected by MULS and MULU instructions.
Zero. Set if the result equals zero, otherwise cleared. This bit is affected only by MAC, MSAC, and load
operations; it is not affected by MULS and MULU instructions.
MCF52277 Reference Manual, Rev. 1
4-4Freescale Semiconductor
Page 97
Table 4-2. MACSR Field Descriptions (continued)
FieldDescription
Enhanced Multiply-Accumulate Unit (EMAC)
1
V
0
EV
Overflow. Set if an arithmetic overflow occurs on a MAC or MSAC instruction, indicating that the result
cannot be represented in the limited width of the EMAC. V is set only if a product overflow occurs or the
accumulation overflows the 48-bit structure. V is evaluated on each MAC or MSAC operation and uses the
appropriate PAVn flag in the next-state V evaluation.
Extension overflow. Signals that the last MAC or MSAC instruction overflowed the 32 lsbs in integer mode
or the 40 lsbs in fractional mode of the destination accumulator. However, the result remains accurately
represented in the combined 48-bit accumulator structure. Although an overflow has occurred, the correct
result, sign, and magnitude are contained in the 48-bit accumulator. Subsequent MAC or MSAC operations
may return the accumulator to a valid 32/40-bit result.
Table 4-3 summarizes the interaction of the MACSR[S/U,F/I,R/T] control bits.
Table 4-3. Summary of S/U, F/I, and R/T Control Bits
S/UF/IR/TOperational Modes
00xSigned, integer
010Signed, fractional
Truncate on MAC.L and MSAC.L
No round on accumulator stores
011Signed, fractional
Round on MAC.L and MSAC.L
Round-to-32-bits on accumulator stores
10xUnsigned, integer
110Signed, fractional
Truncate on MAC.L and MSAC.L
Round-to-16-bits on accumulator stores
111Signed, fractional
Round on MAC.L and MSAC.L
Round-to-16-bits on accumulator stores
4.2.2Mask Register (MASK)
The 32-bit MASK implements the low-order 16 bits to minimize the alignment complications involved
with loading and storing only 16 bits. When the MASK is loaded, the low-order 16 bits of the source
operand are actually loaded into the register. When it is stored, the upper 16 bits are all forced to ones.
This register performs a simple AND with the operand address for MAC instructions. The processor
calculates the normal operand address and, if enabled, that address is then ANDed with {0xFFFF,
MASK[15:0]} to form the final address. Therefore, with certain MASK bits cleared, the operand address
can be constrained to a certain memory region. This is used primarily to implement circular queues with
the (An)+ addressing mode.
This minimizes the addressing support required for filtering, convolution, or any routine that implements
a data array as a circular queue. For MAC + MOVE operations, the MASK contents can optionally be
included in all memory effective address calculations. The syntax is as follows:
mac.sz Ry,RxSF,<ea>y&,Rw
MCF52277 Reference Manual, Rev. 1
Freescale Semiconductor4-5
Page 98
Enhanced Multiply-Accumulate Unit (EMAC)
The & operator enables the MASK use and causes bit 5 of the extension word to be set. The exact
algorithm for the use of MASK is:
if extension word, bit [5] = 1, the MASK bit, then
if <ea> = (An)
oa = An & {0xFFFF, MASK}
if <ea> = (An)+
oa = An
An = (An + 4) & {0xFFFF, MASK}
if <ea> =-(An)
oa = (An - 4) & {0xFFFF, MASK}
An = (An - 4) & {0xFFFF, MASK}
if <ea> = (d16,An)
oa = (An + se_d16) & {0xFFFF0x, MASK}
Here, oa is the calculated operand address and se_d16 is a sign-extended 16-bit displacement. For
auto-addressing modes of post-increment and pre-decrement, the updated An value calculation is also
shown.
Use of the post-increment addressing mode, {(An)+} with the MASK is suggested for circular queue
implementations.
Each pair of 8-bit accumulator extension fields are concatenated with the corresponding 32-bit
accumulator register to form the 48-bit accumulator. For more information, see Section 4.3, “Functional
The MAC speeds execution of ColdFire integer-multiply instructions (MULS and MULU) and provides
additional functionality for multiply-accumulate operations. By executing MULS and MULU in the MAC,
execution times are minimized and deterministic compared to the 2-bit/cycle algorithm with early
termination that the OEP normally uses if no MAC hardware is present.
The added MAC instructions to the ColdFire ISA provide for the multiplication of two numbers, followed
by the addition or subtraction of the product to or from the value in an accumulator. Optionally, the product
may be shifted left or right by 1 bit before addition or subtraction. Hardware support for saturation
arithmetic can be enabled to minimize software overhead when dealing with potential overflow conditions.
Multiply-accumulate operations support 16- or 32-bit input operands these formats:
•Signed integers
•Unsigned integers
•Signed, fixed-point, fractional numbers
The EMAC is optimized for single-cycle, pipelined 32 × 32 multiplications. For word- and
longword-sized integer input operands, the low-order 40 bits of the product are formed and used with the
destination accumulator. For fractional operands, the entire 64-bit product is calculated and truncated or
rounded to the most-significant 40-bit result using the round-to-nearest (even) method before it is
combined with the destination accumulator.
For all operations, the resulting 40-bit product is extended to a 48-bit value (using sign-extension for
signed integer and fractional operands, zero-fill for unsigned integer operands) before being combined
with the 48-bit destination accumulator.
MCF52277 Reference Manual, Rev. 1
4-8Freescale 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.