Manufacturing Part Number: D412008-9761 revision A
Literature Number: SPRU127B
January 1997
Printed on Recycled Paper
IMPORTANT NOTICE
T exas Instruments (TI) reserves the right to make changes to its products or to discontinue any
semiconductor product or service without notice, and advises its customers to obtain the latest
version of relevant information to verify , before placing orders, that the information being relied
on is current.
TI warrants performance of its semiconductor products and related software to the specifications
applicable at the time of sale in accordance with TI’s standard warranty . T esting and other quality
control techniques are utilized to the extent TI deems necessary to support this warranty.
Specific testing of all parameters of each device is not necessarily performed, except those
mandated by government requirements.
Certain applications using semiconductor products may involve potential risks of death,
personal injury , or severe property or environmental damage (“Critical Applications”).
TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR
WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES
OR SYSTEMS OR OTHER CRITICAL APPLICATIONS.
Inclusion of TI products in such applications is understood to be fully at the risk of the customer.
Use of TI products in such applications requires the written approval of an appropriate TI officer .
Questions concerning potential risk applications should be directed to TI through a local SC
sales office.
In order to minimize risks associated with the customer’s applications, adequate design and
operating safeguards should be provided by the customer to minimize inherent or procedural
hazards.
TI assumes no liability for applications assistance, customer product design, software
performance, or infringement of patents or services described herein. Nor does TI warrant or
represent that any license, either express or implied, is granted under any patent right, copyright,
mask work right, or other intellectual property right of TI covering or relating to any combination,
machine, or process in which such semiconductor products or services might be or are used.
Copyright 1996, Texas Instruments Incorporated
About This Manual
How to Use This Manual
Preface
Read This First
This user’s guide describes the architecture, hardware, assembly language
instructions, and general operation of the TMS320C2xx digital signal
processors (DSPs). This manual can also be used as a reference guide for
developing hardware and/or software applications. In this document, ’C2xx
refers to any of the TMS320C2xx devices, except where device-specific
information is explicitly stated. When device-specific information is given, the
device name may be abbreviated; for example, TMS320C203 will be
abbreviated as ’C203.
How to Use This Manual
Chapter 1,
introduces the key features of the TMS320C2xx generation of that family.
Chapter 2,
providing information about the CPU, bus structure, memory, on-chip
peripherals, and scanning logic.
If you are reading this manual to learn about the ’C209, Chapter 1 1 is important
for you. There are some notable differences between the ’C209 and other
’C2xx devices, and Chapter 1 1 explains these differences. In addition, it shows
how to use this manual to get a complete picture of the ’C209.
The following table points you to major topics.
Introduction
Architectural Overview
, summarizes the TMS320 family of products and then
, summarizes the ’C2xx architecture,
iii
How to Use This Manual
For this information:Look here:
Addressing modes (for addressing data
memory)
Assembly language instructionsChapter 7,
Chapter 6,
Instructions
Assembly language instructions of
TMS320C1x, ’C2x, ’C2xx, and ’C5x
compared
Boot loaderChapter 4,
Clock generatorChapter 8,
CPUChapter 3,
Custom ROM from TIAppendix D,
Appendix B,
TMS320C1x/C2x/C2xx/C5x
Instruction Set Comparison
to TI
EmulatorAppendix E,
Using XDS510 Emulator
FeaturesChapter 1,
Chapter 2,
Input/output portsChapter 4,
InterruptsChapter 5,
Memory configurationChapter 4,
Memory interfacingChapter 4,
On-chip peripheralsChapter 8,
PipelineChapter 5,
Program controlChapter 5,
Program examplesAppendix C,
Program-memory address generationChapter 5,
Registers summarizedAppendix A,
Serial portsChapter 9,
Chapter 10,
StackChapter 5,
Status registersChapter 5,
TimerChapter 8,
TMS320C209 differences and
similarities
Wait-state generatorChapter 8,
Chapter 1 1,
Addressing Modes
Assembly Language
Memory and I/O Spaces
On-Chip Peripherals
Central Processing Unit
Submitting ROM Codes
Design Considerations for
Introduction
Architectural Overview
Memory and I/O Spaces
Program Control
Memory and I/O Spaces
Memory and I/O Spaces
On-Chip Peripherals
Program Control
Program Control
Program Examples
Program Control
Register Summary
Synchronous Serial Port
Asynchronous Serial Port
Program Control
Program Control
On-Chip Peripherals
TMS320C209
On-Chip Peripherals
iv
Notational Conventions
This document uses the following conventions:
-
-
Notational Conventions/Information About Cautions
Program listings and program examples are shown in a specialtypeface.
Here is a segment of a program listing:
OUTPUT LDP#6;select data page 6
BLDD#300, 20h;move data at address 300h to 320h
RET
In syntax descriptions, bold portions of a syntax should be entered as
shown;
italic
portions of a syntax identify information that you specify . Here
is an example of an instruction syntax:
BLDD
BLDD is the instruction mnemonic, which must be typed as shown. You
specify the two parameters,
-
Square brackets ( [ and ] ) identify an optional parameter. If you use an
optional parameter, you specify the information within the brackets; you
do not type the brackets themselves. Y ou separate each optional operand
from required operands with a comma and a space. Here is a sample
syntax:
BLDD
BLDD is the instruction. The two required operands are
destination
you choose to use AR
a chosen value for
BLDD *, #310h, AR3
Information About Cautions
This book contains cautions.
This is an example of a caution statement.
A caution statement describes a situation that could potentially
damage your software or equipment.
source, destination
source
and
source, destination
destination
[, ARn]
.
source
, and the optional operand is ARn. AR is bold and n is italic; if
n
, you must type the letters A and R and then supply
n
(in this case, a value from 0 to 7). Here is an example:
and
The information in a caution is provided for your protection. Please read each
caution carefully.
Read This First
v
Related Documentation From Texas Instruments
Related Documentation From Texas Instruments
This subsection describes related TI documents that can be ordered by
calling the T exas Instruments Literature Response Center at (800) 477–8924.
When ordering, please identify the document by its title and literature number.
The following data sheets contain the electrical and timing specifications for
the TMS320C2xx devices, as well as signal descriptions and pinouts for all of
the available packages:
-
TMS320C2xx data sheet (literature number SPRS025)
-
TMS320F2xx data sheet (literature number SPRS050). This data sheet
covers the TMS320C2xx devices that have on-chip flash memory.
The books listed below provide additional information about using the
TMS320C2xx devices and related support tools, as well as more general
information about using the TMS320 family of DSPs.
TMS320C1x/C2x/C2xx/C5x Code Generation Tools Getting Started
Guide
TMS320C1x, TMS320C2x, TMS320C2xx, and TMS320C5x assembly
language tools and the C compiler for the ’C1x, ’C2x, ’C2xx, and ’C5x
devices. The installation for MS-DOS, OS/2, SunOS, and Solaris
systems is covered.
TMS320C1x/C2x/C2xx/C5x Assembly Language Tools User’s Guide
(literature number SPRU018) describes the assembly language tools
(assembler, linker, and other tools used to develop assembly language
code), assembler directives, macros, common object file format, and
symbolic debugging directives for the ’C1x, ’C2x, ’C2xx, and ’C5x
generations of devices.
TMS320C2x/C2xx/C5x Optimizing C Compiler User’s Guide
number SPRU024) describes the ’C2x/C2xx/C5x C compiler. This C
compiler accepts ANSI standard C source code and produces TMS320
assembly language source code for the ’C2x, ’C2xx, and ’C5x
generations of devices.
(literature number SPRU121) describes how to install the
(literature
TMS320C2xx C Source Debugger User’s Guide
(literature number
SPRU151) tells you how to invoke the ’C2xx emulator and simulator
versions of the C source debugger interface. This book discusses
various aspects of the debugger interface, including window
management, command entry , code execution, data management, and
breakpoints. It also includes a tutorial that introduces basic debugger
functionality.
vi
Related Documentation From Texas Instruments
TMS320C2xx Simulator Getting Started
(literature number SPRU137)
describes how to install the TMS320C2xx simulator and the C source
debugger for the ’C2xx. The installation for MS-DOS, PC-DOS,
SunOS, Solaris, and HP-UX systems is covered.
TMS320C2xx Emulator Getting Started Guide
(literature number
SPRU209) tells you how to install the Windows 3.1 and Windows 95
versions of the ’C2xx emulator and C source debugger interface.
XDS51x Emulator Installation Guide
(literature number SPNU070)
describes the installation of the XDS510, XDS510PP, and
XDS510WS emulator controllers. The installation of the XDS511
emulator is also described.
JT AG/MPSD Emulation Technical Reference
(literature number SPDU079)
provides the design requirements of the XDS510 emulator controller.
Discusses JTAG designs (based on the IEEE 1149.1 standard) and
modular port scan device (MPSD) designs.
TMS320 DSP Development Support Reference Guide
(literature number
SPRU011) describes the TMS320 family of digital signal processors and
the tools that support these devices. Included are code-generation tools
(compilers, assemblers, linkers, etc.) and system integration and debug
tools (simulators, emulators, evaluation modules, etc.). Also covered are
available documentation, seminars, the university program, and factory
repair and exchange.
Digital Signal Processing Applications with the TMS320 Family,
Volumes 1, 2, and 3
(literature numbers SPRA012, SPRA016,
SPRA017) Volumes 1 and 2 cover applications using the ’C10 and ’C20
families of fixed-point processors. Volume 3 documents applications
using both fixed-point processors as well as the ’C30 floating-point
processor.
TMS320 DSP Designer’s Notebook: Volume 1
.
SPRT125)
’C3x, ’C4x, ’C5x, and other TI DSPs
Presents solutions to common design problems using ’C2x,
.
TMS320 Third-Party Support Reference Guide
(literature number
(literature number
SPRU052) alphabetically lists over 100 third parties that provide various
products that serve the family of ’320 digital signal processors. A myriad
of products and applications are offered—software and hardware
development tools, speech recognition, image processing, noise
cancellation, modems, etc.
Read This First
vii
Related Articles
Related Articles
“A Greener World Through DSP Controllers”, Panos Papamichalis,
Multimedia Technology
“A Single-Chip Multiprocessor DSP for Image Processing—TMS320C80”,
Dr. Ing. Dung Tu,
“Application Guide with DSP Leading-Edge Technology”, Y. Nishikori, M.
Hattori, T. Fukuhara, R.Tanaka, M. Shimoda, I. Kudo, A.Yanagitani, H.
Miyaguchi, et al.,
“Approaching the No-Power Barrier”, Jon Bradley and Gene Frantz,
Design
“Beware of BAT: DSPs Add Brilliance to New Weapons Systems”, Panos
Papamichalis,
“Choose DSPs for PC Signal Processing”, Panos Papamichalis,
, January 9, 1995.
DSP & Multimedia Technology
Multimedia Technology
“Developing Nations Take Shine to Wireless”, Russell MacDonald, Kara
Schmidt and Kim Higden,
“Digital Signal Processing Solutions T arget V ertical Application Markets”, Ron
ECN
Wages,
“Digital Signal Processors Boost Drive Performance”, Tim Adcock,
Storage
, September 1995.
, September/October 1995.
, September 1994.
Industrie Elektronik
, Germany, March 1995.
Electronics Engineering
, January/February 1995.
EE Times
, October 2, 1995.
, November 1995.
, October 1994.
DSP &
Electronic
DSP &
Data
viii
“DSP and Speech Recognition, An Origin of the Species”, Panos
Papamichalis,
“DSP Design Takes Top-Down Approach”, Andy Fritsch and Kim Asal,
“DSPs Do Best on Multimedia Applications”, Doug Rasor,
World
, October 9–16, 1995.
“DSPs: Speech Recognition Technology Enablers”, Gene Frantz and Gregg
Bennett,
“Easing JTAG Testing of Parallel-Processor Projects”, Tony Coomes, Andy
Fritsch, and Reid Tatge,
November 1995.
DSP & Multimedia Technology
,
EE Times
, April 17, 1995.
I&CS
, May 1995.
, July 17, 1995.
Asian Electronics Engineer
, July 1994.
DSP
DSP Series Part
Asian Computer
, Manila, Philippines,
Related Articles
“Fixed or Floating? A Pointed Question in DSPs”, Jim Larimer and Daniel
EDN
Chen,
“Function-Focused Chipsets: Up the DSP Integration Core”, Panos
Papamichalis,
, August 3, 1995.
DSP & Multimedia Technology
, March/April 1995.
“GSM: Standard, Strategien und Systemchips”, Edgar Auslander,
Praxis
, Germany, October 6, 1995.
“High T ech Copiers to Improve Images and Reduce Paperwork”, Karl Guttag,
Document Management
“Host-Enabled Multimedia: Brought to You by DSP Solutions”, Panos
Papamichalis,
“Integration Shrinks Digital Cellular Telephone Designs”, Fred Cohen and
Mike McMahan,
“On-Chip Multiprocessing Melds DSPs”, Karl Guttag and Doug Deao,
Series Part III
“Real-Time Control”, Gregg Bennett,
“Speech Recognition”, P.K. Rajasekaran and Mike McMahan,
DSP & Multimedia Technology
Wireless System Design
,
EE Times
Design & Development
“Telecom Future Driven by Reduced Milliwatts per DSP Function”, Panos
Papamichalis,
“The Digital Signal Processor Development Environment”, Greg Peake,
DSP & Multimedia Technology
Embedded System Engineering
, July/August 1995.
, September/October 1995.
, November 1994.
, July 18, 1994.
Appliance Manufacturer
, May 1995.
, May/June 1995.
, United Kingdom, February 1995.
Elektronik
DSP
, May 1995.
Wireless
“The Growing Spectrum of Custom DSPs”, Gene Frantz and Kun Lin,
,
Series Part II
“The Wide World of DSPs, ” Jim Larimer,
“Third-Party Support Drives DSP Development for Uninitiated and Experts
Alike”, Panos Papamichalis,
1994/January 1995.
“Toward an Era of Economical DSPs”, John Cooper,
Times
, Jan. 23, 1995.
EE Times
, April 18, 1994.
DSP & Multimedia Technology
Design News
Read This First
, June 27, 1994.
, December
DSP Series Part I, EE
DSP
ix
Trademarks
Trademarks
TI, 320 Hotline On-line, XDS510, XDS510PP, XDS510WS, and XDS511 are
trademarks of Texas Instruments Incorporated.
HP-UX is a trademark of Hewlett-Packard Company.
Intel is a trademark of Intel Corporation.
MS-DOS and Windows are registered trademarks of Microsoft Corporation.
PAL
is a registered trademark of Advanced Micro Devices, Inc.
OS/2, PC, and PC-DOS are trademarks of International Business Machines
Corporation.
Solaris and SunOS are trademarks of Sun Microsystems, Inc.
x
If Y ou Need Assistance
If You Need Assistance. . .
-
World-Wide Web Sites
TI Onlinehttp://www.ti.com
Semiconductor Product Information Center (PIC)http://www.ti.com/sc/docs/pic/home.htm
DSP Solutionshttp://www.ti.com/dsps
320 Hotline On-line
-
North America, South America, Central America
Product Information Center (PIC)(972) 644-5580
TI Literature Response Center U.S.A.(800) 477-8924
Software Registration/Upgrades(214) 638-0333Fax: (214) 638-7742
U.S.A. Factory Repair/Hardware Upgrades(281) 274-2285
U.S. T echnical T raining Organization(972) 644-5580
DSP Hotline(281) 274-2320Fax: (281) 274-2324Email: dsph@ti.com
DSP Modem BBS(281) 274-2323
DSP Internet BBS via anonymous ftp to ftp://ftp.ti.com/mirrors/tms320bbs
-
Europe, Middle East, Africa
European Product Information Center (EPIC) Hotlines:
Literature Response Center+852 2 956 7288Fax: +852 2 956 2200
Hong Kong DSP Hotline+852 2 956 7268Fax: +852 2 956 1002
Korea DSP Hotline+82 2 551 2804Fax: +82 2 551 2828
Korea DSP Modem BBS+82 2 551 2914
Singapore DSP HotlineFax: +65 390 7179
Taiwan DSP Hotline+886 2 377 1450Fax: +886 2 377 2718
Taiwan DSP Modem BBS+886 2 376 2592
Taiwan DSP Internet BBS via anonymous ftp to ftp://dsp.ee.tit.edu.tw/pub/TI/
-
Japan
Product Information Center+0120-81-0026 (in Japan)Fax: +0120-81-0036 (in Japan)
DSP Hotline+03-3769-8735 or
DSP BBS via Nifty-ServeType “Go TIASP”
-
Documentation
When making suggestions or reporting errors in documentation, please include the following information that is on the title
page: the full title of the book, the publication date, and the literature number.
Describes the TMS320C2xx CPU. Includes information about the central arithmetic logic unit,
the accumulator, the shifters, the multiplier , and the auxiliary register arithmetic unit. Concludes
with a description of the status register bits.
Describes the configuration and use of the TMS320C2xx memory and I/O spaces. Includes
memory/address maps and descriptions of the HOLD (direct memory access) operation and
the on-chip boot loader.
Describes the TMS320C2xx hardware and software features used in controlling program flow,
including program-address generation logic and interrupts. Also describes the reset operation
and power-down mode.
Introduces the TMS320C2xx on-chip peripherals. Describes the clock generator, the
CLKOUT1-pin control register, the timer , the wait-state generator , and the general-purpose I/O
pins.
Describes how the TMS320C209 differs from other TMS320C2xx devices and is a central
resource for all the TMS320C209-specific control registers and configuration information.
Is a concise, central resource for information about the TMS320C2xx on-chip registers.
Includes addresses, reset values, and descriptive illustrations for the registers.
The TMS320C2xx (’C2xx) is one of several fixed-point generations of DSPs
in the TMS320 family. The ’C2xx is source-code compatible with the
TMS320C2x. Much of the code written for the ’C2x can be reassembled to run
on a ’C2xx device. In addition, the ’C2xx generation is upward compatible with
the ’C5x generation of DSPs.
The TMS320 family consists of fixed-point, floating-point, and multiprocessor
digital signal processors (DSPs). TMS320 DSPs have an architecture designed specifically for real-time signal processing. The following characteristics make this family the ideal choice for a wide range of processing applications:
-
Flexible instruction sets
-
High-speed performance
-
Innovative parallel architectures
-
Cost effectiveness
1.1.1History, Development, and Advantages of TMS320 DSPs
In 1982, Texas Instruments introduced the TMS32010, the first fixed-point
DSP in the TMS320 family. Before the end of the year,
magazine awarded the TMS32010 the title “Product of the Year”. Today, the
TMS320 family consists of these generations: ’C1x, ’C2x, ’C2xx, ’C5x, and
’C54x fixed-point DSPs; ’C3x and ’C4x floating-point DSPs; and ’C8x multiprocessor DSPs. See Figure 1–1.
Electronic Products
Devices within a generation of the TMS320 family have the same CPU structure but different on-chip memory and peripheral configurations. Spin-off devices use new combinations of on-chip memory and peripherals to satisfy a
wide range of needs in the worldwide electronics market. By integrating
memory and peripherals onto a single chip, TMS320 devices reduce system
cost and save circuit board space.
1-2
Figure 1–1. TMS320 Family
TMS320 Family
Performance
Introduction
1-3
TMS320 Family
1.1.2Typical Applications for the TMS320 Family
T able 1–1 lists some typical applications for the TMS320 family of DSPs. The
TMS320 DSPs offer adaptable approaches to traditional signal-processing
problems such as filtering and vocoding. They also support complex
applications that often require multiple operations to be performed simultaneously.
Table 1–1. Typical Applications for TMS320 DSPs
AutomotiveConsumerControl
Adaptive ride control
Antiskid brakes
Cellular telephones
Digital radios
Engine control
Global positioning
Navigation
Vibration analysis
Voice commands
General-PurposeGraphics/ImagingIndustrial
Adaptive filtering
Convolution
Correlation
Digital filtering
Fast Fourier transforms
Hilbert transforms
Waveform generation
Windowing
InstrumentationMedicalMilitary
Digital filtering
Function generation
Pattern matching
Phase-locked loops
Seismic processing
Spectrum analysis
Transient analysis
Digital radios/TVs
Educational toys
Music synthesizers
Pagers
Power tools
Radar detectors
Solid-state answering machines
T exas Instruments uses static CMOS integrated-circuit technology to fabricate
the TMS320C2xx DSPs. The architectural design of the ’C2xx is based on that
of the ’C5x. The operational flexibility and speed of the ’C2xx and ’C5x are a
result of an advanced, modified Harvard architecture (which has separate
buses for program and data memory), a multilevel pipeline, on-chip peripherals, on-chip memory , and a highly specialized instruction set. The ’C2xx performs up to 40 MIPS (million instructions per second).
The ’C2xx generation offers the following benefits:
-
Enhanced TMS320 architectural design for increased performance and
versatility
-
Modular architectural design for fast development of additional spin-off
devices
-
Advanced IC processing technology for increased performance
-
Fast and easy performance upgrades for ’C1x and ’C2x source code,
which is upward compatible with ’C2xx source code
TMS320C2xx Generation
-
Enhanced instruction set for faster algorithms and for optimized high-level
language operation
-
New static design techniques for minimizing power consumption
Table 1–2 provides an overview of the basic features of the ’C2xx DSPs.
50-, 35-, or 25-ns execution time of a single-cycle instruction
J
20, 28.5, or 40 MIPS
-
Code compatibility with other TMS320 fixed-point devices:
J
Source-code compatible with all ’C1x and ’C2x devices
J
Upward compatible with the ’C5x devices
-
Memory:
J
224K words of addressable memory space (64K words of program
space, 64K words of data space, 64K words of I/O space, and 32K
words of global space)
J
544 words of dual-access on-chip RAM (288 words for data and 256
words for program/data)
J
4K words on-chip ROM or 32K words on-chip flash memory (on
selected devices)
J
4K words of single-access on-chip RAM (on selected devices)
-
CPU:
J
32-bit arithmetic logic unit (CALU)
J
32-bit accumulator
J
16-bit × 16-bit parallel multiplier with 32-bit product capability
J
Three scaling shifters
J
Eight 16-bit auxiliary registers with a dedicated arithmetic unit for indirect addressing of data memory
-
Program control:
J
4-level pipeline operation
J
8-level hardware stack
J
User-maskable interrupt lines
1-6
-
Instruction set:
J
Single-instruction repeat operation
J
Single-cycle multiply/accumulate instructions
J
Memory block move instructions for better program/data
management
J
Indexed-addressing capability
J
Bit-reversed indexed-addressing capability for radix-2 FFTs
-
On-chip peripherals:
J
Software-programmable timer
J
Software-programmable wait-state generator for program, data, and
I/O memory spaces
J
Oscillator and phase-locked loop (PLL) to implement clock options:
×1, ×2, ×4, and
J
CLK register for turning the CLKOUT1 pin on and off (not available on
’C209)
Key Features of the TMS320C2xx
÷2 (only ×2 and ÷2 available on ’C209)
J
Synchronous serial port (not available on ’C209)
J
Asynchronous serial port (not available on ’C209)
-
On-chip scanning-logic circuitry (IEEE Standard 1149.1) for emulation
and testing purposes
-
Power:
J
5- or 3.3-V static CMOS technology
J
Power-down mode to reduce power consumption
-
Packages:
J
100-pin TQFP (thin quad flat pack)
J
80-pin TQFP for the ’C209
Introduction
1-7
Chapter 2
Architectural Overview
This chapter provides an overview of the architectural structure and components of the ’C2xx. The ’C2xx DSPs use an advanced, modified Harvard architecture that maximizes processing power by maintaining separate bus structures for program memory and data memory . The three main components of
the ’C2xx are the central processing unit (CPU), memory , and on-chip peripherals.
Figure 2–1 shows an overall block diagram of the ’C2xx.
Note:
All ’C2xx devices use the same central processing unit (CPU), bus structure,
and instruction set, but the ’C209 has some notable differences. For example, although certain peripheral control registers have the same names on
all ’C2xx devices, these registers are located at different I/O addresses on
the ’C209. See Chapter 1 1 for a detailed description of the differences on the
’C209.
Note:The I/O-mapped (peripheral) registers are not part of the core; they are accessed as shown in Figure 2–2 on page 2-4.
2-2
DWAB
DRAB
DRDB
2.1’C2xx Bus Structure
Figure 2–2 shows a block diagram of the ’C2xx bus structure. The ’C2xx internal architecture is built around six 16-bit buses:
-
PAB. The
and writes to program memory.
-
DRAB. The
data memory.
-
DWAB. The
memory .
-
PRDB. The
operands, as well as table information, from program memory to the CPU.
-
DRDB. The
arithmetic logic unit (CALU) and the auxiliary register arithmetic unit
(ARAU).
-
DWEB. The
memory .
program address bus
data-read address bus
data-write address bus
program read bus
data read bus
data write bus
carries data from data memory to the central
carries data to both program memory and data
’C2xx Bus Structure
provides addresses for both reads from
provides addresses for reads from
provides addresses for writes to data
carries instruction code and immediate
Having separate address buses for data reads (DRAB) and data writes
(DWAB) allows the CPU to read and write in the same machine cycle.
Separate program and data spaces allow simultaneous access to program
instructions and data. For example, while data is multiplied, a previous product
can be added to the accumulator, and, at the same time, a new address can
be generated. Such parallelism supports a set of arithmetic, logic, and bit-manipulation operations that can all be performed in a single machine cycle. In
addition, the ’C2xx includes control mechanisms to manage interrupts, repeated operations, and function/subroutine calls.
All ’C2xx devices share the same CPU and bus structure; however, each device has different on-chip memory configurations and on-chip peripherals.
Architectural Overview
2-3
’C2xx Bus Structure
Figure 2–2. Bus Structure Block Diagram
External
address bus
External
data bus
On-chip peripherals/
registers mapped to
I/O space
Timer
Wait-state
generator
Synchronous
serial port
UART
Other I/O-mapped
registers
ROM/
flash
SARAM
PAB
DRAB
DWAB
PRDB
DRDB
DWEB
Central processing unit (CPU)
ARAU
Auxiliary
registers
Status
registers
Input
shifter
CALU
Accumulator
Output
shifter
B0
DARAM
Multiplier
TREG
PREG
Product
shifter
B1, B2
DARAM
Memory
mapped
registers
Control bus
External
signals
Memory
control
MULTI_DSP
CLOCK/PLL
Interrupts
JTAG/TEST
2-4
2.2Central Processing Unit
The CPU is the same on all the ’C2xx devices. The ’C2xx CPU contains:
-
A 32-bit central arithmetic logic unit (CALU)
-
A 32-bit accumulator
-
Input and output data-scaling shifters for the CALU
-
A 16-bit × 16-bit multiplier
-
A product-scaling shifter
-
Data-address generation logic, which includes eight auxiliary registers
and an auxiliary register arithmetic unit (ARAU)
-
Program-address generation logic
2.2.1Central Arithmetic Logic Unit (CALU) and Accumulator
The ’C2xx performs 2s-complement arithmetic using the 32-bit CALU. The
CALU uses 16-bit words taken from data memory or derived from an immediate instruction, or it uses the 32-bit result from the multiplier. In addition to arithmetic operations, the CALU can perform Boolean operations.
The accumulator stores the output from the CALU; it can also provide a second
input to the CALU. The accumulator is 32 bits wide and is divided into a highorder word (bits 31 through 16) and a low-order word (bits 15 through 0).
Assembly language instructions are provided for storing the high- and loworder accumulator words to data memory.
Central Processing Unit
2.2.2Scaling Shifters
The ’C2xx has three 32-bit shifters that allow for scaling, bit extraction, extended arithmetic, and overflow-prevention operations:
-
-
-
Input data-scaling shifter (input shifter). This shifter left shifts 16-bit input data by 0 to 16 bits to align the data to the 32-bit input of the CALU.
Output data-scaling shifter (output shifter). This shifter can left shift
output from the accumulator by 0 to 7 bits before the output is stored to
data memory. The content of the accumulator remains unchanged.
Product-scaling shifter (product shifter). The product register (PREG)
receives the output of the multiplier. The product shifter shifts the output
of the PREG before that output is sent to the input of the CALU. The product shifter has four product shift modes (no shift, left shift by one bit, left
shift by four bits, and right shift by 6 bits), which are useful for performing
multiply/accumulate operations, performing fractional arithmetic, or justifying fractional products.
Architectural Overview
2-5
Central Processing Unit
2.2.3Multiplier
The on-chip multiplier performs 16-bit × 16-bit 2s-complement multiplication
with a 32-bit result. In conjunction with the multiplier, the ’C2xx uses the 16-bit
temporary register (TREG) and the 32-bit product register (PREG). The TREG
always supplies one of the values to be multiplied. The PREG receives the result of each multiplication.
Using the multiplier, TREG, and PREG, the ’C2xx ef ficiently performs fundamental DSP operations such as convolution, correlation, and filtering. The effective execution time of each multiplication instruction can be as short as one
CPU cycle.
2.2.4Auxiliary Register Arithmetic Unit (ARAU) and Auxiliary Registers
The ARAU generates data memory addresses when an instruction uses indirect addressing (see Chapter 6,
The ARAU is supported by eight auxiliary registers (AR0 through AR7), each
of which can be loaded with a 16-bit value from data memory or directly from
an instruction word. Each auxiliary register value can also be stored to data
memory. The auxiliary registers are referenced by a 3-bit auxiliary register
pointer (ARP) embedded in status register ST0.
Addressing Modes
) to access data memory .
2-6
2.3Memory and I/O Spaces
The ’C2xx memory is organized into four individually selectable spaces: program, local data, global data, and I/O. These spaces form an address range
of 224K words.
All ’C2xx devices include 288 words of dual-access RAM (DARAM) for data
memory and 256 words of data/program DARAM. Depending on the device,
it may also have data/program single-access RAM (SARAM) and read-only
memory (ROM) or flash memory. Table 2–1 shows how much ROM, flash
memory, DARAM, and SARAM are available on the different ’C2xx devices.
Table 2–1. Program and Data Memory on the TMS320C2xx Devices
Memory T ype’C203’C204’F206’C209
ROM (words)–4K–4K
Flash memory (words)––32K–
DARAM (words)544544544544
Memory and I/O Spaces
Data (words)
Data/program (words)
SARAM (words)
The ’C2xx also has CPU registers that are mapped in data memory space and
peripheral registers that are mapped in on-chip I/O space. The ’C2xx memory
types and features are introduced in the subsections following this paragraph.
For more details about the configuration and use of the ’C2xx memory and I/O
space, see Chapter 4,
2.3.1Dual-Access On-Chip RAM
All ’C2xx devices have 544 words × 16-bits of on-chip DARAM, which can be
accessed twice per machine cycle. This memory is primarily intended to hold
data but, when needed, can also hold programs. It can be configured in one
of two ways:
-
All 544 words are configured as data memory.
-
288 words are configured as data memory , and 256 words are configured
as program memory.
Because DARAM can be accessed twice per cycle, it improves the speed of
the CPU. The CPU operates within a four-cycle pipeline. In this pipeline, the
288288288288
256256256256
––4K4K
Memory and I/O Space
.
Architectural Overview
2-7
Memory and I/O Spaces
CPU reads data on the third cycle and writes data on the fourth cycle. However,
DARAM allows the CPU to write and read in one cycle; the CPU writes to
DARAM on the master phase of the cycle and reads from DARAM on the slave
phase. For example, suppose two instructions, A and B, store the accumulator
value to DARAM and load the accumulator with a new value from DARAM.
Instruction A stores the accumulator value during the master phase of the CPU
cycle, and instruction B loads the new value to the accumulator during the
slave phase. Because part of the dual-access operation is a write, it only applies to RAM.
2.3.2Single-Access On-Chip Program/Data RAM
Some of the ’C2xx devices have 4K 16-bit words of single-access RAM
(SARAM). The addresses associated with the SARAM can be used for both
data memory and program memory and are software- or hardware-configurable (depending on the device) to either external memory or the internal
SARAM. When configured as external, these addresses can be used for offchip data and program memory . Code can be booted from of f-chip ROM and
then executed at full speed once it is loaded into the on-chip SARAM. Because
the SARAM can be mapped to program and/or data memory , the SARAM allows for more flexible address mapping than the DARAM block.
SARAM is accessed only once per CPU cycle. When the CPU requests multiple accesses, the SARAM schedules the accesses by providing a not-ready
condition to the CPU and then executing the accesses one per cycle. For example, if the instruction sequence involves storing the accumulator value and
then loading a value to the accumulator, it would take two cycles to complete
in SARAM, compared to one cycle in DARAM.
2.3.3Factory-Masked On-Chip ROM
Some of the ’C2xx devices feature an on-chip, 4K 16-bit words of programmable ROM. The ROM can be selected during reset by driving the MP/MC
low. If the ROM is not selected, the device starts its execution from off-chip
memory.
If you want a custom ROM, you can provide the code or data to be programmed into the ROM in object file format, and T exas Instruments will generate the appropriate process mask to program the ROM. See Appendix D for
details on how to submit ROM code to Texas Instruments.
2-8
pin
2.3.4Flash Memory
Memory and I/O Spaces
Some of the ’C2xx devices feature on-chip blocks of flash memory, which is
electronically erasable and programmable, and non-volatile. Each block of
flash memory will have a set of control registers that allow for erasing, programming, and testing of that block. The flash memory blocks can be selected
during reset by driving the MP/MC
pin low. If the flash memory is not selected,
the device starts its execution from off-chip memory.
Architectural Overview
2-9
Program Control
Program Control
2.4Program Control
Several features provide program control:
-
-
The program controller of the CPU decodes instructions, manages the
pipeline, stores the status of operations, and decodes conditional operations. Elements involved in program control are the program counter, the
status registers, the stack, and the address-generation logic.
Software mechanisms used for program control include branches, calls,
conditional instructions, a repeat instruction, reset, and interrupts.
For descriptions of these program control features, see Chapter 5,
Control.
Program
2-10
2.5On-Chip Peripherals
All the ’C2xx devices have the same CPU, but different on-chip peripherals are
connected to their CPUs. The on-chip peripherals featured on the ’C2xx devices are:
-
Clock generator (an oscillator and a phase lock loop circuit)
-
CLK register for turning the CLKOUT1 pin on and off
-
Timer
-
Wait-state generator
-
General-purpose input/output (I/O) pins
-
Synchronous serial port
-
Asynchronous serial port
2.5.1Clock Generator
The clock generator consists of an internal oscillator and an internal phase lock
loop (PLL) circuit. The clock generator can be driven internally by connecting
the DSP to a crystal resonator circuit, or it can be driven by an external clock
source. The PLL circuit generates an internal CPU clock by multiplying the
clock source by a specified factor. Thus, you can use a clock source with a lower frequency than that of the CPU. The clock generator is discussed in Section
8.2, on page 8-4.
On-Chip Peripherals
2.5.2CLKOUT1-Pin Control (CLK) Register
The ’C2xx CLK register controls whether the master clock output signal
(CLKOUT1) is available at the CLKOUT1 pin.
2.5.3Hardware Timer
The ’C2xx features a 16-bit down-counting timer with a 4-bit prescaler. Timer
control bits can stop, start, reload, and determine the prescaler count for the
timer. For more information, see Section 8.4,
2.5.4Software-Programmable Wait-State Generator
Software-programmable wait-state logic is incorporated (without any external
hardware) for interfacing with slower off-chip memory and I/O devices. The
’C209 wait-state generator generates zero or one wait states; the wait-state
generator on other ’C2xx devices generates zero to seven wait states. For
more information, see Section 8.5,
Wait-State Generator
Timer
, on page 8-8.
, on page 8-14.
Architectural Overview
2-1 1
On-Chip Peripherals
2.5.5General-Purpose I/O Pins
The ’C2xx has pins that provide general-purpose input or output signals. All
’C2xx devices have a general-purpose input pin, BIO
output pin, XF . Except for the ’C209, the ’C2xx devices also have pins IO0, IO1,
IO2, and IO3, which are connected to corresponding bits (IO0–IO3) mapped
into the on-chip I/O space. These bits can be individually configured as inputs
or outputs. For more information on the general-purpose pins, see Section 8.6,
on page 8-17.
2.5.6Serial Ports
The serial ports available on the ’C2xx vary by device, but two types of serial
ports are represented: synchronous and asynchronous. See T able 2–2 for the
number of each kind on the various ’C2xx devices. The subsections following
the table provide an introduction to the two types of serial ports.
Table 2–2. Serial Ports on the ’C2xx Devices
Serial Ports’C203’C204’F206’C209
Synchronous111–
Asynchronous111–
, and a general-purpose
Synchronous serial port (SSP)
The ’C2xx synchronous serial port (SSP) communicates with codecs, other
’C2xx devices, and external peripherals. The SSP offers:
-
Two four-word-deep first in, first out (FIFO) buf fers that have interrupt-generating capabilities.
-
Burst and continuous transfer modes.
-
A wide range of operation speeds when external clocking is used.
If internal clocking is used, the speed is fixed at 1/2 of the internal DSP clock
frequency. For more information on the SSP, see Chapter 9.
Asynchronous serial port (ASP)
The ’C2xx asynchronous serial port (ASP) communicates with asynchronous
serial devices. The ASP has a maximum transfer rate of 250,000 characters
per second (assuming it uses10 bits to transmit each 8-bit character). The ASP
also has logic for automatic baud detection, which allows the ASP to lock to
the incoming data rate. All transfers through the asynchronous serial port use
double buffering. See Chapter 10,
formation.
2-12
Asynchronous Serial Port,
for more in-
2.6Scanning-Logic Circuitry
The ’C2xx has JTAG scanning-logic circuitry that is compatible with IEEE
Standard 1149.1. This circuitry is used for emulation and testing purposes
only . The serial scan path is used to test pin-to-pin continuity as well as to perform operational tests on the on-chip peripherals. The internal scanning logic
provides access to all of the on-chip resources. Thus, the serial-scan pins and
the emulation pins on ’C2xx devices allow on-board emulation. However, on
all ’C2xx devices, the serial scan path does not have boundary scan logic.
Appendix E provides information to help you meet the design requirements of
the Texas Instruments XDS510 emulator with respect to IEEE-1149.1 designs and discusses the XDS510 cable.
Scanning-Logic Circuitry
Scanning-Logic Circuitry
Architectural Overview
2-13
Chapter 3
Central Processing Unit
This chapter describes the main components of the central processing unit
(CPU). First, this chapter describes three fundamental sections of the CPU
(see Figure 3–1):
-
Input scaling section
-
Multiplication section
-
Central arithmetic logic section
The chapter then describes the auxiliary register arithmetic unit (ARAU), which
performs arithmetic operations independently of the central arithmetic logic
section. The chapter concludes with a description of status registers ST0 and
ST1, which contain bits for determining processor modes, addressing pointer
values, and indicating various processor conditions and arithmetic logic results.
Figure 3–1. Block Diagram of the Input Scaling, Central Arithmetic Logic, and
Multiplication Sections of the CPU
Data write bus (DWEB)
Data read bus (DRDB)
Program read bus (PRDB)
Input scaling
section
31
Input shifter (32 bits)
32
Central arithmetic logic
section
32
16
16
MUXMUX
16
016 15
C
16
Multiplication
section
CALU
1
1
Accumulator
Output shifter (32 bits)
Product shifter (32 bits)
MUX
32
32
16
TREG
Multiplier
16 × 16
PREG
32
32
32
16
16
1
1
16
16
16
3-2
3.1Input Scaling Section
A 32-bit input data-scaling shifter (input shifter) aligns a 16-bit value coming
from memory to the 32-bit CALU. This data alignment is necessary for datascaling arithmetic as well as aligning masks for logical operations. The input
shifter operates as part of the data path between program or data space and
the CALU and, thus, requires no cycle overhead. Described directly below are
the input, the output, and the shift count of the input shifter. Throughout the discussion, refer to Figure 3–2.
Figure 3–2. Block Diagram of the Input Scaling Section
From program memory (PRDB)
From data memory (DRDB)
16
16
Input scaling
section
MUX
16
Input Scaling Section
31
Input shifter (32 bits)
32
To CALU
016 15
Input. Bits 15 through 0 of the input shifter accept a 16-bit input from either of
two sources (see Figure 3–2):
-
The data read bus (DRDB).
This input is a value from a data memory loca-
tion referenced in an instruction operand.
-
The program read bus (PRDB).
This input is a constant value given as an
instruction operand.
Output. After a value has been accepted into bits 15 through 0, the input shifter
aligns the16-bit value to the 32-bit bus of the CALU as shown in Figure 3–2.
The shifter shifts the value left 0 to 16 bits and then sends the 32-bit result to
the CALU.
During the left shift, unused LSBs in the shifter are filled with zeros, and unused
MSBs in the shifter are either filled with zeros or sign extended, depending on
the value of the sign-extension mode bit (SXM) of status register ST1.
Central Processing Unit
3-3
Input Scaling Section
Shift count. The shifter can left-shift a 16-bit value by 0 to 16 bits. The size
of the shift (or the shift count) is obtained from one of two sources:
-
A constant embedded in the instruction word.
Putting the shift count in the
instruction word allows you to use specific data-scaling or alignment operations customized for your program code.
-
The four LSBs of the temporary register (TREG).
The TREG-based shift
allows the data-scaling factor to be determined dynamically so that it can
be adapted to the system’s performance.
Sign-extension mode bit. For many but not all instructions, the sign-extension mode bit (SXM), bit 10 of status register ST1, determines whether the
CALU uses sign extension during its calculations. If SXM = 0, sign extension
is suppressed. If SXM = 1, the output of the input shifter is sign extended.
Figure 3–3 shows an example of an input value shifted left by 8 bits for
SXM = 0. The MSBs of the value passed to the CALU are zero filled.
Figure 3–4 shows the same shift but with SXM = 1. The value is sign extended
during the shift.
Figure 3–3. Operation of the Input Shifter for SXM = 0
Input shifter
accepting the
value
Output value
after left shift of 8
(SXM = 0)
Figure 3–4. Operation of the Input Shifter for SXM = 1
Input shifter
accepting the
value
Output value
after left shift of 8
(SXM = 1)
A F 1 1
16
X X X XA F 1 1
32
0 0 A F1 1 0 0
A F 1 1
16
X X X XA F 1 1
32
F F A F1 1 0 0
3-4
3.2Multiplication Section
The ’C2xx uses a 16-bit × 16-bit hardware multiplier that can produce a signed
or unsigned 32-bit product in a single machine cycle. As shown in Figure 3–5,
the multiplication section consists of:
-
The 16-bit temporary register (TREG), which holds one of the multiplicands
-
The multiplier, which multiplies the TREG value by a second value from
data memory or program memory
-
The 32-bit product register (PREG), which receives the result of the multiplication
-
The product shifter, which scales the PREG value before passing it to the
CALU.
Figure 3–5. Block Diagram of the Multiplication Section
From data memory
Multiplication Section
From data memory
From program memory
3.2.1Multiplier
16
16
MUX
16
To data memory
From data
memory
16
To high word
of PREG
Multiplication
section
Product shifter (32 bits)
16
TREG
Multiplier
16 × 16
PREG
32
32
To CALU
16
The 16-bit × 16-bit hardware multiplier can produce a signed or unsigned
32-bit product in a single machine cycle. The two numbers being multiplied are
treated as 2s-complement numbers, except during unsigned multiplication
(MPYU instruction). Descriptions of the inputs and output of the multiplier follow.
Central Processing Unit
3-5
Multiplication Section
Inputs. The multiplier accepts two 16-bit inputs:
-
One input is always from the 16-bit temporary register (TREG). The TREG
is loaded before the multiplication with a data-value from the data read bus
(DRDB).
-
The other input is one of the following:
J
A data-memory value from the data read bus (DRDB).
J
A program memory value from the program read bus (PRDB).
Output. After the two 16-bit inputs are multiplied, the 32-bit result is stored in
the product register (PREG). The output of the PREG is connected to the 32-bit
product-scaling shifter. Through this shifter, the product may be transferred
from the PREG to the CALU or to data memory (by the SPH and SPL instructions).
3.2.2Product-Scaling Shifter
The product-scaling shifter (product shifter) facilitates scaling of the product
register (PREG) value. The shifter has a 32-bit input connected to the output
of the PREG and a 32-bit output connected to the input of the CALU.
3-6
Input. The shifter has a 32-bit input connected to the output of the PREG.
Output. After the shifter completes the shift, all 32 bits of the result can be
passed to the CALU, or 16 bits of the result can be stored to data memory.
Shift Modes. This shifter uses one of four product shift modes, summarized
in T able 3–1. As shown in the table, these modes are determined by the product shift mode (PM) bits of status register ST1. In the first shift mode (PM = 00),
the shifter does not shift the product at all before giving it to the CALU or to data
memory . The next two modes cause left shifts (of one or four), which are useful
for implementing fractional arithmetic or justifying products. The right-shift
mode shifts the product by six bits, enabling the execution of up to 128 consecutive multiply-and-accumulate operations without causing the accumulator to
overflow. Note that the content of the PREG remains unchanged; the value is
copied to the product shifter and shifted there.
Note:
The right shift in the product shifter is always sign extended, regardless of
the value of the sign-extension mode bit (SXM) of status register ST1.
Table 3–1. Product Shift Modes for the Product-Scaling Shifter
Á
Á
Á
Á
Á
Á
Á
Á
Á
Á
Á
PM
Shift
00
no shift
01
left 1
ÁÁ
10
left 4
ÁÁ
ÁÁ
11
right 6
ÁÁ
ÁÁ
†
A Q31 number is a binary fraction in which there are 31 digits to the right of the binary point
БББББББББББББББББББББ
(the base 2 equivalent of the base 10 decimal point).
Comments
Product sent to CALU or data write bus (DWEB) with no shift
Removes the extra sign bit generated in a 2s-complement multiply
БББББББББББББББББ
to produce a Q31 product
Removes the extra four sign bits generated in a 16-bit × 13-bit 2s-
БББББББББББББББББ
complement multiply to produce a Q31 product† when multiplying
by a 13-bit constant
БББББББББББББББББ
†
Scales the product to allow up to 128 product accumulations without overflowing the accumulator . The right shift is always sign ex-
БББББББББББББББББ
tended, regardless of the value of the sign-extension mode bit
БББББББББББББББББ
(SXM) of status register ST1.
Multiplication Section
Central Processing Unit
3-7
Central Arithmetic Logic Section
3.3Central Arithmetic Logic Section
Figure 3–6 shows the main components of the central arithmetic logic section,
which are:
-
The central arithmetic logic unit (CALU), which implements a wide range
of arithmetic and logic functions.
-
The 32-bit accumulator (ACC), which receives the output of the CALU and
is capable of performing bit shifts on its contents with the help of the carry
bit (C). Figure 3–6 shows the accumulator’s high word (ACCH) and low
word (ACCL).
-
The output shifter, which can shift a copy of either the high word or low
word of the accumulator before sending it to data memory for storage.
Figure 3–6. Block Diagram of the Central Arithmetic Logic Section
From input shifter
From product shifter
3232
Central arithmetic logic
section
32
C
MUX
32
CALU
32
ACCH
Output shifter (32 bits)
To data memory
ACCL
32
16
3-8
3.3.1Central Arithmetic Logic Unit (CALU)
The central arithmetic logic unit (CALU), implements a wide range of arithmetic and logic functions, most of which execute in a single clock cycle. These
functions can be grouped into four categories:
-
16-bit addition
-
16-bit subtraction
-
Boolean logic operations
-
Bit testing, shifting, and rotating.
Because the CALU can perform Boolean operations, you can perform bit manipulation. For bit shifting and rotating, the CALU uses the accumulator. The
CALU is referred to as central because there is an independent arithmetic unit,
the auxiliary register arithmetic unit (ARAU), which is described in Section 3.4.
A description of the inputs, the output, and an associated status bit of the CALU
follows.
Inputs. The CALU has two inputs (see again Figure 3–6):
-
One input is always provided by the 32-bit accumulator.
Central Arithmetic Logic Section
3.3.2Accumulator
-
The other input is provided by one of the following:
J
The product-scaling shifter (see subsection 3.2.2)
J
The input data-scaling shifter (see Section 3.1)
Output. Once the CALU performs an operation, it transfers the result to the
32-bit accumulator, which is capable of performing bit shifts of its contents. The
output of the accumulator is connected to the 32-bit output data-scaling shifter.
Through the output shifter, the accumulator’s upper and lower 16-bit words
can be individually shifted and stored to data memory.
Sign-extension mode bit. For many but not all instructions, the sign-extension mode bit (SXM), bit 10 of status register ST1, determines whether the
CALU uses sign extension during its calculations. If SXM = 0, sign extension
is suppressed. If SXM = 1, sign extension is enabled.
Once the CALU performs an operation, it transfers the result to the 32-bit accumulator, which can then perform single-bit shifts or rotations on its contents.
Each of the accumulator’s upper and lower 16-bit words can be passed to the
output data-scaling shifter, where it can be shifted, and then stored in data
memory . Status bits and branch instructions associated with the accumulator
are discussed directly below.
Central Processing Unit
3-9
Central Arithmetic Logic Section
Status bits. Four status bits are associated with the accumulator:
-
Carry bit (C).
J
Additions to and subtractions from the accumulator:
C (bit 9 of status register ST1) is affected during:
C = 0When the result of a subtraction generates a borrow.
When the result of an addition does not generate a carry . (Exception: When the ADD instruction is used with a shift of 16 and
no carry is generated, the ADD instruction has no affect on C.)
C = 1When the result of an addition generates a carry.
When the result of a subtraction does not generate a borrow.
(Exception: When the SUB instruction is used with a shift of 16
and no borrow is generated, the SUB instruction has no effect
on C.)
J
Single-bit shifts and rotations of the accumulator value. During a left
shift or rotation, the most significant bit of the accumulator is passed to
C; during a right shift or rotation, the least significant bit is passed to C.
-
Overflow mode bit (OVM).
OVM (bit 1 1 of status register ST0) determines
how the accumulator will reflect arithmetic overflows. When the processor
is in overflow mode (OVM = 1) and an overflow occurs, the accumulator
is filled with one of two specific values:
J
If the overflow is in the positive direction, the accumulator is filled with
its most positive value (7FFF FFFFh).
J
If the overflow is in the negative direction, the accumulator is filled with
its most negative value (8000 0000h).
-
Overflow flag bit (OV).
OV is bit 12 of status register ST0. When no accumulator overflow is detected, OV is latched at 0. When overflow (positive
or negative) occurs, OV is set to 1 and latched.
-
T est/control flag bit (TC).
TC (bit 1 1 of status register ST1) is set to 0 or 1
depending on the value of a tested bit. In the case of the NORM instruction,
if the exclusive-OR of the two MSBs of the accumulator is true, TC is set
to 1.
A number of branch instructions are implemented based on the status of bits
C, OV , and TC, and on the value in the accumulator (as compared to zero). For
more information about these instructions, see Section 5.4,
Branches, Calls, and Returns
, on page 5-10.
Conditional
3-10
Central Arithmetic Logic Section
3.3.3Output Data-Scaling Shifter
The output data-scaling shifter (output shifter) has a 32-bit input connected to
the 32-bit output of the accumulator and a 16-bit output connected to the data
bus. The shifter copies all 32-bits of the accumulator and then performs a left
shift on its content; it can be shifted from zero to seven bits, as specified in the
corresponding store instruction. The upper word (SACH instruction) or lower
word (SACL instruction) of the shifter is then stored to data memory . The content of the accumulator remains unchanged.
When the output shifter performs the shift, the MSBs are lost and the LSBs are
zero filled. Figure 3–7 shows an example in which the accumulator value is
shifted left by four bits and the shifted high word is stored to data memory.
Figure 3–8 shows the same accumulator value shifted left by 6 bits and then
the shifted low word stored.
Figure 3–7. Shifting and Storing the High Word of the Accumulator
Accumulator
Output shifter
(left shift by 4 bits)
Data-memory
location
0 0 F 0
0 F 0 F
16
0 F 0 F
F 0 A 1
32
0 A 1 0
Figure 3–8. Shifting and Storing the Low Word of the Accumulator
Accumulator
Output shifter
(left shift by 6 bits)
0 0 F 0
3 C 3 C
Data-memory
location
F 0 A 1
32
2 8 4 0
16
2 8 4 0
Central Processing Unit
3-1 1
Auxiliary Register Arithmetic Unit (ARAU)
3.4Auxiliary Register Arithmetic Unit (ARAU)
The CPU also contains the auxiliary register arithmetic unit (ARAU), an arithmetic unit independent of the central arithmetic logic unit (CALU). The main
function of the ARAU is to perform arithmetic operations on eight auxiliary registers (AR7 through AR0) in parallel with operations occurring in the CALU.
Figure 3–9 shows the ARAU and related logic.
Figure 3–9.ARAU and Related Logic
Data read bus (DRDB)
ARB
16
16
16
16
16
16
16
16
16
16
ARAU
16
16
AR7
AR6
AR5
AR4
AR3
AR2
AR1
AR0
MUX
3
ARP
3
MUX
3
3LSBs
Instruction register
8LSBs
Data write bus (DWEB)
3-12
Data-read address bus (DRAB)
Data-write address bus (DWAB)
Auxiliary Register Arithmetic Unit (ARAU)
The eight auxiliary registers (AR7–AR0) provide flexible and powerful indirect
addressing. Any location in the 64K data memory space can be accessed using a 16-bit address contained in an auxiliary register. For the details of indirect
addressing, see Section 6.3 on page 6-9.
To select a specific auxiliary register, load the 3-bit auxiliary register pointer
(ARP) of status register ST0 with a value from 0 through 7. The ARP can be
loaded as a primary operation by the MAR instruction (which only performs
modifications to the auxiliary registers and the ARP) or by the LST instruction
(which can load a data-memory value to ST0 by way of the data read bus,
DRDB). The ARP can be loaded as a secondary operation by any instruction
that supports indirect addressing.
The register pointed to by the ARP is referred to as the
or
current AR
. During the processing of an instruction, the content of the current auxiliary register is used as the address at which the data-memory access
will take place. The ARAU passes this address to the data-read address bus
(DRAB) if the instruction requires a read from data memory, or it passes the
address to the data-write address bus (DWAB) if the instruction requires a
write to data memory. After the instruction uses the data value, the contents
of the current auxiliary register can be incremented or decremented by the
ARAU, which implements unsigned 16-bit arithmetic.
3.4.1ARAU and Auxiliary Register Functions
The ARAU performs the following operations:
-
Increments or decrements an auxiliary register value by 1 or by an index
amount (by way of any instruction that supports indirect addressing)
-
Adds a constant value to an auxiliary register value (ADRK instruction) or
subtracts a constant value from an auxiliary register value (SBRK instruction). The constant is an 8-bit value taken from the eight LSBs of the
instruction word.
-
Compares the content of AR0 with the content of the current AR and puts
the result in the test/control flag bit (TC) of status register ST1 (CMPR
instruction). The result is passed to TC by way of the data write bus
(DWEB).
current auxiliary register
Normally , the ARAU performs its arithmetic operations in the decode phase of
the pipeline (when the instruction specifying the operations is being decoded).
This allows the address to be generated before the decode phase of the next
instruction. There is an exception to this rule: During processing of the NORM
instruction, the auxiliary register and/or ARP modification is done during the
Central Processing Unit
3-13
Auxiliary Register Arithmetic Unit (ARAU)
execute phase of the pipeline. For information on the operation of the pipeline,
see Section 5.2 on page 5-7.
In addition to using the auxiliary registers to reference data-memory addresses, you can use them for other purposes. For example, you can:
-
Use the auxiliary registers to support conditional branches, calls, and returns by using the CMPR instruction. This instruction compares the content of AR0 with the content of the current AR and puts the result in the
test/control flag bit (TC) of status register ST1.
-
Use the auxiliary registers for temporary storage by using the LAR instruction to load values into the registers and the SAR instruction to store AR
values to data memory.
-
Use the auxiliary registers as software counters, incrementing or decrementing them as necessary.
3-14
3.5Status Registers ST0 and ST1
The ’C2xx has two status registers, ST0 and ST1, which contain status and
control bits. These registers can be stored into and loaded from data memory ,
thus allowing the status of the machine to be saved and restored for subroutines.
The LST (load status register) instruction writes to ST0 and ST1, and the SST
(store status register) instruction reads from ST0 and ST1 (with the exception
of the INTM bit, which is not affected by the LST instruction). Many of the individual bits of these registers can be set and cleared using the SETC and CLRC
instructions. For example, the sign-extension mode is set with SETC SXM and
cleared with CLRC SXM.
Figure 3–10 and Figure 3–11 show the organization of status registers ST0
and ST1, respectively. Several bits in the status registers are reserved; they
are always read as logic 1s. The other bits are described in alphabetical order
in Table 3–2.
Figure 3–10. Status Register ST0
Status Registers ST0 and ST1
1514131211109876543210
ARPOVOVM
R/W–xR/W–0R/W–xR/W–1R/W–x
Note:R = Read access; W = Write access; value following dash (–) is value after reset (x means value not affected by
†
reset).
This reserved bit is always read as 1. Writes have no effect on it.
†
1
INTMDP
Figure 3–11.Status Register ST1
151413 12 11 1098765 432 1 0
ARBCNFTCSXMC
R/W–xR/W–0R/W–xR/W–1R/W–1R/W–1R/W–00
Note:R = Read access; W = Write access; value following dash (–) is value after reset (x means value not affected by
†
reset).
These reserved bits are always read as 1s. Writes have no effect on them.
1†1†1†1
†
XF
1†1
†
PM
Central Processing Unit
3-15
Status Registers ST0 and ST1
Table 3–2. Bit Fields of Status Registers ST0 and ST1
NameDescription
ARBAuxiliary register pointer buffer. Whenever the auxiliary register pointer (ARP) is loaded, the pre-
vious ARP value is copied to the ARB, except during an LST (load status register) instruction. When
the ARB is loaded by an LST instruction, the same value is also copied to the ARP.
ARPAuxiliary register pointer. This 3-bit field selects which auxiliary register (AR) to use in indirect
addressing. When the ARP is loaded, the previous ARP value is copied to the ARB register, except
during an LST (load status register) instruction. The ARP may be modified by memory-reference
instructions using indirect addressing, and by the MAR (modify auxiliary register) and LST instructions. When the ARB is loaded by an LST instruction, the same value is also copied to the ARP.
For more details on the use of ARP in indirect addressing, see Section 6.3,
, on page 6-9.
Mode
.
CCarry bit
of a subtraction generates a borrow. Otherwise, it is cleared after an addition or set after a subtraction, except if the instruction is ADD or SUB with a 16-bit shift. In these cases, ADD can only set
and SUB only clear the carry bit, but cannot affect it otherwise. The single-bit shift and rotate instructions also affect this bit, as well as the SETC, CLRC, and LST instructions. The conditional branch,
call, and return instructions can execute based on the status of C. C is set to 1 on reset.
CNFOn-chip DARAM configuration bit
RAM blocks are mapped to data space or to program space. The CNF bit may be modified by the
SETC CNF , CLRC CNF, and LST instructions. Reset clears the CNF bit to 0. For more information
about CNF and the dual-access RAM blocks, see Chapter 4,
This bit is set to 1 if the result of an addition generates a carry , or cleared to 0 if the result
.
This bit determines whether reconfigurable dual-access
Memory and I/O Space
Indirect Addressing
s.
CNF = 0Reconfigurable dual-access RAM blocks are mapped to data space.
CNF = 1Reconfigurable dual-access RAM blocks are mapped to program space.
DPData page pointer.
with the 7 LSBs of the instruction word to form a full 16-bit data-memory address. For more details,
see Section 6.2,
can modify the DP field.
INTMInterrupt mode bit
by the SETC INTM and CLRC INTM instructions, respectively . INTM has no effect on the nonmaskable interrupts RS
(load status register) instruction. INTM is set to 1 when an interrupt trap is taken (except in the case
of the TRAP instruction) and at reset.
INTM = 0All unmasked interrupts are enabled.
INTM = 1All maskable interrupts are disabled.
OV
3-16
Overflow flag bit. This bit holds a latched value that indicates whether overflow has occurred in
the CALU. OV is set to 1 when an overflow occurs in the CALU. Once an overflow occurs, the OV
bit remains set until it is cleared by a reset, a conditional branch on overflow (OV) or no overflow
(NOV), or an LST instruction .
When an instruction uses direct addressing, the 9-bit DP field is concatenated
Direct Addressing Mode
.
This bit enables or disables all maskable interrupts. INTM is set and cleared
and NMI or on interrupts initiated by software. INTM is unaffected by the LST
, on page 6-4. The LST and LDP (load DP) instructions
Status Registers ST0 and ST1
Table 3–2. Bit Fields of Status Registers ST0 and ST1 (Continued)
NameDescription
OVMOverflow mode bit. OVM determines how overflows in the CALU are handled. The SETC and
CLRC instructions set and clear this bit, respectively. An LST instruction can also be used to modify
OVM.
OVM = 0Results overflow normally in the accumulator.
OVM = 1The accumulator is set to either its most positive or negative value upon encountering
an overflow. (See subsection 3.3.2,
PMProduct shift mode. PM determines the amount that the PREG value is shifted on its way to the
CALU or to data memory . Note that the content of the PREG remains unchanged; the value is copied to the product shifter and shifted there. PM is loaded by the SPM and LST instructions. The
PM bits are cleared by reset.
PM = 00The multiplier’s 32-bit product is passed to the CALU or to data memory with no shift.
PM = 01The output of the PREG is left shifted one place (with the LSBs zero filled) before be-
ing passed to the CALU or to data memory .
PM = 10The output of the PREG is left shifted four bits (with the LSBs zero filled) before being
passed to the CALU or to data memory .
Accumulator
.)
PM = 1 1This mode produces a right shift of six bits, sign extended.
SXMSign-extension mode bit. SXM does not affect the basic operation of certain instructions. For
example, the ADDS instruction suppresses sign extension regardless of SXM. This bit is set by the
SETC SXM instruction and cleared by the CLRC SXM instruction, and may be loaded by the LST
instruction. SXM is set to 1 by reset.
SXM = 0This mode suppresses sign extension.
SXM = 1This mode produces sign extension on data as it is passed into the accumulator from
the input shifter.
TCT est/control flag bit. The TC bit is set to 1 if a bit tested by BIT or BITT is a 1, if a compare condition
tested by CMPR exists between the current auxiliary register and AR0, or if the exclusive-OR function of the two MSBs of the accumulator is true when tested by a NORM instruction. The conditional
branch, call, and return instructions can execute based on the condition of the TC bit. The TC bit
is affected by the BIT, BITT, CMPR, LST, and NORM instructions.
XF
XF pin status bit. This bit determines the state of the XF pin, which is a general-purpose output
pin. XF is set by the SETC XF instruction and cleared by the CLRC XF instruction. XF can also be
modified with an LST instruction. XF is set to 1 by reset.
Central Processing Unit
3-17
Chapter 4
Memory and I/O Spaces
This chapter describes the ’C2xx memory configuration options and the address maps of the individual ’C2xx devices. It also illustrates typical ways of
interfacing the ’C2xx with external memory and external input/output (I/O)
devices.
Each ’C2xx device has a 16-bit address line that accesses four individually selectable spaces (224K words total):
-
A 64K-word program space
-
A 64K-word local data space
-
A 32K-word global data space
-
A 64K-word I/O space
Also available on select ’C2xx devices are an on-chip boot loader and a HOLD
operation. The on-chip boot loader allows a ’C2xx to boot software from an
8-bit external ROM to a 16-bit external RAM at reset. The HOLD operation allows a ’C2xx to give external devices direct memory access to external program, data, and I/O spaces.
TopicPage
4.1Overview of the Memory and I/O Spaces4-2. . . . . . . . . . . . . . . . . . . . . . . .
The ’C2xx address map is organized into four individually selectable spaces:
-
Program memory (64K words) contains the instructions to be executed,
as well as data used during program execution.
-
Local data memory (64K words) holds data used by the instructions.
-
Global data memory (32K words) shares data with other processors or
serves as additional data space. Addresses in the upper 32K words
(8000h–FFFFh) of local data memory can be used for global data memory .
-
Input/output (I/O) space (64K words) interfaces to external peripherals
and contains registers for the on-chip peripherals.
These spaces provide a total address range of 224K words. The ’C2xx includes a considerable amount of on-chip memory to aid in system performance and integration and a considerable amount of addresses that can be
used for external memory and I/O devices.
The advantages of operating from on-chip memory are:
-
Higher performance than external memory (because the wait states required for slower external memories are avoided)
-
Lower cost than external memory
-
Lower power consumption than external memory
The advantage of operating from external memory is the ability to access a
larger address space.
The ’C2xx design is based on an enhanced Harvard architecture. The ’C2xx
memory spaces are accessible on three parallel buses—the program address
bus (P AB), the data-read address bus (DRAB), and the data-write address bus
(DWAB). Because the operations of the three buses are independent, it is possible to access both the program and data spaces simultaneously. Within a
given machine cycle, the central arithmetic logic unit (CALU) can execute as
many as three concurrent memory operations.
4-2
Overview of the Memory and I/O Spaces
4.1.1Pins for Interfacing to External Memory and I/O Spaces
The pins for interfacing to external memory and I/O space, described in
Table 4–1, are of four main types:
-
External buses. Sixteen signals (A15–A0) are available for passing an
address from the ’C2xx to another device. Sixteen signals (D15–D0) are
available for transferring a data value between the ’C2xx and another device.
-
Select signals. These signals can be used by external devices to determine when the ’C2xx is requesting access to off-chip locations, and
whether that request is for data, program, global, or I/O space.
-
Read/write signals. These signals indicate to external devices the direction of a data transfer (to the ’C2xx or from the ’C2xx).
-
Request/control signals. The input request signals (BOOT, MP/MC,
RAMEN, READY, and HOLD
’C2xx. The output HOLDA
) effect a change in the operation of the
is the response to HOLD.
Table 4–1. Pins for Interfacing With External Memory and I/O Spaces
Pin(s)Description
External busesA15–A0The 16 lines of the external address bus. This bus can address up to 64K
words of external memory or I/O space.
D15–D0The 16 bidirectional lines of the external data bus. This bus carries data
to and from external memory or I/O space.
Select signalsDS
BR
PS
IS
STRBExternal access active strobe. The ’C2xx asserts STRB during accesses
Data memory select pin. The ’C2xx asserts DS to indicate an access to
external data memory (local or global).
Bus request pin. The ’C2xx asserts both BR and DS to indicate an access
to global data memory .
Program memory select pin. The ’C2xx asserts PS to indicate an access
to external program memory .
I/O space select pin. The ’C2xx asserts IS to indicate an access to external I/O space.
to external program, data, or I/O space.
Memory and I/O Spaces
4-3
Overview of the Memory and I/O Spaces
Table 4–1. Pins for Interfacing With External Memory and I/O Spaces (Continued)
DescriptionPin(s)
Read/write
signals
Request/control
signals
R/WRead/write pin. This pin indicates the direction of transfer between the
’C2xx and external program, data, or I/O space.
RDRead select pin. The ’C2xx asserts RD to request a read from external
program, data, or I/O space.
WE
BOOT
MP/MC
RAMENSingle-access RAM enable pin. On ’C2xx devices with on-chip single-ac-
READYExternal device ready pin (for generating wait states externally). When
Write enable pin. The ’C2xx asserts WE to request a write to external program, data, or I/O space.
Boot load pin. This pin is only on devices that have the on-chip boot loader. If BOOT
EPROM in global data memory to RAM in external program memory.
Microprocessor/microcomputer pin. This pin is only on devices with onchip non-volatile program memory . The level on this pin is tested at reset.
If MP/MC
is fetched from external memory). If MP/MC
computer mode (the reset vector is fetched from on-chip memory).
cess RAM, when this pin is high, the RAM is enabled; when this pin is low,
the RAM is disabled.
this pin is driven low, the ’C2xx waits one CPU cycle and then tests
READY again. After READY is driven low, the ’C2xx does not continue
processing until READY is driven high. If READY is not used, it should
be kept high. On the ’C203, at boot time, this pin must be high.
is low during a hardware reset, the ’C2xx transfers code from
is high, the device is in microprocessor mode (the reset vector
is low, the device is in micro-
4-4
HOLD
HOLDAHOLD acknowledge pin. The ’C2xx (with assistance from proper pro-
HOLD operation request pin. An external device can request control of
the external buses by asserting HOLD
software logic) asserts HOLDA
until it deasserts HOLD.
gram code) asserts HOLDA
serted and places its external buses in high impedance.
to acknowledge that HOLD has been as-
. After the ’C2xx (along with proper
, the external device controls the buses
4.2Program Memory
Program-memory space holds the code for applications; it can also hold table
information and constant operands. The program-memory space addresses
up to 64K 16-bit words. Every ’C2xx device contains a DARAM block B0 that
can be configured as program memory or data memory. Other on-chip program memory may be SARAM and ROM or flash memory . For information on
configuring on-chip program-memory blocks, see Section 4.8.
4.2.1Interfacing With External Program Memory
The ’C2xx can address up to 64K words of external program memory. While
the ’C2xx is accessing the on-chip program-memory blocks, the external
memory signals PS
active only when the ’C2xx is accessing locations within the address ranges
mapped to external memory. An active PS
buses are being used for program memory . Whenever the external buses are
active (when external memory or I/O space is being accessed) the ’C2xx
drives the STRB
and STRB are in high impedance. The external buses are
signal low.
Program Memory
signal indicates that the external
For fast memory interfacing, it is important to select external memory with fast
access time. If fast memory is not available, or if speed is not a serious consideration, you can use the the READY signal and/or the on-chip wait-state generator to create wait states.
Figure 4–1 shows an example of interfacing to external program memory. In
the figure, 8K × 16-bit static memory is interfaced to the ’C2xx using two
8K × 8-bit RAMs.
Obtain the Proper Timing Information
When interfacing memory with high-speed ’C2xx devices, refer to
the data sheet for that ’C2xx device for the required access, delay ,
and hold times.
Memory and I/O Spaces
4-5
Program Memory
Figure 4–1. Interface With External Program Memory
’C2xx DSP
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14
D15
PS
RD
WE
8K 8 RAM
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
8K 8 RAM
D0
D1
D2
D3
D4
D5
D6
D7
WE
RD
CE
D0
D1
D2
D3
D4
D5
D6
D7
WE
RD
CE
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14
D15
4-6
4.3Local Data Memory
The local data-memory space addresses up to 64K 16-bit words. Every ’C2xx
device has three on-chip DARAM blocks: B0, B1, and B2. Block B0 has 256
words that are configurable as either data locations or program locations.
Blocks B1 (256 words) and B2 (32 words) have a total of 288 words that are
available for data memory only . Some ’C2xx devices, in addition to the three
DARAM blocks, have an on-chip SARAM block that can be used for program
and/or data memory . Section 4.8 tells how to configure these memory blocks.
Data memory can be addressed with either of two addressing modes: directaddressing mode or indirect-addressing mode. Addressing modes are described in detail in Chapter 6.
When direct addressing is used, data memory is addressed in blocks of 128
words called data pages. Figure 4–2 shows how these blocks are addressed.
The entire 64K of data memory consists of 512 data pages labeled 0 through
51 1. The current data page is determined by the value in the 9-bit data page
pointer (DP) in status register ST0. Each of the 128 words on the current page
is referenced by a 7-bit offset, which is taken from the instruction that is using
direct addressing. Therefore, when an instruction uses direct addressing, you
must specify both the data page (with a preceding instruction) and the offset
(in the instruction that accesses data memory).
Local Data Memory
Figure 4–2. Pages of Data Memory
0000 0000 0
0000 0000 0
0000 0000 1
0000 0000 1
0000 0001 0
0000 0001 0
1111 1111 1
1111 1111 1
OffsetDP value
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
000 0000
.
.
.
111 1111
000 0000
.
.
.
111 1111
000 0000
.
.
.
111 1111
.
.
.
.
.
.
000 0000
.
.
.
111 1111
’C2xx Data Memory
Page 0: 0000h–007Fh
Page 1: 0080h–00FFh
Page 2: 0100h–017Fh
.
.
.
.
.
.
.
Page 51 1: FF80h–FFFFh
Memory and I/O Spaces
4-7
Local Data Memory
4.3.1Data Page 0 Address Map
T able 4–2 shows the address map of data page 0 (addresses 0000h–007Fh).
Note the following:
-
Three memory-mapped registers can be accessed with zero wait states:
J
Interrupt mask register (IMR)
J
Global memory allocation register (GREG)
J
Interrupt flag register (IFR)
-
The test/emulation reserved area is used by the test and emulation systems for special information transfers.
Do Not Write to Test/Emulation Addresses
Writing to the test/emulation addresses can cause the device to
change its operational mode and, therefore, affect the operation of
an application.
-
The scratch-pad RAM block (B2) includes 32 words of DARAM that provide for variable storage without fragmenting the larger RAM blocks,
whether internal or external. This RAM block supports dual-access operations and can be addressed with any data-memory addressing mode.
Table 4–2. Data Page 0 Address Map
AddressNameDescription
0000h–0003h–Reserved
0004hIMRInterrupt mask register
0005hGREGGlobal memory allocation register
0006hIFRInterrupt flag register
0023h–0027h–Reserved
002Bh–002Fh–Reserved for test/emulation
0060h–007Fh
B2Scratch-pad RAM (DARAM B2)
4-8
4.3.2Interfacing With External Local Data Memory
While the ’C2xx is accessing the on-chip local data-memory blocks, the external memory signals DS
are active only when the ’C2xx is accessing locations within the address
ranges mapped to external memory . An active DS
ternal buses are being used for data memory. Whenever the external buses
are active (when external memory or I/O space is being accessed) the ’C2xx
drives the STRB
For fast memory interfacing, it is important to select external memory with fast
access time. If fast memory is not available, or if speed is not a serious consideration, you can use the the READY signal and/or the on-chip wait-state generator to create wait states.
Figure 4–3 shows an example of interfacing to external data memory. In the
figure 8K × 16-bit static memory is interfaced to the ’C2xx using two 8K × 8-bit
RAMs. The RAM devices must have fast access times if the internal instruction
speed is to be maintained.
and STRB are in high impedance. The external buses
signal low.
Local Data Memory
signal indicates that the ex-
Obtain the Proper Timing Information
When interfacing memory with high-speed ’C2xx devices, refer to
the data sheet for that ’C2xx device for the required access, delay ,
and hold times.
Memory and I/O Spaces
4-9
Local Data Memory
Figure 4–3. Interface With External Local Data Memory
’C2xx DSP
A10
A12
D10
D11
D12
D13
D14
D15
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A11
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DS
RD
WE
8K 8 RAM
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
8K 8 RAM
D0
D1
D2
D3
D4
D5
D6
D7
WE
RD
CE
D0
D1
D2
D3
D4
D5
D6
D7
WE
RD
CE
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14
D15
4-10
4.4Global Data Memory
Addresses in the upper 32K words (8000h–FFFFh) of local data memory can
be used for global data memory. The global memory allocation register
(GREG) determines the size of the global data-memory space, which is between 256 and 32K words. The GREG is connected to the eight LSBs of the
internal data bus and is memory-mapped to data-memory location 0005h.
Table 4–3 shows the allowable GREG values and shows the corresponding
address range set aside for global data memory. Any remaining addresses
within 8000h–FFFFh are available for local data memory.
Note:
Choose only the GREG values listed in Table 4–3. Other values lead to
fragmented memory maps.
As an example of configuring global memory , suppose you want to designate
8K addresses as global addresses. Y ou would write the 8-bit value 1 1 100000
to the eight LSBs of the GREG (see Figure 4–4). This would designate addresses E000h–FFFFh of data memory as global data addresses (see
Figure 4–5).
Figure 4–4. GREG Register Set to Configure 8K for Global Data Memory
8 MSBs8 LSBs
X
XXXXXXX11100000
(Don’t cares)Set for 8K of global data memory
Figure 4–5. Global and Local Data Memory for GREG = 11100000
Data Memory Map
0000h
Lower 32K × 16
(always local)
2
7FFFh
8000h
Upper 32K × 16
(local and/or global)
FFFFh
4.4.1Interfacing With External Global Data Memory
When a program accesses any data-memory address, the ’C2xx drives the DS
signal low. If that address is within a range defined by the GREG as global, BR
and DS are asserted. Because BR differentiates local and global accesses,
you can use the GREG to extend data memory by up to 32K. Figure 4–6 shows
two external RAMs that are sharing data-memory addresses 8000h–FFFFh.
Overlapping addresses must be reconfigured with the GREG in order to be
4-12
GREG = 11100000
8000h
Local (24K × 16)
DFFFh
E000h
Global (8K × 16)
FFFFh
toggled between local memory and global memory . For example, in the system
of Figure 4–6, when GREG = XXXXXXXX00000000
(no global memory), the
2
local data RAM is fully accessible; when GREG = XXXXXXXX10000000
global memory), the local data RAM is not accessible.
Figure 4–6. Using 8000h–FFFFh for Local and Global External Memory
Global Data Memory
(all
2
’C2xx
16
D15–D0D15–D0
RD
WE
DS
16
16
16
Local data RAM
A15–A0A15–A0
OE
WE
CE
Global data RAM
A15–A0
D15–D0
8000h–FFFFh
8000h–FFFFh
BR
OE
WE
CE
Memory and I/O Spaces
4-13
Boot Loader
4.5Boot Loader
This section applies to ’C2xx devices that have an on-chip boot loader. The
boot loader is used for booting software from an 8-bit external ROM to a 16-bit
external RAM at reset (see Figure 4–7). The source for your program is an external ROM located in external global data memory. The destination for the
boot loaded program is RAM in program space. The main purpose of the boot
loader is to provide you with the ability to use low-cost, simple-to-use 8-bit
EPROMs with the 16-bit ’C2xx.
Figure 4–7. Simplified Block Diagram of Boot Loader Operation
The code for the boot loader is stored on chip. Using the boot loader requires
several steps: choosing an EPROM, connecting and programming the
EPROM, enabling the boot loader program, and finally, booting.
4.5.1Choosing an EPROM
The code that you want boot loaded must be stored in non-volatile external
memory; usually, this code is stored in an EPROM. Most standard EPROMs
can be used. At reset, the processor defaults to the maximum number of software wait states to accommodate slow EPROMs.
’C2xx
16
8
EPROM
(program source)
Mapped in global data
memory space
RAM
(program destination)
Written starting at
address 0000h
4-14
The maximum size for the EPROM is 32K words × 8 bits, which accommodates a program of up to 16K words 16 bits. However, you could use the
boot loader to load your own boot software to get around this limit or to perform
a different type of boot.
Recommended EPROMs include the 27C32, 27C64, 27C128, and 27C256.
4.5.2Connecting the EPROM to the Processor
To map the EPROM into the global data space at address 8000h, make the
following connections between the processor and the EPROM (refer to
Figure 4–8):
-
Connect the address lines of the processor and the EPROM (see lines
A14–A0 in the figure).
-
Connect the data lines of the processor and the EPROM (see lines D7–D0
in the figure).
-
Connect the processor’s RD pin to the EPROM’s output enable pin (OE
in the figure).
-
Connect the processor’s BR pin to the EPROM’s chip enable pin (CE in
the figure).
Notes:
1) If the EPROM is smaller than 32K words × 8 bits, connect only the address pins that are available on the EPROM.
Boot Loader
2) When the boot loader accesses global memory, along with BR
driven low. Design your system such that the DS
undesired accesses to data memory during the boot loads.
Figure 4–8. Connecting the EPROM to the Processor
’C2xx
A14–A0A14–A0
RD
BR
15
8
, DS is
signal does not initiate
EPROM
(27C256)
D7–D0D7–D0
OE
CE
Memory and I/O Spaces
4-15
Boot Loader
4.5.3Programming the EPROM
T exas Instruments fixed-point development tools provide the utilities to generate the boot ROM code. (For an introduction to the procedure for generating
boot loader code, see Appendix C,
need to do the programming, use the following procedure.
Store the following to the EPROM:
-
Destination address. Store the destination address in the first two bytes
of the EPROM—store the high-order byte of the destination address at
EPROM address 8000h and store the low-order byte at EPROM address
8001h.
-
Program length. Store N (the length of your program in bytes) in the next
two bytes in EPROM. Use this calculation to determine N:
N = ((number of bytes to be transferred)/2) – 1
Store the high-order N byte at EPROM address 8002h and the low-order N
byte at EPROM address 8003h.
Program Examples
.) However, should you
-
Program. Store the program, one byte at a time, beginning at EPROM address 8004h.
Each word in the program must be divided into two bytes in the EPROM;
store the high-order byte first and store the low-order byte second. For example, if the first word were 813Fh, you would store 81h into the first byte
(at 8004h) and 3Fh into the second byte (at 8005h). Then, you would store
the high byte of the next word at address 8006h.
Notes:
1) Do not include the first four bytes of the EPROM in your calculation of
the length (N). The boot loader uses N beginning at the fifth byte of the
EPROM.
2) Make sure the first part of the program on the EPROM contains code for
the reset and interrupt vectors. These vectors must be stored in the destination RAM first, so that they can be fetched from program-memory addresses 0000h–003Fh. The reset vector will be fetched from 0000h. For
a list of all the assigned vector locations, see subsection 5.6.2,
T able
, on page 5-16.
Interrupt
4-16
Boot Loader
Figure 4–9 shows how to store a 16-bit program into the 8-bit EPROM. A subscript h (for example, on Word1
example, on Word1
) indicates the low byte.
l
) indicates the high-byte and a subscript l (for
h
Figure 4–9. Storing the Program in the EPROM
16-Bit Program8-Bit EPROM
158 70Address 70
Word1
h
Word2
h
•.•8002hLength N
••8003hLength N
••8004hWord1
Wordn
h
Word1
Word2
Wordn
l
l
l
8000hDestination
8001hDestination
h
8005hW ord1
8006hWord2
8007hW ord2
••
••
••
nnnEhWordn
nnnFhWordn
l
h
l
h
l
h
l
h
l
4.5.4Enabling the Boot Loader
To enable the boot loader, tie the BOOT pin low and reset the device. The
pin is sampled only at reset. If you don’t want to use the boot loader,
BOOT
tie BOOT
Three main conditions occur at reset that ensure proper operation of the boot
loader:
-
-
-
After a hardware reset, the processor either executes the boot loader software
or skips execution of the boot loader, depending on the level on the BOOT
-
-
high before initiating a reset.
All maskable interrupts are globally disabled (INTM bit = 1).
On-chip DARAM block B0 is mapped to data space (CNF bit = 0).
Seven wait states are selected for program and data spaces.
If BOOT is low, the processor branches to the location of the on-chip boot
loader program.
If BOOT is high, the processor begins program execution at the address
pointed to by the reset vector at address 0000h in program memory.
Memory and I/O Spaces
pin:
4-17
Boot Loader
4.5.5Boot Loader Execution
Once the EPROM has been programmed and installed, and the boot loader
has been enabled, the processor automatically boots the program from
EPROM at startup. If you need to reboot the processor during operation, bring
the RS
When the processor executes the boot loader, the program first enables the
full 32K words of global data memory by setting the eight LSBs of the GREG
register to 80h. Next, the boot loader copies your program from the EPROM
in global data space to the RAM in program space through a five step process
(refer to Figure 4–10):
1) The boot loader loads the first two bytes from the EPROM and uses this
2) The boot loader loads the next two bytes to determine the length of the
3) The boot loader transfers the next two bytes. It loads the high byte first and
pin low to cause a hardware reset.
word as the destination address for the code. (In Figure 4–10, the
destination is 0000h.)
code.
the low byte second, combines the two bytes into one word, stores the new
word in the destination memory location, and then increments the source
and destination addresses.
4-18
4) The boot loader checks to see if the end of the program has been reached:
J
If the end is reached, the boot loader goes on to step 5.
J
If the end is not reached, the boot loader repeats steps 3 and 4.
5) The boot loader disables the entire global memory and then forces a
branch to the reset vector at address 0000h in program memory . Once the
boot loader finishes operation, the processor switches the on-chip boot
loader out of the memory map.
Note:
During the boot load, data is read using the low-order eight data lines
(D7–D0). The upper eight data lines are not used by the boot loader code.
Boot Loader
Figure 4–10. Program Code Transferred From 8-Bit EPROM to 16-Bit RAM
8-Bit EPROM16-Bit RAM
Address 70Address 158 70
8000hDestination
8001hDestinationl = 00h•Word2
8002hLength N
8003hLength N
8004hWord1
8005hWord1
8006hWord2
8007hWord2
••
••
••
nnnEhWordn
nnnFhWordn
= 00h0000hWord1
h
h
l
h
l
h
l
h
l
••.•
•••
nnnEh••
nnnFhWordn
h
h
h
Word1
Word2
Wordn
l
l
l
The ’C2xx fetches its interrupt vectors from program-memory locations
0000h–003Fh (the reset vector is fetched from 0000h). Make sure that the interrupt vectors are stored at the top of the EPROM, so that they will be transferred to addresses 0000h–003Fh in the RAM (see Figure 4–1 1). Each interrupt vector is a branch instruction, which requires four 8-bit words, and there
is space for 32 interrupt vectors. Therefore, the first 128 words to be transferred from the EPROM should be the interrupt vectors.
Memory and I/O Spaces
4-19
Boot Loader
Figure 4–11.Interrupt Vectors Transferred First During Boot Load
8000h
8001h
8002h
8003h
8004h
8083h
8084h
nnnFh
8-bit EPROM
in global data memory
Destination
Destination
Length N
Length N
(00)
h
(00)
l
h
l
Interrupt vectors
Program code
16-bit RAM
in program memory
0000h
Interrupt vectors
003Fh
0040h
Program code
nnnFh
4-20
Boot Loader
4.5.6Boot Loader Program
*********************************************************************************
* TMS320C2xx Boot Loader Program *
* *
* This code sets up and executes boot loader code that loads program *
* code from location 8000h in external global data space and transfers it *
* to the destination address specified by the first word read from locations *
* 8000h and 8001h. *
*********************************************************************************
.length 60
GREG.set5h; The GREG Register
SRC.set8000h; Source address
DEST.set60h; Destination address
LENGTH.set61h; Code length
TEMP.set62h; Temporary storage
HBYTE.set63h; Temporary storage for upper half of 16–bit word
CODEWORD .set64h; Hold program code word
.sect”bootload”
*
* Initialization
*
BOOTLDP#0; Set the data page to 0 (load DP with 0)
LACC*+,8; Load ACC with high byte shifted left by 8 bits
SACLHBYTE; Store high byte
LACL*+; Load ACC with low byte of destination
AND#0FFH; Mask off upper 24 bits.
ORHBYTE; OR ACC with high byte to form 16-bit
; destination address
SACLDEST; Store destination address
*
* Determine length of code to be transferred
*
LENLACC*+,8; Load ACC with high byte shifted left by 8 bits
SACLHBYTE; Store high byte
LACL*+; Load ACC with low byte of length
AND#0FFH; Mask off upper 24 bits.
ORHBYTE; OR ACC with high byte to form 16-bit length
SACLLENGTH; Store length
LARAR0,LENGTH; Load AR0 with length to be used for BANZ
Memory and I/O Spaces
4-21
Boot Loader
*
* Transfer code
*
LOOPLACC*+,8; Load ACC with high byte of code shifted by 8 bits
SACLHBYTE; Store high byte
LACL*+,AR0; Load ACC with low byte of code
AND#0FFH; Mask off upper 24 bits
ORHBYTE; OR ACC with high byte to form 16-bit code word
SACLCODEWORD; Store code word
LACLDEST; Load destination address
TBLWCODEWORD; Transfer code to destination address
ADD#1; Add 1 to destination address
SACLDEST; Save new address
BANZLOOP,AR1; Determine if end of code is reached
SPLK#0,GREG; Disable entire global memory
INTR0; Branch to reset vector and execute code.
.END
Note:
The INTR instruction in the boot loader program causes the processor to
push a return address onto the stack, but the device does not use a RET to
return to this address. Therefore, your program must execute a POP
instruction to get the address off the stack.
4-22
4.6I/O Space
The ’C2xx supports an I/O address range of 64K 16-bit words. Figure 4–12
shows the ’C2xx I/O address map.
Figure 4–12. I/O Address Map for the ’C2xx
0000h
I/O Space
’C2xx I/O
External
On-chip space
FEFFh
FF00h
FF0Fh
FF10h
FFFFh
Reserved for
test/emulation
I/O-mapped
registers and
reserved addresses
Memory and I/O Spaces
4-23
I/O Space
The map has three main sections of addresses:
-
Addresses 0000h–FEFFh allow access to off-chip peripherals typically
used in DSP applications, such as digital-to-analog and analog-to-digital
converters.
-
Addresses FF00h–FF0Fh are mapped to on-chip I/O space. These addresses are reserved for test purposes and should not be used.
-
Addresses FF10h–FFFFh are also mapped to on-chip I/O space. These
addresses are used for other reserved space and for the on-chip I/Omapped registers. For ’C2xx devices other than the ’C209, T able 4–4 lists
the registers mapped to on-chip I/O space. For the I/O-mapped registers
on the ’C209, see Section 11.2, on page 11-5.
Do Not Write to Reserved Addresses
T o avoid unpredictable operation of the processor, do not write to
I/O addresses FF00h–FF0Fh or any reserved I/O address in the
range FF10–FFFFh (that is, any address not designated for an
on-chip peripheral.)
Table 4–4. On-Chip Registers Mapped to I/O Space
I/O Address NameDescription
FFE8hCLKCLK register
FFEChICRInterrupt control register
FFF0hSDTRSynchronous serial port transmit and receive register
FFF1hSSPCRSynchronous serial port control register
FFF4hADTRAsynchronous serial port transmit and receive register
FFF5hASPCRAsynchronous serial port control register
FFF6hIOSRInput/output status register
FFF7hBRDBaud rate divisor register
FFF8hTCRTimer control register
FFF9hPRDTimer period register
FFFAhTIMTimer counter register
FFFChWSGRWait-state generator control register
4-24
Note:This table does not apply to the ’C209. For the I/O-mapped registers on the ’C209,
see Section 11.2 on page 11-5.
4.6.1Accessing I/O Space
All I/O words (external I/O ports and on-chip I/O registers) are accessed with
the IN and OUT instructions. Accesses to external parallel I/O ports are multiplexed over the same address and data buses for program and data-memory
accesses. These accesses are distinguished from external program and datamemory accesses by IS
you use 8-bit peripherals, you can use either the higher or lower eight lines of
the data bus to suit a particular application.
I/O Space
going low. The data bus is 16 bits wide; however, if
Y ou can use RD
an external peripheral. You can also use the WE
with chip-select logic to generate an output-enable signal for
signal with chip-select logic
to generate a write-enable signal for an external peripheral. As an example of
interfacing to external I/O space, Figure 4–13 shows interface circuitry for
eight input bits and eight output bits. Note that the decode section is simplified
if fewer I/O ports are used.
Memory and I/O Spaces
4-25
I/O Space
Figure 4–13. I/O Port Interface Circuitry
A0
A1
A2
A3
’C2xx DSP
1
2
3
6
5 V
4
5
I/O port address decoder
A
B
C
G1
G2A
G2B
74AC138
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
15
14
13
12
11
10
9
7
Port 0
Port 1
Port 2
Port 3
Port 4
Port 5
Port 6
Port 7
D0
D1
D2
D3
D4
D5
D6
D7
WE
18
1Y1
16
1Y2
14
1Y3
12
1Y4
9
2Y1
7
2Y2
5
2Y3
3
2Y4
IS
5 V
74AC244
8-bit input port at
I/O address 0000h
3
D1
4
D2
7
D3
8
D4
13
D5
14
D6
17
D7
18
D8
11
CLK
1
CLR
74AC273
8-bit output latch
at I/O address 0001h
1A1
1A2
1A3
1A4
2A1
2A2
2A3
2A4
1G
2G
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Q8
2
4
6
8
11
13
15
17
2
5
6
9
12
15
16
19
1
19
Input bit 0
Input bit 1
Input bit 2
Input bit 3
Input bit 4
Input bit 5
Input bit 6
Input bit 7
Output bit 0
Output bit 1
Output bit 2
Output bit 3
Output bit 4
Output bit 5
Output bit 6
Output bit 7
4-26
Direct Memory Access Using the HOLD Operation
4.7Direct Memory Access Using the HOLD Operation
The ’C2xx HOLD operation allows direct-memory access to external program,
data, and I/O spaces. The process is controlled by two signals:
-
HOLD. An external device can drive the HOLD/INT1 pin low to request
control over the external buses. If the HOLD/INT1 interrupt line is enabled,
this triggers an interrupt.
-
HOLDA. In response to a HOLD interrupt, software logic can cause the
processor to issue a HOLD
it is relinquishing control of its external lines. Upon HOLDA
address signals (A15–A0), data signals (D15–D0), and memory-control
signals (PS
, DS, BR, IS, STRB, R/W, RD, WE) are placed in high imped-
ance.
Following a negative edge on the HOLD/INT1 pin, if interrupt line HOLD/INT1
is enabled, the CPU branches to address 0002h (this branch could also be accomplished with an INTR 1 instruction). Here the CPU fetches the interrupt
vector and follows it to the interrupt service routine. If you wish to use this routine for HOLD operations and also for the interrupt INT1
by this routine will depend on the value of the MODE bit:
acknowledge (HOLDA pin low), to indicate that
, the external
, the tasks carried out
-
MODE = 1. When the CPU detects a negative edge on HOLD/INT1, it
finishes executing the current instruction (or repeat operation) and then
forces program control to the interrupt service routine. The interrupt service routine, after successfully testing for MODE = 1, performs the tasks
for INT1
-
MODE = 0. Interrupt line INT1 is both negative- and positive-edge sensi-
.
tive. When the CPU detects the negative edge, it finishes executing the
current instruction (or repeat operation) and then forces program control
to the interrupt service routine. This routine, after successfully testing for
MODE = 0, executes an IDLE instruction. Upon IDLE, HOLDA
is asserted
and the external lines are placed in high impedance. Only after detecting
a rising edge on the HOLD
deasserts HOLDA
, and returns the external lines to their normal states.
/INT1 pin, the CPU exits the IDLE state,
Example 4–1 shows an interrupt service routine that tests the MODE bit and
acts accordingly . Note that the IDLE instruction should be placed inside the interrupt service routine to issue HOLDA
code disables all maskable interrupts except HOLD
ery of HOLDA
and the buses. Any other sequence of CPU code will cause un-
. Also note that the interrupt program
/INT1 to allow safe recov-
desirable bus control and is not recommended. (Interrupt operation is explained in detail in Section 5.6 on page 5-15.)
Memory and I/O Spaces
4-27
Direct Memory Access Using the HOLD Operation
Example 4–1. An Interrupt Service Routine Supporting INT1 and HOLD
ICR.set0FFECh;Define interrupt control register in I/O space.
ICRSHDW.set060h;Define ICRSHDW in scratch pad location.
* Interrupt vectors *
resetBmain;0 – reset , Branch to main program on reset.
*********Interrupt service routine for HOLD logic*****************************
int1_hold:
.mmregs;Include c2xx memory–mapped registers.
.space 40*16;Fill 0000 between vectors and main program.
CLRCINTM
; Perform any desired context save.
LDP#0;Set data–memory page to 0.
INICRSHDW, ICR ;Save the contents of ICR register.
LACL#010h;Load accumulator (ACC) with mask for MODE bit.
ANDICRSHDW;Filter out all bits except MODE bit.
BCNDint1, neq;Branch if MODE bit is 1, else in HOLD mode.
LACCimr, 0;Load ACC with interrupt mask register.
SPLK#1, imr;Mask all interrupts except interrupt1/HOLD.
IDLE;Enter HOLD mode. Issues HOLDA, and puts
;buses in high impedance. Wait until
;rising edge is seen on HOLD/INT1 pin.
SPLK#1, ifr;Clear HOLD/INT1 flag in interrupt flag register
int1:NOP;Replace these NOPs with desired int1 interrupt
4-28
NOP;service routine.
; Perform necessary context restore.
CLRCINTM;Enable all interrupts.
RET;Return from interrupts.
Direct Memory Access Using the HOLD Operation
Here are three valid methods for exiting the IDLE state, thus deasserting
HOLDA
-
-
-
and restoring the buses to normal operation:
Cause a rising edge on the HOLD/INT1 pin when MODE = 0.
Assert system reset at the reset pin.
Assert the nonmaskable interrupt NMI at the NMI pin.
If reset or NMI
occurs while HOLDA is asserted, the CPU will deassert HOLDA
regardless of the level on the HOLD/INT1 pin. Therefore, to avoid further conflicts in bus control, the system hardware logic should restore HOLD
state.
4.7.1HOLD During Reset
The HOLD logic can be used to put the buses in a high-impedance state at
power-on or reset. This feature is useful in extending the DSP memory control
to external processors. If HOLD
tion occurs internally , but HOLDA
is driven low during reset, normal reset opera-
will be asserted, placing all buses and control lines in a high-impedance state. Upon release of both HOLD
execution starts from program location 0000h.
Either of the following conditions will cause the processor to deassert HOLDA
and return the buses to a normal state:
-
HOLD is deasserted before reset is deasserted. See Figure 4–14. This
is the normal recovery condition after a HOLD operation. After the HOLD
signal goes high, the HOLDA signal will be deasserted, and the buses will
assume normal states.
Figure 4–14. HOLD Deasserted Before Reset Deasserted
to a high
and RS,
RS
HOLD
HOLDA
-
Reset is deasserted before HOLD is deasserted. See Figure 4–15. The
CPU will deassert HOLDA
regardless of the HOLD signal after the 16 clock
cycles required for normal reset operation. Along with the HOLDA
the buses will assume normal states. The external system hardware logic
should restore the HOLD
signal to a high state to avoid conflicts in HOLD
logic.
Memory and I/O Spaces
signal,
4-29
Direct Memory Access Using the HOLD Operation
Direct Memory Access Using the HOLD Operation
Figure 4–15. Reset Deasserted Before HOLD Deasserted
RS
HOLD
HOLDA
4-30
4.8Device-Specific Information
For ’C2xx devices other than the ’C209, this section mentions the presence
or absence of the boot loader and HOLD features, shows address maps, and
explains the contents and configuration of the program-memory and datamemory maps. For details about the memory and I/O spaces of the ’C209, see
Section 11.2 on page 11-5.
4.8.1TMS320C203 Address Maps and Memory Configuration
The ’C203 has a ’C2xx on-chip boot loader and supports the ’C2xx HOLD
operation. Figure 4–16 shows the ’C203 address map.
The on-chip program and data memory available on the ’C203 consists of:
-
DARAM B0 (256 words, for program or data memory)
-
DARAM B1 (256 words, for data memory)
-
DARAM B2 (32 words, for data memory)
Device-Specific Information
Memory and I/O Spaces
4-31
Device-Specific Information
Figure 4–16. ’C203 Address Map
’C203 I/O
0000h
003Fh
’C203 Program’C203 Data
Interrupts (external)
0000h
Memory-mapped
registers and
005Fh
0060h
007Fh
reserved addresses
On-chip
DARAM B2
0000h
0080h
Reserved
External
01FFh
0200h
02FFh
0300h
03FFh
On-chip DARAM
‡
B0
(CNF = 0);
Reserved (CNF = 1)
On-chip
DARAM B1
§
External
0400h
Reserved
07FFh
0800h
External
FDFFh
FE00h
Reserved (CNF = 1);
7FFFh
8000h
External (CNF = 0)
FEFFh
FF00h
FFFFh
†
When CNF = 1, addresses FE00h–FEFFh and FF00h–FFFFh are mapped to the same physical block (B0) in program-memory
space. For example, a write to FE00h will have the same effect as a write to FF00h. For simplicity , addresses FE00h–FEFFh
are referred to here as reserved when CNF = 1.
‡
When CNF = 0, addresses 0100h–01FFh and 0200h–02FFh are mapped to the same physical block (B0) in data-memory
space. For example, a write to 0100h will have the same effect as a write to 0200h. For simplicity , addresses 0100h–01FFh are
referred to here as reserved.
§
Addresses 0300h–03FFh and 0400h–04FFh are mapped to the same physical block (B1) in data-memory space. For example,
a write to 0400h has the same effect as a write to 0300h. For simplicity, addresses 0400h–04FFh are referred to here as
reserved.
On-chip DARAM
†
B0
(CNF = 1);
External (CNF = 0)
FFFFh
External
(local and/or global)
FEFFh
FF00h
FF0Fh
FF10h
FFFFh
Reserved for
test/emulation
I/O-mapped
registers and
reserved addresses
4-32
Device-Specific Information
DARAM blocks B1 and B2 are fixed, but DARAM block B0 may be mapped to
program space or data space, depending on the value of the CNF bit (bit 12
of status register ST1):
-
CNF = 0. B0 is mapped to data space and is accessible at data addresses
0200h–02FFh. Note that the addressable external
program
memory in-
creases by 512 words.
-
CNF = 1. B0 is mapped to program space and is accessible at program
addresses FF00h–FFFFh.
At reset, CNF = 0.
Table 4–5 shows the program-memory options for the ’C203; Table 4–6 lists
the data-memory options. Note these facts:
-
Program-memory addresses 0000h–003Fh are used for the interrupt
vectors.
-
Data-memory addresses 0000h–005Fh contain on-chip memory-mapped
registers and reserved memory.
-
Two other on-chip data-memory ranges are always reserved:
0080h–01FFh and 0400h–07FFh.
Do Not Write to Reserved Addresses
T o avoid unpredictable operation of the processor, do not write to
any addresses labeled Reserved. This includes any data-memory
address in the range 0000h–005Fh that is not designated for an
on-chip register and any I/O address in the range FF00h–FFFFh
that is not designated for an on-chip register.
4.8.2TMS320C204 Address Maps and Memory Configuration
The ’C204 does not have an on-chip boot loader, but it does support the ’C2xx
HOLD operation. Figure 4–16 shows the ’C204 address map. The on-chip
program and data memory available on the ’C204 consists of:
-
ROM (4K words, for program memory)
-
DARAM B0 (256 words, for program or data memory)
-
DARAM B1 (256 words, for data memory)
-
DARAM B2 (32 words, for data memory)
External
(hex)
Reserved
(hex)
0080–01FF
0400–07FF
0080–02FF
0400–07FF
4-34
Figure 4–17. ’C204 Address Map
Device-Specific Information
’C204 I/O
External
0000h
003Fh
1000h
0FFFh
’C204 Program’C204 Data
Interrupts (on-chip)
= 0)
(MP/MC
Interrupts (external)
(MP/MC
= 1)
On-chip ROM
(MP/MC
= 0)
External
(MP/MC
= 1)
0000h
005Fh
0060h
007Fh
0080h
Memory-mapped
registers and
reserved addresses
On-chip
DARAM B2
Reserved
01FFh
External
0200h
02FFh
0300h
03FFh
On-chip DARAM
‡
B0
(CNF = 0);
Reserved (CNF = 1)
On-chip
DARAM B1
0000h
§
0400h
Reserved
07FFh
0800h
FDFFh
FE00h
Reserved (CNF = 1);
External (CNF = 0)
FEFFh
FF00h
FFFFh
†
When CNF = 1, addresses FE00h–FEFFh and FF00h–FFFFh are mapped to the same physical block (B0) in program-memory
space. For example, a write to FE00h will have the same effect as a write to FF00h. For simplicity , addresses FE00h–FEFFh
are referred to here as reserved when CNF = 1.
‡
When CNF = 0, addresses 0100h–01FFh and 0200h–02FFh are mapped to the same physical block (B0) in data-memory
space. For example, a write to 0100h will have the same effect as a write to 0200h. For simplicity , addresses 0100h–01FFh are
referred to here as reserved.
§
Addresses 0300h–03FFh and 0400h–04FFh are mapped to the same physical block (B1) in data-memory space. For example,
a write to 0400h has the same effect as a write to 0300h. For simplicity, addresses 0400h–04FFh are referred to here as
reserved.
On-chip DARAM
†
B0
(CNF = 1);
External (CNF = 0)
7FFFh
8000h
External
(local and/or global)
FFFFh
External
FEFFh
FF00h
FF0Fh
FF10h
FFFFh
Reserved for
test/emulation
I/O-mapped
registers and
reserved addresses
Memory and I/O Spaces
4-35
Device-Specific Information
Y ou select or deselect the ROM by changing the level on the MP/MC pin at reset:
-
MP/MC = 0 at reset. The device is configured as a microcomputer. The
on-chip ROM is enabled and is accessible at addresses 0000h–0FFFh.
The device fetches the reset vector from on-chip ROM.
-
MP/MC = 1 at reset. The device is configured as a microprocessor, and
addresses 0000h–0FFFh are used to access external memory. The device fetches the reset vector from external memory.
Regardless of the value of MP/MC
, the ’C2xx fetches its reset vector at location
0000h of program memory.
DARAM blocks B1 and B2 are fixed, but DARAM block B0 may be mapped to
program space or data space, depending on the value of the CNF bit (bit 12
of status register ST1):
-
CNF = 0. B0 is mapped to data space and is accessible at data addresses
0200h–02FFh. Note that the addressable external
program
memory in-
creases by 512 words.
-
CNF = 1. B0 is mapped to program space and is accessible at program
addresses FF00h–FFFFh.
At reset, CNF = 0.
Table 4–7 lists the available program memory configurations for the ’C204;
Table 4–8 lists the data-memory configurations. Note these facts:
-
Program-memory addresses 0000h–003Fh are used for the interrupt
Two other on-chip data-memory ranges are always reserved:
0080h–01FFh and 0400h–07FFh.
4-36
Do Not Write to Reserved Addresses
T o avoid unpredictable operation of the processor, do not write to
any addresses labeled Reserved. This includes any data-memory
address in the range 0000h–005Fh that is not designated for an
on-chip register and any I/O address in the range FF00h–FFFFh
that is not designated for an on-chip register.
This chapter discusses the processes and features involved in controlling the
flow of a program on the ’C2xx.
Program control involves controlling the order in which one or more blocks of
instructions are executed. Normally, the flow of a program is sequential: the
’C2xx executes instructions at consecutive program-memory addresses. At
times, a program must branch to a nonsequential address and then execute
instructions sequentially at that new location. For this purpose, the ’C2xx supports branches, calls, returns, repeats, and interrupts.
The ’C2xx also provides a power-down mode, which halts internal program
flow and temporarily lowers the power requirements of the ’C2xx.