Table A-4GPIO and Interrupt Status Memory Map ................................................................. A-6
A/D, MBUS2 and Memory Stick Memory Map ........................................................ A-7
cale Semiconductor,
List of Tables
Page
Number
Frees
MOTOROLAList of TablesLOT-7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
List of Tables
nc...
I
Page
Number
cale Semiconductor,
Frees
Intentionally
Left
Blank
LOT-8MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 1
Introduction
1.1MCF5249 OVERVIEW
This document provides an overview of the MCF5249 ColdFire® processor and general descriptions of the
MCF5249 features and modules.
The MCF5249 was designed as a system controller/decoder for MP3 music players, especially portable
MP3 CD players. The 32-bit ColdFire core with Enhanced Multiply Accumulate (EMAC) unit provides
optimum performance and code density for the combination of control code and signal processing required
for MP3 decode, file management, and system control.
Low power features include a hardwired CD ROM decoder, advanced 0.18um CMOS process technology,
nc...
I
1.8V core power supply, and on-chip 96KByte SRAM. MP3 decode requires less than 20MHz CPU
bandwidth and runs in on-chip SRAM with external access only for data input and output.
cale Semiconductor,
Frees
The MCF5249 is also an excellent general purpose system controller with over 125 Dhrystone 2.1 MIPS @
140MHz performance at a very competitive price. The integrated peripherals and EMAC allow the
MCF5249 to replace both the microcontroller and the DSP in certain applications. Most peripheral pins can
also be remapped as General Purpose I/O pins.
1.2MCF5249 FEATURE INTRODUCTION
The MCF5249 integrated microprocessor combines a Version 2 ColdFire® processor core operating at
140MHz with the following modules.
• DMA controller with 4 DMA channels
• Integrated Enhanced Multiply-accumulate Unit (EMAC)
• 8-KByte Direct Mapped Instruction Cache
• 96-KByte SRAM (A 64K and a 32K bank)
• Operates from external crystal oscillator
• Supports 16-bit wide SDRAM memories
• Serial Audio Interface which supports IIS and EIAJ audio protocols
• Digital audio transmitter and two receivers compliant with IEC958 audio protocol
• CD-ROM and CD-ROM XA block decoding and encoding function
•Two UARTS
• Queued Serial Peripheral Interface (QSPI) (Master Only)
• Two timers
• IDE and SmartMedia interfaces
• Analog/Digital Converter
• Flash Memory Card Interface
•Two I
• System debug support
• General Purpose I/O pins shared with other functions
2
C modules
1
1. I2C is a proprietary Philips bus.
MOTOROLAIntroduction1-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MCF5249 Block Diagram
• 1.8V core, 3.3V I/O
• 160 pin MAPBGA package (qualified at 140 MHz) and 144 pin QFP package (qualified at 120 MHz)
1.3MCF5249 BLOCK DIAGRAM
nc...
I
cale Semiconductor,
Frees
Instruction
Cache
64K
SRAM1
32K
SRAM0
ColdFire
V2 Core
(160 BGA
140 Mhz)
(144 QFP
120 Mhz)
Clock
Multiplied
PLL
Debug
Module w/
JTAG
Standard ColdFire Peripheral Blocks
Timer
I2C
Dual
DMA
5x08
Arbiter
Translator
UART
5x08
Interrupt
S/DRAM
Interface
External
Bus
IDE
SmartMedia
Interrupt
Controller
QSPI
Interface
Audio
Interfaces
ADC
Flash Memory/
Card
Interface
Timer
Support
I2C
Interface
UART
Interface
MUX
(S)DRAM
SRAM
IDE
BUFEN1_B
BufEn_b1
BUFEN2_B
BufEn_b2
IDE-DIOR
IDE-DIOW
IDE-IORDY
SWE
SRE
QSPI_DIN
QSPI_Din
QSPI_DOUT
QSPI_Dout
QSPI_CS[3:0]
QSPI_CLK
Serial Audio
Interface
ebuin3_adin0_gpi38
EBUIN3/ADIN0_GP138
ebuin4_adin1_gpi39
EBUIN4/ADIN1_GP139
rxd2_adin2_gpi28
RXD2/ADIN2/GP128
CTS2/ADIN3/GP131
cts2_adin3_gpi31
TOUT1/ADOUT/GP135
tout1_adout_gpi35
MemoryStick/
SecureDigital
Interface
Figure 1-1 MCF5249 Block Diagram
1-2MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
1.4MCF5249 FEATURE DETAILS
The primary features of the MCF5249 integrated processor include the following:
• ColdFire V2 Processor Core operating at 140MHz
—Clock-doubled Version 2 microprocessor core
—32-bit internal data bus, 16 bit external data bus
—16 user-visible, 32-bit general-purpose registers
—Supervisor/user modes for system protection
—Vector base register to relocate exception-vector table
—Optimized for high-level language constructs
•DMA controller
—Four fully programmable channels: Two dedicated to the audio interface module and two
dedicated to the UART module (External requests are not supported.)
—Supports dual- and single-address transfers with 32-bit data capability
—Two address pointers that can increment or remain constant
—16-/24-bit transfer counter
—Operand packing and unpacking support
—Auto-alignment transfers supported for efficient block movement
—Supports bursting and cycle stealing
—All channels support memory to memory transfers
—Interrupt capability
—Provides two clock cycle internal access
• Enhanced Multiply-accumulator Unit
—Single-cycle multiply-accumulate operations for 32 x 32 bit and 16 x 16 bit operands
—Support for signed, unsigned, integer, and fixed-point fractional input operands
—Four 48-bit accumulators to allow the use of a 40-bit product
—The addition of 8 extension bits to increase the dynamic number range
—Fast signed and unsigned integer multiplies
• 8-KByte Direct Mapped instruction cache
—Clocked at core clock frequency
—Flush capability
—Non-blocking cache provides fast access to critical code and data
• 96-KByte SRAM
—Provides one-cycle access to critical code and data
—Split into two banks, SRAM0 (32K), and SRAM1 (64K)
—DMA requests to/from internal SRAM1 supported
MCF5249 Feature Details
• Crystal Trim
—The XTRIM output can be used to trim an external crystal oscillator circuit which would allow
lock with an incoming IEC958 or serial audio signal
• Audio Interfaces
—IEC958 input and output
—Four serial Philips IIS/Sony EIAJ interfaces
–One with input and output, one with output only, two with input only (Three inputs, two outputs)
–Master and Slave operation
MOTOROLAIntroduction1-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MCF5249 Feature Details
• CD Text Interface
—Allows the interface of CD subcode (transmitter only)
• Queued Serial Peripheral Interface (QSPI)
—Programmable queue to support up to 16 transfers without user intervention
—Supports transfer sizes of 8 to 16 bits in 1-bit increments
—Four peripheral chip-select lines for control of up to 15 devices
—Baud rates from 273 Kbps to 15 Mbps at 140MHz
—Programmable delays before and after transfers
nc...
I
—Programmable clock phase and polarity
—Supports wraparound mode for continuous transfers
—Master mode only
cale Semiconductor,
Frees
• Dual 16-bit General-purpose Multimode Timers
—Clock source selectable from external, CPU clock/2 and CPU clock/32.
—8-bit programmable prescaler
—2 timer inputs and 2 outputs
—Processor-interrupt capability
—14.3 nS resolution with CPU clock at 140MHz
• IDE/ SmartMedia Interface
—Allows direct connection to an IDE hard drive or other IDE peripheral
• Analog/Digital Converter
—12-Bit Resolution
—4 Muxed inputs
• Flash Memory Card Interface
—Allows connection to Sony MemoryStick compatible devices
—Support SD cards and other types of flash media
•Dual I
• System debug support
2
C Interfaces
—Interchip bus interface for EEPROMs, LCD controllers, A/D converters, keypads
—Master and slave modes, support for multiple masters
—Automatic interrupt generation with programmable level
—Real-time instruction trace for determining dynamic execution path
—Background debug mode (BDM) for debug features while halted
—Debug exception processing capability
—Real-time debug support
1-4MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
• System Interface
—Glueless bus interface and DRAMC support for interface to 16-bit for DRAM, SRAM, ROM,
FLASH, and I/O devices
—Two programmable chip-select signals for static memories or peripherals with programmable
wait states and port sizes.
—Two dedicated chip selects for 16-bit wide DRAM/SDRAM.
—CS0 is active after reset to provide boot-up from external FLASH/ROM.
—Two dedicated chip selects (CS2 and CS3) are used for the IDE and/or SmartMedia interface
—Programmable interrupt controller (low interrupt latency, eight external interrupt requests,
programmable autovector generator)
—44 programmable general-purpose inputs (for the 160 MAPBGA package)
—46 programmable general-purpose outputs (for the 160 MAPBGA package)
—IEEE 1149.1 Test (JTAG) Module
• Clocking
—Clock-multiplied PLL, programmable frequency
nc...
I
• 1.8V Core, 3.3V I/O
• 160 pin MAPBGA package (qualified at 140 MHz) and 144 pin QFP package (qualified at 120 MHz)
160 MAPBGA Ball Assignments
cale Semiconductor,
Frees
1.5160 MAPBGA BALL ASSIGNMENTS
The following signals are not available on the 144 QFP package.
Table 1-1 160 MAPBGA Ball Assignments
160 MAPBGA BALL NUMBERFUNCTIONGPIO
E3CMD_SDIO2GPIO34
G4SDATA0_SDIO1GPIO54
H3RSTO/SDATA2_BS2
K3A25GPIO8
L4QSPI_CS1 GPIO24
L8QSPI_CS3GPIO22
N8SDRAM_CS2GPIO7
P9EBUOUT2GPO 37
K11BUFENB2GPIO17
G12SUBRGPIO 53
F13SFSYGPIO 52
F12RCKGPIO 51
E8SREGPIO11
B8LRCK3GPIO 45
E7SWEGPIO12
A7SCLK3GPIO 49
MOTOROLAIntroduction1-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MCF5249 Functional Overview
1.6MCF5249 FUNCTIONAL OVERVIEW
1.6.1COLDFIRE V2 CORE
The ColdFire processor Version 2 core consists of two independent, decoupled pipeline structures to
maximize performance while minimizing core size.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 instruction, fetches the required operands, and then
executes the required function. Because the IFP and OEP pipelines are decoupled by an instruction buffer
that serves as a FIFO queue, the IFP can prefetch instructions in advance of their actual use by the OEP,
which minimizes time stalled waiting for instructions. The OEP is implemented in a two-stage pipeline
featuring a traditional RISC data path with a dual-read-ported register file feeding an arithmetic/logic unit
(ALU).
1.6.2DMA CONTROLLER
The MCF5249 provides four fully programmable DMA channels for quick data transfer. Single and dual
nc...
I
address mode is supported with the ability to program bursting and cycle stealing. Data transfer is
selectable as 8, 16, 32, or 128-bits. Packing and unpacking is supported.
cale Semiconductor,
Frees
Two internal audio channels and the dual UART can be used with the DMA channels. All channels can
perform memory to memory transfers. The DMA controller has a user-selectable, 24- or 16-bit counter and
a programmable DMA exception handler.
External requests are not supported.
1.6.3ENHANCED MULTIPLY AND ACCUMULATE MODULE (EMAC)
The integrated EMAC unit provides a common set of DSP operations and enhances the integer multiply
instructions in the ColdFire architecture. The EMAC provides functionality in three related areas:
1. Faster signed and unsigned integer multiplies
2. New multiply-accumulate operations supporting signed and unsigned operands
3. New miscellaneous register operations
Multiplies of 16x16 and 32x32 with 48-bit accumulates are supported in addition to a full set of extensions
for signed and unsigned integers plus signed, fixed-point fractional input operands. The EMAC has a
single-clock issue for 32x32-bit multiplication instructions and implements a four-stage execution pipeline.
1.6.4INSTRUCTION CACHE
The instruction cache improves system performance by providing cached instructions to the execution unit
in a single clock. The MCF5249 processor uses a 8K-byte, direct-mapped instruction cache to achieve 125
MIPS at 140 Mhz. The cache is accessed by physical addresses, where each 16-byte line consists of an
address tag and a valid bit. The instruction cache also includes a bursting interface for 16-bit and 8-bit port
sizes to quickly fill cache lines.
1.6.5INTERNAL 96-KBYTE SRAM
The 96-KByte on-chip SRAM is split over two banks, SRAM0 (64k) and SRAM1 (32K). It provides one
clock-cycle access for the ColdFire core. This SRAM can store processor stack and critical code or data
segments to maximize performance. Memory in the second bank can be accessed under DMA.
1-6MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MCF5249 Functional Overview
1.6.6DRAM CONTROLLER
The MCF5249 DRAM controller provides a glueless interface for up to two banks of DRAM, each of which
can be up to 32 MBytes. The controller supports a 16-bit data bus. A unique addressing scheme allows for
increases in system memory size without rerouting address lines and rewiring boards. The controller
operates in page mode, non-page mode, and burst-page mode and supports SDRAMs.
1.6.7SYSTEM INTERFACE
The MCF5249 provides a glueless interface to 16-bit port size SRAM, ROM, and peripheral devices with
independent programmable control of the assertion and negation of chip-select and write-enable signals.
The MCF5249 also supports bursting ROMs.
1.6.8EXTERNAL BUS INTERFACE
The bus interface controller transfers information between the ColdFire core or DMA and memory,
peripherals, or other devices on the external bus. The external bus interface provides 23 bits of address
nc...
I
bus space, a 16-bit data bus, Output Enable, and Read/Write signals. This interface implements an
extended synchronous protocol that supports bursting operations.
cale Semiconductor,
Frees
1.6.9SERIAL AUDIO INTERFACES
The MCF5249 digital audio interface provides four serial Philips IIS/Sony EIAJ interfaces. One interface is
a 4-pin (1 bit clock, 1 word clock, 1 data in, 1 data out), the other three interfaces are 3-pin (1 bit clock, 1
word clock, 1 data in or out). The serial interfaces have no limit on minimum sampling frequency.
Maximum sampling frequency is determined by the maximum frequency on the bit clock input. (1/3 the
frequency of the internal system clock.)
1.6.10IEC958 DIGITAL AUDIO INTERFACES
The MCF5249 has two digital audio input interfaces, and one digital audio output interface. There are four
digital audio input pins and two digital audio output pins. An internal multiplexer selects one of the four
inputs to the digital audio input interface.
There is one digital audio output interface with two IEC958 outputs. One output carries the professional “c”
channel (Channel Status), and the other carries the consumer “c” channel. All other bits (audio data, user
channel bits, validity flag, etc) are identical.
The IEC958 output can take the output from the internal IEC958 generator, or multiplex out one of the four
IEC958 inputs.
1.6.11AUDIO BUS
The audio interfaces connect to an internal bus that carries all audio data. Each receiver places its
received data on the audio bus and each transmitter takes data from the audio bus for transmission. Each
transmitter has a source select register.
In addition to the audio interfaces, there are six CPU accessible registers connected to the audio bus.
Three of these registers allow data reads from the audio bus and allow selection of the audio source. The
other three registers provide a write path to the audio bus and can be selected by transmitters as the audio
source. Through these registers, the CPU has access to the audio samples for processing.
MOTOROLAIntroduction1-7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MCF5249 Functional Overview
Audio can be routed from a receiver to a transmitter without the data being processed by the core so the
audio bus can be used as a digital audio data switch. The audio bus can also be used for audio format
conversion.
1.6.12CD-ROM ENCODER/DECODER
The MCF5249 is capable of processing CD-ROM sectors in hardware. Processing is compliant with
CD-ROM and CD-ROM XA standards.
The CD-ROM decoder performs following functions in hardware:
• Sector sync recognition
• Descrambling of sectors
• Verification of the CRC checksum for Mode 1, Mode 2 Form 1, and Mode 2 Form 2 sectors
• Third-layer error correction is not performed
The CD-ROM encoder performs following functions in hardware:
nc...
I
cale Semiconductor,
Frees
• Sector sync recognition
• Scrambling of sectors
• Insertion of the CRC checksum for Mode 1, Mode 2 Form 1, and Mode 2 Form 2 sectors.
• Third-layer error encoding needs to be done in software. This can use approximately 5-10 Mhz of
performance for single-speed.
1.6.13DUAL UART MODULE
Two full-duplex UARTs with independent receive and transmit buffers are in this module. Data formats can
be 5, 6, 7, or 8 bits with even, odd, or no parity, and up to 2 stop bits in 1/16 increments. Four-byte receive
buffers and two-byte transmit buffers minimize CPU service calls. The Dual UART module also provides
several error-detection and maskable-interrupt capabilities. Modem support includes request-to-send
) and clear-to-send (CTS) lines.
(RTS
The system clock provides the clocking function from a programmable prescaler. Users can select full
duplex, auto-echo loopback, local loopback, and remote loopback modes. The programmable Dual UARTs
can interrupt the CPU on various normal or error-condition events.
1.6.14QUEUED SERIAL PERIPHERAL INTERFACE QSPI
The QSPI module provides a serial peripheral interface with queued transfer capability. It supports up to 16
stacked transfers at a time, making CPU intervention between transfers unnecessary. Transfers of up to
17.5 Mbits/second are possible at a CPU clock of 140 MHz. The QSPI supports master mode operation
only.
1.6.15TIMER MODULE
The timer module includes two general-purpose timers, each of which contains a free-running 16-bit timer
for use in any of three modes:
1. Input Capture. This mode captures the timer value with an external event.
2. Output Compare. This mode triggers an external signal or interrupts the CPU when the timer
reaches a set value
3. Event Counter. This mode counts external events.
1-8MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
The timer unit has an 8-bit prescaler that allows programming of the clock input frequency, which is
derived from the system clock. In addition to the ÷1 and ÷16 clock derived from the bus clock (CPU clock /
2), the programmable timer-output pins either generate an active-low pulse or toggle the outputs.
MCF5249 Functional Overview
1.6.16IDE AND SMARTMEDIA INTERFACES
The MCF5249 system bus allows connection of an IDE hard disk drive and SmartMedia flash card with a
minimum of external hardware. The external hardware consists of bus buffers for address and data and
are intended to reduce the load on the bus and prevent SDRAM and Flash accesses to propagate to the
IDE bus. The control signals for the buffers are generated in the MCF5249.
1.6.17ANALOG/DIGITAL CONVERTER (ADC)
The four channel ADC is based on the Sigma-Delta concept with 12-bit resolution. The digital portion of the
ADC is provided internally. The analog voltage comparator must be provided externally as well as an
external integrator circuit (resistor/capacitor) which is driven by the ADC output. A software interrupt is
provided when the ADC measurement cycle is complete.
nc...
I
1.6.18FLASH MEMORY CARD INTERFACE
cale Semiconductor,
Frees
The interface is Sony MemoryStick and SecureDigital compatible. However, there is no hardware support
for MagicGate
™.
1.6.19I2C MODULE
The two-wire I2C bus interface, which is compliant with the Philips I2C bus standard, is a bidirectional serial
bus that exchanges data between devices. The I
the end system and is best suited for applications that need occasional bursts of rapid communication over
short distances among several devices. Bus capacitance and the number of unique addresses limit the
maximum communication length and the number of devices that can be connected.
2
C bus minimizes the interconnection between devices in
1.6.20CHIP-SELECTS
There are four programmable chip selects on the MCF5249:
• Two programmable chip-select outputs (CS0 and CS1) provide signals that enable glueless
connection to external memory and peripheral circuits. The base address, access permissions, and
automatic wait-state insertion are programmable with configuration registers. These signals also
interface to 16-bit ports.
• Two dedicated chip selects (CS2 and CS3) are used for the IDE and/or SmartMedia interface
CS0 is active after reset to provide boot-up from external FLASH/ROM.
1.6.21GPIO INTERFACE
A total of 44 General Purpose inputs and 46 General Purpose outputs are available. These are multiplexed
with various other signals. Eight of the GPIO inputs have edge sensitive interrupt capability.
1.6.22INTERRUPT CONTROLLER
The MCF5249 has a primary and a secondary interrupt controller. These interrupt controllers handle
interrupts from all internal interrupt sources. In addition, there are 8 GPIOs where external interrupts can
MOTOROLAIntroduction1-9
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
MCF5249 Functional Overview
be generated on the rising or falling edge of the pin. All interrupts are autovectored and interrupt levels are
programmable.
1.6.23JTAG
To help with system diagnostics and manufacturing testing, the MCF5249 includes dedicated
user-accessible test logic that complies with the IEEE 1149.1A standard for boundary scan testability,
often referred to as Joint Test Action Group, or JTAG. For more information, refer to the IEEE 1149.1A
standard. Motorola provides BSDL files for JTAG testing.
1.6.24SYSTEM DEBUG INTERFACE
The ColdFire processor core debug interface supports real-time instruction trace and debug, plus
background-debug mode. A background-debug mode (BDM) interface provides system debug.
In real-time instruction trace, four status lines provide information on processor activity in real time (PST
pins). A four-bit wide debug data bus (DDATA) displays operand data and change-of-flow addresses,
nc...
I
which helps track the machine’s dynamic execution path.
1.6.25CRYSTAL AND ON-CHIP PLL
cale Semiconductor,
Frees
Typically, an external 16.92 Mhz or 33.86 Mhz clock input is used for CD R/W applications, while an
11.2896 MHz clock is more practical for Portable CD player applications. However, the on-chip
programmable PLL, which generates the processor clock, allows the use of almost any low frequency
external clock (5-35 Mhz).
Two clock outputs (MCLK1 and MCLK2) are provided for use as Audio Master Clock. The output
frequencies of both outputs are programmable to Fxtal, Fxtal/2, Fxtal/3, and Fxtal/4. The Fxtal/3 option is
only available when the 33.86 Mhz crystal is connected.
The MCF5249 supports VCO operation of the oscillator by means of a 16-bit pulse density modulation
output. Using this mode, it is possible to lock the oscillator to the frequency of an incoming IEC958 or IIS
signal. The maximum trim depends on the type and design of the oscillator. Typically a trim of +/- 100 ppm
can be achieved with a crystal oscillator and over +/- 1000 ppm with an LC oscillator.
1-10MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 2
Signal Description
2.1INTRODUCTION
This section describes the MCF5249 input and output signals. The signal descriptions as shown in Table
2-1 are grouped according to relevant functionality.
Table 2-1 MCF5249 Signal Index
nc...
I
cale Semiconductor,
Frees
SIGNAL NAMEMNEMONICFUNCTION
AddressA[23:1]
A[25]/GPO8
Read-write controlRW_bBus write enable - indicates if read or
Output enableOEOutput enable for asynchronous
DataD[31:16]Data bus used to transfer word dataIn/OutHi-Z
Synchronous row address
strobe
Synchronous column
address strobe
SDRAM write enableSDWEWrite enable for external SDRAMOutnegated
SDRAM upper byte
enable
SDRAM lower byte enable SDLDQMIndicates during write cycle if low
ISA bus wait signalIDE-IORDY/GPIO16ISA bus wait line - available for both
Chip Selects[1:0]CS0
Buffer enable 1BUFENB1
Buffer enable 2BUFENB2
Transfer acknowledgeTA/GPIO20Transfer Acknowledge signalIn/Out
SDRASRow address strobe for external
SDCASColumn address strobe for external
SDUDQMIndicates during write cycle if high
CS3/SRE/GPIO11
SWE/GPIO12
CS1/GPIO58
/GPIO57Two programmable buffer enables
/GPIO7In/Out
23 address bus lines, address line 25
multiplexed with gpo8
write cycle in progress
memories connected to chip selects
SDRAM.
SDRAM
byte is written
byte is written
There are 2 ISA bus read strobes
and 2 ISA bus write strobes. They
Allow connection of two independent
ISA bus peripherals, e.g. an IDE
slave device and a SmartMedia card
busses
Enables peripherals at programmed
addresses. CS[1:0]. CS[0] provides
boot ROM selection
Allow seamless steering of external
buffers to split data and address bus
in sections.
MemoryStick interface 2 strobe
Reset output signal
Analog to Digital converter input
signals
signal
QSPI chip selectsIn/Out
signal pins.
Displays captured processor data
and break-point status.
Indicates internal processor status.In/OutHi-Z
INPUT/
OUTPUT
In/Out
In/Out
In/Out
In/Out
In/Out
In/Out
In/Out
In
In/OutHi-Z
RESET
STATE
MOTOROLASignal Description2-3
For More Information On This Product,
Go to: www.freescale.com
GPIO
Freescale Semiconductor, Inc.
Table 2-1 MCF5249 Signal Index (Continued)
nc...
I
cale Semiconductor,
Frees
SIGNAL NAMEMNEMONICFUNCTION
Test Clock TCKClock signal for IEEE 1149.1A JTAG.In
Test Reset/Development
Serial Clock
Test Mode Select/ Break
Point
Test Data Input /
Development Serial Input
Test Data
Output/Development
Serial Output
Note: The CMD_SDIO2, SDATA0_SDIO1, RSTO/SDATA2_BS2, A25, QSPI_CS1,
QSPI_CS3, SDRAM_CS2, EBUOUT2, BUFENB2, SUBR, SFSY, RCK, SRE,
LRCK3, SWE, and the SCLK3 signals are only used in the 160 MAPBGA package.
/DSCLKMultiplexed signal that is
TRST
asynchronous reset for JTAG
controller. Clock input for debug
module.
TMS/BKPT
TDI/DSIMultiplexed serial input for the JTAG
TDO/DSOMultiplexed serial output for the
Multiplexed signal that is test mode
select in JTAG mode and a hardware
break-point in debug mode.
or background debug module.
JTAG or background debug module.
INPUT/
OUTPUT
Out
In
In
In
RESET
STATE
2.2GPIO
Many pins have a GPIO as first or second function. If gpio is second function, following rules apply:
• General purpose input is always active, regardless of state of pin.
• General purpose output or primary output is determined by value written to gpio function select
register.
• Power-on reset function is not gpio
2.3MCF5249 BUS SIGNALS
These signals provide the external bus interface to the MCF5249.
2.3.1ADDRESS BUS
• The address bus provides the address of the byte or most significant byte of the word or longword
being transferred.The address lines also serve as the DRAM address pins, providing multiplexed row
and column address signals.
• Bits 23 down to 1 and 25 of the address are available. A25 is intended to be used with 256 Mbit
DRAM’s. Signals are named:
•A[23:1]
• A[25]/GPO8
2.3.2READ-WRITE CONTROL
This signal indicates during any bus cycle whether a read or write is in progress. A low is write cycle and a
high is a read cycle.
2-4MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
SDRAM Controller Signals
2.3.3OUTPUT ENABLE
The OE signal is intended to be connected to the output enable of asynchronous memories connected to
chip selects. During bus read cycles, the ColdFire processor will drive OE
low.
2.3.4DATA BUS
The data bus (D[31:16]) is bi-directional and non-multiplexed. Data is registered by the MCF5249 on the
rising clock edge. The port width for each chip-select and DRAM bank are programmable. The data bus
uses a default configuration if none of the chip-selects or DRAM bank match the address decode. All 16
bits of the data bus are driven during writes, regardless of port width or operand size.
2.3.5TRANSFER ACKNOWLEDGE
The TA/GPIO20 pin is the transfer acknowledge signal.
2.4SDRAM CONTROLLER SIGNALS
nc...
I
cale Semiconductor,
Frees
The following SDRAM signals provide a seamless interface to external SDRAM. An SDRAM width of 16
bits is supported and can access as much as 64 Mbytes of memory. ADRAMs are not supported.
Table 2-2 SDRAM Controller Signals
SDRAM SIGNALDESCRIPTION
synchronous DRAM row address strobe The SDRAS
RAS input on synchronous DRAM
Synchronous DRAM Column Address
Strobe
Synchronous DRAM WriteThe SDWE
Synchronous DRAM Chip EnablesThe SDRAM_CS1
Synchronous DRAM UDQM and LQDM
signals
Synchronous DRAM clockThe DRAM clock is driven by the SCLK signal
Synchronous DRAM Clock EnableThe BCLKE active high output signal is used during
The SDCAS
CAS input on synchronous DRAM.
write cycle is underway. This pin outputs logic ‘1’ during read
bus cycles.
signals are used during synchronous mode to route directly to
the chip selects of up to 2 SDRAM devices.
The SDRAM_CS2
the GPIO-FUNCTION register.
The DRAM byte enables UDMQ and LDQM are driven by the
SDUDQM and SDLDQM byte enable outputs.
synchronous mode to route directly to the SCKE signal of
external SDRAMs. This signal provides the clock enable to the
SDRAM.
active low pin provides a seamless interface to the
active low pin provides a seamless interface to
active-low pin is asserted to signify that a SDRAM
and SDRAM_CS2/gpio7 active-low output
/gpio7 can be programmed to be gpio using
Note: The SDRAM_CS2 signal is only used on the 160 MAPBGA package.
2.5CHIP SELECTS
There are two chip select outputs on the MCF5249 device. CS0 and CS1/GPIO58. The second signal is
multiplexed with a GPIO signal. The active low chip selects can be used to access asynchronous
memories. The interface is glueless.
MOTOROLASignal Description2-5
For More Information On This Product,
Go to: www.freescale.com
ISA bus
Freescale Semiconductor, Inc.
2.6ISA BUS
The MCF5249 supports an ISA bus. (No ISA DMA channel). Using the ISA bus protocol, reads and writes
to up to two ISA bus peripherals are possible. For the first peripheral, CS2/IDE-DIOR/
IDE-DIOW
SWE
IDE-IORDY/GPIO16
/GPIO14 are the read and write strobe. For the second peripheral, CS3/SRE/GPIO11 and
/GPIO12 are the read and write strobe. Either peripheral can insert wait states by pulling
GPIO13 and
2.7BUS BUFFER SIGNALS
As the MCF5249 has a quite complicated slave bus, with the possibility to put DRAM on the bus, put
asynchronous memories on the bus, and to put ISA bus peripherals on the bus, it may become necessary
to introduce a bus buffer on the bus. The MCF5249 has a glueless interface to steer these bus buffers with
2 bus buffer output signals BUFENB1
Note: The BUFENB2 signal is only used in the 160 MAPBGA package.
/GPIO57 and BUFENB2/GPIO7.
nc...
I
cale Semiconductor,
Frees
2.8I2C MODULE SIGNALS
There are two I2C interfaces on this device.
2
The I
C module acts as a quick two-wire, bidirectional serial interface between the MCF5249 processor
and peripherals with an I
devices connected to the I
be accomplished with an open-drain output.
I2C MODULE SIGNALDESCRIPTION
2
I
C Serial Clock
2
I
C Serial Data
2
C interface (e.g., LED controller, A-to-D converter, D-to-A converter). When
2
C bus drive the bus, they will either drive logic-0 or high-impedance. This can
Table 2-3 I2C Module Signals
The SCL/QPSICLK and SCL2/GPIO3 bidirectional signals are
the clock signal for first and second I
2
C module controls this signal when the bus is in master
I
2
mode; all I
timing.
Signals are multiplexed
Function select is done via PLLCR register.
The SDA/QSPI_DIN and SDA2/GPIO55 bidirectional signals
are the data input/output for the first and second serial I
interface.
Signals are multiplexed
Function select is done via PLLCR register.
C devices drive this signal to synchronize I2C
2
C module operation. The
2
C
2.9SERIAL MODULE SIGNALS
The following signals transfer serial data between the two UART modules and external peripherals.
All serial module signals can be used as gpi or gpo. The GPIO-FUNCTION and GPIO1-FUNCTION
registers must be programmed to determine pin functions of the inputs and outputs. If used as gpo or gpi,
UART functionality is lost.
2-6MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
SERIAL MODULE SIGNALDESCRIPTION
Receive DataThe RXD1_GPI27 and RXD2/ADIN2/GPI28 are the inputs on
Transmit DataThe DUART transmits serial data on the TXD1/GPO27 and
Request To SendThe RTS
nc...
I
Clear To SendPeripherals drive the CTS
Timer Module Signals
Table 2-4 Serial Module Signals
which serial data is received by the DUART. Data is sampled
on RxD[1:0] on the rising edge of the serial clock source, with
the least significant bit received first.
TXD2/GPO28 output signals. Data is transmitted on the falling
edge of the serial clock source, with the least significant bit
transmitted (LSB) first. When no data is being transmitted or
the transmitter is disabled, these two signals are held high.
TxD[1:0] are also held high in local loopback mode.
1/GPO30 and RTS2/GPO31 request-to-send outputs
indicate to the peripheral device that the DUART is ready to
send data and requires a clear-to-send signal to initiate
transfer.
1/GPI30 and CTS2/ADIN3/GPI31
inputs to indicate to the MCF5249 serial module that it can
begin data transmission.
cale Semiconductor,
Frees
2.10TIMER MODULE SIGNALS
The following signals are external interface to the two general-purpose MCF5249 timers. These 16-bit
timers can capture timer values, trigger external events, or internal interrupts, or count external events.
These pins can be reused as GPO or GPI. Registers GPIO-FUNCTION and GPIO1-FUNCTION must be
programmed for this.
Table 2-5 Timer Module Signals
SERIAL MODULE SIGNALDESCRIPTION
Timer InputUsers can program the TIN0/GPI33 and TIN1/GPIO23 inputs
as clocks that cause events in the counter and prescalars.
They can also cause capture on the rising edge, falling edge,
or both edges.
Timer OutputThe TOUT0/GPO33 and TOUT1/ADOUT/GPO35
programmable outputs pulse or toggle on various timer events.
2.11SERIAL AUDIO INTERFACE SIGNALS
All serial audio interface signals can be programmed to serve as general purpose I/Os or as serial audio
interface signals. The function is programmed using GPIO-FUNCTION and GPIO1-FUNCTION registers.
Note: The LRCK3 and SCLK3 signals are only used in the 160 MAPBGA package.
MOTOROLASignal Description2-7
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Serial Audio Interface Signals
Table 2-6 Serial Audio Interface Signals
SERIAL MODULE SIGNALDESCRIPTION
Serial Audio Bit ClockThe SCLK1, SCLK2/GPIO48, SCLK3/GPIO49, AND
Serial Audio Word ClockThe LRCK1, LRCK2/GPIO44, LRCK3/GPIO45, AND
Serial Audio Data InThe SDATAI1, SDATAI3/GPI41, SDATAI4/GPI42 multiplexed
Serial Audio Data OutThe SDATAO1/GPIO25 AND SDATAO2/GPI41 multiplexed
Serial audio error flagThe EF/GPIO19 multiplexed pin can serve as general purpose
Serial audio CFLGThe CFLG/GPIO18 multiplexed pin can serve as general
SCLK4/GPIO50 multiplexed pins can serve as general purpose
I/Os or serial audio bit clocks. As bit clocks, these bidirectional
pins can be programmed as outputs to drive their associated
serial audio (IIS) bit clocks. Alternately, these pins can be
programmed as inputs when the serial audio bit clocks are
driven internally. The functionality is programmed within the
Audio module. During reset, these pins are configured as input
serial audio bit clocks.
LRCK4/GPIO46 multiplexed pins can serve as general
purpose I/Os or serial audio word clocks. As word clocks, the
bidirectional pins can be programmed as inputs to drive their
associated serial audio word clock. Alternately, these pins can
be programmed as outputs when the serial audio word clocks
are derived internally. The functionality is programmed within
the Audio module. During reset, these pins are configured as
input serial audio word clocks.
pins can serve as general purpose I/Os or serial audio inputs.
As serial audio inputs the data is sent to interfaces 1,3 and 4
respectively. The functionality of these pins is programmed
with the GPIO-FUNCTION and GPIO1-FUNCTION registers.
During reset, the pins are configured as serial data inputs.
pins can serve as general purpose I/Os or serial audio outputs.
The functionality of these pins is programmed with registers
GPIO-FUNCTION and GPIO1-FUNCTION. During reset, the
pins are configured as serial data outputs.
I/Os or error flag input. As error flag input, this pin will input the
error flag delivered by the CD-DSP. EF/GPIO19 is only
relevant for serial interface in 1
purpose I/O or CFLG input. As CFLG input, the pin will input
the CFLG flag delivered by the CD-DSP. CFLG/GPIO18 is only
relevant for serial interface in 1.
2-8MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Digital Audio Interface Signals
2.12DIGITAL AUDIO INTERFACE SIGNALS
Table 2-7 Digital Audio Interface Signals
SERIAL MODULE SIGNALDESCRIPTION
Digital Audio InThe EBUIN1/GPI36, EBUIN2/GPI37, EBUIN3/ADIN0/GPI38,
and EBUIN4/ADIN1/GPI39 multiplexed signals can serve as
general purpose input or can be driven by various digital audio
(IEC958) input sources. Both functionalities are always active.
Input chosen for IEC958 receiver is programmed within the
audio module. Input value on the 4 pins can always be read
from the appropriate gpio register.
Digital Audio OutThe EBUOUT1_GPO36 and EBUOUT2_GPO37 multiplexed
pins can serve as general purpose I/O or as digital audio
(IEC958) output. EBUOUT1 is digital audio out for consumer
mode, EBUOUT2 is digital audio out for professional mode.
The functionality of the pins is programmed with the
nc...
I
GPIO-FUNCTION and GPIO1-FUNCTION register. During
reset, the pin is configured as a digital audio output.
cale Semiconductor,
Frees
Note: The EBUOUT2 signal is only used on the 160 MAPBGA package.
2.13SUBCODE INTERFACE
There is a 3-line subcode interface on the MCF5249. This 3-line subcode interface allows the device to
format and transmit subcode in EIAJ format to a CD channel encoder device. The three signals are
described in Table 2-8
Table 2-8 Subcode Interface Signal
SIGNAL NAMEDESCRIPTION
RCK/GPIO51Subcode clock input. When pin is used as subcode clock, this
pin is driven by the CD channel encoder.
SFSY/GPIO52Subcode sync output
This signal is driven high if a subcode sync needs to be
inserted in the EFM stream.
SUBR/GPIO53Subcode data output
This signal is a subcode data out pin.
Note: The SUBR, SFSY, and the RCK signals are only used in the 160 MAPBGA
package.
2.14ANALOG TO DIGITAL CONVERTER (ADC)
The single output on the TOUT1/ADOUT/GPO35 pin provides the reference voltage in PDM format
therefore this output requires an external integrator circuit (resistor/capacitor) to convert it to a DC level to
be used by the external comparator circuit.
Four external comparators compare the DC level obtained after filtering TOUT1/ADOUT/GPO35 with the
relevant input signals. The outputs of the comparators are fed to the 4 ADIN inputs on the MCF5249:
EBUIN3/ADIN0/GPI38, EBUIN4/ADIN1/GPI39, RXD2/ADIN2/GPI38 and CTS2/ADIN3/GPI31.
MOTOROLASignal Description2-9
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Secure Digital/ MemoryStick card Interface
Selection of function for pin TOUT1/ADOUT/GPO35 is done by writing GPIO function select register
(determines if function is GPIO or not), and differentiation between timer and adout functions is done in the
ADCONFIG Register.
2.15SECURE DIGITAL/ MEMORYSTICK CARD INTERFACE
The device has a versatile flash card interface that supports both SecureDigital and MemoryStick cards.
The interface can either support one SecureDigital or two MemoryStick cards. No mixing of card types is
possible. Table 2-9 gives the pin descriptions.
Table 2-9 Flash Memory Card Signals
FLASH MEMORY SIGNALDESCRIPTION
SCLKOUT/GPIO15Clock out for both MemoryStick interfaces and for
SecureDigital
CMD_SDIO2/GPIO34Secure Digital command line
MemoryStick interface 2 data i/o
SDATA0_SDIO1/GPIO54SecureDigital serial data bit 0
MemoryStick interface 1 data i/o
SDATA1_BS1/GPIO9SecureDigital serial data bit 1
MemoryStick interface 1 strobe
RSTO/SDATA2_BS2SecureDigital serial data bit 2
MemoryStick interface 2 strobe
Reset output signal
Selection between Reset function and SDATA2_BS2 is done
by programming PLLCR register.
SDATA3/GPIO57SecureDigital serial data bit 3
Note: The SDATA0_SDIO1 and RSTO/SDATA2_BS2 signals are only used in the 160
MAPBGA package.
2.16QUEUED SERIAL PERIPHERAL INTERFACE (QSPI)
Table 2-10 Queued Serial Peripheral Interface (QSPI) Signals
SERIAL MODULE SIGNALDESCRIPTION
SCL_QSPICLKMultiplexed signal IIC interface clock or QSPI clock output
Function select is done via PLLCR register.
SDA_QSPIDINMultiplexed signal IIC interface data or QSPI data input.
Function select is done via PLLCR register.
QSPIDOUT_GPIO26QSPI data output
QSPICS0_GPIO294 different QSPI chip selects
QSPICS1_GPIO24
QSPICS2_GPIO21
QSPICS3_GPIO22
Note: The CMD_SDIO2 signal is only used in the 160 MAPBGA package.
The QSPI interface is a high-speed serial interface allowing transmit and receive of serial data. Pin
descriptions are given in Table 2-10.
2-10MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Crystal Trim
2.17CRYSTAL TRIM
The XTRIM_GPO38output produces a pulse-density modulated phase/frequency difference signal to be
used after low-pass filtering to control varicap-voltage to control crystal oscillation frequency. This will lock
the crystal to the incoming digital audio signal.
2.18CLOCK OUT
The MCLK1/GPO39 and MCLK2/GPO42 can serve as general purpose I/Os or as DAC clock outputs.
When programmed as DAC clock outputs, these signals are directly divided from the crystal.
2.19DEBUG AND TEST SIGNALS
These signals interface with external I/O to provide processor status signals.
2.19.1TEST MODE
The TEST[3:0] inputs are used for various manufacturing and debug tests. For normal mode these inputs
nc...
I
should always be tied low. Use TEST0 to switch between background debug mode and JTAG mode. Drive
TEST0 high for debug mode.
cale Semiconductor,
Frees
2.19.2HIGH IMPEDANCE
The assertion of HI_Z will force all output drivers to a high-impedance state. The timing on HI_Z is
independent of the clock.
Note: JTAG operation will override the HI_Z
pin.
2.19.3PROCESSOR CLOCK OUTPUT
The internal PLL generates this PSTCLK_GPO63 and output signal, and is the processor clock output that is
used as the timing reference for the Debug bus timing (DDATA[3:0] and PST[3:0]). The PSTCLK_GPO63 is
at the same frequency as the core processor and cache memory. The frequency will be twice the bus clock
(SCLK) frequency.
2.19.4DEBUG DATA
The debug data pins, DDATA0_GPIO0, DDATA1_GPIO1, DDATA2_GPIO2, and DDATA3_GPIO4, are
four bits wide. This nibble-wide bus displays captured processor data and break-point status.
2.19.5PROCESSOR STATUS
The processor status pins, PST0_GPIO59, PST1_GPIO60, PST2_GPIO61, and PST3_GPIO62, indicate
the MCF5249 processor status. During debug mode, the timing is synchronous with the processor clock
(PSTCLK) and the status is not related to the current bus transfer. Table 2-11 shows the encodings of
these signals.
MOTOROLASignal Description2-11
For More Information On This Product,
Go to: www.freescale.com
BDM/JTAG Signals
Freescale Semiconductor, Inc.
.
Table 2-11 Processor Status Signal Encodings
PST[3:0]
DEFINITION
(HEX)(BINARY)
$00000Continue execution
$10001Begin execution of an instruction
$20010Reserved
$30011Entry into user-mode
$40100Begin execution of PULSE and WDDATA instructions
$50101
$60110Reserved
nc...
I
$70111Begin execution of RTE instruction
$81000Begin 1-byte data transfer on DDATA
$91001Begin 2-byte data transfer on DDATA
$A1010Begin 3-byte data transfer on DDATA
Begin execution of taken branch or Synch_PC
1
cale Semiconductor,
Frees
$B1011Begin 4-byte data transfer on DDATA
$C1100
$D1101
$E1110
$F1111
Note 1. Rev. B enhancement.
Note 2. These encodings are asserted for multiple cycles.
Exception processing
Emulator mode entry exception processing
Processor is stopped, waiting for interrupt
Processor is halted
2
2
2
2
2.20BDM/JTAG SIGNALS
The MCF5249 complies with the IEEE 1149.1A JTAG testing standard. The JTAG test pins are multiplexed
with background debug pins.
2.20.1TEST CLOCK
TCK is the dedicated JTAG test logic clock that is independent of the MCF5249 processor clock. Various
JTAG operations occur on the rising or falling edge of TCK. The internal JTAG controller logic is designed
such that holding TCK high or low for an indefinite period of time will not cause the JTAG test logic to lose
state information. If TCK will not be used, it should be tied to ground.
2.20.2TEST RESET/DEVELOPMENT SERIAL CLOCK
The TEST[3:0] signals determine the function of the TRST/DSCLK dual-purpose pin. If TEST[3:0]=0001,
the DSCLK function is selected. If TEST[3:0]= 0000, the TRST function is selected. TEST[3:0] should not
be changed while RSTI
2-12MCF5249UMMOTOROLA
= 1. When used as TRST, this pin will asynchronously reset the internal JTAG
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
controller to the test logic reset state, causing the JTAG instruction register to choose the “bypass”
command. When this occurs, all the JTAG logic is benign and will not interfere with the normal functionality
of the MCF5249 processor. Although this signal is asynchronous, Motorola recommends that TRST
only a 0 to 1 (asserted to negated) transition while TMS is held at a logic 1 value. TRST
pullup so that if it is not driven low its value will default to a logic level of 1. However, if TRST
used, it can either be tied to ground or, if TCK is clocked, it can be tied to VDD. If it is tied to ground, it will
place the JTAG controller in the test logic reset state immediately. If it is tied to VDD, it will cause the JTAG
controller (if TMS is a logic 1) to eventually end up in the test logic reset state after 5 clocks of TCK.
This pin is also used as the development serial clock (DSCLK) for the serial interface to the Debug
Module.The maximum frequency for the DSCLK signal is 1/5 the BCLKO frequency.
BDM/JTAG Signals
make
has an internal
will not be
2.20.3TEST MODE SELECT/BREAK POINT
The TEST[3:0] signals determine the TMS/BKPT pin function. If TEST[3:0] =0001, the BKPT function is
selected. If TEST[3:0] = 0000, then the TMS function is selected. TEST[3:0] should not change while RSTI
= 1. When used as TMS, this input signal provides the JTAG controller with information to determine which
nc...
I
test operation mode should be performed. The value of TMS and current state of the internal 16-state
JTAG controller state machine at the rising edge of TCK determine whether the JTAG controller holds its
current state or advances to the next state. This directly controls whether JTAG data or instruction
operations occur. TMS has an internal pullup so that if it is not driven low, its value will default to a logic
level of 1. However, if TMS will not be used, it should be tied to VDD. This pin also signals a hardware
breakpoint to the processor when in the debug mode.
cale Semiconductor,
Frees
2.20.4TEST DATA INPUT/DEVELOPMENT SERIAL INPUT
The TDI/DS is a dual-function pin. If TEST[3:0] = 0001, then DSI is selected. If TEST[3:0] = 0000, then TDI
is selected. When used as TDI, this input signal provides the serial data port for loading the various JTAG
shift registers composed of the boundary scan register, the bypass register, and the instruction register.
Shifting in of data depends on the state of the JTAG controller state machine and the instruction currently
in the instruction register. This data shift occurs on the rising edge of TCK. TDI also has an internal pullup
so that if it is not driven low its value will default to a logic level of 1. However, if TDI will not be used, it
should be tied to VDD.
This pin also provides the single-bit communication for the debug module commands.
2.20.5TEST DATA OUTPUT/DEVELOPMENT SERIAL OUTPUT
The TDO/DSO is a dual-function pin. When TEST[3:0] = 0001, then DSO is selected. When TEST[3:0] =
0000, TDO is selected. When used as TDO, this output signal provides the serial data port for outputting
data from the JTAG logic. Shifting out of data depends on the state of the JTAG controller state machine
and the instruction currently in the instruction register. This data shift occurs on the falling edge of TCK.
When TDO is not outputting test data, it is three-stated. TDO can also be placed in three-state mode to
allow bussed or parallel connections to other devices having JTAG. This signal also provides single-bit
communication for the debug module responses.
MOTOROLASignal Description2-13
For More Information On This Product,
Go to: www.freescale.com
Clock and Reset signals
Freescale Semiconductor, Inc.
2.21CLOCK AND RESET SIGNALS
These signals configure the MCF5249 and provide interface signals to the external system.
2.21.1RESET IN
Asserting RSTI causes the MCF5249 to enter reset exception processing. When RSTI is recognized, the
data bus is tri-stated.
2.21.2SYSTEM BUS INPUT
The CRIN signal is the system clock input. The device has no on-chip clock oscillator, and needs an
external oscillator.
nc...
I
cale Semiconductor,
Frees
2-14MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 3
ColdFire Core
This section provides an overview of the microprocessor core of the MCF5249. The section describes the
V2 programming model as it is implemented on the MCF5249. It also includes a full description of
exception handling, data formats, an instruction set summary, and a table of instruction timings. For
detailed information on instructions, see the ColdFire Family Programmer’s Reference Manual.
3.1PROCESSOR PIPELINES
The following figure shows a block diagram of the processor pipelines of a V2 ColdFire core
.
IFP
nc...
I
INSTRUCTION
FETCH
PIPELINE
INSTRUCTION
ADDRESS IA
GENERATION
INSTRUCTION
FETCH
ADDRESS[31:0]
cale Semiconductor,
Frees
FIFO
INSTRUCTION
BUFFER
OEP
DECODE & SELECT,
OPERAND
EXECUTION
PIPELINE
Figure 3-1 V2 ColdFire Processor Core Pipelines
The processor core is comprised of two separate pipelines that are decoupled by an instruction buffer. The
Instruction Fetch Pipeline (IFP) is responsible for instruction address generation and instruction fetch. The
instruction buffer is a first-in-first-out (FIFO) buffer that holds prefetched instructions awaiting execution in
the Operand Execution Pipeline (OEP). The OEP includes two pipeline stages. The first stage decodes
instructions and selects operands (DSOC); the second stage (AGEX) performs instruction execution and
calculates operand effective addresses, if needed.
OPERAND FETCH
ADDRESS
GENERATION,
EXECUTE
3 X 32
DATA[31:0]
MOTOROLAColdFire Core3-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Processor Register Description
3.2PROCESSOR REGISTER DESCRIPTION
The following sections describe the processor registers in the user and supervisor programming models.
The appropriate programming model is selected based on the privilege level (user mode or supervisor
mode) of the processor as defined by the S bit of the status register.
3.2.1USER PROGRAMMING MODEL
Figure 3-2 shows the user programming model. The model is the same as the M68000 family of
microprocessors and consists of the following registers:
Registers D0–D7 are used as data registers for bit (1 bit), byte (8 bit), word (16 bit) and longword (32 bit)
nc...
I
operations and can also be used as index registers.
cale Semiconductor,
Frees
3.2.1.2ADDRESS REGISTERS (A0–A6)
Registers A0–A6 can be used as software stack pointers, index registers, or base address registers as
well as for word and longword operations.
3.2.1.3STACK POINTER (A7,SP)
The ColdFire architecture supports a single hardware stack pointer (A7) for explicit references as well as
for implicit ones during stacking for subroutine calls and returns and exception handling. The initial value of
A7 is loaded from the reset exception vector, address $0. The same register is used for both user and
supervisor mode as well as word and longword operations.
3-2MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Processor Register Description
nc...
I
cale Semiconductor,
Frees
15031
1570
7
D0
D1
D2
D3
D4
D5
D6
D7
A0
A1
A2
A3
A4
A5
A6
A7
PC
CCR
DATA
REGISTERS
ADDRESS
REGISTERS
STACK
POINTER
PROGRAM
COUNTER
CONDITION
CODE
REGISTER
Figure 3-2 User Programming Model
A subroutine call saves the Program Counter (PC) on the stack and the return restores it from the stack.
Both the PC and the Status Register (SR) are saved to the stack during the processing of exceptions and
interrupts. The return from exception instruction restores the SR and PC values from the stack.
3.2.1.4PROGRAM COUNTER (PC)
The PC contains the address of the next instruction to execute. During instruction execution and exception
processing, the processor automatically increments the contents of the PC or places a new value in the
PC, as appropriate. For some addressing modes, the PC can be used as a pointer for PC-relative operand
addressing.
3.2.1.5CONDITION CODE REGISTER (CCR)
The CCR is the least significant byte of the processor status register (SR). Refer to Section 3.2.3.1 Status
Register (SR) for more information. Bits 4–0 represent indicator flags based on results generated by
processor operations. Bit 4, the extend bit (X bit), is also used as an input operand during multiprecision
arithmetic computations.
Table 3-1 Condition Code Register (Bits 0-4)
76543210
——— X N Z V C
MOTOROLAColdFire Core3-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Processor Register Description
The following table describes the bits in the condition code register.
BITCODEDESCRIPTION
7–5—Reserved, should be cleared.
4XExtend condition code bit. Assigned the value of the carry bit for arithmetic
operations; otherwise not affected or set to a specified result. Also used as an
input operand for multiple-precision arithmetic.
3NNegative condition code bit. Set if the msb of the result is set; otherwise cleared.
2ZZero condition code bit. Set if the result equals zero; otherwise cleared.
1VOverflow condition code bit. Set if an arithmetic overflow occurs, implying that the
result cannot be represented in the operand size; otherwise cleared.
0CCarry condition code bit. Set if a carry-out of the data operand msb occurs for an
addition or if a borrow occurs in a subtraction; otherwise cleared.
nc...
I
Table 3-2 CCR Functionality
3.2.2ENHANCED MULTIPLY ACCUMULATE MODULE (EMAC) USER
PROGRAMMING MODEL
The EMAC provides a variety of program-visible registers:
• Four 48-bit accumulators (Raccx = Racc0, Racc1, Racc2, Racc3)
• Eight 8-bit accumulator extensions (2 per accumulator), packaged as two 32-bit values for load and
store operations (Raccext01, Raccext23)
• One 16-bit Mask Register (Rmask)
• One 32-bit Status Register (MACSR) including four indicator bits signaling product or accumulation
overflow (one for each accumulator: PAV0, PAV1, PAV2, PAV3)
3.2.2.1EMAC INSTRUCTION SET SUMMARY
The EMAC unit supports the integer multiply operations defined by the baseline ColdFire architecture, as
well as the multiply-accumulate instructions. The following table summarizes the EMAC unit instruction set.
cale Semiconductor,
Table 3-3 EMAC Instruction Summary
COMMANDMNEMONICDESCRIPTION
Frees
Multiply SignedMULS <ea>y,DxMultiplies two signed operands yielding a signed result
Multiply UnsignedMULU <ea>y,DxMultiplies two unsigned operands yielding an unsigned
result
Multiply AccumulateMAC Ry,RxSF,Raccx
MSAC Ry,RxSF,Raccx
Multiply Accumulate with
Load
Load AccumulatorMOV.L {Ry,#imm},RaccxLoads an accumulator with a 32-bit operand
Store AccumulatorMOV.L Raccx,RxWrites the contents of an accumulator to a CPU register
Copy AccumulatorMOV.L Raccy,RaccxCopies a 48-bit accumulator
3-4MCF5249UMMOTOROLA
MAC Ry,RxSF,Rw,Raccx
MSAC Ry,RxSF,Rw,Raccx
For More Information On This Product,
Go to: www.freescale.com
Multiplies two operands, then adds/subtracts the product
to/from an accumulator
Multiplies two operands, then combines the product to an
accumulator while loading a register with the memory
operand
Freescale Semiconductor, Inc.
Table 3-3 EMAC Instruction Summary (Continued)
COMMANDMNEMONICDESCRIPTION
Load MAC Status RegMOV.L {Ry,#imm},MACSRWrites a value to the MAC status register
Store MAC Status RegMOV.L MACSR,RxWrite the contents of the MAC status register to a CPU
Store MACSR to CCRMOV.L MACSR,CCRWrite the contents of the MAC status register to the
Load MAC Mask RegMOV.L {Ry,#imm},RmaskWrites a value to the MAC Mask Register
Store MAC Mask RegMOV.L Rmask,RxWrites the contents of the MAC mask register to a CPU
Load AccExtensions01MOV.L {Ry,#imm},Raccext01 Loads the accumulator 0,1 extension bytes with a 32-bit
Load AccExtensions23MOV.L {Ry,#imm},Raccext23 Loads the accumulator 2,3 extension bytes with a 32-bit
nc...
I
Store AccExtensions01MOV.L Raccext01,RxWrites the contents of accumulator 0,1 extension bytes
Processor Register Description
register
processor’s CCR register
register
operand
operand
into a CPU register
cale Semiconductor,
Frees
Store AccExtensions23MOV.L Raccext23,RxWrites the contents of accumulator 2,3 extension bytes
into a CPU register
3.2.3SUPERVISOR PROGRAMMING MODEL
Only system programmers use the supervisor programming model to implement sensitive 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 the registers available to
users as well as the following control registers:
• 16-bit status register (SR)
• 32-bit vector base register (VBR)
31 — 20 19 — 0
MUST BE ZEROSVBRVECTOR BASE
REGISTER
15 — 87 — 0
System ByteCCRSRSTATUS REGISTER
Figure 3-3 Supervisor Programming Model
Additional registers may be supported on a part-by-part basis.
The following sections describe the supervisor programming model registers.
MOTOROLAColdFire Core3-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Processor Register Description
3.2.3.1STATUS REGISTER (SR)
The SR stores the processor status and includes the CCR, the interrupt priority mask, and other control
bits. In the supervisor mode, software can access the entire SR. In user mode, only the lower 8 bits are
accessible (CCR). 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).
Table 3-4 Status Register
SYSTEM BYTECONDITION CODE REGISTER (CCR)
1514131211109876543210
T0SM0I[2:0]000XNZVC
Table 3-5 Status Bit Descriptions
nc...
I
cale Semiconductor,
Frees
BIT NAMEDESCRIPTION
TWhen set, the trace enable allows the processor to perform a trace exception after every
instruction.
SThe supervisor / user state bit denotes whether the processor is in supervisor mode
(S=1) or user mode (S=0).
MThe master / interrupt state bit is cleared by an interrupt exception, and can be set by
software during execution of the RTE or move to SR instructions.
I [2:0]The interrupt priority mask defines the current interrupt priority. Interrupt requests are
inhibited for all priority levels less than or equal to the current priority, except the
edge-sensitive level 7 request, which cannot be masked.
3.2.3.2VECTOR BASE REGISTER (VBR)
The VBR contains the base address of the exception vector table in memory. The displacement of an
exception vector is added to the value in this register to access the vector table. The lower 20 bits of the
VBR are not implemented by ColdFire processors; they are zero, forcing the table to be aligned on a 1
MByte boundary.
30 — 2119 — 0
FieldException vector table base address—
Reset0000_0000_0000_0000_0000_0000_0000_0000
R/WWritten from a BDM serial command or from the CPU using the MOVEC instruction.
VBR can be read from the debug module only. The upper 12 bits are returned, the
low-order 20 bits are undefined.
Rc [11-0]0x801
Figure 3-4 Vector Base Register (VBR)
3-6MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
Exception Processing Overview
3.3EXCEPTION PROCESSING OVERVIEW
Exception processing for ColdFire processors is streamlined for performance. The ColdFire processors
provide a simplified exception processing model. The next section details the model.Differences from
previous 68000 Family processors include:
• A simplified exception vector table
• Reduced relocation capabilities using the vector base register
• A single exception stack frame format
• Use of a single self-aligning system stack
ColdFire processors use an instruction restart exception model but do require more software support to
recover from certain access errors.
Exception processing is comprised of four major steps and is defined as the time from the detection of the
fault condition to the fetch of the first handler instruction has been initiated.
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 occurrence of an interrupt exception also
forces the M bit to be cleared and the interrupt priority mask to be set to the level of the current
interrupt request.
2. The processor determines the exception vector number. For all faults except interrupts, the
processor performs this calculation based on the exception type. For interrupts, the processor
performs an interrupt-acknowledge (IACK) bus cycle to obtain the vector number from a peripheral
device. The IACK cycle is mapped to a special acknowledge address space with the interrupt level
encoded in the address.
3. The processor saves the current context by creating an exception stack frame on the system stack.
The V2 Core supports a single stack pointer in the A7 address register; therefore, there is no notion
of separate supervisor or user stack pointers. As a result, the exception stack frame is created at a
0-modulo-4 address on the top of the current system stack. Additionally, 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 x vector number). Once the
exception vector has been fetched, the contents of the vector determine the address of the first
instruction of the desired handler. After the instruction fetch for the first opcode of the handler has
been initiated, exception processing terminates and normal instruction processing continues in the
handler.
ColdFire 5200 processors support a 1024-byte vector table aligned on any 1 Mbyte address boundary (see
Table 3-6). The table contains 256 exception vectors where the first 64 are defined by Motorola and the
remaining 192 are user-defined interrupt vectors.
The V2 Core processor inhibits sampling for interrupts during the first instruction of all exception handlers.
This allows any handler to effectively disable interrupts, if necessary, by raising the interrupt mask level
contained in the status register.
Note:“Fault” refers to the PC of the instruction that caused the exception
Note:“Next” refers to the PC of the next instruction that follows the instruction that caused the fault.
VECTOR
OFFSET (HEX)
STACKED
PROGRAM
COUNTER
ASSIGNMENT
3.4EXCEPTION STACK FRAME DEFINITION
The exception stack frame is shown in Figure 3-5. The first longword of the exception stack frame 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.
3-8MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
31 2 7 2 5 1 7 1 5 C
A7
The 16-bit format/vector word contains 3 unique fields:
• A 4-bit format field at the top of the system stack is always written with a value of {4,5,6,7} by the
processor indicating a two-longword frame format. See Table 3-7.
FORMATFS[3 :0]V ECTOR[7:0]FS[1:0]
+ $04
Figure 3-5 Exception Stack Frame Form
Exception Stack Frame Definition
STATUS REGISTER
PROGRAM COUNTER[31:0]
Table 3-7 Format Field Encoding
nc...
I
cale Semiconductor,
Frees
ORIGINAL A7 @ TIME OF
EXCEPTION, BITS 1:0
00Original A7 - 84
01Original A7 - 95
10Original A7 - 106
11Original A7 - 117
• 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 types of exceptions. See Table 3-8.
Table 3-8 Fault Status Encoding
FS[3:0]DEFINITION
00xxReserved
0100Error on instruction fetch
0101Reserved
011xReserved
1000Error on operand write
1001Attempted write to write-protected space
101xReserved
A7 @ 1ST INSTRUCTION OF
HANDLER
FORMAT FIELD
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 peripheral in the case of an interrupt.
Refer to Table 3-6.
MOTOROLAColdFire Core3-9
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Processor Exceptions
Freescale Semiconductor, Inc.
3.5PROCESSOR EXCEPTIONS
3.5.1ACCESS ERROR EXCEPTION
The exact processor response to an access error depends on the type of 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 that occur during instruction prefetches that are
then 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, (e.g., (An)+,-(An)), have already been performed, so the programming model
contains the updated An value. In addition, if an access error occurs during the execution of a MOVEM
instruction loading from memory, any registers already updated before the fault occurs contains the
operands from memory.
The 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
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.5.2ADDRESS ERROR EXCEPTION
Any attempted execution transferring control to an odd instruction address (i.e., 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 8 on an indexed effective
addressing mode generates an address error as does an attempted execution of a full-format indexed
addressing mode.
3.5.3ILLEGAL INSTRUCTION EXCEPTION
The MCF5249 processors decode the full 16-bit opcode and generate this exception if execution of an
unsupported instruction is attempted. Additionally, attempting to execute an illegal line A or line F opcode
generates unique exception types: vectors 10 and 11, respectively.
ColdFire processors do not provide illegal instruction detection on extension words of any instruction,
including MOVEC. Attempting to execute an instruction with an illegal extension word causes undefined
results.
3.5.4DIVIDE BY ZERO
Attempted division by zero causes an exception (vector 5, offset = 0x014) except when the PC points to
the faulting instruction (DIVU, DIVS, REMU, REMS).
3-10MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Processor Exceptions
3.5.5PRIVILEGE VIOLATION
The attempted execution of a supervisor mode instruction while in user mode generates a privilege
violation exception. Refer to the ColdFire Programmer’s Reference Manual for lists of supervisor- and
user-mode instructions.
3.5.6TRACE EXCEPTION
To aid in program development, the V2 processors provide an instruction-by-instruction tracing capability.
While in trace mode, indicated by the assertion of the T bit in the status register (SR[15] = 1), the
completion of an instruction execution signals a trace exception. This functionality allows a debugger to
monitor program execution.
The single exception to this definition is the STOP instruction. When the STOP opcode is executed, the
processor core waits until an unmasked interrupt request is asserted, then aborts the pipeline and initiates
interrupt exception processing.
Because ColdFire processors do not support hardware stacking of multiple exceptions, it is the
nc...
I
responsibility of the operating system to check for trace mode after processing other exception types. For
example, consider the execution of a TRAP instruction while in trace mode. The processor will initiate the
TRAP exception and then pass 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[15] in the exception stack frame asserted) and pass control to the trace handler before returning from
the original exception.
cale Semiconductor,
Frees
3.5.7DEBUG INTERRUPT
This exception 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).
3.5.8RTE AND FORMAT ERROR EXCEPTIONS
When an RTE instruction is executed, the processor first examines the 4-bit format field to validate the
frame type. For a ColdFire 5200 processor, any attempted execution of an RTE 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 68000
applications. On 680x0 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 5200 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.
MOTOROLAColdFire Core3-11
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Execution Timing
3.5.9TRAP INSTRUCTION EXCEPTIONS
Executing TRAP always forces an exception and is useful for implementing system calls. The trap
instruction may be used to change from user to supervisor mode.
3.5.10INTERRUPT EXCEPTION
The interrupt exception processing, with interrupt recognition and vector fetching, includes uninitialized
and spurious interrupts as well as those where the requesting device supplies the 8-bit interrupt vector.
Autovectoring may optionally be supported through the System Integration module (SIM).
3.5.11FAULT-ON-FAULT HALT
If a V2 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.
nc...
I
cale Semiconductor,
Frees
3.5.12RESET EXCEPTION
Asserting the reset input signal 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 S bit and disables tracing
by clearing the T bit in the SR. This exception also clears the M bit and sets the processor’s interrupt
priority mask in the SR to the highest level (level 7). Next, the VBR is initialized to zero ($00000000). 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 supervisor registers are also affected.
Refer to each of the modules in this manual for details on these registers.
After reset is negated, the core performs two longword read bus cycles. The first longword at address 0 is
loaded into the stack pointer and the second longword at address 4 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 halted state.
3.6INSTRUCTION EXECUTION TIMING
This section describes V2 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
clock cycles. Each timing entry is presented as C(r/w) where:
•C — 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 — 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).
This section includes the assumptions concerning the timing values and the execution time details.
3-12MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Execution Timing
3.6.1TIMING ASSUMPTIONS
For the timing data presented in this section, the following assumptions apply:
1. The operand execution pipeline (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
instruction fetch pipeline (IFP) to supply opwords and/or extension words.
2. The OEP does not experience any sequence-related pipeline stalls. For ColdFire 5200 processors,
the most common example of this type 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 DSOC cycle of the
store instruction. If a subsequent STORE instruction is encountered within this 2-cycle window, it
will be stalled until the resource again becomes available. Thus, the maximum pipeline stall
involving consecutive STORE operations is 2 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
nc...
I
attached to the processor core.
4. All operand data accesses are aligned on the same byte boundary as the operand size, i.e., 16 bit
operands aligned on 0-modulo-2 addresses, 32 bit operands aligned on 0-modulo-4 addresses.
cale Semiconductor,
Frees
If the operand alignment fails these guidelines, it is misaligned. The processor core decomposes the
misaligned operand reference into a series of aligned accesses as shown in the following table.
ADDRESS[1:0]SIZE
X1WordByte, Byte2(1/0) if read
X1LongByte, Word, Byte3(2/0) if read
10LongWord, Word2(1/0) if read
Table 3-9 Misaligned Operand References
KBUS
OPERATIONS
ADDITIONAL C(R/W)
1(0/1) if write
2(0/2) if write
1(0/1) if write
3.6.2MOVE INSTRUCTION EXECUTION TIMES
The execution times for the MOVE.{B,W} instructions are shown in Table 3-10, while Table 3-11 provides
the timing 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.
MOTOROLAColdFire Core3-13
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Execution Timing
The nomenclature “xxx.wl” refers to both forms of absolute addressing, xxx.w and xxx.l.
SOURCE
Dn1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
An1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
(An)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1)3(1/1)
(An)+3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1)3(1/1)
-(An)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1)3(1/1)
(d
,An)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)——
16
(d
,An,Xi)4(1/0)4(1/1)4(1/1)4(1/1)———
nc...
I
cale Semiconductor,
8
(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)———
(d
,PC)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)——
16
(d8,PC,Xi)4(1/0)4(1/1)4(1/1)4(1/1)———
#<xxx>1(0/0)3(0/1)3(0/1)3(0/1)———
SOURCE
Dn1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
An1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
(An)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)3(1/1)2(1/1)
(An)+2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)3(1/1)2(1/1)
-(An)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)3(1/1)2(1/1)
Table 3-10 Move Byte and Word Execution times
DESTINATION
RX(AX)(AX)+-(AX)(D
Table 3-11 Move Long Execution Times
DESTINATION
RX(AX)(AX)+-(AX)(D
,AX) (D8,AX,XI) (XXX).WL
16
,AX)(D8,AX,XI) (XXX).WL
16
Frees
(d
,An)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)——
16
,An,Xi)3(1/0)3(1/1)3(1/1)3(1/1)———
(d
8
(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)———
(d
,PC)2(1/0)2(1/1)2(1/1)2(1/1)2(1/1)——
16
(d8,PC,Xi)3(1/0)3(1/1)3(1/1)3(1/1)———
#<xxx>1(0/0)2(0/1)2(0/1)2(0/1)———
3-14MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Standard One Operand Instruction Execution Times
3.7STANDARD ONE OPERAND INSTRUCTION EXECUTION TIMES
Table 3-12 One Operand Instruction Execution Times
Note:n is the number of registers moved by the MOVEM opcode.
Note:
Note:
Note:
Note:
Note:
1
≤ indicates that long multiplies have early termination after 9 cycles; thus, actual cycle count is operand
independent
2
If a MOVE.W #imm,SR instruction is executed and imm[13] = 1, the execution time is 1(0/0).
3
The execution time for STOP is the time required until the processor begins sampling continuously for
interrupts.
4
PEA execution times are the same for (d16,PC)
5
PEA execution times are the same for (d8,PC,Xn*SF)
2(0/1)
4
3(0/1)
5
2(0/1)—
3(0/0)
3
3-18MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Branch Instruction Execution Times
3.10BRANCH INSTRUCTION EXECUTION TIMES
Table 3-15 General Branch Instruction Execution Times
EFFECTIVE ADDRESS
OPCODE <EA>
RN(AN)(AN)+-(AN)
BSR————3(0/1)———
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)—————
(D16,AN)
(D16,PC)
(D8,AN,XI*SF)
(D8,PC,XI*SF)
XXX.WL#XXX
nc...
I
cale Semiconductor,
Frees
Table 3-16 BRA, Bcc Instruction Execution Times
OPCODE
BRA2(0/0)—2(0/0)—
Bcc3(0/0)1(0/0)2(0/0)3(0/0)
FORWARD
TAKEN
FORWARD
NOT TAKEN
BACKWARD
TAKEN
BACKWARD
NOT TAKEN
MOTOROLAColdFire Core3-19
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
nc...
I
NOTES
cale Semiconductor,
Frees
3-20MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
K
Freescale Semiconductor, Inc.
Section 4
Phase-Locked Loop and Clock Dividers
4.1PLL FEATURES
• The PLL locks to the crystal clock frequency at the CRIN pin and produces a processor clock
(PSTCLK) and a bus clock which is always 1/2 of the processor clock.
• The audio clock (AUDIOCLK) is derived directly from the crystal. The DAC clocks MCLK1 and
MCLK2 are divided directly from the crystal.
• The PLL is configured by writing to a configuration register. By programming this register, the user
may change the processor clock (PSTCLK) and the audio clock (AUDIOCLK).
• The PLL Configuration Register must always be programmed to Bypass mode before it is
reprogrammed to change any clock frequency. In bypass mode, the crystal clock is fed to the
processor (PSTCLK).
nc...
I
• When the clock circuit is switched from “bypass” to “normal operation”, the switch-over is delayed
until the PLL is locked.
cale Semiconductor,
Frees
The following figure shows the PLL module and the frequency relationships of various clock signals.
PLLBYPASS
Divide
By
VCODIV +
Divide
By 2
Divide
By
PLLDIV + 2
CRSEL,CLSEL
Divide
By 2
Divide
By 3
Divide
By 4
Phase
Frequency
Comparator
VCO
Divide
By
VCOOU
0
1
Divide
By
CPUDIV
AUDIOSEL
Divide
By 2
0
1
MCLK1
AUDIOCLK
PSTCL
SCLK
MCLK2
X-TAL
External Circuitry
Figure 4-1 Phase-Locked Loop Module Block Diagram
MOTOROLAPhase-Locked Loop and Clock Dividers4-1
For More Information On This Product,
Go to: www.freescale.com
PLL Programming
Freescale Semiconductor, Inc.
4.2PLL PROGRAMMING
The different settings for the PLL/clock module are summarized in Table 4-1.
BITS31302928272625242322212019181716
FIELD LOCKCLSELN/ACPUDIVCRSEL
RESE
T
R/WRR/W
BITS1514131211109876543210
FIELDVCODIV
RESE
T
nc...
I
R/WR/W
ADDRADDRESS MBAR2BAS + 0 x 180
000000 0 0 0 0 0 0000 0
QSPI
SEL
000000 0 0 0 0 0 0000 0
Note:Bits marked N/A are reserved bits; program these bits to 0.
Table 4-1 PLLCR Register
RST
SEL
PLL
POWER
DOWN
AUDIO
PLLDIVVCOOUTN/A
SEL
DEBUG
SEL
VCODIV
PLL
BYPASS
cale Semiconductor,
Frees
Table 4-2 PLLCR Bit Descriptions
BIT NAMEDESCRIPTION
LOCKRead-only bit, 1 if PLL is locked. (See Note 2 following these bit descriptions.)
CLSEL(See Note 12)
MCLK1,MCLK2 select bit.
CPUDIV(See Notes 8 and 9)
CPU clock divider
CRSEL(See Note 3)
0 = Fin = Fxtal
1 = Fin = Fxtal/2
AUDIOSEL(See Note 4)
1 = FXTAL
0 = FXTAL/2
DEBUGSEL(See Note 11)
1 = Secondary functions on aux debug port.
0 = Aux debug port active.
VCODIV(See Notes 5 and 10)
PLL compare frequency is VCO frequency divided by (VCODIV + 2)
QSPISEL(See Note 7)
1 = QSPI functions active on pins. (qspi_clk, qspi_din)
0 = IIC functions active on pins. (scl, sda)
VCOOUT(See Note 6)
VCO output divider
PLLBYPASS (See Notes 1 and 2 following these bit descriptions)
1 = switch to PLL after PLL is locked
0 = Bypass PLL and dividers
RSTSEL(See Note 7)
1 = SDATA2BS2 function active on pin
0 = RST function active on pin
4-2MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PLL Programming
Table 4-2 PLLCR Bit Descriptions (Continued)
BIT NAMEDESCRIPTION
PLLDIV(See Note 5)
Input frequency (Fin) is divided by (PLLDIV + 2) to determine the PLL compare frequency.
Note:1. If this bit is written 0, the PLL is not used, and the crystal clock is sent directly to the CPU. Write this bit 0 before
changing any other bit in this register. Write back to 1 after writing new settings. After writing 1 to this bit, new
setting will become active after a hardware controlled delay. This delay is ca. 0.5 mS. Clock frequencies described
in other notes are only valid when this bit is set 1.
Note:2. PLL may require up to 10.0 mS to lock
Note:3. Fin is input frequency to PLL. Nominal setting for CRSEL is ‘1’ for 33.8688 Mhz X-tal, ‘0’ for 16.9344 Mhz X-tal.
Note:4. AUDIOCLK is clock for audio interfaces. May be 11.2896MHz, 16.9344 or 33.8688 Mhz.
Note:5. Fvco = Fin * (VCODIV + 2)/ (PLLDIV + 2)
Note:6. FVCOOUT depends on Fvco (note 5) and VCOOUT setting as shown in the following table:
VCO OUT
SETTING
0Fvco
nc...
I
1Fvco/2
2Fvco/2
3Fvco/4
FVCO OUT
cale Semiconductor,
Frees
Note:7. This bit selects between two different functions implemented on an external pin.
Note:8. Fcpu = FVCOOUT / CPUDIV; Fcpu is the frequency the processor is running at.
Note:9. If field is “000”, divide by 8
Note:10. Fvco max. is 400 Mhz
Note:11. This bit selects the function of the aux_dsi/intmon1, aux_bkpt_b/TA, aux_dsclk/intmon2, and aux-dso/A27 pins.
Note:12. This field determines the frequency of the DAC clocks. Fxtal/3 and Fxtal/4 should not be used normally:
If this bit = 0, the primary function (aux_dsi,aux_bkpt_b,aux_dsclk, and aux_dso) is selected. If this bit = 1, the
secondary function (intmon1, TA,intmon2, and A27) is selected.
The input to the PLL is either the crystal clock, or the crystal clock divided by two. Selection is done by
CRSEL. The PLL divides this input frequency by a programmable division factor (PLLDIV+2). In the PLL
phase/frequency detector, this divided clock is compared with the VCO output clock divided by
(VCODIV+2). As a result, Fvco = Fin * (VCODIV+2)/(PLLDIV+2).
Note: The PLL lock counter is designed for worst case input frequency (Fin) of
33.8688MHz. This will result in the required 0.5 ns for the PLL to lock. Other Fin
frequencies can be used, however, the resulting lock time will be slightly longer.
In a second step, this VCO clock is divided by (VCOOUT * CPUDIV) to create the CPU clock PSTCLK.
The PLL has a PLL-bypass feature. When PLL bypass is written 0, the crystal clock is passed directly to
the CPU. When PLL bypass is written 1, CPU clock will be switched to PLL-generated values. The
switching is delayed until the PLL has been locked, and produces a stable clock output for CPU. The
processor can read the PLL lock status (bit 31 of PLLCR). The multiplexers that switch between PLL clock
and crystal clock is glitch-free, so no system reset is needed after switching this mux.
nc...
I
Note: It is important that before reprogramming the PLL division factors, users must
switch to PLL bypass mode. After reprogramming, users may immediately switch
back to PLL enabled mode. Switching back is delayed internally until the PLL is
locked.
cale Semiconductor,
Frees
4.2.2PLL LOCK-IN TIME
Pll lock-in time is less than 10.0 ms.
4.2.3PLL ELECTRICAL LIMITS
Due to implementation of the block, some limits apply to the PLL block. These limitations are shown in
Table 4-3.
Table 4-3 PLL Electrical Limits
NAME
Fvco200400PLL limitations
Fcpu0120 (144QFP)
Fin550PLL limitations
MIN. FREQUENCY
MHZ
MAX FREQUENCY
MHZ
140 (160 MAPBGA)
REASON
Max. operating frequency of device
4-4MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Audio Clock Generation
4.3AUDIO CLOCK GENERATION
The audio clocks and output DAC clocks are divided directly from the crystal. Clock settings depend on
CRSEL, CLSEL, and AUDIOSEL bits, as explained in Table 4-4. As the table shows, the AUDIOCLK is
completely derived from the AUDIOSEL bit, and this clock is independent of the other select bits. For the
DAC clocks (MCLK2 and MCLK1) the relationship between CRSEL and CLSEL is defined in Table 4-4.
Table 4-4 PLLCR Bit Fields
nc...
I
cale Semiconductor,
Frees
PLLCR CLSEL
(BITS30-28)
00011FXTALFXTALFXTAL/2
00111FXTALFXTALFXTAL
01011FXTALFXTAL/2FXTAL/2
01111FXTALFXTAL/2FXTAL
10011FXTALFXTALFXTAL/2
10111FXTALFXTALFXTAL
11011FXTALFXTAL/2FXTAL/2
11111FXTALFXTAL/2FXTAL
00010FXTAL/2FXTALFXTAL/2
00110FXTAL/2FXTALFXTAL
01010FXTAL/2FXTAL/2FXTAL/2
01110FXTAL/2FXTAL/2FXTAL
10010FXTAL/2FXTALFXTAL/2
10110FXTAL/2FXTALFXTAL
11010FXTAL/2FXTAL/2FXTAL/2
11110FXTAL/2FXTAL/2FXTAL
Note: MCLK1 and MCLK2 will output a clock signal just after reset and before they can be
configured as GPIO if so desired. The frequency of the clock will be the same as
CRIN prior to initialization of the PLL.
PLLCR CRSEL
(BIT 23)
PLLCR CONFIG
AUDIOSEL
(BIT 22)
AUDIOCLKMCLK2MCLK1
The multiplexer that switches AUDIOCLK between Fxtal and Fxtal/2 is glitch free. No reset is needed after
switching audio clock. For the MCLK1 and MCLK2 clocks, the divide by 2 is 50% duty cycle, divide by 3 is
33% duty cycle, and divide by 4 is 25% duty cycle.
MOTOROLAPhase-Locked Loop and Clock Dividers4-5
For More Information On This Product,
Go to: www.freescale.com
Reduced Power Mode
Freescale Semiconductor, Inc.
4.4REDUCED POWER MODE
To save power, it is recommended that users reduce the frequency of the CPU clocks. This is done by
reprogramming the PLLCR register.
The PLL is also configured with a power down bit. This bit, when set to ‘1’, allows the PLL to enter “sleep”
mode. In “sleep” mode, the VCO and charge pump are turned off.
Note: The PLL must go through the re-locking procedure when it is re-enabled.
4.5RECOMMENDED SETTINGS
Many valid PLL settings exist. However, in many cases some limitations apply so that only a few typical
settings will be used. In a typical system, the following limitations may exist:
• Users want to run the processor at 120, 96, 64, 84, or 72 Mhz clock frequency
• MCLK2 must be one of the following: 16.9344, 11.2896, or 8.4672 Mhz see Table 4-4 in this section
for further definition.
nc...
I
• MCLK1 must be one of the following: 16.9344, 11.2896, or 8.4672 Mhz see Table 4-4 in this section
for further definition.
As a result of these limitations, users may select a 33.8688 Mhz X-TAL and use the settings shown in
Table 4-5.
cale Semiconductor,
Frees
A utility that calculates PLL frequencies from PLL register settings is available at the following URL:
The instruction cache is a direct-mapped single-cycle memory, organized as 512 lines, each containing 16
Bytes. The memory storage consists of a 512-entry tag array (containing addresses and a valid bit), and
the data array containing 8KBytes of instruction data, organized as 2048 x 32 bits.
The two memory arrays are accessed in parallel: bits [12:4] of the instruction fetch address provide the
index into the tag array, and bits [12:2] addressing the data array. The tag array outputs the address
mapped to the given cache location along with the valid bit for the line. This address field is compared to
bits [31:12] of the instruction fetch address from the local bus to determine if a cache hit in the memory
array has occurred. If the desired address is mapped into the cache memory, the output of the data array
is driven onto the ColdFire core's local data bus completing the access in a single cycle.
The tag array maintains a single valid bit per line entry. Accordingly, only entire 16 Byte lines are loaded
into the instruction cache.
The instruction cache also contains a 16 Byte fill buffer that provides temporary storage for the last line
fetched in response to a cache miss. With each instruction fetch, the contents of the line fill buffer are
examined. Thus, each instruction fetch address examines both the tag memory array and the line fill buffer
to see if the desired address is mapped into either hardware resource. A cache hit in either the memory
array or the line-fill buffer is serviced in a single cycle. Because the line fill buffer maintains valid bits on a
longword basis, hits in the buffer can be serviced immediately without waiting for the entire line to be
fetched.
If the referenced address is not contained in the memory array or the line-fill buffer, the instruction cache
initiates the required external fetch operation. In most situations, this is a 16-byte line-sized burst
reference.
The hardware implementation is a nonblocking design, meaning the ColdFire core's local bus is released
after the initial access of a miss. Thus, the cache or the SRAM module can service subsequent requests
while the remainder of the line is being fetched and loaded into the fill buffer.
MOTOROLAInstruction Cache5-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Cache Operation
EXTERNAL DATA[31:0]
LOCAL ADDRESS BUS
31
nc...
I
12
1
4
0
2
3
=
FILL HIT
Figure 5-1 Instruction Cache Block Diagram
5.3INSTRUCTION CACHE OPERATION
The instruction cache is physically connected to the ColdFire core local bus, allowing it to service all
instruction fetches from the ColdFire core and certain memory fetches initiated by the debug module.
cale Semiconductor,
Typically, the debug module's memory references appear as supervisor data accesses but the unit can be
programmed to generate user-mode accesses and/or instruction fetches. The instruction cache processes
any instruction fetch access in the normal manner.
31
LINE
31
TAG HIT
BUFFER
ADDRESS
TAG
=
4
LINE BUFFER DATA STORAGE
MUX
9
0
VALID
31
31
DATA
LOCAL DATA BUS
MUX
0
‘127
0
Frees
5.3.1INTERACTION WITH OTHER MODULES
Because both the instruction cache and high-speed SRAM module are connected to the ColdFire core
local data bus, certain user-defined configurations can result in simultaneous instruction fetch processing.
If the referenced address is mapped into the SRAM module, that module will service the request in a single
cycle. In this case, data accessed from the instruction cache is simply discarded and no external memory
references are generated. If the address is not mapped into the SRAM space, the instruction cache
handles the request in the normal fashion.
5-2MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Cache Operation
5.3.2MEMORY REFERENCE ATTRIBUTES
For every memory reference the ColdFire core or the debug module generates, a set of “effective
attributes” is determined based on the address and the Access Control Registers (ACR0, ACR1). This set
of attributes includes the cacheable/noncacheable definition, the precise/imprecise handling of operand
write, and the write-protect capability.
In particular, each address is compared to the values programmed in the Access Control Registers (ACR).
If the address matches one of the ACR values, the access attributes from that ACR are applied to the
reference. If the address does not match either ACR, then the default value defined in the Cache Control
Register (CACR) is used. The specific algorithm is as follows:
if (address = ACR0_address including mask)
Effective Attributes = ACR0 attributes
else if (address = ACR1_address including mask)
Effective Attributes = ACR1 attributes
else Effective Attributes = CACR default attributes
nc...
I
cale Semiconductor,
Frees
5.3.3CACHE COHERENCY AND INVALIDATION
The instruction cache does not monitor ColdFire core data references for accesses to cached instructions.
Therefore, software must maintain cache coherency by invalidating the appropriate cache entries after
modifying code segments.
The cache invalidation can be performed in two ways. The assertion of bit 24 in the CACR forces the entire
instruction cache to be marked as invalid. The invalidation operation requires 512 cycles because the
cache sequences through the entire tag array, clearing a single location each cycle. Any subsequent
instruction fetch accesses are postponed until the invalidation sequence is complete.
The privileged CPUSHL instruction can invalidate a single cache line. When this instruction is executed,
the cache entry defined by bits[12:4] of the source address register is invalidated, provided bit 28 of the
CACR is cleared.
These invalidation operations can be initiated from the ColdFire core or the debug module.
5.3.4RESET
A hardware reset clears the CACR disabling the instruction cache. The contents of the tag array are not
affected by the reset. Accordingly, the system startup code must explicitly perform a cache invalidation by
setting CACR[24] before the cache can be enabled.
5.3.5CACHE MISS FETCH ALGORITHM/LINE FILLS
As detailed in Section 5.2 Instruction Cache Physical Organization, the instruction cache hardware
includes a 16-byte line fill buffer for providing temporary storage for the last fetched instruction.
With the cache enabled as defined by CACR[31], a cacheable instruction fetch that misses in both the tag
memory and the line-fill buffer generates a external fetch. The size of the external fetch is determined by
the value contained in the 2-bit CLNF field of the CACR and the miss address. Table 5-1 shows the
relationship between the CLNF bits, the miss address, and the size of the external fetch.
Depending on the runtime characteristics of the application and the memory response speed, overall
performance may be increased by programming the CLNF bits to values {00, 01}.
MOTOROLAInstruction Cache5-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Cache Operation
Table 5-1 Initial Fetch Offset vs. CLNF Bits
CLNF[1:0]
00LineLineLineLongword
01LineLineLongwordLongword
1XLineLineLineLine
For all cases of a line-sized fetch, the critical longword defined by bits [3:2] of the miss address is accessed
first followed by the remaining three longwords that are accessed by incrementing the longword address in
a modulo-16 fashion is shown in the following example code:
if miss address[3:2] = 00
fetch sequence = {$0, $4, $8, $C}
if miss address[3:2] = 01
nc...
I
Once an external fetch has been initiated and the data loaded into the line-fill buffer, the instruction cache
maintains a special “most-recently-used” indicator that tracks the contents of the fill buffer versus its
corresponding cache location. At the time of the miss, the hardware indicator is set, marking the fill buffer
as “most recently used.” If a subsequent access occurs to the cache location defined by bits [8:4] of the fill
buffer address, the data in the cache memory array is now most recently used, so the hardware indicator is
cleared. In all cases, the indicator defines whether the contents of the line fill buffer or the memory data
array are most recently used. At the time of the next cache miss, the contents of the line-fill buffer are
written into the memory array if the entire line is present, and the fill buffer data is still most recently used
compared to the memory array.
The fill buffer can also be used as temporary storage for line-sized bursts of non-cacheable references
cale Semiconductor,
under control of CACR[10]. With this bit set, a noncacheable instruction fetch is processed as defined by
Table 5-2. For this condition, the fill buffer is loaded and subsequent references can hit in the buffer, but
the data is never loaded into the memory array.
The following table shows the relationship between CACR bits 31 and 10 and the type of instruction fetch.
fetch sequence = {$4, $8, $C, $0}
if miss address[3:2] = 10
fetch sequence = {$8, $C, $0, $4}
if miss address[3:2] = 11
fetch sequence = {$C, $0, $4, $8}
00011011
LONGWORD ADDRESS BITS
Frees
5-4MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table 5-2 Instruction Cache Operation as Defined by CACR[31,10]
Instruction Cache Programming Model
CACR[31]CACR[10]
00N/AInstruction cache is completely disabled; all fetches are
01N/AAll fetches are word, longword in size
1XCacheableFetch size is defined by Table 4-1 and contents of the
10NoncacheableAll fetches are longword in size, and not loaded into the
11NoncacheableFetch size is defined by Table 4-1 and loaded into the
nc...
I
TYPE OF
INSTR. FETCH
DESCRIPTION
word, longword in size.
line-fill buffer can be written into the memory array
line-fill buffer
line-fill buffer, but are never written into the memory
array.
5.4INSTRUCTION CACHE PROGRAMMING MODEL
Three supervisor registers define the operation of the instruction cache and local bus controller: the Cache
Control Register (CACR) and two Access Control Registers (ACR0, ACR1).
5.4.1INSTRUCTION CACHE REGISTERS MEMORY MAP
Table 5-3 shows the memory map of the Instruction cache and access control registers.
The following list describes several key issues regarding the programming model table:
• The Cache Control Register and Access Control Registers can only be accessed in supervisor mode
using the MOVEC instruction with an Rc value of $002, $004 and $005, respectively.
• Addresses not assigned to the registers and undefined register bits are reserved for future
cale Semiconductor,
expansion. Write accesses to these reserved address spaces and reserved register bits have no
effect; read accesses will return zeros.
• The reset value column indicates the initial value of the register at reset. Certain registers may be
uninitialized upon reset, i.e., they may contain random values after reset.
Frees
The access column indicates if the corresponding register allows both read/write functionality (R/W),
read-only functionality (R), or write-only functionality (W). If a read access to a write-only register is
attempted, zeros will be returned. If a write access to a read-only register is attempted the access will be
ignored and no write will occur.
MOTOROLAInstruction Cache5-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Cache Programming Model
ADDRESSNAMEWIDTHDESCRIPTION
MOVEC with $002CACR32Cache Control Register$0000W
MOVEC with $004ACR032Access Control Register 0$0000W
MOVEC with $005ACR132Access Control Register 1$0000W
Table 5-3 Memory Map of I-Cache Registers
RESET
VALUE
ACCESS
5.4.2INSTRUCTION CACHE REGISTER
5.4.2.1CACHE CONTROL REGISTER
The CACR controls the operation of the instruction cache. The CACR provides a set of default memory
nc...
I
access attributes used when a reference address does not map into the spaces defined by the ACRs.
The CACR is a 32-bit write-only supervisor control register. It is accessed in the CPU address space using
the MOVEC instruction with an Rc encoding of $002. The CACR can be read when in Background Debug
mode (BDM). At system reset, the entire register is cleared.
Table 5-4 Cache Control Register (CACR)
cale Semiconductor,
Frees
BITS3130 292827262524232221 2019181716
FIELDCENBCPDI CFRZ
RESET0000000000000000
R/WR/WR/WR/W
BITS1514 131211109876543210
FIELDCEIB DCM DBWEDWPCLNF1 CLNF2
RESET0000000000000000
R/WR/WR/WR/WR/WR/WR/W
5-6MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Cache Programming Model
Table 5-5 Cache Control Bit Descriptions
BIT NAMEDESCRIPTION
nc...
I
cale Semiconductor,
Frees
CENBThe Cache Enable bit generally provides longword references used for sequential fetches. If the processor
branches to an odd word address, a word-sized fetch is generated. The memory array of the instruction cache
is enabled only if CENB is asserted.
0 = Cache disabled
1 = Cache enabled
CPDIWhen the disable CPUSHL Invalidation instruction is executed, the cache entry defined by bits [8:4] of the
address is invalidated if CPDI = 0. If CPDI = 1, no operation is performed.
0 = Enable invalidation
1 = Disable invalidation
CFRZ The Cache Freeze bit allows users to freeze the contents of the cache. When CFRZ is asserted line fetches
can be initiated and loaded into the line-fill buffer, but a valid cache entry can not be overwritten. If a given
cache location is invalid, the contents of the line-fill buffer can be written into the memory array while CFRZ is
asserted.
0 = Normal Operation
1 = Freeze valid cache lines
CINVThe Cache Invalidate bit forces the cache to invalidate each tag array entry. The invalidation process requires
32 machine cycles, with a single cache entry cleared per machine cycle. The state of this bit is always read as
a zero. After a hardware reset, the cache must be invalidated before it is enabled.
0 = No operation
1 = Invalidate all cache locations
CEIBThe Cache Enable Noncacheable Instruction Bursting bit enables the line-fill buffer to be loaded with burst
transfers under control of CLINF[1:0] for non-cacheable accesses. Noncacheable accesses are never written
into the memory array.
0 = Disable burst fetches on noncacheable accesses
1 = Enable burst fetches on noncacheable accesses
DCMThe Default Cache Mode bit defines the default cache mode: 0 is cacheable, 1 is noncacheable.
0 = Default cacheable
1 = Default noncacheable
DBWEThe Default Buffered Write Enable bit defines the default value for enabling buffered writes. If DBWE = 0, the
termination of an operand write cycle on the processor's local bus is delayed until the external bus cycle is
completed. If DBWE = 1, the write cycle on the local bus is terminated immediately and the operation buffered
in the bus controller. In this mode, operand write cycles are effectively decoupled between the processor's
local bus and the external bus.
Generally, enabled buffered writes provide higher system performance but recovery from access errors can be
more difficult. For the ColdFire CPU, reporting access errors on operand writes is always imprecise and
enabling buffered writes simply further decouples the write instruction from the signaling of the fault.
0 = Disable buffered writes
1 = Enable buffered writes
DWPDefault Write Protection
CLNF[1:0]The Cache Line Fill bits control the size of the memory request the cache issues to the bus controller for
MOTOROLAInstruction Cache5-7
0 = Read and write accesses permitted
1 = Only read accesses permitted
different initial line access offsets. The following table shows the fetch size.
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Instruction Cache Programming Model
Table 5-6 External Fetch Size Based on Miss Address and CLNF
CLNF[1:0]
00LineLineLineLongword
01LineLineLongwordLongword
10LineLineLineLine
11LineLineLineLine
LONGWORD ADDRESS BITS
00011011
5.4.2.2ACCESS CONTROL REGISTERS
The access control registers ACR0 and ACR1, provide a definition of memory reference attributes for two
memory regions (one per ACR). This set of effective attributes is defined for every memory reference using
nc...
I
the ACRs or the set of default attributes contained in the CACR. The ACRs are examined for every
memory reference that is NOT mapped to the SRAM module.
cale Semiconductor,
Frees
The ACRs are 32-bit write-only supervisor control registers. They are accessed in the CPU address space
using the MOVEC instruction with an Rc encoding of $004 and $005. The ACRs can be read when in
background debug mode (BDM). At system reset, the registers are cleared.
Table 5-7 Access Control Registers (ACRo, ACR1)
BITS31302928272625242322212019181716
FIELD
RESET
R/W
BITS
FIELD
RESET
R/W
BA31 BA30 BA29 BA28 BA27 BA26 BA25 BA24
000 0 0000 0 0 0 0 0 0 0 0
R/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/W
1514131211109876543210
ENSM1 SM0CMBWEWP
000 0 0000 0 0 0 0 0 0 0 0
R/WR/WR/WR/WR/WR/W
BAM31BAM3
0
BAM29
BAM28BAM27BAM26BAM25BAM2
4
5-8MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Table 5-8 Access Control Bit Descriptions
BIT NAMEDESCRIPTION
AB[31:24]The Address Base [31:24] 8-bit field is compared to address bits [31:24] from the
processor's local bus under control of the ACR address mask. If the address
matches, the attributes for the memory reference are sourced from the given ACR.
AM[31:24]The Address Mask [31:24] 8-bit field can mask any bit of the AB field comparison. If
a bit in the AM field is set, then the corresponding bit of the address field
comparison is ignored.
ENThe Enable bit defines the ACR enable. Hardware reset clears this bit, disabling the
ACR.
0 = ACR disabled
1 = ACR enabled
Instruction Cache Programming Model
nc...
I
cale Semiconductor,
Frees
SM[1:0]The Supervisor mode two-bit field allows the given ACR to be applied to references
based on operating privilege mode of the ColdFire processor. The field uses the
ACR for user references only, supervisor references only, or all accesses.
00 = Match if user mode
01 = Match if supervisor mode
1x = Match always - ignore user/supervisor mode
CMThe Cache Mode bit defines the cache mode: 0 is cacheable, 1 is noncacheable.
0 = Caching enabled
1 = Caching disabled
BWEThe Buffered Write Enable bit defines the value for enabling buffered writes. If BWE
= 0, the termination of an operand write cycle on the processor's local bus is
delayed until the external bus cycle is completed. If BWE = 1, the write cycle on the
local bus is terminated immediately and the operation is then buffered in the bus
controller. In this mode, operand write cycles are effectively decoupled between the
processor's local bus and the external bus.
Generally, the enabling of buffered writes provides higher system performance but
recovery from access errors may be more difficult. For the ColdFire CPU, the
reporting of access errors on operand writes is always imprecise, and enabling
buffered writes simply decouples the write instruction from the signaling of the fault
even more.
0 = Don’t buffer writes
1 = Buffer writes
WPThe Write Protect bit defines the write-protection attribute. If the effective memory
attributes for a given access select the WP bit, an access error terminates any
attempted write with this bit set.
0 = Read and write accesses permitted
1 = Only read accesses permitted
MOTOROLAInstruction Cache5-9
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
nc...
I
NOTES
cale Semiconductor,
Frees
5-10MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 6
Static RAM (SRAM)
6.1SRAM FEATURES
• One 64 KByte and one 32 KByte SRAMS
• Single-cycle access
• Physically located on processor's high-speed local bus
• Memory location programmable on any 32 KByte address
• Byte, word, longword address capabilities
6.2SRAM OPERATION
nc...
I
cale Semiconductor,
Frees
The SRAM module provides a general-purpose memory block that the ColdFire processor can access in a
single cycle. The location of the memory block can be specified to any modulo-16K address within the
4-GByte address space. The memory is ideal for storing critical code or data structures or for use as the
system stack. Because the SRAM module is physically connected to the processor's high-speed local bus,
it can service processor-initiated access or memory-referencing commands from the debug module.
Depending on configuration information, instruction fetches may be sent to both the cache and the SRAM
block simultaneously. If the reference is mapped into the region defined by the SRAM, the SRAM provides
the data back to the processor, and the cache data discarded. Accesses from the SRAM module are not
cached.
The first SRAM, SRAM0 (32 KBytes) cannot be accessed by the on-chip DMAs of the MCF5249. The
second SRAM, SRAM1 (64 Kbytes), can be accessed by the on-chip DMAs. SRAM0 is made up of one
memory array consisting of 2048 lines, each containing 16 Bytes. However, SRAM1 is made up of two
memory arrays each consisting of 2048 lines, with 16 Bytes in each line. The SRAM1 array is split (Upper
32K bank and Lower 32K bank) to allow simultaneous access to both arrays by both the DMA and the
CPU. Figure 1-1, the MCF5249 block diagram, shows this concept.
6.3SRAM PROGRAMMING MODEL
The SRAM programming model includes a description of the SRAM base address register (RAMBAR),
SRAM initialization, and power management.
6.3.1SRAM BASE ADDRESS REGISTER
The configuration information in the SRAM Base Address Register (RAMBAR[0:1]) controls the operation
of the SRAM module.
• There are 2 RAMBAR registers. One for SRAM0, the second for SRAM1.
• The RAMBAR is the register that holds the base address of the SRAM. The MOVEC instruction
provides write-only access to this register.
• The RAMBAR registers can be read or written from the Debug module in a similar manner.
• All undefined bits in the register are reserved. These bits are ignored during writes to the RAMBAR,
and return zeroes when read from the debug module.
• The RAMBAR valid bit is cleared by reset, disabling the SRAM module. All other bits are unaffected.
MOTOROLAStatic RAM (SRAM)6-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
SRAM Programming Model
The RAMBAR register contains several control fields. These fields are detailed in the following tables.
BA[31:14]The Base Address field defines the 0-modulo-16K base address of the SRAM module. The
SRAM memory occupies a 16KByte space defined by the contents of the Base Address field.
By programming this field, the SRAM may be located on any 16KByte boundary within the
processor’s four gigabyte address space.
PRI1, PRI2The PRI1 priority bit (only SRAM1) determines if DMA or CPU has priority in upper 32k bank
of memory. PRI2 determines if DMA or CPU has priority in lower 32k bank of memory. If bit is
set, DMA has priority. If bit is reset, CPU has priority. Priority is determined by the following
table:
nc...
I
cale Semiconductor,
Frees
PRI[1:2]
2’b00CPU AccessesCPU Accesses
2’b01CPU AccessesDMA Accesses
2’b10DMA AccessesCPU Accesses
2’b11DMA AccessesDMA Accesses
SPVAllow DMA access (only SRAM1)
0 = DMA access to memory is disabled.
1 = DMA access to memory is enabled.
WPThe Write Protect field allows only read accesses to the SRAM. When this bit is set, any
attempted write access will generate an access error exception to the ColdFire processor
core.
0 = Allows read and write accesses to the SRAM module
1 = Allows only read accesses to the SRAM module
C/I, SC, SD,
UC, UD
Address Space Masks (ASn)
These five bit fields allow certain types of accesses to be “masked,” or inhibited from
accessing the SRAM module. The address space mask bits are:
C/I = CPU space/interrupt acknowledge cycle mask
SC = Supervisor code address space mask
SD = Supervisor data address space mask
UC = User code address space mask
UD = User data address space mask
UPPER BANK
PRIORITY
LOWER BANK
PRIORITY
For each address space bit:
0 = An access to the SRAM module can occur for this address space
1 = Disable this address space from the SRAM module. If a reference using this address
space is made, it is inhibited from accessing the SRAM module, and is processed like any
other non-SRAM reference.
These bits are useful for power management as detailed in Section 6.3.4.
VThe valid bit (V-bit) is specified by RAMBAR[0:1]. A hardware reset clears this bit. When set,
this bit enables the SRAM module; otherwise, the module is disabled.
0 = Contents of RAMBAR are not valid
1 = Contents of RAMBAR are valid
MOTOROLAStatic RAM (SRAM)6-3
For More Information On This Product,
Go to: www.freescale.com
SRAM Programming Model
Freescale Semiconductor, Inc.
6.3.2SRAM INITIALIZATION
After a hardware reset, the contents of the SRAM module are undefined. The valid bit of the RAMBAR is
cleared, disabling the module. If the SRAM requires initialization with instructions or data, the following
steps should be performed:
1. Load the RAMBAR mapping the SRAM module to the desired location within the address space.
2. Read the source data and write it to the SRAM. There are various instructions to support this
function, including memory-to-memory move instructions, or the MOVEM opcode. The MOVEM
instruction is optimized to generate line-sized burst
fetches on 0-modulo-16 addresses, so this opcode generally provides maximum performance.
3. After the data has been loaded into the SRAM, it may be appropriate to load a revised value into
the RAMBAR with a new set of attributes. These attributes consist of the write-protect and address
space mask fields.
The ColdFire processor or an external emulator using the debug module can perform these initialization
functions.
nc...
I
cale Semiconductor,
Frees
6.3.3SRAM INITIALIZATION CODE
The following code segment describes how to initialize the SRAM. The code sets the base address of the
SRAM at $20000000 and then initializes the RAM to zeros.
RAMBASE EQU $20000000 set this variable to $20000000
RAMVALID EQU $00000000
move.l #RAMBASE+RAMVALID,D0;load RAMBASE + valid bit into D0.
movec.l D0, RAMBAR;load RAMBAR and enable SRAM
The following loop initializes the entire SRAM to zero
lea.l RAMBASE,A0;load pointer to SRAM
move.l #1024,D0;load loop counter into D0
SRAM_INIT_LOOP:
clr.l (A0)+) clear 4 bytes of SRAM
subq.l #1,D0;decrement loop counter
bne.b SRAM_INIT_LOOP;if done, then exit; else continue looping
6.3.4POWER MANAGEMENT
As noted previously, depending on the configuration defined by the RAMBAR, instruction fetch and operand
read accesses may be sent to the SRAM and unified cache simultaneously. If the access is mapped to the
SRAM module, it sources the read data, and the unified cache access is discarded. If the SRAM is used only
for data operands, asserting the ASn bits associated with instruction fetches can decrease power dissipation.
Additionally, if the SRAM contains only instructions, masking operand accesses can reduce power
dissipation. The following table shows some examples of typical RAMBAR settings.
.
Table 6-4 Typical RAMBAR Setting Examples
DATA CONTAINED IN SRAMRAMBAR[7:0]
Code Only$2B
Data Only$35
Both Code And Data$21
6-4MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Section 7
Synchronous DRAM Controller Module
7.1DRAM FEATURES
The key features of the DRAM controller include the following:
• Support for two independent blocks of DRAM
• Interface to standard synchronous dynamic random access memory (SDRAM) components
• Programmable SDRAS
• Support for page mode
• Support for 16- wide DRAM blocks
, SDCAS, and refresh timing
nc...
I
cale Semiconductor,
Frees
7.1.1DEFINITIONS
The following terminology is used in this section:
• SDRAM block—Any group of DRAM memories selected by one of the MCF5249 SDRAM_CS1
SDRAM_CS2
address of each block is programmed in the DRAM address and control registers (DACR0 and
DACR1).
• SDRAM—RAMs that operate like asynchronous DRAMs but with a synchronous clock, a pipelined,
multiple-bank architecture, and faster speed.
• SDRAM bank—An internal partition in an SDRAM device. For example, a 64-Mbit SDRAM
component might be configured as four 512K x 32 banks. Banks are selected through the SDRAM
component’s bank select lines.
Note:The SDRAM_CS2 signal is only used in the 160 MAPBGA package.
signals. Thus, the MCF5249 can support two independent memory blocks. The base
7.1.2BLOCK DIAGRAM AND MAJOR COMPONENTS
The basic components of the DRAM controller are shown in Figure 7-1.
,
MOTOROLASynchronous DRAM Controller Module7-1
For More Information On This Product,
Go to: www.freescale.com
DRAM Controller Operation
Freescale Semiconductor, Inc.
DRAM Controller Module
nc...
I
cale Semiconductor,
Frees
A[31:0]
Internal
Bus
Page Hit
Logic
Memory Block 0 Hit Logic
DRAM Address/Control Register 0
(DACR0)
Memory Block 1 Hit Logic
DRAM Address/Control Register 1
(DACR1)
Figure 7-1 Synchronous DRAM Controller Block Diagram
The DRAM controller’s major components, shown in Figure 7-1, are described as follows:
• DRAM address and control registers (DACR0 and DACR1)—The DRAM controller consists of two
configuration register units, one for each supported memory block. DACR0 is accessed at MBAR +
0x0108; DACR1 is accessed at 0x0110. The register information is passed on to the hit logic.
• Control logic and state machine—Generates all DRAM signals, taking bus cycle characteristic data
from the block logic, along with hit information to generate DRAM accesses. Handles refresh
requests from the refresh counter.
—DRAM control register (DCR)—Contains data to control refresh operation of the DRAM
controller. Both memory blocks are refreshed concurrently as controlled by DCR[RC].
—Refresh counter—Determines when refresh should occur, determined by the value of
DCR[RC]. It generates a refresh request to the control block.
• Hit logic—Compares address and attribute signals of a current DRAM bus cycle to both DACRs to
determine if a DRAM block is being accessed. Hits are passed to the control logic along with
characteristics of the bus cycle to be generated.
• Page hit logic—Determines if the next DRAM access is in the same DRAM page as the previous one.
This information is passed on to the control logic.
• Address multiplexing—Multiplexes addresses to allow column and row addresses to share pins. This
allows glueless interface to DRAMs.
By running synchronously with the system clock, SDRAM can (after an initial latency period) be accessed
on every clock; 5-1-1-1 is a typical MCF5249 burst rate to SDRAM.
Note:Because the MCF5249 cannot have more than one page open at a time, it does not
support interleaving.
cale Semiconductor,
Frees
Table 7-2 lists common SDRAM commands.
Table 7-2 SDRAM Commands
COMMANDDEFINITION
ACTVActivate. Executed before
row address.
MRSMode register set.
NOPNo-op. Does not affect SDRAM state machine; DRAM controller control signals
negated; SDRAM_CS
PALLPrecharge all. Precharges all internal banks of an SDRAM component; executed
before new page is opened.
READRead access. SDRAM registers column address and decodes that a read access is
occurring.
REFRefresh. Refreshes internal bank rows of an SDRAM component.
SELFSelf refresh. Refreshes internal bank rows of an SDRAM component when it is in
low-power mode.
SELFXExit self refresh. This command is sent to the DRAM controller when DCR[IS] is
cleared.
WRITEWrite access. SDRAM registers column address and decodes that a write access is
occurring.
READ or WRITE executes; SDRAM registers and decodes
asserted.
Commands are issued to memory using specific encoding on address and control pins. Soon after system
reset, a command must be sent to the SDRAM mode register to configure SDRAM operating parameters.
MOTOROLASynchronous DRAM Controller Module7-3
For More Information On This Product,
Go to: www.freescale.com
Synchronous Operation
Note:After synchronous operation is selected by setting DCR[SO], DRAM controller
registers reflect the synchronous operation.
Freescale Semiconductor, Inc.
7.3.1DRAM CONTROLLER SIGNALS IN SYNCHRONOUS MODE
Table 7-3 shows the behavior of DRAM signals in synchronous mode.
Table 7-3 Synchronous DRAM Signal Connections
SignalDescription
SDRAS Synchronous row address strobe. Indicates a valid SDRAM row address is present
and can be latched by the SDRAM. SDRAS
SDRAM SRAS
.
should be connected to the corresponding
SDCAS
nc...
I
SDWE
SDRAM_CS1
SDRAM_CS2
BCLKE Synchronous DRAM clock enable. Connected directly to the CKE (clock enable) signal
UDQM
LDQM
BCLKBus clock output. Connects to the CLK input of SDRAMs.
cale Semiconductor,
Synchronous column address strobe. Indicates a valid column address is present and
can be latched by the SDRAM. SDCAS
signal labeled SCAS
DRAM read/write. Asserted for write operations and negated for read operations.
Select each memory block of SDRAMs connected to the MCF5249. One signal selects
one SDRAM block and connects to the corresponding CS
of SDRAMs. Enables and disables the clock internal to SDRAM. When BCLKE is low,
memory can enter a power-down mode where operations are suspended or they can
enter self-refresh mode. BCLKE functionality is controlled by DCR[COC]. For designs
using external multiplexing, setting COC allows BCLKE to provide command-bit
functionality.
Column address strobe. For synchronous operation, UDQM, LDQM function as byte
enables to the SDRAMs. They connect to the DQM signals (or mask qualifiers) of the
SDRAMs.
Note:The SDRAM_CS2 is only used in the 160 MAPBGA package.
on the SDRAM.
should be connected to the corresponding
signals.
Frees
7-4MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Figure 7-2 shows a typical signal configuration for synchronous mode.
Synchronous Operation
MCF5249
SDRAM_CS1
A[31:0]
D[31:0]
DQM
SDWE
SDCAS
SDRAS
BCLKE
BCLK
nc...
I
Figure 7-2 MCF5249 SDRAM Interface
CS
ADDRESS
DATA
DQM
WE
CAS
RAS
CKE
CLK
SDRAM
7.3.2SYNCHRONOUS REGISTER SET
The memory map is shown in Table 7-1. Bit descriptions are shown in the following sections.
7.3.2.1DRAM CONTROL REGISTER (DCR) (SYNCHRONOUS MODE)
The DRAM control register (DCR), Figure 7-3, controls refresh logic.
1514131211109876543210
FieldSO—NAM COCISRTIMRC
Reset0Uninitialized
R/WR/W
AddrMBAR + 0x100
cale Semiconductor,
Table 7-4 describes DCR fields.
Figure 7-3 DRAM Control Register (DCR) (Synchronous Mode)
Frees
MOTOROLASynchronous DRAM Controller Module7-5
For More Information On This Product,
Go to: www.freescale.com
Synchronous Operation
Freescale Semiconductor, Inc.
Table 7-4 DCR Field Descriptions (Synchronous Mode)
BITSNAMEDESCRIPTION
15SOSynchronous operation. Selects synchronous or asynchronous mode. When in synchronous
mode, the DRAM controller can be switched to ADRAM mode only by resetting the MCF5249.
0Asynchronous DRAMs. Default at reset. Do not use.
1Synchronous DRAMs
Note: bit setting SO=0 is a legacy mode. Do not use. First action must always be to set this bit
one.
14—Reserved, should be cleared.
13NAMNo address multiplexing. Some implementations require external multiplexing. For example,
when linear addressing is required, the DRAM should not multiplex addresses on DRAM
accesses.
0The DRAM controller multiplexes the external address bus to provide column addresses.
1The DRAM controller does not multiplex the external address bus to provide column
addresses.
nc...
I
cale Semiconductor,
Frees
12COCCommand on SDRAM clock enable (SCKE). Implementations that use external multiplexing
(NAM = 1) must support command information to be multiplexed onto the SDRAM address bus.
0SCKE functions as a clock enable; self-refresh is initiated by the DRAM controller through
DCR[IS].
1SCKE drives command information. Because SCKE is not a clock enable, self-refresh
cannot be used (setting DCR[IS]). Thus, external logic must be used if this functionality is
desired. External multiplexing is also responsible for putting the command information on the
proper address bit.
11ISInitiate self-refresh command.
0Take no action or issue a
1If DCR[COC] = 0, the DRAM controller sends a
them in low-power, self-refresh state where they remain until IS is cleared, at which point the
controller sends a SELFX command for the SDRAMs to exit self-refresh. The refresh counter
is suspended while the SDRAMs are in self-refresh; the SDRAM controls the refresh period.
10–9RTIMRefresh timing. Determines the timing operation of auto-refresh in the DRAM controller.
Specifically, it determines the number of clocks inserted between a
possible
DRAM controller. This corresponds to t
00 3 clocks
01 6 clocks
1x 9 clocks
8–0RCRefresh count. Controls refresh frequency. The number of bus clocks between refresh cycles is
(RC + 1) * 16. Refresh can range from 16–8192 bus clocks to accommodate both standard and
low-power DRAMs with bus clock operation from less than 2 MHz to greater than 50 MHz.
The following example calculates RC for an auto-refresh period for 4096 rows to receive 64 mS of
refresh every 15.625 µs for each row (625 bus clocks at 40 MHz).
# of bus clocks = 625 = (RC field + 1) * 16
RC = (625 bus clocks/16) -1 = 38.06, which rounds to 38; therefore, RC = 0x26.
ACTV command. This same timing is used for both memory blocks controlled by the
SELFX command to exit self refresh.
SELF command to both SDRAM blocks to put
in the SDRAM specifications.
RC
REF command and the next
7-6MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Synchronous Operation
7.3.2.2DRAM ADDRESS AND CONTROL (DACR0/DACR1) (SYNCHRONOUS
MODE)
The DRAM address and control registers (DACR0 and DACR1), shown in Figure 7-4, contain the base
address compare value and the control bits for both memory blocks 0 and 1 of the DRAM controller.
Address and timing are also controlled by bits in DACRn.
3118 17 161514 13 12 11 10 9 8765 432 1 0
FieldBA—RE — CASL—CBM—IMRSPSIP PM —
ResetUninitialized0Uninitialized0Uninitialized
R/WR/W
AddrMBAR+0x108 (DACR0); 0x110(DACR1)
Figure 7-4 DACR0 and DACR1 (Synchronous Mode)
nc...
I
Table 7-5 describes DACRn fields.
cale Semiconductor,
Frees
Table 7-5 DACR0/DACR1 Field Descriptions (Synchronous Mode)
BITNAMEDESCRIPTION
31–18BABase address register. With DCMR[BAM], determines the address range in which the
associated DRAM block is located. Each BA bit is compared with the corresponding
address of the current bus cycle. If all unmasked bits match, the address hits in the
associated DRAM block.
17–16—Reserved, should be cleared.
15RERefresh enable. Determines when the DRAM controller generates a refresh cycle to
the DRAM block.
0Do not refresh associated DRAM block
1Refresh associated DRAM block
14—Reserved, should be cleared.
13–12CASLCAS
latency. Affects the following SDRAM timing specifications. Timing nomenclature
varies with manufacturers. Refer to the SDRAM specification for the appropriate timing
nomenclature:
NUMBER OF BUS CLOCKS
PARAMETER
t
—SRAS assertion to SCAS assertion233
RCD
—SCAS assertion to data out122
t
CASL
—ACTV command to precharge command466
t
RAS
—Precharge command to ACTV command233
t
RP
—Last data input to precharge command111
t
RWL,tRDL
—Last data out to precharge command)111
t
EP
CASL= 00CASL = 01CASL= 10CASL=
11
11—Reserved, should be cleared.
MOTOROLASynchronous DRAM Controller Module7-7
For More Information On This Product,
Go to: www.freescale.com
Synchronous Operation
Freescale Semiconductor, Inc.
Table 7-5 DACR0/DACR1 Field Descriptions (Synchronous Mode) (Continued)
BITNAMEDESCRIPTION
10–8CBMCommand and bank MUX [2:0]. Because different SDRAM configurations cause the
command and bank select lines to correspond to different addresses, these resources
are programmable. CBM determines the addresses onto which these functions are
multiplexed.
CBMCommand Bit Bank Select Bits
000 17 18 and up
001 18 19 and up
010 19 20 and up
011 20 21 and up
100 21 22 and up
101 22 23 and up
110 23 24 and up
111 24 25 and up
This encoding and the address multiplexing scheme handle common SDRAM
organizations. Bank select bits include a base bit and all address bits above for
nc...
I
7—Reserved, should be cleared.
SDRAMs with multiple bank select bits.
cale Semiconductor,
Frees
6IMRSInitiate mode register set (
the associated SDRAMs. In initialization, IMRS should be set only after all DRAM
controller registers are initialized and PALL and REFRESH commands have been issued.
After IMRS is set, the next access to an SDRAM block programs the SDRAM’s mode
register. Thus, the address of the access should be programmed to place the correct
mode information on the SDRAM address pins. Because the SDRAM does not register
this information, it doesn’t matter if the IMRS access is a read or a write or what, if any,
data is put onto the data bus. The DRAM controller clears IMRS after the
command finishes.
0Take no action
1Initiate
5–4PSPort size. Indicates the port size of the associated block of SDRAM, which allows for
dynamic sizing of associated SDRAM accesses.
1x 16-bit port
0x Do not use
01 8-bit port
3IPInitiate precharge all (
command is finished. Accesses using IP should be no wider than the port size
programmed in PS.
0Take no action.
1A PALL command is sent to the associated SDRAM block. During initialization, this
2PMPage mode. Indicates how the associated SDRAM block supports page-mode
operation.
0Page mode on bursts only. The DRAM controller dynamically bursts the transfer if
1Continuous page mode. The page stays open and only SDCAS
1–0—Reserved, should be cleared.
MRS command
command is executed after all DRAM controller registers are programmed. After
IP is set, the next write to an appropriate SDRAM address generates the
command to the SDRAM block.
it falls within a single page and the transfer size exceeds the port size of the
SDRAM block. After the burst, the page closes and a precharge is issued.
asserted for sequential SDRAM accesses that hit in the same page, regardless of
whether the access is a burst.
MRS) command. Setting IMRS generates a MRS command to
MRS
PALL) command. The DRAM controller clears IP after the PALL
PALL
needs to be
7-8MCF5249UMMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
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.