TMS320C54 Details
TMS320C54 Details
TMS320C54 Details
Reference Set
Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265
This user’s guide contains limited information about the enhanced peripherals
available on some C54x devices. For detailed information on the enhanced
peripherals, see TMS320C54x DSP Enhanced Peripherals Reference Guide,
literature number SPRU302.
SPRU131G iii
How to Use This Manual
Notational Conventions
This book uses the following conventions.
- The TMS320C54x DSP can use either of two forms of the instruction set:
a mnemonic form or an algebraic form. This book uses the mnemonic form
of the instruction set. For information about the mnemonic form of the
instruction set, see TMS320C54x DSP Reference Set, Volume 2:
Mnemonic Instruction Set, literature number SPRU172. For information
about the algebraic form of the instruction set, see TMS320C54x DSP
Reference Set, Volume 3: Algebraic Instruction Set, literature number
SPRU179.
The information in a caution is provided for your protection. Please read each
caution carefully.
The following books describe the TMS320C54x DSP and related support
tools. To obtain a copy of any of these TI documents, call the Texas Instru-
ments Literature Response Center at (800) 477-8924. When ordering, please
identify the book by its title and literature number. Many of these documents
are located on the internet at http://www.ti.com.
Technical Articles
A wide variety of related documentation is available on digital signal processing.
These references fall into one of the following application categories:
- General-Purpose DSP
- Graphics/Imagery
- Speech/Voice
- Control
- Multimedia
- Military
- Telecommunications
- Automotive
- Consumer
- Medical
- Development Support
General-Purpose DSP:
1) Chassaing, R., Horning, D.W., “Digital Signal Processing with Fixed and
Floating-Point Processors” , CoED, USA, Volume 1, Number 1, pages 1-4,
March 1991.
2) Defatta, David J., Joseph G. Lucas, and William S. Hodgkiss, Digital Sig-
nal Processing: A System Design Approach, New York: John Wiley, 1988.
3) Erskine, C., and S. Magar, “Architecture and Applications of a Second-
Generation Digital Signal Processor,” Proceedings of IEEE International
Conference on Acoustics, Speech, and Signal Processing, USA, 1985.
4) Essig, D., C. Erskine, E. Caudel, and S. Magar, “A Second-Generation
Digital Signal Processor,” IEEE Journal of Solid-State Circuits, USA, Vol-
ume SC-21, Number 1, pages 86-91, February 1986.
7) Jackson, Leland B., Digital Filters and Signal Processing, Hingham, MA:
Kluwer Academic Publishers, 1986.
8) Jones, D.L., and T.W. Parks, A Digital Signal Processing Laboratory Using
the TMS32010, Englewood Cliffs, NJ: Prentice-Hall, Inc., 1987.
9) Lim, Jae, and Alan V. Oppenheim, Advanced Topics in Signal Processing,
Englewood Cliffs, NJ: Prentice- Hall, Inc., 1988.
10) Lin, K., G. Frantz, and R. Simar, Jr., “The TMS320 Family of Digital Signal
Processors,” Proceedings of the IEEE, USA, Volume 75, Number 9, pages
1143-1159, September 1987.
11) Lovrich, A., Reimer, J., “An Advanced Audio Signal Processor” , Digest of
Technical Papers for 1991 International Conference on Consumer Elec-
tronics, June 1991.
12) Magar, S., D. Essig, E. Caudel, S. Marshall and R. Peters, “An NMOS Digi-
tal Signal Processor with Multiprocessing Capability,” Digest of IEEE Inter-
national Solid-State Circuits Conference, USA, February 1985.
13) Oppenheim, Alan V., and R.W. Schafer, Digital Signal Processing, Engle-
wood Cliffs, NJ: Prentice-Hall, Inc., 1975 and 1988.
14) Papamichalis, P.E., and C.S. Burrus, “Conversion of Digit-Reversed to Bit-
Reversed Order in FFT Algorithms,” Proceedings of ICASSP 89, USA,
pages 984-987, May 1989.
15) Papamichalis, P., and R. Simar, Jr., “The TMS320C30 Floating-Point Digi-
tal Signal Processor,” IEEE Micro Magazine, USA, pages 13-29, Decem-
ber 1988.
16) Papamichalis, P.E., “FFT Implementation on the TMS320C30,” Proceed-
ings of ICASSP 88, USA, Volume D, page 1399, April 1988.
17) Parks, T.W., and C.S. Burrus, Digital Filter Design, New York, NY: John Wiley
and Sons, Inc., 1987.
18) Peterson, C., Zervakis, M., Shehadeh, N., “Adaptive Filter Design and
Implementation Using the TMS320C25 Microprocessor” , Computers in
Education Journal, USA, Volume 3, Number 3, pages 12-16, July-Sep-
tember 1993.
19) Prado, J., and R. Alcantara, “A Fast Square-Rooting Algorithm Using a
Digital Signal Processor,” Proceedings of IEEE, USA, Volume 75, Number
2, pages 262-264, February 1987.
20) Rabiner, L.R. and B. Gold, Theory and Applications of Digital Signal Pro-
cessing, Englewood Cliffs, NJ: Prentice-Hall, Inc., 1975.
21) Simar, Jr., R., and A. Davis, “The Application of High-Level Languages to
Single-Chip Digital Signal Processors,” Proceedings of ICASSP 88, USA,
Volume D, page 1678, April 1988.
22) Simar, Jr., R., T. Leigh, P. Koeppen, J. Leach, J. Potts, and D. Blalock, “A
40 MFLOPS Digital Signal Processor: the First Supercomputer on a Chip,”
Proceedings of ICASSP 87, USA, Catalog Number 87CH2396-0, Volume 1,
pages 535-538, April 1987.
23) Simar, Jr., R., and J. Reimer, “The TMS320C25: a 100 ns CMOS VLSI Digi-
tal Signal Processor,” 1986 Workshop on Applications of Signal Processing
to Audio and Acoustics, September 1986.
24) Texas Instruments, Digital Signal Processing Applications with the TMS320
Family, 1986; Englewood Cliffs, NJ: Prentice-Hall, Inc., 1987.
25) Treichler, J.R., C.R. Johnson, Jr., and M.G. Larimore, A Practical Guide
to Adaptive Filter Design, New York, NY: John Wiley and Sons, Inc., 1987.
Graphics/Imagery:
1) Reimer, J., and A. Lovrich, “Graphics with the TMS32020,” WESCON/85
Conference Record, USA, 1985.
Speech/Voice:
1) DellaMorte, J., and P. Papamichalis, “Full-Duplex Real-Time Implementa-
tion of the FED-STD-1015 LPC-10e Standard V.52 on the TMS320C25,”
Proceedings of SPEECH TECH 89, pages 218-221, May 1989.
2) Gray, A.H., and J.D. Markel, Linear Prediction of Speech, New York, NY:
Springer-Verlag, 1976.
3) Frantz, G.A., and K.S. Lin, “A Low-Cost Speech System Using the
TMS320C17,” Proceedings of SPEECH TECH ’87, pages 25-29, April
1987.
4) Papamichalis, P., and D. Lively, “Implementation of the DOD Standard
LPC-10/52E on the TMS320C25,” Proceedings of SPEECH TECH ’87,
pages 201-204, April 1987.
5) Papamichalis, Panos, Practical Approaches to Speech Coding, Engle-
wood Cliffs, NJ: Prentice-Hall, Inc., 1987.
6) Pawate, B.I., and G.R. Doddington, “Implementation of a Hidden Markov
Model-Based Layered Grammar Recognizer,” Proceedings of ICASSP
89, USA, pages 801- 804, May 1989.
7) Rabiner, L.R., and R.W. Schafer, Digital Processing of Speech Signals,
Englewood Cliffs, NJ: Prentice-Hall, Inc., 1978.
8) Reimer, J.B. and K.S. Lin, “TMS320 Digital Signal Processors in Speech
Applications,” Proceedings of SPEECH TECH ’88, April 1988.
9) Reimer, J.B., M.L. McMahan, and W.W. Anderson, “Speech Recognition
for a Low-Cost System Using a DSP,” Digest of Technical Papers for 1987
International Conference on Consumer Electronics, June 1987.
Control:
1) Ahmed, I., “16-Bit DSP Microcontroller Fits Motion Control System Applica-
tion,” PCIM, October 1988.
2) Ahmed, I., “Implementation of Self Tuning Regulators with TMS320 Family
of Digital Signal Processors,” MOTORCON ’88, pages 248-262, Septem-
ber 1988.
3) Allen, C. and P. Pillay, “TMS320 Design for Vector and Current Control of
AC Motor Drives” , Electronics Letters, UK, Volume 28, Number 23, pages
2188-2190, November 1992.
11) Ahmed, I., and S. Lindquist, “Digital Signal Processors: Simplifying High-
Performance Control,” Machine Design, September 1987.
Multimedia:
1) Reimer, J., “DSP-Based Multimedia Solutions Lead Way Enhancing
Audio Compression Performance” , Dr. Dobbs Journal, December 1993.
2) Reimer, J., G. Benbassat, and W. Bonneau Jr., “Application Processors:
Making PC Multimedia Happen” , Silicon Valley PC Design Conference,
July 1991.
Military:
Telecommunications:
1) Ahmed, I., and A. Lovrich, “Adaptive Line Enhancer Using the
TMS320C25,” Conference Records of Northcon/86, USA, 14/3/1-10,
September/October 1986.
3) Reimer, J.B., P.E. Nixon, E.B. Boles, and G.A. Frantz, “Audio Customiza-
tion of a DSP IC,” Digest of Technical Papers for 1988 International Con-
ference on Consumer Electronics, June 8-10 1988.
Medical:
Development Support:
Trademarks
TMS320, TMS320C2x, TMS320C20x, TMS320C24x, TMS320C5x,
TMS320C54x, C54x, 320 Hotline On-line, Micro Star, TI, XDS510, and
XDS510WS are trademarks of Texas Instruments.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Summarizes the features of the TMS320 family of products and presents typical applications.
Describes the TMS320C54x DSP and lists its key features.
1.1 TMS320 DSP Family Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.1.1 History, Development, and Advantages of TMS320 DSPs . . . . . . . . . . . . . . . . . 1-2
1.1.2 Typical Applications for the TMS320 DSP Family . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.2 TMS320C54x DSP Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.3 TMS320C54x DSP Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
2 Architectural Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Summarizes the TMS320C54x DSP architecture. Provides general information about the CPU,
bus structures, internal memory organization, on-chip peripherals, and scanning logic.
2.1 Bus Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.2 Internal Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.2.1 On-Chip ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.2.2 On-Chip Dual-Access RAM (DARAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.2.3 On-Chip Single-Access RAM (SARAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.2.4 On-Chip Two-Way Shared RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.2.5 On-Chip Memory Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.2.6 Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2.3 Central Processing Unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
2.3.1 Arithmetic Logic Unit (ALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
2.3.2 Accumulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
2.3.3 Barrel Shifter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.3.4 Multiplier/Adder Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.3.5 Compare, Select, and Store Unit (CSSU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.4 Data Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.5 Program Memory Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2.6 Pipeline Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2.7 On-Chip Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
2.7.1 General-Purpose I/O Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
2.7.2 Software-Programmable Wait-State Generator . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
2.7.3 Programmable Bank-Switching Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
2.7.4 Hardware Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
2.7.5 Clock Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
2.7.6 Direct Memory Access (DMA) Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2.7.7 Host Port Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
xv
Contents
3 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Describes the TMS320C54x DSP memory configuration and operation. Includes memory
maps and descriptions of program memory, data memory, and I/O space. Also includes
descriptions of the CPU memory-mapped registers.
3.1 Memory Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
3.2.1 Program Memory Configurability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
3.2.2 On-Chip ROM Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
3.2.3 Program Memory Address Map and On-Chip ROM Contents . . . . . . . . . . . . . 3-18
3.2.4 On-Chip ROM Code Contents and Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
3.2.5 Extended Program Memory (Available on C548/549/5402/5410/5420) . . . . . 3-20
3.3 Data Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
3.3.1 Data Memory Configurability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
3.3.2 On-Chip RAM Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
3.3.3 Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
3.3.4 CPU Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
3.4 I/O Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29
3.5 Program and Data Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
7 Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
Describes the TMS320C54x DSP pipeline operation and lists the pipeline latency cycles for
these types of latencies.
7.1 Pipeline Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.1.1 Branch Instructions in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
7.1.2 Call Instructions in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
7.1.3 Return Instructions in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
7.1.4 Conditional Execute Instructions in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . 7-19
7.1.5 Conditional-Call and Conditional-Branch Instructions in the Pipeline . . . . . . . 7-20
7.2 Interrupts and the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
7.3 Dual-Access Memory and the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27
7.3.1 Resolved Conflict Between Instruction Fetch and Operand Read . . . . . . . . . 7-29
7.3.2 Resolved Conflict Between Operand Write and Dual-Operand Read . . . . . . 7-30
7.3.3 Resolved Conflict Among Operand Write, Operand Write, and
Dual-Operand Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
xx Contents SPRU131G
Contents
D Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Defines terms and abbreviations used throughout this book.
Figures
1–1 Evolution of the TMS320 DSP Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
2–1 Block Diagram of TMS320C54x DSP Internal Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
3–1 Memory Maps for the C541 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3–2 Memory Maps for the C542 and C543 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
3–3 Memory Maps for the C545 and C546 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3–4 Memory Maps for the C548 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3–5 Memory Maps for the C549 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3–6 Extended Program Memory Maps for the C548 and C549 . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
3–7 Memory Maps for the C5402 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
3–8 Extended Program Memory for the C5402 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3–9 Memory Maps for the C5410 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
3–10 Extended Program Memory Maps for the C5410
(On-chip RAM Not Mapped in Program Space and Data Space, OVLY = 0) . . . . . . . . . . 3-12
3–11 Extended Program Memory Maps for the C5410
(On-chip RAM Mapped in Program Space and Data Space, OVLY = 1) . . . . . . . . . . . . . 3-12
3–12 Data Memory Map for the C5420 Relative to CPU Subsystems A and B . . . . . . . . . . . . . 3-13
3–13 Program Memory Maps for the C5420 Relative to CPU Subsystems A and B . . . . . . . . 3-14
3–14 On-Chip ROM Block Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
3–15 On-Chip ROM Program Memory Map (High Addresses) . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
3–16 Extended Program Memory With On-Chip RAM Not Mapped
in Program Space (OVLY = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
3–17 Extended Program Memory With On-Chip RAM Mapped in Program Space
and Data Space (OVLY = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
3–18 On-Chip RAM Block Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
3–19 On-Chip RAM Block Organization (C5402/C5410/C5420) . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
4–1 Status Register 0 (ST0) Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4–2 Status Register 1 (ST1) Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4–3 Processor Mode Status Register (PMST) Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4–4 ALU Functional Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
4–5 Accumulator A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
4–6 Accumulator B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
4–7 Barrel Shifter Functional Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
4–8 Multiplier/Adder Functional Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
4–9 Compare, Select, and Store Unit (CSSU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
4–10 Viterbi Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
4–11 Exponent Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
9–7 Burst Mode Serial Port Transmit Operation With Delayed Frame Sync
in External Frame Sync Mode (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
9–8 Burst Mode Serial Port Transmit Operation With Delayed Frame Sync
in External Frame Sync Mode (BSP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21
9–9 Burst Mode Serial Port Receive Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21
9–10 Burst Mode Serial Port Receive Overrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-22
9–11 Serial Port Receive With Long FSR Pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-23
9–12 Burst Mode Serial Port Transmit at Maximum Packet Frequency . . . . . . . . . . . . . . . . . . . 9-23
9–13 Burst Mode Serial Port Receive at Maximum Packet Frequency . . . . . . . . . . . . . . . . . . . . 9-24
9–14 Continuous Mode Serial Port Transmit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
9–15 Continuous Mode Serial Port Receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26
9–16 SP Receiver Functional Operation (Burst Mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27
9–17 BSP Receiver Functional Operation (Burst Mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-28
9–18 SP/BSP Transmitter Functional Operation (Burst Mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-29
9–19 SP/BSP Receiver Functional Operation (Continuous Mode) . . . . . . . . . . . . . . . . . . . . . . . 9-30
9–20 SP/BSP Transmitter Functional Operation (Continuous Mode) . . . . . . . . . . . . . . . . . . . . . 9-31
9–21 BSP Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-34
9–22 BSP Control Extension Register (BSPCE) Diagram — Serial Port Control Bits . . . . . . . 9-37
9–23 Transmit Continuous Mode with External Frame and FIG = 1 (Format Is 16 Bits) . . . . . 9-40
9–24 ABU Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-42
9–25 BSP Control Extension Register (BSPCE) Diagram — ABU Control Bits . . . . . . . . . . . . . 9-43
9–26 Circular Addressing Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-47
9–27 Transmit Buffer and Receive Buffer Mapping Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-48
9–28 Standard Mode BSP Initialization Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-51
9–29 Autobuffering Mode Initialization Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-52
9–30 Time-Division Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-56
9–31 TDM 4-Wire Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-58
9–32 TDM Serial Port Registers Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-60
9–33 Serial Port Timing (TDM Mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-62
9–34 TDM Example Configuration Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-65
10–1 External Bus Interface Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
10–2 Software Wait-State Register (SWWSR) Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5
10–3 Software Wait-State Control Register (SWCR) Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
10–4 Software Wait-State Generator Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8
10–5 Bank-Switching Control Register (BSCR) Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
10–6 Bank Switching Between Memory Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12
10–7 Bank Switching Between Program Space and Data Space . . . . . . . . . . . . . . . . . . . . . . . 10-13
10–8 Memory Interface Operation for Read-Read-Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
10–9 Memory Interface Operation for Write-Write-Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
10–10 Memory Interface Operation for Read-Read-Write (Program-Space Wait States) . . . . 10-17
10–11 Parallel I/O Interface Operation for Read–Write–Read . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
10–12 Parallel I/O Operation for Read-Write-Read (I/O-Space Wait States) . . . . . . . . . . . . . . . 10-19
10–13 Memory Read and I/O Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20
10–14 Memory Read and I/O Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20
Tables
1–1 Typical Applications for the TMS320 DSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
2–1 Bus Usage for Read and Write Accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2–2 Program and Data Memory on the TMS320C54x Devices . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2–3 Host Port Interfaces on the TMS320C54x Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2–4 Serial Port Interfaces on the TMS320C54x Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
3–1 On-Chip Program Memory Available on TMS320C54x Devices . . . . . . . . . . . . . . . . . . . . 3-15
3–2 On-Chip Data Memory Available on the TMS320C54x Devices . . . . . . . . . . . . . . . . . . . . . 3-22
3–3 CPU Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
3–4 Memory Security Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
3–5 HPI Access in Memory Security Modes for Specific Devices . . . . . . . . . . . . . . . . . . . . . . . 3-30
4–1 Status Register 0 (ST0) Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4–2 Status Register 1 (ST1) Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4–3 Processor Mode Status Register (PMST) Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4–4 ALU Input Selection for ADD Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
4–5 Multiplier Input Selection for Several Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
4–6 ALU Operations in Dual 16-Bit Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
5–1 Instructions That Allow Immediate Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5–2 Direct-Addressing Instruction Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
5–3 Indirect-Addressing Instruction Bit Summary – Single Data-Memory Operand . . . . . . . 5-10
5–4 Indirect Addressing Types With a Single Data-Memory Operand . . . . . . . . . . . . . . . . . . . 5-13
5–5 Bit-Reversed Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19
5–6 Indirect-Addressing Instruction Bit Summary – Dual Data-Memory Operands . . . . . . . . 5-20
5–7 Auxiliary Registers Selected by Xar and Yar Field of Instruction . . . . . . . . . . . . . . . . . . . . 5-20
5–8 Indirect Addressing Types With Dual Data-Memory Operands . . . . . . . . . . . . . . . . . . . . . 5-21
5–9 Assembler Syntax Comparison to TMS320C54x DSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23
5–10 Indirect-Addressing Instruction Bit Summary – Compatibility Mode . . . . . . . . . . . . . . . . . 5-24
5–11 Instructions With 32-Bit Word Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28
6–1 Devices With Additional Program Memory Address Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6–2 Loading Addresses Into PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6–3 Loading Addresses into XPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
6–4 Unconditional Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
6–5 Conditional Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
6–6 Far Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
6–7 Unconditional Call Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
6–8 Conditional Call Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
6–9 Far Call Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
7–25 Latencies for Updating BRC From Within an RPTB Loop . . . . . . . . . . . . . . . . . . . . . . . . . . 7-74
7–26 Latencies for OVLY, IPTR, and MP/MC Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-76
7–27 Latencies for the DROM Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-78
7–28 Latencies for Accumulators A and B When Used as Memory-Mapped Registers . . . . . . 7-81
8–1 C541/541B Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8–2 C542 Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8–3 C543 Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8–4 C545/C545A Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
8–5 C546/C546A Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8–6 C548 Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8–7 C549 Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
8–8 C5402 Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11
8–9 C5410 Peripheral Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
8–10 C5420 Peripheral Memory-Mapped Registers For Each DSP Subsystem . . . . . . . . . . . . 8-15
8–11 C5402/C5410/C5420 McBSP Subaddressed Registers . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17
8–12 C5402/C5410/C5420 DMA Subaddressed Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18
8–13 Timer Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
8–14 Timer Control Register (TCR) Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
8–15 Clock Mode Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8–16 Clock Mode Settings at Reset (C541B/C545A/C546A/C548/C549/C5410) . . . . . . . . . . . 8-28
8–17 Clock Mode Settings at Reset (C5402) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
8–18 Clock Mode Register (CLKMD) Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
8–19 PLL Multiplier Ratio as a Function of PLLNDIV, PLLDIV, and PLLMUL . . . . . . . . . . . . . . 8-30
8–20 HPI Registers Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
8–21 HPI Signal Names and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-40
8–22 HPI Input Control Signals Function Selection Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . 8-42
8–23 HPI Control Register (HPIC) Bit Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-43
8–24 HPIC Host/TMS320C54x DSP Read/Write Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 8-45
8–25 Wait-State Generation Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-48
8–26 Initialization of BOB and HPIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-49
8–27 Read Access to HPI With Autoincrement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-49
8–28 Write Access to HPI With Autoincrement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-50
8–29 Sequence for Entering and Exiting IDLE2 and IDLE3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-52
8–30 HPI Operation During RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-53
9–1 Serial Ports on the TMS320C54x Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9–2 Sections that Discuss the Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9–3 Serial Port Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
9–4 Serial Port Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
9–5 Serial Port Control Register (SPC) Bit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
9–6 Serial Port Clock Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-17
9–7 Buffered Serial Port Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-35
9–8 Differences Between Serial Port and BSP Operation in Standard Mode . . . . . . . . . . . . . 9-36
9–9 BSP Control Extension Register (BSPCE) Bit Summary — Serial Port Control Bits . . . 9-38
9–10 Buffered Serial Port Word Length Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-39
Examples
4–1 Use of SMUL Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
4–2 Use of SST Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
4–3 Accumulator Store With Shift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
4–4 CMPS Instruction Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
4–5 Normalization of Accumulator A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
5–1 Sequence of Auxiliary Registers Modifications in Bit-Reversed Addressing . . . . . . . . . . 5-18
7–1 Sample Pipeline Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
7–2 Branch (B) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
7–3 Delayed-Branch (BD) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
7–4 Call Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
7–5 Delayed-Call (CALLD) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
7–6 Interrupt (INTR) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
7–7 Return (RET) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
7–8 Delayed-Return (RETD) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
7–9 Return-With-Interrupt-Enable (RETE) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . 7-15
7–10 Delayed Return-With-Interrupt-Enable (RETED) Instruction in the Pipeline . . . . . . . . . . . 7-16
7–11 Return-Fast (RETF) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
7–12 Delayed Return-Fast (RETFD) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
7–13 Execute-Conditionally (XC) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
7–14 Conditional-Call (CC) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
7–15 Delayed Conditional-Call (CCD) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
7–16 Conditional-Branch (BC) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
7–17 Delayed Conditional-Branch (BCD) Instruction in the Pipeline . . . . . . . . . . . . . . . . . . . . . . 7-24
7–18 Interrupt Response by the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
7–19 Instruction Fetch and Operand Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30
7–20 Operand Write and Dual-Operand Read Conflict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
7–21 Operand Write and Operand Read Conflict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
7–22 Resolving Conflict When Updating Multiple ARxs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-40
7–23 Resolving Conflict When Updating ARx and BK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
7–24 Resolving Conflict When Updating SP, BK, and ARx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43
7–25 ARx Updated With No Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-48
7–26 ARx Updated With a 1-Cycle Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-48
7–27 ARx Updated With and Without a 1-Cycle Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
7–28 ARx Updated With and Without a 2-Cycle Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
7–29 ARx Updated With a 2-Cycle Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
7–30 BK Updated With a 1-Cycle Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-50
Introduction
The C54x central processing unit (CPU), with its modified Harvard architec-
ture, features minimized power consumption and a high degree of parallelism.
In addition to these features, the versatile addressing modes and instruction
set in the C54x improve the overall system performance.
Topic Page
1-1
TMS320 DSP Family Overview
Today, the TMS320 DSP family consists of three supported DSP platforms:
TMS320C2000, TMS320C5000, and TMS320C6000. Within the
C5000 DSP platform there are three generations, the TMS320C5x,
TMS320C54x, and TMS320C55x.
Devices within the C5000 DSP platform use a similar CPU structure that is
combined with a variety of on-chip memory and peripheral configurations.
These various configurations satisfy a wide range of needs in the worldwide
electronics market. When memory and peripherals are integrated with a CPU
onto a single chip, overall system cost is greatly reduced and circuit board
space is reduced. Figure 1–1 shows the performance gains of the
TMS320 DSP family of devices.
C6000
(C62x, C64x,
C67x)
C5000 C8x
(C54x, C55x) C3x/4x
C2000
C5x
(C20x, C24x, High performance
C28x) Power-efficient
C1/2x performance
Control optimized
Telecommunications Voice/Speech
1200- to 33Ă600-bps modems Faxing Speaker verification
Adaptive equalizers Line repeaters Speech enhancement
ADPCM transcoders Personal communications Speech recognition
Cellular telephones systems (PCS) Speech synthesis
Channel multiplexing Personal digital assistants (PDA) Speech vocoding
Data encryption Speaker phones Text-to-speech
Digital PBXs Spread spectrum communications Voice mail
Digital speech interpolation (DSI) Video conferencing
DTMF encoding/decoding X.25 packet switching
Echo cancellation
- Enhanced Harvard architecture built around one program bus, three data
buses, and four address buses for increased performance and versatility
- A highly specialized instruction set for faster algorithms and for optimized
high-level language operation
Program Program/Data
Device ROM ROM DARAM† SARAM‡
C541 20 8 5 0
C542 2 0 10 0
C543 2 0 10 0
C545 32 16 6 0
C546 32 16 6 0
C548 2 0 8 24
C549 16 16 8 24
C5402 4 4 16 0
C5410 16 0 8 56
C5420 0 0 32 168
† Dual-access RAM
‡ Single-access RAM
- Instruction set
J Conditional-store instructions
- On-chip peripherals
† The C541B, C545A, C546A, C548, C549, C5402, C5410, and C5420 have a
software-programmable PLL and two additional saturation modes. The software-
programmable PLL is described in section 8.5.2, Software-Programmable PLL, on
page 8-27. The saturation modes are described in section 4.1.2, Processor Mode
Status Register (PMST), on page 4-6.
Each device offers selection of clock modes from one option list only.
J External bus-off control to disable the external data bus, address bus,
and control signals
J Programmable timer
J Ports:
Serial Ports
Multi-
Host Port Channel Time-Division
Device Interface Synchronous Buffered Buffered Multiplexed
C541 0 2 0 0 0
C542 1 0 1 0 1
C543 0 0 1 0 1
C545 1 1 1 0 0
C546 0 1 1 0 0
C548 1 0 2 0 1
C549 1 0 2 0 1
C5402 1 0 0 2 0
C5410 1 0 0 3 0
C5420 1 0 0 6 0
- Power
Architectural Overview
Topic Page
2.1 Bus Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
2.2 Internal Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2.3 Central Processing Unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
2.4 Data Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.5 Program Memory Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2.6 Pipeline Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2.7 On-Chip Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
2.8 Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
2.9 External Bus Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
2.10 IEEE Standard 1149.1 Scanning Logic . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
2-1
Block Diagram
ÁÁ
BRC, RSA, REA
ARP, BK, DP, SP
ÁÁ
ÁÁ
PAB
ÁÁ
PB
ÁÁ
Memory
and
CAB
ÁÁ
external
interface
ÁÁ
CB
DAB
ÁÁ
ÁÁ
ÁÁ
Peripheral
DB
interface
EAB
ÁÁ
ÁÁ
ÁÁ
EB
EXP encoder
X D A B
MUX
T register
T D A B A C D
A PC D T A B C D S
Sign ctr Sign ctr A(40) B(40) Sign ctr Sign ctr Sign ctr
- The program bus (PB) carries the instruction code and immediate
operands from program memory.
- Three data buses (CB, DB, and EB) interconnect to various elements,
such as the CPU, data address generation logic, program address
generation logic, on-chip peripherals, and data memory.
J The CB and DB carry the operands that are read from data memory.
J The EB carries the data to be written to memory.
- Four address buses (PAB, CAB, DAB, and EAB) carry the addresses
needed for instruction execution.
The C54x DSP can generate up to two data-memory addresses per cycle
using the two auxiliary register arithmetic units (ARAU0 and ARAU1).
The PB can carry data operands stored in program space (for instance, a
coefficient table) to the multiplier and adder for multiply/accumulate operations
or to a destination in data space for data move instructions (MVPD and
READA). This capability, in conjunction with the feature of dual-operand read,
supports the execution of single-cycle, 3-operand instructions such as the
FIRS instruction.
The C54x DSP also has an on-chip bidirectional bus for accessing on-chip
peripherals. This bus is connected to DB and EB through the bus exchanger
in the CPU interface. Accesses that use this bus can require two or more
cycles for reads and writes, depending on the peripheral’s structure.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 2–1. Bus Usage for Read and Write Accesses
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Á
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ Address Bus Data Bus
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Access Type
Program read
ÁÁÁ
ÁÁÁÁ
Á ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ PAB
√
CAB DAB EAB PB
√
CB DB EB
Program write √ √
Peripheral read √ √
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Peripheral write √ √
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Legend: hw = high 16-bit word
lw = low 16-bit word
Memory C541 C542 C543 C545 C546 C548 C549 C5402 C5410 C5420
Type
ROM: 28K 2K 2K 48K 48K 2K 16K 4K 16K 0
The on-chip ROM is part of the program memory space and, in some cases,
part of the data memory space. The amount of on-chip ROM available on each
device varies, as shown in Table 2–2.
On most devices, the ROM contains a bootloader that is useful for booting to
faster on-chip or external RAM. For bootloading details on C54x devices, visit
the TI web site and review the list of application reports.
On devices with large amounts of ROM, a portion of the ROM may be mapped
into both data and program space. The larger ROMs are also custom ROMs:
you provide the code or data to be programmed into the ROM in object file
format, and Texas Instruments generates the appropriate process mask to
program the ROM. For details on submitting ROM codes to Texas Instruments,
see Appendix C, Submitting ROM Codes to TI.
The ALU can also function as two 16-bit ALUs and perform two 16-bit
operations simultaneously. See section 4.2, Arithmetic Logic Unit (ALU), on
page 4-10, for more details about ALU operation.
2.3.2 Accumulators
Accumulators A and B (see Figure 2–1 on page 2-2) store the output from the
ALU or the multiplier/adder block. They can also provide a second input to the
ALU; accumulator A can be an input to the multiplier/adder. Each accumulator
is divided into three parts:
- Guard bits (bits 39–32)
- High-order word (bits 31–16)
- Low-order word (bits 15–0)
Instructions are provided for storing the guard bits, for storing the high- and the
low-order accumulator words in data memory, and for transferring 32-bit
accumulator words in or out of data memory. Also, either of the accumulators
can be used as temporary storage for the other. See section 4.3, Accumulators
A and B, on page 4-13, for more details about the features of these accumulators.
The barrel shifter and the exponent encoder normalize the values in an accu-
mulator in a single cycle. The LSBs of the output are filled with 0s, and the
MSBs can be either zero filled or sign extended, depending on the state of the
sign-extension mode bit (SXM) in ST1. Additional shift capabilities enable the
processor to perform numerical scaling, bit extraction, extended arithmetic,
and overflow prevention operations. See section 4.4, Barrel Shifter, on page
4-17, for more details about the function and use of the shifter. See section 4.7,
Exponent Encoder, on page 4-27, for more information about the encoder’s
accumulator-normalizing function.
The fast, on-chip multiplier allows the C54x DSP to perform operations
efficiently such as convolution, correlation, and filtering. In addition, the multi-
plier and ALU together execute multiply/accumulate (MAC) computations and
ALU operations in parallel in a single instruction cycle. This function is used
in determining the Euclidian distance and in implementing symmetrical and
LMS filters, which are required for complex DSP algorithms. See section 4.5,
Multiplier/Adder Unit, on page 4-19, for more details about the multiplier/adder
unit.
- Direct addressing uses seven bits of the instruction to encode the lower
seven bits of an address. The seven bits are used with the data page point-
er (DP) or the stack pointer (SP) to determine the actual memory address.
- Stack addressing manages adding and removing items from the system
stack.
The C54x device provides general-purpose I/O pins that can be read or written
through software control. All C54x devices support two GPIO pins:
BIO and XF are often used for handshaking functions. In addition to the above
described pins, other GPIO pins are available on selected devices. Some
GPIO pins are multiplexed with the McBSP/HPI pin functions and some GPIO
pins are dedicated. The multiplexed pins can be used for a GPIO function or
a McBSP/HPI function under software control. However, the dedicated GPIO
pins are always used for general-purpose I/O. See section 8.3,
General-Purpose I/O, on page 8-20, for more details about BIO and XF.
The clock options available vary depending on the C54x device; however, all
C54x devices provide the divide-by-2 clock capability. On devices that provide
a hardware PLL, the desired multiplication factor is chosen by the state of
CLKMD pins only. For more details about the generator, see section 8.5, Clock
Generator, on page 8-26.
Buffered 0 1 1 1 1 2 2 0 0 0
Multichannel 0 0 0 0 0 0 0 2 3 6
Buffered
TDM 0 1 1 0 0 1 1 0 0 0
The interface’s external ready input signal and software-generated wait states
allow the processor to interface with memory and I/O devices of many different
speeds. The interface’s hold modes allow an external device to take control
of the C54x DSP buses; in this way, an external device can access the
resources in the program, data, and I/O spaces.
See Chapter 10, External Bus Operation, for more details about interfacing the
C54x DSP to external devices.
Memory
The parallel nature of the C54x DSP architecture and the dual-access capabili-
ty of the on-chip RAM allow the C54x devices to perform four concurrent
memory operations in any given machine cycle: an instruction fetch, two-
operand reads, and an operand write.
The main advantage of operating from off-chip memory is the ability to access
a larger memory space.
Topic Page
3-1
Memory Space
Depending on the DSP version, several on-chip memory types are available
on the C54x devices: dual-access RAM (DARAM), single-access RAM
(SARAM), two-way shared RAM, and ROM. The RAMs are always mapped
into data space, but may also be mapped into program space. The ROM may
be activated and mapped into program space; it can also be mapped, in part,
into data space. For device-specific on-chip memory configurations, see the
TMS320C54x DSP Functional Overview (SPRU307) and the device data
sheet.
There are three CPU status register bits that affect memory configuration. The
effects of these bits are device-specific.
The MP/MC, OVLY, and DROM bits are located in the processor mode status
register (PMST). For more details, see section 4.1, CPU Status and Control
Registers, on page 4-2.
Figure 3–1 through Figure 3–4 show the C54x device’s data and program
memory maps and how the maps are affected by the MP/MC, OVLY, and
DROM bits.
2000h 2000h
4000h 4000h
1400h–8FFFh External
6000h 6000h
1400h–DFFFh External
8000h 8000h
A000h A000h
4000h 4000h
6000h 6000h
8000h 8000h
2800h–EFFFh External
2800h–FFFFh External
A000h A000h
C000h C000h
E000h E000h
MP/MC = 0 F000h–F7FFh Reserved
F800h–FF7Fh On-chip ROM
FF80h–FFFFh Interrupt vectors
MP/MC = 1 F000h–FF7Fh External
FF80h–FFFFh Interrupt vectors
FFFFh FFFFh
2000h 2000h
1800h–3FFFh External
4000h 4000h
6000h 6000h
1800h–BFFFh External
8000h 8000h
C000h C000h
FFFFh FFFFh
External
External EFFF
F000
Reserved External
F7FF
F800
On-Chip ROM
(2K Words)
FF7F FF7F
FF80 Interrupts and FF80 Interrupts and
Reserved Reserved
(External) (On-Chip)
FFFF FFFF FFFF
MP / MC = 1 MP / MC = 0
(Microprocessor Mode) (Microcomputer Mode)
External
External
BFFF
External BFFF
C000
C000
On-Chip ROM (DROM = 1)
On-Chip ROM or
(16K Words) External (DROM = 0)
FEFF
FEFF
FF00
FF00 Reserved (DROM = 1)
FF7F Interrupts and or
FF80 Interrupts and Reserved External (DROM = 0)
Reserved (On-Chip)
(External)
FFFF FFFF FFFF
MP / MC = 1 MP / MC = 0
(Microprocessor Mode) (Microcomputer Mode)
Figure 3–6. Extended Program Memory Maps for the C548 and C549
xx 0000 01 0000 02 0000 7F 0000
† See Figure 3–4 and Figure 3–5 for more information about this on-chip memory region.
‡ These pages available when OVLY = 0 when on–chip RAM is not mapped in program space or data space. When OVLY = 1
the first 32K words are all on page 0 when on–chip RAM is mapped in program space or data space.
NOTE: When the on-chip RAM is enabled in program space, all accesses to the region xx 0000 – xx 7FFF, regardless of page
number, are mapped to the on-chip RAM at 00 0000 – 00 7FFF.
External External
EFFF EFFF
External
F000 F000
On-Chip ROM ROM (DROM=1) or
(4K x 16-bits) External (DROM=0)
FEFF
FEFF
FF00
FF00
Reserved
FF7F FF7F Reserved (DROM=1)
FF80 FF80 or External (DROM=0)
Interrupts Interrupts
(External) (On-Chip)
MP / MC = 1 MP / MC = 0
(Microprocessor Mode) (Microcomputer Mode)
External
FF7F
FF7F
FF80
FF80
Interrupts and Interrupts and
Reserved Reserved
(External) (On-Chip ROM)
FFFF 01FFFF 01FFFF FFFF
FFFF
MP/MC= 1 MP/MC= 0
(Microprocessor Mode) (Microcomputer Mode)
xx 0000 Page 0
32K†
xx 7FFF Words
On-Chip
XPC = xx
Figure 3–12. Data Memory Map for the C5420 Relative to CPU Subsystems A and B
Hex Data
0000 Memory-
Mapped Registers
005F
0060
Scratch-Pad
007F DARAM
0080
On-Chip
DARAM 0
(16k Words)
3FFF
4000
On-Chip
SARAM 1
(16k Words)
7FFF
8000
On-Chip
SARAM 2
(32k Words)
Prog/Data
(DROM=1)
External
(DROM=0)
FFFF
Figure 3–13. Program Memory Maps for the C5420 Relative to CPU Subsystems A and B
Hex Program Page 0 Hex Program Page 1 Hex Program Page 2 Hex Program Page 3 Hex I/O
† EMIF (external memory) mode is required for all external accesses. EMIF mode is when XIO pin = 1 and the MP/MC bit is 1.
A. OVLY = 1 overlays the data page and all program pages between addresses 0x0000–0x7FFF.
B. DROM = 1 overlays 0x8000–0xFFFF of program and data memory.
C. All internal memory is divided into 8K blocks with the exception of the 4K W block on P2 (0x2F000–0x2FFFF).
When the memory cells are mapped into program space, the C54x device
automatically accesses these memory cells when addresses fall within the
boundaries of the on-chip memory. When the program address generation unit
(PAGEN) generates an address outside the boundaries of the on-chip
memory, the device automatically generates an external access. (For more
information about program address generation, see Chapter 6, Program
Memory Addressing.)
C542 2K 10K –
C543 2K 10K –
C545 48K 6K –
C546 48K 6K –
C548 2K 8K 24K
C5402 4K 16K –
At reset, the logic level present on the MP/MC pin is transferred to the MP/MC
bit in the PMST register (see section 4.1, CPU Status and Control Registers,
on page 4-2). The MP/MC bit determines whether to enable the on-chip ROM.
If MP/MC = 1, the device is configured as a microprocessor, and the on-chip
ROM is not enabled. If MP/MC pin = 0, the device is configured as a microcom-
puter, and the on-chip ROM is enabled. The MP/MC pin is sampled only at
reset; however, you can disable or enable the on-chip ROM through software
by setting or clearing the MP/MC bit in the PMST register.
Figure 3–1 through Figure 3–4 (pages 3-3 through 3-6) show the program
memory configurations on the individual C54x devices.
Depending on the device, the ROM is organized into 2K, 4K, or 8K blocks. For
2K-ROM devices, typically the ROM block is 2K; for 4K-ROM and 28K-ROM
devices, typically the ROM block is 4K; for 16K-ROM and 48K-ROM devices,
typically the ROM block is 8K.
5000h
5000 – 5FFF
6000h
6000 – 6FFF
7000h
7000 – 7FFF
8000h
8000 – 8FFF
B000h
B000 – BFFF B000 – BFFF
C000h
C000 – CFFF C000 – CFFF
E000h
E000 – EFFF E000 – EFFF
E000 – FFFF E000 – FFFF
F000h
F000 – FFFF F000 – FFFF
F7FF – FFFF F800 – FFFF F000 – FFFF
At device reset, the reset, interrupt, and trap vectors are mapped to the
128-word page starting at address FF80h in program-memory space.
However, these vectors can be remapped to the beginning of any 128-word
page in program space after device reset. This feature facilitates moving the
vector table out of the boot ROM and then removing the ROM from the memory
map. For details on remapping the vectors, see section 6.10.9, Remapping
Interrupt-Vector Addresses, on page 6-36.
Note:
In the on-chip ROM, 128 words are reserved for device-testing purposes.
Application code written to be implemented in on-chip ROM must reserve
these 128 words at addresses FF00h–FF7Fh in program space.
The C54x devices provide a variety of ROM sizes (2K, 4K, 16K, 28K, or 48K
words). For device-specific on-chip ROM configurations, see the device data
sheet. On C54x devices with on-chip bootloader ROM, the 2K words (at F800h
to FFFFh) may contain one or more of the following, depending on the specific
device:
- A bootloader program that boots from the serial ports, external memory,
an I/O port, or the host port interface (if present)
Figure 3–15 shows which of these items are on a particular C54x device and
shows the addresses of each of the items. The address range for the code,
F800h–FFFFh, is mapped to the on-chip ROM if the MP/MC bit is 0.
Note:
You can submit code to Texas Instruments in object file format to program
into the on-chip ROM. See Appendix C, Submitting ROM Codes to TI, for
details on how to submit ROM code to Texas Instruments.
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Figure 3–15. On-Chip ROM Program Memory Map (High Addresses)
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
F800h
Á ÁÁ
C541/545/546
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
User-specified code
C542/543/548/549/5402/5410
Bootloader code
ÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
F900h
Á ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
FA00h
ÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
FB00h
ÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
FC00h
Á ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
µ-law expansion table
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
FD00h
Á ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ A-law expansion table
ÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
FE00h
Á ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Sine look-up table
ÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
FF00h
Á ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Reserved Reserved
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
FF80h
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Interrupt vector table Interrupt vector table
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
The value of XPC defines the page. This register is memory-mapped into data
space to address 001Eh. At a hardware reset, the XPC is initialized to 0.
Program memory in the C548, C549, C5402, C5410, and C5420 is organized
into 128 pages (16 pages in the C5402, and 4 pages in the C5420) that are
each 64K words in length. Figure 3–16 shows extended program memory to
128 pages.
When the on-chip RAM is enabled in program space (OVLY = 1), each page
of program memory is made up of two parts: a common block of 32K words
maximum and a unique block of 32K words. The common block is shared by
all pages and each unique block is accessible only through its assigned page.
Figure 3–17 shows the common and unique blocks of the extended program
memory.
If the on-chip ROM is enabled (MP/MC = 0), it is enabled only on page 0. It is
not mapped to any other page in program memory.
Figure 3–16. Extended Program Memory With On-Chip RAM Not Mapped in Program
Space (OVLY = 0)
...
00 FFFF 01 FFFF 02 FFFF 7F FFFF
Figure 3–17. Extended Program Memory With On-Chip RAM Mapped in Program Space
and Data Space (OVLY = 1)
xx 0000
Page 0
32K†
words
xx 7FFF
XPC = xx
To facilitate page switching through software, the C548, C549, C5402, C5410,
and C5420 have six special instructions that affect the XPC:
- FB – Far branch (with or without delay)
The following C54x DSP instructions are extended in the C548, C549, C5402,
C5410, and C5420 to use 23 bits (20 bits in the C5402, and 18 in the C5420):
- READA – Read program memory addressed by accumulator A and store
in data memory
- WRITA – Write data to program memory addressed by accumulator A
All other instructions do not modify the XPC and access only memory within
the current page.
C542 – 10K –
C543 – 10K –
C545 16K 6K –
C546 16K 6K –
C548 – 8K 24K
C5402 4K 16K –
Accesses to the RAM and the data ROM (when it is enabled) are made when
addresses fall within the bounds of the corresponding on-chip memories.
When the data-address generation logic (DAGEN) generates an address out-
side of the bounds of on-chip memory, the device automatically generates an
external access. (For more information about data addresses generation, see
Chapter 5, Data Addressing.)
The data ROM is accessed in a single cycle by an instruction using single data-
memory operand addressing, including an instruction with a 32-bit long word
operand. In the dual-memory operand addressing, the access requires two
cycles if both operands reside in the same block; if the operands reside in
different blocks, the access requires a single cycle. For the address bound-
aries of the ROM blocks, see section 3.2.2, On-Chip ROM Organization, on
page 3-17.
Figure 3–1 through Figure 3–4 (pages 3-3 through 3-6) show the data
memory configurations on the individual C54x devices.
The organization of the first 1K of DARAM on all C54x devices includes the
memory-mapped CPU and peripheral registers, 32 words of scratch-pad
DARAM, and 896 words of DARAM.
Depending on the device, the RAM is organized into 1K, 2K, or 8K blocks. For
5K-RAM devices, typically the RAM block is 1K; for 6K-RAM and 10K-RAM
devices, typically the RAM block is 2K; for 16K-RAM devices, typically the
RAM block is 8K; other devices have a combination of RAM block sizes.
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ ÁÁ
Figure 3–18. On-Chip RAM Block Organization
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
0000h
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
C541
ÁÁÁÁÁÁÁÁ
Á
0000–03FF
C542/543 C545/546 C548/549
ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ
0000 07FF
0000–07FF 0000 07FF
0000–07FF 0000 07FF
0000–07FF
0400–07FF
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
0800–0AFF
Á
0B00–0FFF
0800–0FFF 0800–0FFF 0800–0FFF
ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ ÁÁ
1000h 1000–13FF
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ
1000 17FF
1000–17FF 1000 17FF
1000–17FF 1000 17FF
1000–17FF
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Á
1800 1FFF
1800–1FFF 1800 1FFF
1800–1FFF
ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ ÁÁ
2000h
2000–27FF
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ
2000–3FFF
3000h
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
4000h
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ ÁÁ
4000–5FFF
5000h
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
6000h
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ
6000–7FFF
7000h
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁÁÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁ Á
ÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ Á Á
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
Dual-access RAM Single-access RAM
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁÁ
3-24 Memory SPRU131G
Data Memory
Dual–access RAM
2F000h
Single–access RAM 4k
2FFFFh
n = page, where n = 0, 1, 2 . . .127
- The peripheral registers are used as control and data registers in peripher-
al circuits. These registers reside within addresses 0020h–005F and
reside on a dedicated peripheral bus structure. For a list of peripherals on
a particular C54x device, see section 8.2, Peripheral Memory-Mapped
Registers, on page 8-2.
The interrupt mask register (IMR) individually masks off specific interrupts at
required times. The interrupt flag register (IFR) indicates the current status of
the interrupts. Interrupts are described in detail in section 6.10, Interrupts, on
page 6-26.
The status registers ST0 and ST1 contain the status of the various conditions
and modes for the C54x devices. ST0 contains the flags (OVA, OVB, C, and
TC) produced by arithmetic operations and bit manipulations, in addition to the
DP and the ARP fields. ST1 reflects the status of modes and instructions
executed by the processor. See section 4.1, CPU Status and Control Regis-
ters, on page 4-2 for detailed information.
The C54x devices have two 40-bit accumulators: accumulator A and accumu-
lator B. Each accumulator is memory-mapped and partitioned into accumula-
tor low word (AL, BL), accumulator high word (AH, BH), and accumulator
guard bits (AG, BG). See section 4.3, Accumulators A and B, on page 4-13 for
more details about these accumulator features.
Address
(Hex) Name Description
0 IMR Interrupt mask register
1 IFR Interrupt flag register
2–5 – Reserved for testing
6 ST0 Status register 0
7 ST1 Status register 1
8 AL Accumulator A low word (bits 15–0)
9 AH Accumulator A high word (bits 31–16)
A AG Accumulator A guard bits (bits 39–32)
B BL Accumulator B low word (bits 15–0)
C BH Accumulator B high word (bits 31–16)
D BG Accumulator B guard bits (bits 39–32)
E T Temporary register
F TRN Transition register
10 AR0 Auxiliary register 0
11 AR1 Auxiliary register 1
12 AR2 Auxiliary register 2
13 AR3 Auxiliary register 3
14 AR4 Auxiliary register 4
15 AR5 Auxiliary register 5
16 AR6 Auxiliary register 6
17 AR7 Auxiliary register 7
18 SP Stack pointer
19 BK Circular-buffer size register
1A BRC Block-repeat counter
1B RSA Block-repeat start address
1C REA Block-repeat end address
1D PMST Processor mode status register
1E XPC Program counter extension register (C548,
C549, C5402, C5410, and C5420)
1E–1F – Reserved
- Branch metrics used by the DADST and DSADT instructions for ACS
operation of Viterbi decoding
In addition, the EXP instruction stores the exponent value computed into T
register, and then the NORM instruction uses the T register value to normalize
the number.
The 16-bit block-repeat counter (BRC) register specifies the number of times
a block of code is to repeat when a block repeat is performed. The 16-bit block-
repeat start address (RSA) register contains the starting address of the block
of program memory to be repeated. The 16-bit block-repeat end address
(REA) register contains the ending address of the block of program memory
to be repeated. For more information about repeating multiple instructions and
the BRC, RSA, and REA, see section 6.8, Repeating a Block of Instructions,
on page 6-23.
The program counter extension register (XPC) contains the upper 7 bits of the
current program memory address. See section 3.2.5, Extended Program
Memory on page 3-20, for more information about extended memory.
The C54x devices have two staged security options: on-chip ROM security
and ROM/RAM security. See Table 3–4 for a summary of the memory security
modes. See Table 3–5 for a summary of the HPI memory access while in the
memory security modes.
ROM ROM/RAM
Emulator cannot run. Emulator cannot run.
Instructions from on-chip ROM can read data from Instructions from on-chip ROM can read data from
on-chip ROM. on-chip ROM.
Instructions from on-chip RAM or external program Instructions from on-chip RAM or external program
cannot read data from on-chip ROM and will read cannot read data from on-chip ROM and will read
FFFFh. FFFFh.
Instructions from on-chip RAM or external program Instructions from on-chip RAM or external program
can branch to on-chip ROM. can branch to on-chip ROM.
Can start from either microprocessor mode Can start from only microcomputer mode
(MP/MC = 1) or microcomputer mode (MP/MC = 0) (MP/MC = 0) and not dependent on the logic level of
depending on the logic level of the MP/MC pin. the MP/MC pin.
Can change MP/MC bit in PMST with software. Can change MP/MC bit in PMST with software.
Table 3–5. HPI Access in Memory Security Modes for Specific Devices
TMS320C5410 64K 64K Can read only 2K block Can write only 2K block
(1000h–17FFh) (1000h–17FFh)
TMS320C5416 128K 128K Can read only 8K block Can write entire 128K
(4000h–5FFFh)
TMS3205409A 32K 32K Can read only 8K block Can write only 8K block
(4000h–5FFF) (4000h–5FFF)
TMS3205410A 64K 64K Can read only 8K block Can write only 8K block
(4000h–5FFF) (4000h–5FFF)
This chapter describes the TMS320C54x DSP central processing unit (CPU)
operations. The CPU can perform high-speed arithmetic operations within one
instruction cycle because of its parallel architectural design.
The CPU registers are memory-mapped, enabling quick saves and restores.
Topic Page
4-1
CPU Status and Control Registers
ST0 and ST1 contain the status of various conditions and modes; PMST
contains memory-setup status and control information. Because these
registers are memory-mapped, they can be stored into and loaded from data
memory; the status of the processor can be saved and restored for
subroutines and interrupt service routines (ISRs).
The individual bits of the ST0 and ST1 registers can be set or cleared with the
SSBX and RSBX instructions. For example, the sign-extension mode is set
with SSBX 1, SXM, or reset with RSBX 1, SXM. The ARP, DP, and ASM bit
fields can be loaded using the LD instruction with a short-immediate operand.
The ASM and DP fields can be also loaded with data-memory values by using
the LD instruction.
The ST0 bits are shown in Figure 4–1 and described in Table 4–1. The ST1
bits are shown in Figure 4–2 and described in Table 4–2 on page 4-4.
- Bit 31 and bit 30 of an accumulator tested by SFTC have different values from
each other.
10 OVA 0 Overflow flag for accumulator A. OVA is set to 1 when an overflow occurs in either
the ALU or the multiplier’s adder and the destination for the result is accumulator A.
Once an overflow occurs, OVA remains set until either a reset, a BC[D], a CC[D],
an RC[D], or an XC instruction is executed using the AOV and ANOV conditions.
The RSBX instruction can also clear this bit.
9 OVB 0 Overflow flag for accumulator B. OVB is set to 1 when an overflow occurs in either
the ALU or the multiplier’s adder and the destination for the result is accumulator B.
Once an overflow occurs, OVB remains set until either a reset, a BC[D], a CC[D],
an RC[D], or an XC instruction is executed using the BOV and BNOV conditions.
This RSBX instruction can also clear this bit.
8–0 DP 0 Data-memory page pointer. This 9-bit field is concatenated with the seven LSBs of
an instruction word to form a direct-memory address of 16 bits for single data-
memory operand addressing. This operation is done if the compiler mode bit in ST1
(CPL) = 0. The DP field can be loaded by the LD instruction with a short-immediate
operand or from data memory.
15 14 13 12 11 10 9 8 7 6 5 4–0
BRAF = 0 The block repeat is deactivated. BRAF is cleared when the block-
repeat counter (BRC) decrements below 0.
BRAF = 1 The block repeat is active. BRAF is automatically set when an RPTB
instruction is executed.
14 CPL 0 Compiler mode. CPL indicates which pointer is used in relative direct addressing:
CPL = 0 The relative direct-addressing mode using the data page pointer
(DP) is selected.
CPL = 1 The relative direct-addressing mode using the stack pointer (SP) is
selected.
13 XF 1 XF status. XF indicates the status of the external flag (XF) pin, which is a general-
purpose output pin. The SSBX instruction can set XF and the RSBX instruction can
reset XF.
12 HM 0 Hold mode. HM indicates whether the processor continues internal execution when
acknowledging an active HOLD signal:
The SSBX instruction sets INTM and the RSBX instruction resets INTM. INTM is set
to 1 by reset or when a maskable interrupt trap is taken (INTR or external interrupts).
INTM is cleared to 0 when a RETE or RETF instruction (return from interrupt) is
executed. INTM does not affect the nonmaskable interrupts (RS and NMI). INTM
cannot be set by memory-write operations.
10 0 Always read as 0.
OVM = 0 An overflowed result from either the ALU or the multiplier’s adder
overflows normally in the destination accumulator.
OVM = 1 The destination accumulator is set to either the most positive value
(00 7FFF FFFFh) or the most negative value (FF 8000 0000h) upon
encountering an overflow.
The SSBX and RSBX instructions set and reset OVM, respectively.
SXM does not affect the definitions of certain instructions: the ADDS, LDU, MAC,
and SUBS instructions suppress sign extension regardless of SXM value. The
SSBX and RSBX instructions set and reset SXM, respectively.
7 C16 0 Dual 16-Bit/double-precision arithmetic mode. C16 determines the arithmetic mode
of the ALU’s operation:
6 FRCT 0 Fractional mode. When FRCT is 1, the multiplier output is left-shifted by one bit to
compensate for an extra sign bit.
5 CMPT 0 Compatibility mode. CMPT determines the compatibility mode for the ARP:
CMPT = 0 ARP is not updated in indirect addressing mode with a single data-
memory operand. ARP must always be set to 0 when the DSP is in
this mode.
4–0 ASM 0 Accumulator shift mode. The 5-bit ASM field specifies a shift value within a –16
through 15 range and is coded as a 2s-complement value. Instructions with a
parallel store, as well as STH, STL, ADD, SUB, and LD, use this shift capability. ASM
can be loaded from data memory or by the LD instruction using a short-immediate
operand.
MP/MC is set to the value corresponding to the logic level on the MP/MC pin
when sampled at reset. This pin is not sampled again until the next reset. The
RESET instruction does not affect this bit. This bit can also be set or cleared by
software.
5 OVLY 0 RAM overlay. OVLY enables on-chip dual-access data RAM blocks to be
mapped into program space. The values for the OVLY bit are:
OVLY = 1 The on-chip RAM is mapped into program space and data space.
Data page 0 (addresses 0h to 7Fh), however, is not mapped into
program space.
Table 4–3. Processor Mode Status Register (PMST) Bit Summary (Continued)
Reset
Bit Name Value Function
4 AVIS 0 Address visibility mode. AVIS enables/disables the internal program address to
be visible at the address pins.
AVIS = 0 The external address lines do not change with the internal
program address. Control and data lines are not affected and
the address bus is driven with the last address on the bus.
AVIS = 1 This mode allows the internal program address to appear at the
pins of the C54x device so that the internal program address
can be traced. Also, it allows the interrupt vector to be decoded
in conjunction with IACK when the interrupt vectors reside in
on-chip memory.
3 DROM 0 Data ROM. DROM enables on-chip ROM to be mapped into data space. The
values for the DROM bit are:
DROM = 1 A portion of the on-chip ROM is mapped into data space. See
Chapter 3, Memory, for details.
2 CLKOFF† 0 CLOCKOUT off. When the CLKOFF bit is 1, the output of CLKOUT is disabled
and remains at a high level.
Table 4–3. Processor Mode Status Register (PMST) Bit Summary (Continued)
Reset
Bit Name Value Function
0 SST† N/A Saturation on store. When SST = 1, saturation of the data from the accumulator
is enabled before storing in memory. The saturation is performed after the shift
operation. Saturation on store takes place with the following instructions: STH,
STL, STLM, DST, ST||ADD, ST||LD, ST||MACR[R], ST||MAS[R], ST||MPY, and
ST||SUB. The following steps are performed when using saturate on store:
1) A 40-bit data value is shifted (right or left) depending on the instruction. The
shift is the same as described in the SFTA instruction and depends on the
SXM bit.
2) The 40-bit data value is saturated to a 32-bit value; the saturation depends
on the SXM bit (the number is always assumed to be positive).
If SXM = 0, the following 32-bit value is generated:
J FFFF FFFFh, if the value is greater than FFFF FFFFh
If SXM = 1, the following 32-bit value is generated:
J 7FFF FFFFh, if the value is greater than 7FFF FFFFh
DB15 – DB0
T
Y X OVM
A B
C16
C
ACC
ALU OVA/OVB
ZA/ZB
MUX TC
40
40 Legend:
A M U B A Accumulator A
40 B Accumulator B
C CB data bus
D DB data bus
MAC M MAC unit
output S Barrel shifter
T T register
U ALU
When a 16-bit data-memory operand is fed through data bus CB or DB, the
40-bit ALU input is constructed in one of two ways:
- If bits 15 through 0 contain the data-memory operand, bits 39 through 16
are zero filled (SXM = 0) or sign-extended (SXM = 1).
- If bits 31 through 16 contain the data-memory operand, bits 15 through 0
are zero filled, and bits 39 through 32 are either zero filled (SXM = 0) or
sign extended (SXM = 1).
Table 4–4 shows how the ALU inputs are obtained for the ADD instructions,
depending on the type of syntax used. The ADD instructions execute in one
cycle, except for cases 4, 7, and 8 that use two words and execute in two
cycles.
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
Table 4–4. ALU Input Selection for ADD Instructions
ÁÁÁ
ÁÁÁÁÁÁÁÁ
Case
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
Instruction Syntax Words A
√
B DB CB Shift
√
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
1 ADD *AR1, A 1
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
2 ADD *AR3, TS, A 1 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
3 ADD *AR2, 16, B, A 1 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
4
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
5
ÁÁÁ
ÁÁÁÁ ÁÁÁ
ADD
ÁÁÁ ÁÁÁ
ÁÁÁ
ADD
ÁÁÁ
ÁÁÁ ÁÁÁ
*AR1, 8, B, A
ÁÁÁ
ÁÁÁ
*AR2, 8, B
2
1
√
√
√
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
6
ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ADD
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁ
*AR2, *AR3, A 1 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
7 ADD #1234h, 6, A, B 2 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
8 ADD #1234h, 16, A, B 2 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁ
9
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ADD
ÁÁÁ
ÁÁÁ
ÁÁÁ
A, 12, B 1 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁ
10
11
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ADD
DADD
ÁÁÁ
ÁÁÁ
ÁÁÁ
B, ASM, A
*AR2, A, B
1
1
√
√
√
- If OVM = 0, the accumulators are loaded with the ALU result without
modification.
- If OVM = 1, the accumulators are loaded with either the most positive
32-bit value (00 7FFF FFFFh) or the most negative 32-bit value
(FF 8000 0000h), depending on the direction of the overflow.
- The overflow flag (OVA/OVB) in status register ST0 is set for the destina-
tion accumulator and remains set until one of the following occurs:
J A reset is performed.
J A conditional instruction (such as a branch, a return, a call, or an
execute) is executed on an overflow condition.
J The overflow flag (OVA/OVB) is cleared.
Note:
You can saturate the accumulator by using the SAT instruction, regardless
of the value of OVM.
Two conditional operands, C and NC, enable branching, calling, returning, and
conditionally executing according to the status (set or cleared) of the carry bit.
Also, the RSBX and SSBX instructions can be used to load the carry bit. The
carry bit is set on a hardware reset.
Each accumulator is split into three parts, as shown in Figure 4–5 and
Figure 4–6.
AG, BG, AH, BH, AL, and BL are memory-mapped registers that can be
pushed onto and popped from the stack for context saves and restores by
using PSHM and POPM instructions. These registers can also be used by
other instructions that use memory-mapped registers (MMR) for page 0
addressing. The only difference between accumulators A and B is that bits
32–16 of A can be used as an input to the multiplier in the multiplier/adder unit.
To store the 16 LSBs of the accumulator in memory with a shift, use the STL
instruction. For right-shift operations, bits from AH and BH shift into AL and BL,
respectively, and the LSBs are lost. For left-shift operations, the bits in AL and
BL are filled with zeros. Since shift operations are performed in the shifter, the
contents of the accumulator remain unchanged. Example 4–3 shows the
result of accumulator store operations with shift; it assumes that accumulator
A = 0FF 4321 1234h.
In SFTA and SFTL, the shift count is defined as –16 v SHIFT v 15. SFTA is
affected by the SXM bit. When SXM = 1 and SHIFT is a negative value, SFTA
performs an arithmetic right shift and maintains the sign of the accumulator.
When SXM = 0, the MSBs of the accumulator are zero filled. SFTL is not
affected by the SXM bit; it performs the shift operation for bits 31–0, shifting
0s into the MSBs or LSBs, depending on the direction of the shift.
SFTC performs a 1-bit left shift when both bits 31 and 30 are 1 or both are 0.
This normalizes 32 bits of the accumulator by eliminating the most significant
nonsign bit.
ROL rotates each bit of the accumulator to the left by one bit, shifts the value
of the carry bit into the LSB of the accumulator, shifts the value of the MSB of
the accumulator into the carry bit, and clears the accumulator’s guard bits.
ROR rotates each bit of the accumulator to the right by one bit, shifts the value
of the carry bit into the MSB of the accumulator, shifts the value of the LSB of
the accumulator into the carry bit, and clears the accumulator’s guard bits.
The ROLTC instruction (rotate accumulator left with TC) rotates the accumula-
tor to the left and shifts the test control (TC) bit into the LSB of the accumulator.
The following steps are performed when saturating upon accumulator store:
1) The 40-bit data value is shifted (right or left) depending on the instruction.
The shift is the same as described in the SFTA instruction and depends
on the value of the SXM bit.
- LMS performs a MAC and a parallel add with rounding to efficiently update
the coefficients in an FIR filter.
In the LMS instruction, accumulator B stores the interim results of the input
sequence convolution and filter coefficients; accumulator A updates the filter
coefficients. Accumulator A can also be used as an input for MAC, which con-
tributes to single-cycle execution of instructions with parallel operations.
The SQDST instruction computes the square of the distance between two
vectors. Accumulator A(32–16) is squared and the product is added to accu-
mulator B. The result is stored in accumulator B. At the same time, Ymem is
subtracted from Xmem and the difference is stored in accumulator A. The
value that is squared is the value of the accumulator before the subtraction,
Ymem – Xmem, is executed.
- The ASM value represents a shift count value in the –16 to 15 range and
can be loaded by the LD instruction (with an immediate operand or with
a data-memory operand). For example:
ADD A, ASM, B ; Add accumulator A to accumulator B
; with a shift specified by ASM
- The six LSBs of T represent a shift count value in the –16 to 31 range. For
example:
NORM A ; Normalize accumulator A (T
; contains the exponent value)
40 CB15 – CB0
A
16
B 16
40 B A D C
MUX
- For unsigned multiplication, a 0 is added to the MSB (bit 16) in each input
operand.
The multiplier output can be shifted left by one bit to compensate for the extra
sign bit generated by multiplying two 16-bit 2s-complement numbers in frac-
tional mode. (Fractional mode is selected when the FRCT bit = 1 in ST1.)
The adder in the multiplier/adder unit contains a zero detector, a rounder (2s
complement), and overflow/saturation logic. Rounding consists of adding 215
to the result and then clearing the lower 16 bits of the destination accumulator.
Rounding is performed in some multiply, MAC, and multiply/subtract (MAS)
instructions when the suffix R is included with the instruction. The LMS instruc-
tion also rounds to minimize quantization errors in updated coefficients.
The adder’s inputs come from the multiplier’s output and from one of the accu-
mulators. Once any multiply operation is performed in the unit, the result is
transferred to a destination accumulator (A or B).
17
T
T D A P A D C
X MUX Y MUX
A B
XA YA
OVA / OVB
Zero detect Round SAT
ZA /ZB
40
To accumulator A / B
Table 4–5 shows how the multiplier inputs are obtained for several instructions.
There are a total of nine combinations of multiplier inputs that are actually used.
For instructions using T as one input, the second input may be obtained as an
immediate value or from data memory via a data bus (DB), or from accumula-
tor A.
The last two cases are used with the FIRS instruction and the SQUR and
SQDST instructions. The FIRS instruction obtains inputs from PB and accu-
mulator A. The SQUR and SQDST obtain both inputs from accumulator A.
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 4–5. Multiplier Input Selection for Several Instructions
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ ÁÁ
Á
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Á
ÁÁÁ
X Multiplexer Y Multiplexer
Á ÁÁÁ
ÁÁÁÁÁ
Case Instruction Type T DB A PB CB DB A
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
1
ÁÁ
ÁÁ
MPY
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁ
#1234h, A
ÁÁÁÁÁ
√ √
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
ÁÁ ÁÁ
Á
2 MPY[R] *AR2, A √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁ
ÁÁÁ
ÁÁ
Á ÁÁÁ
ÁÁÁ ÁÁÁÁÁ
3 MPYA B √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
4
ÁÁ
ÁÁ
ÁÁÁ
MACP
ÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁ ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁ
*AR2, pmad, A
Á ÁÁÁ
ÁÁÁ ÁÁ
√ √
ÁÁÁÁÁ
5 MPY *AR2, *AR3, B √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁ
ÁÁÁ
ÁÁ
ÁÁ ÁÁ
Á
6 SQUR *AR2, B √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
7
ÁÁ
ÁÁ
ÁÁÁ
MPYA
ÁÁ
Á ÁÁÁ
ÁÁÁ ÁÁÁÁÁ
*AR2 √ √
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
8
9
ÁÁ
ÁÁ
ÁÁÁ
FIRS
SQUR
ÁÁ
Á ÁÁÁ
ÁÁÁ ÁÁÁÁÁ
*AR2, *AR3, pmad
A, B
√
√
√
Since bits A(32–16) can be an input to the multiplier, some sequences that
require storing the result of one computation in memory and feeding this result
to the multiplier can be made faster. For some application-specific instructions
(FIRS, SQDST, ABDST, and POLY), the contents of accumulator A can be
computed by the ALU and then input to the multiplier without any overhead.
In the MAC, MAS, and MACSU instructions with dual data-memory operand
addressing, data can be transferred to the multiplier during each cycle via CB
and DB and multiplied and added in a single cycle. Data addresses for these
operands are generated by ARAU0 and ARAU1, the auxiliary register arithme-
tic units. For information about ARAU0 and ARAU1, see section 5.5.2, ARAU
and Address-Generation Operation, on page 5-11.
In the MACD and MACP instructions, data can be transferred to the multiplier
during each cycle via DB and PB. DB retrieves data from data memory, and
PB retrieves coefficients from program memory. When MACD and MACP are
used with repeat instructions (RPT and RPTZ), they perform single-cycle MAC
operations with sequential access of data and coefficients. Data addresses
are generated by ARAU0 and the program address register (PAR). The data-
memory address is updated by ARAU0 according to a single data-memory
operand in the indirect addressing mode; the program-memory address is
incremented by PAGEN.
When saturate-on-multiply is not set (SMUL = 0), only the end results of MAC
and MAS are saturated.
When OVM = 1 and FRCT = 1, the SMUL bit in PMST determines whether or
not the result of a multiplication is saturated before the accumulation is
performed in MAC and MAS instructions. This feature allows the MAC and
MAS operations to be consistent with the MAC and MAS basic operation
defined in ETSI GSM specifications (GSM specifications 6.06, 6.10, and 6.53).
COMP MSW/LSW
select
TRN
16
TC
EB15 – EB0
CSSU
The CSSU allows the C54x device to support various Viterbi butterfly
algorithms used in equalizers and channel decoders.
The add function of the Viterbi operator (see Figure 4–10) is performed by the
ALU. This function consists of a double addition function (Met1 " D1 and
Met2 " D2). Double addition is completed in one machine cycle if the ALU is
configured for dual 16-bit mode by setting the C16 bit in ST1. With the ALU
configured in dual 16-bit mode, all the long-word (32-bit) instructions become
dual 16-bit arithmetic instructions.
T is connected to the ALU input (as a dual 16-bit operand) and is used as local
storage in order to minimize memory access. Table 4–6 shows the instructions
that perform dual 16-bit ALU operations.
D1 J
(New_Met1)
2J
(Met1)
D2 If (Met1 + D1) > (Met2 + D2)
then New_Met1 = Met1 + D1
else
New_Met1 = Met2 + D2
2J + 1
(Met2)
J + STNB/2
(New_Met2)
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DADD Lmem, src [, dst]
src(15–0) + Lmem(15–0) → dst(15–0)
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DADST Lmem, dst Lmem(31–16) + T → dst(39–16)
Lmem(15–0) – T → dst(15–0)
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Lmem(15–0) – src(15–0) → src(15–0)
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DSADT Lmem, dst
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Lmem(31–16) – T → dst(39–16)
Lmem(15–0) + T → dst(15–0)
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ src(15–0) – Lmem(15–0) → src(15–0)
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DSUBT Lmem, dst
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Lmem(31–16) – T → dst(39–16)
Lmem(15–0) – T → dst(15–0)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Legend: →
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Lmem
Is stored to
Long (32-bit) data-memory value
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
src Source accumulator (A or B)
dst Destination accumulator (A or B)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
x(n–m) Read as bits n through m of x
The CSSU implements the compare and select operation via the CMPS
instruction, a comparator, and the 16-bit transition register (TRN). This opera-
tion compares two 16-bit parts of the specified accumulator and shifts the
decision into bit 0 of TRN. This decision is also stored in the TC bit of ST0.
Based on the decision, the corresponding 16-bit part of the accumulator is
stored in data memory. Example 4–4 shows the compare and select operation
executed by the CMPS instruction.
TRN contains information of the path transition decisions to new states. This
information can be used for a back-tracking routine that finds the optimal path,
which results in decoding the code.
EXP encoder
To T register
The EXP and NORM instructions use the exponent encoder to normalize the
accumulator’s contents efficiently. NORM supports shifting the accumulator
value by the number of bits specified in T in a single cycle. A negative value
in T produces a right shift of the accumulator’s contents, which normalizes any
value beyond the 32-bit range of the accumulator. Example 4–5 demonstrates
the normalization of accumulator A.
;Normalize accumulator A
EXP A ; (the number of leading bits – 8)-> T
ST T, EXPONENT ; Store the exponent (T) into data
; memory
NORM A ; Normalize accumulator A, (A)<<(T)
Data Addressing
- Stack addressing manages adding and removing items from the system
stack.
Topic Page
5.1 Immediate Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.2 Absolute Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5.3 Accumulator Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.4 Direct Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.5 Indirect Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
5.6 Memory-Mapped Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
5.7 Stack Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27
5.8 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28
5-1
Immediate Addressing
Immediate values can be encoded in 1-word or 2-word instructions. The 3-, 5-,
8-, or 9-bit values are encoded into 1-word instructions; 16-bit values are
encoded into 2-word instructions.
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
Table 5–1. Instructions That Allow Immediate Addressing
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
3- and 5-Bit
Constants
8-Bit
Constant
9-Bit
Constant 16-Bit Constant
LD FRAME LD ADD ORM
LD ADDM RPT
RPT AND RPTZ
ANDM ST
BITF STM
CMPM SUB
LD XOR
MAC XORM
OR
The syntax for immediate addressing uses a number sign (#) immediately
preceding the value or symbol to indicate that it is an immediate value. For
example, to load accumulator A with the value 80 in hexadecimal, you would
write:
LD #80h, A
Figure 5–1 uses the RPT instruction to show how a short-immediate (#K)
value is encoded in instructions that use immediate addressing. The opcode
of the instruction is encoded in the high half of the instruction, bits 8–15 of a
1-word encoding. The value of the constant is in the remaining instruction
space.
Figure 5–2 uses the RPT instruction to show how a long-immediate (#lk) value
is encoded in instructions that use immediate addressing. The opcode of the
instruction is encoded in the high half of the instruction, bits 0–15 of the high
word of a 2-word encoding. The value of the constant is in the remaining
instruction space.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 instruction word
1 1 1 0 1 1 0 0 8-bit constant
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0
2 instruction words
16-bit constant
- *(lk) addressing is used with all instructions that support the use of a single
data-memory (Smem) operand.
5.2.3 PA Addressing
Port address (PA) addressing uses a specific value to specify an external I/O
port address.
The syntax for PA addressing uses a symbol or a number to specify the port
address. For example, to copy a value from the I/O port at port address FIFO
to a data-memory location pointed to by AR5, you would write:
PORTR FIFO, *AR5
In the example, FIFO refers to the port address.
Note:
Instructions using the *(lk) form of absolute addressing cannot be used with
repeat single instructions (RPT, RPTZ).
- READA Smem
- WRITA Smem
Note:
The C54x devices have different number of address lines; therefore, the
program-memory location is specified by the lower bits of accumulator A.
See section 3.2.5, Extended Program Memory, on page 3-20.
Note:
Direct addressing is not the only method of offset addressing. However, the
advantage of this mode is that it encodes each instruction and address into
a single word.
Either DP or SP can be combined with the dma offset to generate the actual
address. The compiler mode bit (CPL), located in status register ST1, selects
which method is used to generate the address:
- When CPL = 0, the dma field is concatenated with the 9-bit DP field to form
the 16-bit data-memory address.
- When CPL = 1, the dma field is added (positive offset) to SP to form the
16-bit data-memory address.
The syntax for direct addressing uses a symbol or a number to specify the off-
set value. For example, to add the contents of the memory location SAMPLE
to accumulator B, provided that the correct base address is in DP (CPL = 0)
or SP (CPL = 1), you would write:
ADD SAMPLE, B
The lower seven bits of the address of SAMPLE are stored in the instruction
word.
Figure 5–3 shows the opcode format for instructions that use direct addressing.
Table 5–2 describes the bits of the direct-addressing instruction. Figure 5–4
illustrates how the 16-bit data address is formed.
15 – 8 7 6– 0
Opcode I=0 dma
7 I I = 0, the addressing mode used by the instruction is the direct addressing mode.
6–0 dma This seven-bit field contains the data-memory address offset for the instruction.
DP(9)
SP(16)
DAB(16) (read)
CPL DAGEN
CPL
DP-referenced direct addressing divides memory into 512 pages, because the
DP’s range is from 0 to 511 (29 – 1). Each page has 128 addressable locations,
because the dma ranges from 0 to 127 (27 – 1).
In other words, the DP points to one of 512 possible 128-word data-memory
pages; the dma points to the specific location within that page. The only differ-
ence between an access to location 0 on page 1 and to location 0 on page 2
is the value of the DP.
The DP is loaded by the LD instruction.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Effective memory address
The SP points to any address in memory. The dma points to the specific loca-
tion on the page, allowing you to access a contiguous 128-word (27 – 1) block
in memory from any base address.
SP can also add or remove items from the stack. See section 5.7, Stack
Addressing, for more information.
When memory is addressed with indirect addressing, the auxiliary register and
the address can be optionally modified by a decrement, an increment, an
offset, or an index. Special modes offer circular and bit-reversed addressing.
A circular buffer size register (BK) is used with circular addressing. The AR0
register is used for indexed and bit-reversed addressing modes in addition to
being used to point to memory as the other auxiliary registers do.
Indirect addressing is flexible enough not only to read or write a single 16-bit
data operand from memory with one instruction, but also to access two data-
memory locations with one instruction. Accesses of two data-memory
locations include reads of two independent memory locations, reads and
writes of two consecutive memory locations, and a read of one memory
location combined with a write to a memory location.
7 I I = 1, the addressing mode used by the instruction is the indirect addressing mode.
6–3 MOD This 4-bit modification field defines the type of indirect addressing. section 5.5.3, Single-
Operand Address Modifications, on page 5-13, describes the 16 ways to specify addres-
sing types with the MOD field.
CMPT = 0 Standard mode. In standard mode, ARF always specifies the auxiliary regis-
ter, regardless of the value in ARP. ARP is not updated. ARP must always be
cleared to zero when the DSP is in this mode.
CMPT = 1 Compatibility mode. In compatibility mode, ARP selects the auxiliary register
if ARF = 0. Otherwise, ARF selects the auxiliary register and the ARF value
is loaded into ARP when the access is completed. *AR0 in the assembly
instruction indicates the auxiliary register selected by ARP in compatibility
mode.
Note:
In some cases, two data operands can be fetched at once. This requires a
different instruction format that is described in section 5.5.4, Dual-Operand
Address Modifications, on page 5-19.
Two auxiliary register arithmetic units (ARAU0 and ARAU1) operate on the
contents of the auxiliary registers. The ARAUs perform unsigned, 16-bit
auxiliary register arithmetic operations. Some addresses can be obtained by
premodifying the auxiliary register.
Note:
Typically, STM or MVDK is used to load auxiliary registers. Both of these
instructions allow the next instruction to use the new value in the register.
Other instructions that load a new value into an AR produce a pipeline laten-
cy. For further information on the pipeline and possible pipeline conflicts, see
Chapter, 7 Pipeline.
Figure 5–8 shows the ARAUs used to generate an address in the indirect
addressing mode using a single data-memory operand. As the figure shows,
the main components used for address generation in indirect addressing are
the auxiliary register arithmetic units (ARAU0 and ARAU1) and the auxiliary
registers (AR0–AR7).
Figure 5–8. Indirect Addressing Block Diagram for a Single Data-Memory Operand
AR0 BK lk 1
ARP(3)
ARAU0
AR0(16) index
AR1(16)
+/– % 0 B
AR2(16)
DAB(16)
AR3(16) AR0 BK 1 (read)
AR4(16)
AR5(16) ARAU1
AR6(16)
AR7(16) EAB(16)
+/– % 0 (write) or
BK(16) CAB(16)
(32-bit read)
You can modify the addresses you use in instructions before or after they are
accessed, or you can leave them unchanged. You can modify them by
incrementing or decrementing the address by 1, adding a 16-bit offset (lk), or
indexing with the value in AR0. These three types of action combined with
taking the action either before or after the access, plus the ways of leaving the
address unchanged make a total of 16 addressing types, each assigned to a
value of MOD, the 4-bit modification field in the encoding of an instruction using
indirect addressing.
Table 5–4 lists the types of single data-memory operand addressing, along
with the value of MOD, the assembler syntax, and the function for each type.
Table 5–4. Indirect Addressing Types With a Single Data-Memory Operand (Continued)
MOD Operand
Field Syntax Function Description†
1010 (10) *ARx+% addr = ARx After access, the address in ARx is incremented using
ARx = circ(ARx + 1) circular addressing.‡
1011 (11) *ARx + 0% addr = ARx After access, AR0 is added to ARx using circular addressing.
ARx = circ(ARx + AR0)
1100 (12) *ARx(lk) addr = ARx + lk The sum of ARx and the 16-bit long offset (lk) is used as the
ARx = ARx data-memory address. ARx is not updated.§
1101 (13) *+ARx(lk) addr = ARx + lk Before its use, the signed 16-bit long offset (lk) is added to
ARx = ARx + lk ARx and this sum replaces the previous content of ARx;
this sum is then used to address the data-memory
operand.§
1110 (14) *+ARx(lk)% addr = circ(ARx + lk) Before its use, the signed 16-bit long offset (lk) is added to
ARx = circ(ARx + lk) ARx using circular addressing and this sum replaces the
previous content of ARx; this sum is then used to address
the data-memory operand.§
1111 (15) *(lk) addr = lk An unsigned 16-bit long offset (lk) is used as the absolute
address of data memory (absolute addressing).§¶
† ARx is used as the data-memory address unless otherwise specified.
‡ Increment/decrement value is 1 for 16-bit word access and 2 for 32-bit word access.
§ This mode is not allowed in memory-mapped register addressing.
¶ This mode is discussed in greater detail in section 5.2.4, *(lk) Addressing, on page 5-5.
# This mode is allowed only for write accesses.
The syntaxes for offset addressing of an AR without and with updating the AR
using offset addressing are shown in Table 5–4 in MOD 12 and 13, respectively.
Notes:
1) Instructions using offset addressing cannot be repeated using the repeat
single instruction.
2) Premodification by a 16-bit word offset (*+ARx(lk)) uses an extra cycle
because the instruction code has two or three words. The last word is the
offset.
The syntaxes for subtracting AR0 from ARx and for adding AR0 to ARx are
shown in Table 5–4 for MOD = 5 and 6, respectively.
Many algorithms, such as convolution, correlation, and FIR filters, require the
implementation of a circular buffer in memory. In these algorithms, a circular
buffer is a sliding window containing the most recent data. As new data comes
in, the buffer overwrites the oldest data. The key to the implementation of a
circular buffer is the implementation of circular addressing.
The circular-buffer size register (BK) specifies the size of the circular buffer.
A circular buffer of size R must start on a N-bit boundary (that is, the N LSBs
of the base address of the circular buffer must be 0), where N is the smallest
integer that satisfies 2N > R. The value R must be loaded into BK. For example,
a 31-word circular buffer must start at an address whose five LSBs are 0 (that
is, XXXX XXXX XXX0 00002), and the value 31 must be loaded into BK. As
a second example, a 32-word circular buffer must start at an address whose
six LSBs are 0 (that is, XXXX XXXX XX00 00002), and the value 32 must be
loaded into BK. In some applications, however, it may be possible to use bit-
reversed addressing to place a 2N buffer on a 2N boundary and offer the effect
of circular addressing.
The effective base address (EFB) of the circular buffer is determined by zero-
ing the N LSBs of a user-selected auxiliary register (ARx). The end of buffer
address (EOB) of the circular buffer is determined by replacing the N LSBs of
ARx with the N LSBs of BK. The index of the circular buffer is simply the N LSBs
of ARx and the step is the quantity being added to or subtracted from the auxil-
iary register. Follow these three rules when you use circular addressing:
- Place the first (lowest) address of the circular buffer on a 2N boundary
where 2N is larger than the circular buffer size.
- Use a step less than or equal to the circular buffer size.
- The first time the circular queue is addressed, the auxiliary register must
point to an element in the circular queue.
The algorithm for circular addressing is as follows:
If 0 v index + step t BK:
index = index + step.
Else if index + step w BK:
index = index + step – BK.
Else if index + step t 0:
index = index + step + BK.
Circular addressing can be used for single data-memory or dual data-memory
operands. When BK is zero, the circular modifier results in no circular address
modification. This is especially useful when a dual operand must perform an
address modification equivalent to ARx+0.
Figure 5–9 illustrates the relationships among BK, the auxiliary register (ARx),
the bottom of the circular buffer, the top of the circular buffer, and the index into
the circular buffer.
Figure 5–10 shows how the circular buffer is implemented and illustrates the
relationship between the generated values and the elements in the circular
buffer.
15 N N–1 0 15 N N–1 0
ARx H ... H L ... L BK 0 ... 0 BL ... BL
15 N N–1 0
Circular
addressing 15 N N–1 0
algorithm
EFB H ... H 0 ... 0
logic
Base (low address)
New
index 0 ... 0 L’ ... L’ Legend: EFB Effective base address
H High-order bits
L Low-order bits
15 N N–1 0 L’ New low-order bits
New BL Low-order bit of circular buffer
ARx H ... H L’ ... L’ size register
15 N N–1 0
The syntaxes for each of the five types of circular addressing are shown in
Table 5–4 for MOD = 8, 9, 10, 11, and 14.
The syntaxes for each of the two bit-reversed addressing modes are shown
in Table 5–4 for MOD 4 and 7, respectively.
Assume that the auxiliary registers are eight bits long, that AR2 represents the
base address of the data in memory (0110 00002), and that AR0 contains the
value 0000 10002. Example 5–1 shows a sequence of modifications of AR2
and the resulting values of AR2.
Table 5–5 shows the relationship of the bit pattern of the index steps and the
four LSBs of AR2, which contain the bit-reversed address.
See the TMS320C54x DSP Reference Set, Volume 4: Applications Guide for
an application of the bit-reversed addressing mode.
- Xmem is a read operand with access through the D bus. Store instruc-
tions, for example STH and STL with shift operation, change Xmem to a
write operand.
- Ymem is used as a read operand in instructions with dual reads (accessed
through the C bus) or as a write operand in instructions with a parallel store
(accessed through the E bus).
If the source operand and the destination operand point to the same location,
in instructions with a parallel store (for example, ST||LD), the source is read
before writing to the destination. If a dual-operand instruction (for example,
ADD) points to the same auxiliary register with different addressing modes
specified for both operands, the mode defined by the Xmod field is used for
addressing.
Figure 5–11 shows the indirect-addressing instruction format for a dual data-
memory operand. Table 5–6 describes the bits of the instruction.
Because only two bits are available for selecting each auxiliary register in this
mode, only four of the auxiliary registers can be used, AR2 – AR5. Table 5–7
shows which Xar or Yar value selects which auxiliary registers.
7–6 Xmod This 2-bit field defines the type of indirect addressing mode used for accessing the Xmem
operand.
5–4 Xar The 2-bit Xmem auxiliary register selection field defines the auxiliary register that contains
the address of Xmem.
3–2 Ymod This 2-bit field defines the type of indirect addressing mode used for accessing the Ymem
operand.
1–0 Yar The 2-bit Ymem auxiliary register selection field defines the auxiliary register that contains
the address of Ymem.
Table 5–7. Auxiliary Registers Selected by Xar and Yar Field of Instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Xar or Yar
Field Auxiliary Register
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
00 AR2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
01
ÁÁÁÁÁÁÁÁ
10
AR3
AR4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
11 AR5
Table 5–8 lists the types of dual data-memory operand addressing, along with
the value of the modification field (either Xmod or Ymod), the assembler
syntax, and the function for each type.
Figure 5–12. Indirect Addressing Block Diagram for Dual Data-Memory Operands
AR0 BK lk 1
ARP(3)
ARAU0
AR0(16) index
+/– % 0
AR2(16)
DAB(16)
AR3(16) AR0 BK 1 (read)
AR4(16)
AR5(16) ARAU1
EAB(16)
+/– % 0 (write) or
BK(16) CAB(16)
(32-bit read)
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 5–8. Indirect Addressing Types With Dual Data-Memory Operands
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Xmod or
ÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Ymod Field
Operand
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Syntax Function Description†
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
00 (0)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
*ARx addr = ARx ARx is the data-memory address.
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
01 (1)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
*ARx– addr = ARx
ARx = ARx – 1
After access, the address in ARx is decremented.
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
10 (2) *ARx+ addr = ARx After access, the address in ARx is incremented.
ARx = ARx + 1
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
11 (3)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
*ARx+0%
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
addr = ARx
ARx = circ(ARx + AR0)
After access, AR0 is added to ARx using circular
addressing.‡
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
† ARx is used as the data-memory address unless otherwise specified.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
‡ The size of the circular buffer is specified in circular-buffer size register (BK)
In each case, the content of the auxiliary register is used as the data-memory
operand. After using the address in the auxiliary register, the ARAUs perform
the specified mathematical operation. By disabling circular modifications, it is
possible to perform indexed addressing or the equivalent of *ARx+0. Clearing
the BK to 0 disables circular modification.
See the TMS320C54x DSP Reference Set, Volume 4: Applications Guide for
examples of dual-operand indirect addressing.
Five instructions with optional shift also support this type of addressing for
single-word, single-cycle execution:
In using ARP, the C54x device differs from the C5x device. When the C54x
device uses the AR pointed to by ARP, the C54x device does not update the
ARP with the same instruction. Table 5–9 shows the assembler syntax
comparing the C54x device to the following devices: C20x, C24x, and C5x.
AR0(16) index
AR1(16)
AR2(16)
AR3(16)
ARP AR4(16)
AR5(16)
AR6(16)
AR7(16)
BK(16)
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Table 5–9. Assembler Syntax Comparison to TMS320C54x DSP
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Syntax for devices:
ÁÁÁÁÁÁÁ
C20x/C24x/C5x
ÁÁÁÁÁÁ
Syntax for
C54x device
Syntax for devices:
C20x/C24x/C5x
Syntax for
C54x device
ÁÁÁÁÁÁÁ
*
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ*AR0 *0– *AR0 – 0
ÁÁÁÁÁÁÁ
*–
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ*AR0– *0+ *AR0 + 0
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
*+ *AR0+ *BR0– *AR0 – 0B
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
*BR0+ *AR0 + 0B
Figure 5–14 shows the indirect-addressing instruction format for the ARP
mode. Table 5–10 describes the bits of the ARP-mode instruction.
7 I I = 1, the addressing mode used by the instruction is the indirect addressing mode.
6–3 MOD This 4-bit modification field defines the type of indirect addressing. section 5.5.3, Single-
Operand Address Modifications, on page 5-13, describes the 16 ways to specify addressing
types with the MOD field.
2–0 ARF This 3-bit auxiliary register field defines the auxiliary register used for addressing. ARF
depends on the compatibility mode bit (CMPT) in status register ST1:
CMPT = 0 Standard mode. In standard mode, ARF always specifies the auxiliary register,
regardless of the value in ARP. ARP is not updated. ARP must always be cleared
to 0 when the DSP is in this mode.
CMPT = 1 Compatibility mode. In compatibility mode, ARP selects the auxiliary register if
ARF = 0. Otherwise, ARF selects the auxiliary register and the ARF value is
loaded into ARP when the access is completed. *AR0 in the assembly instruction
indicates the auxiliary register selected by ARP in compatibility mode.
Note:
ARP must always be cleared to 0 when the DSP is in standard mode
(CMPT = 0). At reset, both ARP and CMPT are cleared to 0 automatically.
- Using the seven LSBs of the current auxiliary register value when indirect
addressing is used
Note:
In indirect addressing, the nine MSBs of the auxiliary register are forced to
0 after the operation.
All bits 0s
9
7 7 LSBs from instruction register (IR)
or current auxiliary register
16
Note:
In addition to registers, any scratch-pad RAM located on data page 0 can be
modified by using memory-mapped register addressing.
Note:
The following indirect addressing modes are not allowed for memory-
mapped register addressing:
- *ARx(lk)
- *+ARx(lk)
- *+ARx(lk)%
- *(lk)
Four instructions access the stack using the stack addressing mode:
- PSHD pushes a data-memory value onto the stack.
- PSHM pushes a memory-mapped register onto the stack.
- POPD pops a data-memory value from the stack.
- POPM pops a memory-mapped register from the stack.
Figure 5–16. Stack and Stack Pointer Before and After a Push Operation
Stack and SP before operation Stack and SP after operation
SP 0011 0001 SP 0010 0001
0010 0010 X2
0011 X1 0011 X1
0100 0100
0101 0101
0110 0110
Other operations also affect the stack and the stack pointer. The stack is used
during interrupts and subroutines to save and restore the PC contents. When
a subroutine is called or an interrupt occurs, the return address is automatically
saved in the stack using a push operation. Instructions used for subroutine
calls and interrupts are CALA[D], CALL[D], CC[D], INTR, and TRAP.
When a subroutine returns, the return address is retrieved from the stack using
a pop operation and loaded into the PC. Instructions used for returns from sub-
routines are RET[D], RETE[D], RETEF[D], and RC[D].
The FRAME instruction also affects the stack. This instruction adds a short-
immediate offset to the stack pointer. The stack is also used in SP-referenced
direct addressing (see section 5.4.2, SP-Referenced Direct Addressing, on
page 5-9).
For a 16-bit operand access, a 16-bit word is read from data memory through
the D bus and written to data memory through the E bus. For a 32-bit operand
access, both the C (for most-significant word) and the D (for least-significant
word) buses are used for a read. However, because only the E bus is used for
a write, the write operation (DST instruction) is executed in two cycles.
With 32-bit accesses, the first word accessed is treated as the most-significant
word (MSW), while the second word accessed is the least-significant word
(LSW). If the first word accessed is at an even address, then the second word
is at the next (higher) address. If the first word accessed is at an odd address,
then the second word is at the previous (lower) address. Figure 5–17 shows
this effect.
Topic Page
6.1 Program-Memory Address Generation . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.2 Program Counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
6.3 Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.4 Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
6.5 Returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6.6 Conditional Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
6.7 Repeating a Single Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20
6.8 Repeating a Block of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23
6.9 Reset Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
6.10 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
6.11 Power-Down Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-50
6-1
Program-Memory Address Generation
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 6–1. Devices With Additional Program Memory Address Lines
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
Device
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Additional
Address Lines
Provides
External Access To:
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
C548, C549, C5410 7 128 64K-Word Pages
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
C5402
C5420
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
4
2
16 64K-Word Pages
4 64K-Word Pages
One additional register is used in the C548, C549, C5402, C5410, and C5420
to address extended memory:
- Program counter extension register (XPC)
PAGEN
PC
Repeat registers
RC
BRC
RSA
REA
The C54x devices fetch instructions by putting the value of the PC on the PAB
and reading the appropriate location in memory. While the memory location is
read, PC is incremented for the next fetch. If a program address discontinuity
occurs (for example, a branch, a call, a return, an interrupt, or a block repeat),
the appropriate address is loaded into the PC. The instruction addressed
through the PAB is then loaded into the instruction register (IR).
The PC can be loaded several ways. Table 6–2 shows what is loaded into the
PC according to the code operation performed.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–2. Loading Addresses Into PC
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Code Operation
ÁÁÁÁÁÁÁÁ
Reset
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address Loaded to the PC
PC is loaded with FF80h.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Sequential execution PC is loaded with PC + 1.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Branch PC is loaded with the 16-bit-immediate value directly
following the branch instruction.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Branch from accumulator PC is loaded with the lower 16-bit word of accumulator
A or B.
Block repeat loop PC is loaded with the repeat start address (RSA) when
PC + 1 equals the repeat end address (REA) + 1,
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ provided that BRAF = 1.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Subroutine call
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
PC + 2 is pushed onto the stack, and PC is loaded with
the 16-bit-immediate value directly following the call
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
instruction mnemonic. The return instruction pops the
top of the stack back into PC to return to the calling
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Subroutine call from
sequence of code.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
return to the calling sequence of code.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Hardware interrupt, soft- PC is pushed onto the stack, and PC is loaded with the
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ware interrupt, or trap address of the appropriate trap vector. The return
instruction pops the top of the stack back into PC to
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ return to the interrupting sequence of code.
The XPC is a 7-bit register that selects the extended page of program memory
for the C548, C549, C5402, C5410, and C5420. For more information about
extended program memory in these devices, see section 3.2.5, Extended
Program Memory, on page 3-20.
The XPC can be loaded in several ways in conjunction with the loading of the
PC. Table 6–3 lists operations that load XPC.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–3. Loading Addresses into XPC
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Code Operation Address Loaded to the PC
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Reset PC is loaded with FF80h. XPC is loaded with 0h.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Sequential execution PC is loaded with PC + 1. XPC is not automatically
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
incremented.
Far branch PC is loaded with bits 15–0 of the immediate value direct-
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ly following the branch instruction. XPC is loaded bits
23–16 of that value.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Far branch from accu-
mulator
PC is loaded with bits 15–0 of accumulator A or B. XPC
is loaded with bits 23–16 of accumulator A or B.
Far subroutine call PC + 2 is pushed onto the stack, XPC is pushed onto the
stack, PC and XPC are loaded with bits 15–0 and bits
23–16, respectively, of the immediate value specified by
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
the call instruction.
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Far subroutine call from PC + 1 is pushed onto the stack, XPC is pushed onto the
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
accumulator stack, and the PC and XPC are loaded with bits 15–0
and bits 23–16, respectively, of accumulator A or B.
Far return The return instruction pops the top of the stack into XPC
and pops the next value into the PC to return to the call-
ing sequence of code.
Note:
The XPC is not loaded by instructions other than those listed in Table 6–3.
6.3 Branches
Branches break the sequential flow of instructions by transferring control to
another location in program memory. Therefore, branches affect the program
address generated and stored in PC. The C54x DSP performs both
unconditional and conditional branches, and both of these types can be either
nondelayed or delayed.
By the time the branch instruction reaches the execute phase of the pipeline,
the next two instruction words have already been fetched. How these two
instruction words are handled depends in part on whether the branch is
nondelayed or delayed:
- Nondelayed: The two instruction words are flushed from the pipeline so
that they are not executed, and then execution continues at the branched-
to address.
Note:
The two words following a delayed instruction cannot be an instruction that
causes a PC discontinuity (a branch, call, return, or software interrupt).
Table 6–4 shows the unconditional branch instructions in the C54x DSP and
the number of cycles needed to execute these instructions (both nondelayed
and delayed). Delayed instructions use two cycles fewer than the correspond-
ing nondelayed instructions because they do not flush the pipeline.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 6–4. Unconditional Branch Instructions
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction
ÁÁÁÁÁÁÁÁ
Description
Number of Cycles
(Nondelayed / Delayed)
B[D] Load PC with the address specified by 4/2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
the instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
BACC[D] Load PC with the address specified by 6/4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
the low 16 bits of the designated
accumulator
By the time the conditions have been tested, the two instruction words follow-
ing the conditional branch instruction have already been fetched and are in the
pipeline. How these two instruction words are handled depends in part on
whether the branch is nondelayed or delayed:
- Nondelayed: If all the conditions are met, these two instruction words are
flushed from the pipeline so that they are not executed, and then execution
continues at the branched-to address. If the conditions are not met, the
two instruction words are executed instead of the branch.
Note:
The two words following a delayed instruction cannot be an instruction that
causes a PC discontinuity (a branch, call, return, or software interrupt).
Table 6–5 shows the conditional branch instructions and the number of cycles
needed to execute these instructions. Because conditional branches use
conditions determined by the execution of the previous instructions, the
conditional branch instruction, BC[D], requires one more cycle than an
unconditional one.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Table 6–5. Conditional Branch Instructions
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Number of Cycles
(Condition met / Not met)
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
Instruction Description Nondelayed Delayed
BC[D] Load PC with the address specified by 5/3 3/3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
the instruction if the condition speci-
fied by the instruction is met
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
BANZ[D] ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
Load PC with the address specified by
the instruction if currently selected
4/2 2/2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁ
auxiliary register not equal to 0 (useful
ÁÁÁÁÁ
for loops)
Table 6–6 shows the far branch instructions (both nondelayed and delayed)
and the number of cycles needed to execute these instructions. Delayed
instructions use two cycles fewer than the corresponding nondelayed
instructions.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 6–6. Far Branch Instructions
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction
ÁÁÁÁÁÁÁÁ
Description
Number of Cycles
(Nondelayed / Delayed)
FB[D] Load the PC and the XPC with the 4/2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
address specified in the instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
FBACC[D]
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Load the PC and the XPC with the
ÁÁÁÁÁÁÁÁ
address specified by the lower 23 bits of
6/4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
the designated accumulator
6.4 Calls
Like branches, calls break the sequential flow of instructions by transferring
control to some other location in program memory. However, unlike branches,
this transfer is intended to be temporary. When a subroutine or function is
called, the address of the next instruction following the call is saved in the
stack. This address is used to return to the calling program and resume execu-
tion. The C54x DSP performs both unconditional and conditional calls, and
both of these types can be either nondelayed or delayed.
By the time the unconditional call instruction reaches the execute phase of the
pipeline, the next two instruction words have already been fetched. How these
two instruction words are handled depends in part on whether the call is
nondelayed or delayed:
- Nondelayed: The two instruction words are flushed from the pipeline so
that they are not executed, the return address is stored to the stack, and
then execution continues at the beginning of the called function.
Note:
The two words following a delayed instruction cannot be an instruction that
causes a PC discontinuity (a branch, call, return, or software interrupt).
Table 6–7 shows the unconditional call instructions in the C54x DSP and the
number of cycles needed to execute these instructions (both nondelayed and
delayed). Delayed instructions need two cycles fewer than the corresponding
nondelayed instructions because they do not flush the pipeline.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 6–7. Unconditional Call Instructions
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
Instruction
CALL[D]
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Description
Places the return address on the stack
Number of Cycles
(Nondelayed / Delayed)
4/2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
and then loads the PC with the address
specified by the instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
CALA[D]
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Places the return address on the stack
and then loads the PC with the address
6/4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
specified in the designated accumulator
By the time the conditions of the conditional call instruction have been tested,
the two instruction words following the call instruction have already been
fetched in the pipeline. How these two instruction words are handled depends
in part on whether the call is nondelayed or delayed:
- Nondelayed: If all the conditions are met, these two instruction words are
flushed from the pipeline so that they are not executed, and then execution
continues at the beginning of the called function. If the conditions are not
met, the two instructions are executed instead of the call.
Note:
The two words following a delayed instruction cannot be an instruction that
causes a PC discontinuity (a branch, call, return, or software interrupt).
Table 6–8 shows the conditional call instruction and the number of cycles
needed to execute this instruction. Because there is a wait cycle for conditions
to become stable, the conditional call instruction, CC[D], requires one more
cycle than the unconditional one.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Table 6–8. Conditional Call Instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Number of Cycles
(Condition met / Not met)
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Instruction
CC[D]
ÁÁÁÁÁ
ÁÁÁÁÁ
Description
Places the return address on the
Nondelayed
5/3
Delayed
3/3
stack and then loads the PC with the
address specified by the instruction if
the condition specified by the instruc-
tion is met
- The FCALL instruction pushes XPC onto the stack, pushes PC onto the
stack, and branches to the extended memory address specified by the the
instruction.
- The FCALA pushes XPC onto the stack, pushes PC onto the stack, and
branches to the extended memory address specified in the designated
accumulator.
Table 6–9 shows the far call instructions (nondelayed and delayed) and the
number of cycles needed to execute these instructions. Note that delayed
instructions need two cycles fewer than the corresponding nondelayed
instructions.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Number of Cycles
Instruction Description (Nondelayed / Delayed)
FCALL[D] Places XPC and PC on the stack and 4/2
then loads XPC and PC with the address
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
specified by the instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
FCALA[D]
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Places XPC and PC on the stack and
ÁÁÁÁÁÁÁÁ
then loads XPC and PC with the address
6/4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
specified in the designated accumulator
6.5 Returns
Return instructions provide a way to resume processing of a sequence of
instructions that was broken by a call to another function or an interrupt service
routine. When the called function or interrupt service routine has completed
its execution, it is necessary to resume processing at the point immediately
following the call or the point at which the interrupt occurred. Return instruc-
tions accomplish this by popping the top value of the stack, which contains the
address of the next instruction to be executed, into the program counter (PC).
The C54x DSP performs both unconditional and conditional returns, and
both of these types can be either nondelayed or delayed.
By the time the unconditional return instruction reaches the execute phase of
the pipeline, the next two instruction words have already been fetched. How
these two instruction words are handled depends in part on whether the return
is nondelayed or delayed.
- Nondelayed: The two instruction words are flushed from the pipeline so
that they are not executed, the return address is taken from the stack or
from the RTN register, and then execution continues at that address in the
calling function.
Note:
The two words following a delayed instruction cannot be an instruction that
causes a PC discontinuity (a branch, call, return, or software interrupt).
Table 6–10 shows the unconditional return instructions in the C54x DSP and
the number of cycles needed to execute these instructions (nondelayed and
delayed). Delayed instructions need two cycles fewer than the corresponding
nondelayed instructions.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 6–10. Unconditional Return Instructions
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction
ÁÁÁÁÁÁÁÁ
Description
Number of Cycles
(Nondelayed / Delayed)
RET[D] Load the PC with the return address at 5/3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
the top of the stack
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
RETE[D]
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Load the PC with the return address at
ÁÁÁÁÁÁÁÁ
the top of the stack, and enable mask-
able interrupts
5/3
Enabling interrupts with the RETE and RETF instructions ensures that the
return executes before another interrupt is processed. By using the RETF
instruction, loading the PC from the RTN register rather than the stack allows
a quicker return. This reduces the total number of cycles used by an interrupt
routine, which is particularly important for short, frequently used interrupt
routines.
Note:
The RTN register is a CPU-internal register that you cannot read from or write
to.
By using the conditional return (RC) instruction, you can give a function or
interrupt service routine (ISR) more than one possible return path. The path
chosen depends on the data being processed. In addition, you can use a
conditional return to avoid conditionally branching to/around the return instruc-
tion at the end of the function or ISR.
Conditional returns operate like unconditional returns, but they execute only
when one or more conditions are met. The possible conditions are given in
Table 6–13 on page 6-16. If all the conditions are met, the processor loads the
return address from the stack to PC, and resumes execution of the calling
program.
By the time the conditions of the conditional return instruction have been
tested, the two instruction words following the return instruction have already
been fetched in the pipeline. How these two instruction words are handled
depends in part on whether the return is nondelayed or delayed:
- Nondelayed: If all the conditions are met, these two instruction words are
flushed from the pipeline so that they are not executed, and then execution
of the calling program continues. If the conditions are not met, the two
instructions are executed instead of the return.
- Delayed: The processor executes the two instructions that follow the
return instruction. This allows you to avoid flushing the pipeline, which
requires extra cycles. The conditions tested are not affected by the instruc-
tions following the delayed return.
Note:
The two words following a delayed instruction cannot be an instruction that
causes a PC discontinuity (a branch, call, return, or software interrupt).
Table 6–11 shows the conditional return instruction and the number of cycles
needed to execute this instruction.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Table 6–11. Conditional Return Instruction
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Number of Cycles
(Condition met / Not met)
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
Instruction Description Nondelayed Delayed
RC[D] Load PC with the return address at 5/3 3/3
the top of the stack if the condition
specified by the instruction is met
- FRET loads XPC from the stack and then loads PC from the stack, allow-
ing program execution to resume at the previous point.
- FRETE loads XPC from the stack, loads PC from the stack, and enables
maskable interrupts.
Table 6–12 shows the far return instructions (nondelayed and delayed) and
the number of cycles needed to execute these instructions. Note that delayed
instructions need two cycles fewer than the corresponding nondelayed
instructions.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Table 6–12. Far Return Instructions
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction
ÁÁÁÁÁÁÁÁ
Description
Number of Cycles
(Nondelayed / Delayed)
FRET[D] Loads XPC with the value at the top of the 6/4
stack and loads PC with the next value on
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
the stack
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
FRETE[D] Loads XPC with the value at the top of the 6/4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
stack, loads PC with the next value on the
stack, and enables maskable interrupts
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Condition Description Operand
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
A=0 Accumulator A equal to 0 AEQ
ÁÁÁÁÁÁÁ
B=0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
A00
ÁÁÁÁ
Accumulator B equal to 0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
BEQ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Accumulator A not equal to 0 ANEQ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
B00 Accumulator B not equal to 0 BNEQ
ÁÁÁÁÁÁÁ
A<0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Accumulator A less than 0 ALT
ÁÁÁÁÁÁÁ
B<0
Av0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Accumulator B less than 0 BLT
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Accumulator A less than or equal to 0 ALEQ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Bv0 Accumulator B less than or equal to 0 BLEQ
ÁÁÁÁÁÁÁ
A>0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Accumulator A greater than 0 AGT
ÁÁÁÁÁÁÁ
B>0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Accumulator B greater than 0 BGT
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Aw0 Accumulator A greater than or equal to 0 AGEQ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Bw0 Accumulator B greater than or equal to 0 BGEQ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
AOV = 1
ÁÁÁÁ
Accumulator A overflow detected AOV
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
BOV = 1
ÁÁÁÁ
Accumulator B overflow detected BOV
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
AOV = 0 No accumulator A overflow detected ANOV
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
BOV = 0 No accumulator B overflow detected BNOV
ÁÁÁÁÁÁÁ
C=1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ALU carry set to 1 C
ÁÁÁÁÁÁÁ
C=0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ALU carry cleared to 0 NC
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
TC = 1 Test/control flag set to 1 TC
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
TC = 0
ÁÁÁÁÁÁÁ ÁÁÁÁ
Test/control flag cleared to 0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
BIO low
ÁÁÁÁ
BIO signal is low
NTC
BIO
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
BIO high
none
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
BIO signal is high
Unconditional operation
NBIO
UNC
- Group 1: You can select one condition from category A and one condi-
tion from category B. The two conditions cannot be from the same catego-
ry. For example, you can test EQ and OV at the same time but you cannot
test GT and NEQ at the same time. The accumulator must be the same
for both conditions; you cannot test conditions for both accumulators with
the same instruction. For example, you can test AGT and AOV at the same
time, but you can not test AGT and BOV at the same time.
- Group 2: You can select one condition from each of three categories (A,
B, and C). No two conditions can be from the same category. For example,
you can test TC, C, and BIO at the same time, but you cannot test NTC,
C, and NC at the same time.
LT
LEQ
GT
GEQ
The condition must be stable two full cycles before the XC instruction is
executed. This ensures that the decision is made before the instruction follow-
ing XC is decoded. Avoid changing the XC condition in the two 1-word instruc-
tions prior to XC. If no interrupts occur, these instructions have no effect on XC.
However, if an interrupt occurs, it can trap between the instructions and XC,
affecting the condition before XC is executed. See Chapter 7, Pipeline, for
information about pipeline latencies.
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
SACCD Accumulator A or B
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
STRCD
SRCCD
Temporary register (T)
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–16. Conditions for Conditional Store Instructions
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Operand
ÁÁÁÁÁÁ
AEQ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Condition
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
A=0
Description
Accumulator A equal to 0
ÁÁÁÁÁÁ
BEQ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
B=0 Accumulator B equal to 0
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ANEQ A00 Accumulator A not equal to 0
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
BNEQ
ÁÁÁÁÁÁ
ALT
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
B00
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
A<0
Accumulator B not equal to 0
ÁÁÁÁÁÁ
BLT
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
B<0 Accumulator B less than 0
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ALEQ Av0 Accumulator A less than or equal to 0
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
BLEQ
ÁÁÁÁÁÁ
AGT
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
Bv0
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
A>0
Accumulator B less than or equal to 0
ÁÁÁÁÁÁ
BGT
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
B>0 Accumulator B greater than 0
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
AGEQ Aw0 Accumulator A greater than or equal to 0
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
BGEQ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Bw0 Accumulator B greater than or equal to 0
ÁÁÁÁÁ
Description # Cycles†
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
FIRS Symmetrical FIR filter 3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
MACD Multiply and move result in accumulator with delay 3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
MACP
ÁÁÁÁÁ
Multiply and move result in accumulator 3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
MVDK
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
MVDM
Data-to-data move
ÁÁÁÁÁ
Data-to-MMR move
2
2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
MVDP
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Data-to-program move
ÁÁÁÁÁ
4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
MVKD Data-to-data move 2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
MVMD MMR-to-data move 2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
MVPD Program-to-data move 3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
READA
WRITA ÁÁÁÁÁ
Program-to-data move
Data-to-program move
5
5
† Number of cycles when instruction is not repeated
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–18. Nonrepeatable Instructions
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction Description
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ADDM Add long constant to data memory
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ANDM AND data memory with long constant
ÁÁÁÁÁÁÁ
B[D]
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Unconditional branch
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
BACC[D] Branch to accumulator address
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
BANZ[D] Branch on auxiliary register not 0
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
BC[D]
ÁÁÁÁÁÁÁ
Conditional branch
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
CALA[D] Call to accumulator address
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
CALL[D] Unconditional call
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
CC[D] Conditional call
ÁÁÁÁÁÁÁ
CMPR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
DST
Compare with auxiliary register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Long word (32-bit) store
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FB[D] Far branch unconditionally
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FBACC[D] Far branch to location specified by accumulator
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FCALA[D] Far call subroutine at location specified by accumulator
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FCALL[D] Far call unconditionally
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FRET[D] Far return
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FRETE[D] Enable interrupts and far return from interrupt
ÁÁÁÁÁÁÁ
IDLE
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Idle instructions
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
INTR Interrupt trap
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
LD ARP
ÁÁÁÁÁÁÁ
Load auxiliary register pointer (ARP)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
LD DP Load data page pointer (DP)
ÁÁÁÁÁÁÁ
MVMM
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Move memory-mapped register (MMR) to another MMR
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ORM OR data memory with long constant
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RC[D] Conditional return
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RESET Software reset
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RET[D] Unconditional return
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–18. Nonrepeatable Instructions (Continued)
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction
ÁÁÁÁÁÁÁÁ
Description
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RETE[D] Return from interrupt
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RETF[D] Fast return from interrupt
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RND Round accumulator
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RPT
ÁÁÁÁÁÁÁÁ
Repeat next instruction
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RPTB[D] Block repeat
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RPTZ Repeat next instruction and clear accumulator
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RSBX Reset status register bit
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
SSBX
ÁÁÁÁÁÁÁÁ
Set status register bit
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
TRAP Software trap
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
XC Conditional execute
The instructions used for this operation are RPTB and RPTBD (a delayed
instruction). The RPTB instruction executes in four cycles. RPTBD allows the
execution of one 2-word instruction or two 1-word instructions following the
RPTBD instruction instead of flushing the pipeline; thus, RPTBD effectively
executes in 2 cycles. When the RPTBD instruction is used, delayed instruc-
tions cannot be in the two words following the RPTBD instruction.
- BRC contains the value N, which is one less than the number of times the
block is to be repeated.
- The block-repeat start address register (RSA) holds the address of the first
instruction of the block of code to be repeated.
- The block-repeat end address register (REA) holds the address of the last
instruction word of the block of code to be repeated.
BRAF is set to 1 to activate the block repeat. The block repeat feature can be
activated only if the number of iterations is greater than 0. The following steps
start a loop:
Step 1: You load BRC with a loop count in the 0 through 65 535 range.
Step 3: The instruction loads REA with the address following the last word
of the last instruction to be repeated in the block, which is also the
long-immediate operand given in the instruction. This action also
sets BRAF. REA is loaded with the 16-bit-immediate operand of the
RPTB or RPTBD instruction, and the BRAF bit is set. The value for
the 16-bit-immediate operand of RPTB or RPTBD is L – 1, where L
is the address of the instruction following the last word of the last
instruction in the loop.
Every time the PC is updated during loop execution, REA is compared to the
PC value. If the values are equal, BRC is decremented. If BRC is greater than
or equal to 0, RSA is loaded into the PC to restart the loop. If not, BRAF is reset
to 0 and the processor resumes execution past the end of the loop.
BRC is decremented during the instruction decode phase of the last repeat
block instruction. For this reason, be careful when using the SRCCD instruc-
tion within a loop. To save the current loop counter value (the predecremented
BRC), the SRCCD instruction must be placed a minimum of three instructions
before the end of the loop.
There is only one set of block repeat registers, so multiple block repeats cannot
be nested without saving the context of the outside loops. The simplest way
of establishing nested loops is to use the RPTB[D] instruction for the innermost
loop only, and use the BANZ[D] for all outer loops.
Reset (RS) is a nonmaskable external interrupt that can be used at any time to
place the C54x DSP into a known state. For correct system operation after
power-up, RS must be asserted (low) for several clock cycles to ensure that
the data, address, and control lines are configured properly. Approximately
five clock cycles after RS is de-asserted (goes high), the processor fetches the
instruction at FF80h and begins executing code. See section 10.5, Start-Up
Access Sequences, on page10-24, for the reset sequence.
Notes:
1) The remaining status bits are not initialized—your code must initialize
them appropriately.
2) Reset does not initialize the stack pointer (SP). Your code must initialize it.
3) If MP/MC = 0, the device begins executing code from the on-chip ROM.
Otherwise, it begins executing code from off-chip memory.
6.10 Interrupts
Interrupts are hardware-driven or software-driven signals that cause the
C54x DSP to suspend its main program and execute another function called
an interrupt service routine (ISR). Typically, interrupts are generated by
hardware devices that need to give data to or take data from the C54x DSP (for
example, ADCs, DACs, and other processors). Interrupts can also be used to
signal that a particular event has taken place (for example, the timer is finished
counting).
The C54x DSP supports both software and hardware interrupts:
- A software interrupt is requested by a program instruction (INTR, TRAP,
or RESET).
- A hardware interrupt is requested by a signal from a physical device. Two
types exist:
J External hardware interrupts are triggered by signals at external inter-
rupt ports.
J Internal hardware interrupts are triggered by signals from the on-chip
peripherals.
When multiple hardware interrupts are triggered at the same time, the C54x
DSP services them according to a set priority ranking in which 1 has the
highest priority. To determine the priorities for the hardware interrupts, refer to
the table for your particular C54x device in section 6.10.10, Interrupt Tables,
on page 6-38.
Each of the C54x DSP interrupts, whether hardware or software, can be
placed in one of the following two categories:
- Maskable interrupts. These are hardware or software interrupts that can
be blocked (masked) or enabled (unmasked) using software. The C54x
DSP supports up to 16 user-maskable interrupts (SINT15–SINT0). Each
device uses a subset of these 16 interrupts. For example, the C541 uses
only nine of these interrupts (the others are tied high internally). Some of
these have two names because they can be initiated by software or
hardware; for the C541, the hardware names for these interrupts are:
J INT3 through INT0
J RINT0, XINT0, RINT1, and XINT1 (serial port interrupts)
J TINT (timer interrupt)
- Nonmaskable interrupts. These interrupts cannot be blocked. The C54x
DSP always acknowledges this type of interrupt and branches from the
main program to an ISR. The C54x DSP nonmaskable interrupts include
all software interrupts and two external hardware interrupts: RS (reset)
and NMI. (RS and NMI can also be asserted using software.)
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd Resvd INT3 XINT1 RINT1 XINT0 RINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd HPINT INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd Resvd INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd HPINT INT3 XINT1 RINT1 BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd Resvd INT3 XINT1 RINT1 BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd BXINT1 BRINT1 HPINT INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15–14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd BMINT1 BMINT0 BXINT1 BRINT1 HPINT INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd Resvd INT3 XINT1 RINT1 XINT0 RINT0 TINT INT2 INT1 INT0
Resvd Resvd Resvd HPINT INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
Resvd Resvd Resvd Resvd INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd HPINT INT3 XINT1 RINT1 BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd Resvd Resvd Resvd INT3 XINT1 RINT1 BXINT0 BRINT0 TINT INT2 INT1 INT0
15–12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd BXINT1 BRINT1 HPINT INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15–14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Resvd BMINT1 BMINT0 BXINT1 BRINT1 HPINT INT3 TXINT TRINT BXINT0 BRINT0 TINT INT2 INT1 INT0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Interrupt
Request Acknowledgment service routine
Table 6–19 through Table 6–24 (pages 6-38 through 6-43) list the interrupt
sources for some C54x devices.
Interrupt
Request Acknowledgment
service routine
After an interrupt has been requested by hardware or software, the CPU must
decide whether to acknowledge the request. Software interrupts and non-
maskable hardware interrupts are acknowledged immediately. Maskable
hardware interrupts are acknowledged only after certain conditions are met:
- INTM bit is 0. The interrupt mode bit (INTM), which is in ST1, enables or
disables all maskable interrupts:
J When INTM = 0, all unmasked interrupts are enabled.
J When INTM = 1, all unmasked interrupts are disabled.
- IMR mask bit is 1. Each of the maskable interrupts has its own mask bit
in the IMR. To enable an interrupt, set its mask bit to 1. See section 6.10.2,
Interrupt Mask Register (IMR), on page 6-29.
For enabled interrupts, when IACK occurs, the interrupt number is indicated
by address bits A6–A2 on the rising edge of CLKOUT. If the interrupt vectors
reside in on-chip memory and you want to observe the addresses, the C54x
DSP must operate in address visibility mode (AVIS = 1) so that the interrupt
number can be decoded. If an interrupt occurs while the C54x DSP is on hold
and HM = 0, the address cannot be present when IACK becomes active.
Interrupt
Request Acknowledgment service routine
1) Stores the program counter (PC) value (the return address) to the top of
the stack in data memory
Note:
The program counter extension register, XPC, does not get pushed to the top
of the stack; that is, it does not get saved on the stack. Therefore, if an ISR
is located on a different page from the vector table, you must push the XPC
on the stack prior to branching to the ISR. A FRET[E] can be used to return
from the ISR.
4) Executes the branch, which leads it to the address of your ISR. (If the
branch is delayed, the additional instruction(s) are executed before the
branch.)
5) Executes the ISR until a return instruction concludes the ISR
6) Follows the stack pointer (SP) to the top of the stack, and pops the return
address off the stack and into PC
There are a number of special considerations that you must follow when doing
context saves and restores. The first consideration is that when you use the
stack to save the context you must perform the restore in the exact reverse
order. The second consideration is that BRC should be restored prior to restor-
ing the BRAF bit in ST1. If you fail to follow this order, the BRAF bit will be
cleared, if BRC = 0 before BRC is restored.
The C54x DSP completes all instructions in the pipeline except the instructions
in the prefetch and fetch stages before executing an interrupt, so the maximum
interrupt latency depends on the contents of the pipeline. See section 7.2,
Interrupts and the Pipeline, on page 7-25 for more information about pipeline
latencies associated with interrupts. Instructions that are extended by wait
states for slower-memory access and repeated instructions require extra time
to process an interrupt.
The single-repeat instructions (RPT and RPTZ) require that all executions of
the next instruction be completed before allowing an interrupt to execute to
protect the context of the repeated instructions. This protection is necessary,
because these instructions run parallel operations in the pipeline, and the
context of these operations cannot be saved in the ISR.
Since the hold function takes precedence over interrupts, it can also delay an
interrupt trap. If an interrupt occurs when the CPU is on hold (HOLD is
asserted) and the interrupt vector must be fetched from external memory, the
interrupt is not taken until HOLDA is de-asserted (after the hold state ends).
However, if the processor is in the concurrent hold mode (HM = 0) and the
interrupt vector table is located in internal memory, the CPU takes the interrupt,
regardless of HOLD.
Interrupts cannot be processed between the RSBX INTM instruction and the
next instruction in a program sequence. If an interrupt occurs during the
decode phase of RSBX INTM, the CPU always completes RSBX INTM as well
as the following instruction before the pending interrupt is processed. Waiting
for these instructions to complete ensures that a return (RET) can be executed
in an ISR before the next interrupt is processed to protect against stack over-
flow. If an ISR ends with an RETE instruction (return from ISR with enable), the
RSBX INTM instruction is unnecessary. Similar to an RSBX INTM instruction,
an SSBX INTM instruction and the instruction that follows it cannot be
interrupted.
Note:
Reset (RS) is not delayed by multicycle instructions. NMI can be delayed by
multicycle instructions and by HOLD.
Note:
The INTR instruction disables maskable interrupts by setting the interrupt
mode bit (INTM), but the TRAP instruction does not affect INTM.
Vector 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address 0 0 C 0
At reset, the IPTR bits are set to 1 (IPTR = 1FFh); this value maps the vectors
to page 511 in program-memory space. Therefore, the reset vector for hard-
ware resets always resides at location 0FF80h. The interrupt vectors can be
mapped to another location by loading IPTR with a value other than 1FFh. For
example, the interrupt vectors can be moved to start at location 0080h by load-
ing IPTR with 0001h.
Note:
The hardware reset (RS) vector cannot be remapped because the hardware
reset loads the IPTR with 1s. Therefore, the reset vector for hardware resets
is always fetched at location FF80h in program space.
No
Interrupt
maskable?
Yes
No
INTM = 0?
Yes
No
IMR mask
bit = 1?
Yes
Interrupt acknowledged;
IACK generated
INTM set to 1
No
Table 6–19 through Table 6–24 show the interrupt trap number, priority, and
location for some C54x devices.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–19. TMS320C541 Interrupt Locations and Priorities
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
TRAP/INTR
ÁÁÁÁÁÁÁÁÁÁÁ Location
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
Number (K)
ÁÁÁÁÁÁ
0 ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
Priority
ÁÁÁÁÁÁÁÁÁÁÁ 1
Name
RS/SINTR
(Hex)
0
Function
Reset (hardware and software reset)
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
ÁÁÁÁÁ
1
ÁÁÁÁÁ
ÁÁÁÁÁÁ
2 ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
2
–
NMI/SINT16
SINT17
4
8
Nonmaskable interrupt
Software interrupt #17
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
ÁÁÁÁÁ
3
ÁÁÁÁÁ
ÁÁÁÁÁÁ
4
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
–
–
SINT18
SINT19
C
10
Software interrupt #18
Software interrupt #19
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
ÁÁÁÁÁ
5
ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
– SINT20 14 Software interrupt #20
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
6 – SINT21 18 Software interrupt #21
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
7 – SINT22 1C Software interrupt #22
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
8 – SINT23 20 Software interrupt #23
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
9 – SINT24 24 Software interrupt #24
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
10 – SINT25 28 Software interrupt #25
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
11 – SINT26 2C Software interrupt #26
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
12 – SINT27 30 Software interrupt #27
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
13
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ
14 ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
–
–
SINT28
SINT29
34
38
Software interrupt #28
Software interrupt #29; reserved
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
15
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ
16 ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
–
3
SINT30
INT0/SINT0
3C
40
Software interrupt #30; reserved
External user interrupt #0
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
17
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ
18
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
4
5
INT1/SINT1
INT2/SINT2
44
48
External user interrupt #1
External user interrupt #2
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁÁÁÁ
19
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
6 TINT/SINT3 4C Internal timer interrupt
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
20 7 RINT0/SINT4 50 Serial port 0 receive interrupt
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
21 8 XINT0/SINT5 54 Serial port 0 transmit interrupt
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
22 9 RINT1/SINT6 58 Serial port 1 receive interrupt
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
23 10 XINT1/SINT7 5C Serial port 1 transmit interrupt
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
24 11 INT3/SINT8 60 External user interrupt #3
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
25–31 – 64–7F Reserved
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–20. TMS320C542 Interrupt Locations and Priorities
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
TRAP/INTR
ÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ
Number (K) ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Priority Name
Location
(Hex) Function
ÁÁÁÁÁÁ
ÁÁÁÁÁ
0
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
1 RS/SINTR 0 Reset (hardware and software reset)
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
1
ÁÁÁÁÁÁ
ÁÁÁÁÁ
2
ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
2 NMI/SINT16
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT17
4
8
Nonmaskable interrupt
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
3 ÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT18 C Software interrupt #18
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
4 – SINT19 10 Software interrupt #19
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
5
ÁÁÁÁÁÁ
ÁÁÁÁÁ
6
ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
– SINT20
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT21
14
18
Software interrupt #20
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
7
ÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT22 1C Software interrupt #22
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
8 – SINT23 20 Software interrupt #23
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
9
ÁÁÁÁÁÁ
ÁÁÁÁÁ
10 ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
– SINT24
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT25
24
28
Software interrupt #24
ÁÁÁÁÁÁ
ÁÁÁÁÁ
11
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT26 2C Software interrupt #26
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
12 – SINT27 30 Software interrupt #27
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
13 – SINT28 34 Software interrupt #28
ÁÁÁÁÁÁ
ÁÁÁÁÁ
14
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT29 38 Software interrupt #29, reserved
ÁÁÁÁÁÁ
ÁÁÁÁÁ
15
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
– SINT30 3C Software interrupt #30, reserved
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
16 3 INT0/SINT0 40 External user interrupt #0
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
17 4 INT1/SINT1 44 External user interrupt #1
ÁÁÁÁÁÁ
ÁÁÁÁÁ
18
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
5 INT2/SINT2 48 External user interrupt #2
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
19
ÁÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
6 TINT/SINT3
ÁÁÁÁÁÁÁÁÁÁÁÁ
4C Internal timer interrupt
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
20 7 BRINT0/SINT4 50 Buffered serial port receive interrupt
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
21 8 BXINT0/SINT5 54 Buffered serial port transmit interrupt
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
22 9 TRINT/SINT6 58 TDM serial port receive interrupt
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
23
ÁÁÁÁÁÁ
ÁÁÁÁÁ
24
ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
10 TXINT/SINT7
ÁÁÁÁÁÁÁÁÁÁÁÁ
11 INT3/SINT8
5C
60
TDM serial port transmit interrupt
ÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁ
25
ÁÁÁÁÁÁ
ÁÁÁÁÁ
26–31
ÁÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
12
–
HPINT/SINT9 64
68–7F
HPI interrupt
Reserved
TRAP/INTR Location
Number (K) Priority Name (Hex) Function
0 1 RS/SINTR 0 Reset (hardware and software reset)
TRAP/INTR Location
Number (K) Priority Name (Hex) Function
0 1 RS/SINTR 0 Reset (hardware and software reset)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–27. TMS320C5410 Interrupt Locations and Priorities
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
TRAP/INTR Location
Number (K) Priority Name (Hex) Function
0 1 RS/SINTR 0 Reset (hardware and software reset)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–27. TMS320C5410 Interrupt Locations and Priorities (Continued)
TRAP/INTR Location
Number (K) Priority Name (Hex) Function
5 – SINT20 14 Software interrupt #20
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 6–27. TMS320C5410 Interrupt Locations and Priorities (Continued)
TRAP/INTR Location
Number (K) Priority Name (Hex) Function
28 15 DMAC4/SINT12 70 DMA channel 4 interrupt
18 5 INT2/SINT2 48 Reserved
24 11 INT3/SINT8 60 Reserved
You can invoke one of the power-down modes either by executing the IDLE 1,
IDLE 2 or IDLE 3 instructions, or by driving the HOLD signal low with the HM
status bit set to 1. Power-down operation is summarized in Table 6–29 and
described in detail in sections 6.11.1 through 6.11.5.
Use the IDLE 1 instruction to enter the IDLE1 mode. To terminate IDLE1, use
a wake-up interrupt. If INTM = 0 when the wake-up interrupt takes place, the
C54x DSP enters the ISR when IDLE1 is terminated. If INTM = 1, the C54x
DSP continues with the instruction following the IDLE 1 instruction. All
wake-up interrupts must set to enable the corresponding bits in the IMR
register regardless of the INTM value. The only exceptions are the nonmask-
able interrupts, RS and NMI.
6.11.2 IDLE2 Mode
The IDLE2 mode halts the on-chip peripherals as well as the CPU. Because
the on-chip peripherals are stopped in this mode, they cannot be used to
generate the interrupt to wake up the C54x DSP as with IDLE1. However,
power is significantly reduced because the device is completely stopped.
Use the IDLE 2 instruction to enter the IDLE2 mode. To terminate IDLE2,
activate any of the external interrupt pins (RS, NMI, and INTx) with a 10-ns
minimum pulse. If INTM = 0 when the wake-up interrupt takes place, the C54x
DSP enters the ISR when IDLE2 is terminated. If INTM = 1, the C54x DSP
continues with the instruction following IDLE 2 instruction. All wake-up
interrupts must be set to enable the corresponding bits in the IMR register
regardless of the INTM value. Reset all peripherals when IDLE2 terminates,
especially if they are externally clocked.
When RS is the wake-up interrupt in IDLE2, a 10-ns minimum pulse of RS can
activate the reset sequence.
6.11.3 IDLE3 Mode
The IDLE3 mode functions like IDLE2 but it also halts the PLL. IDLE3 is used
for a complete shutdown of the C54x DSP. This mode reduces power dissipa-
tion more than IDLE2. Furthermore, the IDLE3 state allows you to reconfigure
the PLL externally if the system requires the C54x DSP to operate at a lower
speed to save power.
Use the IDLE 3 instruction to enter the IDLE3 mode. To terminate IDLE3,
activate any of the external interrupt pins (RS, NMI, and INTx) with a 10-ns
minimum pulse. If INTM = 0 when the wake-up interrupt takes place, the C54x
DSP enters the ISR when IDLE3 is terminated. If INTM = 1, the C54x DSP
continues with the instruction following the IDLE 3 instruction. All wake-up
interrupts should be set to enable the corresponding bits on the IMR register,
regardless of the INTM value. Reset all peripherals when IDLE3 terminates,
especially if they are externally clocked.
To terminate IDLE3, the external interrupt must be a minimum of 10 ns to
activate the wake-up sequence. The C54x DSP can accept multiple interrupts
during the wake-up sequence; the interrupt with highest priority is serviced first
after IDLE3. See section 10.5.2, IDLE3, on page 10-26, and section 8.5.2,
Software-Programmable PLL (Available on TMS320C545/546/548), on page
8-27 for more details on PLL lockup time requirements.
This power-down mode is initiated by the HOLD signal. The effect of HOLD
depends on the value of HM. If HM = 1, the CPU stops executing and address,
data, and control lines go into the high-impedance state for further power
reduction. If HM = 0, the address, data, and control signals are put into the
high-impedance state, but the CPU continues to execute internally. You can
use HM = 0 with the HOLD signal when your system does not require external-
memory accesses. The C54x DSP continues to operate normally unless an
off-chip access is required by an instruction; then the processor halts until
HOLD is released.
This mode does not stop the operation of on-chip peripherals (such as timers
and serial ports); they continue to operate regardless of the HOLD level or the
condition of the HM bit.
Pipeline
This chapter describes the TMS320C54x DSP pipeline operation and lists
the pipeline latency cycles for operations with various registers.
Topic Page
The C54x DSP has a six-level deep instruction pipeline. The six stages of
the pipeline are independent of each other, which allows overlapping
execution of instructions. During any given cycle, from one to six different
instructions can be active, each at a different stage of completion.
- Program prefetch. Program address bus (PAB) is loaded with the address
of the next instruction to be fetched.
- Program fetch. An instruction word is fetched from the program bus (PB)
and loaded into the instruction register (IR). This completes an instruction
fetch sequence that consists of this and the previous cycle.
- Decode. The contents of the instruction register (IR) are decoded to deter-
mine the type of memory access operation and the control sequence at
the data-address generation unit (DAGEN) and the CPU.
- Access. DAGEN outputs the read operand’s address on the data address
bus, DAB. If a second operand is required, the other data address bus,
CAB, is also loaded with an appropriate address. Auxiliary registers in
indirect addressing mode and the stack pointer (SP) are also updated.
This is considered the first of the 2-stage operand read sequence.
- Read. The read data operand(s), if any, are read from the data buses, DB
and CB. This completes the two-stage operand read sequence. At the
same time, the two-stage operand write sequence begins. The data
address of the write operand, if any, is loaded into the data write address
bus (EAB). For memory-mapped registers, the read data operand is read
from memory and written into the selected memory-mapped registers
using the DB.
Figure 7–1 shows the six stages of the pipeline and the events that occur in
each stage.
The first two stages of the pipeline, prefetch and fetch, are the instruction fetch
sequence. In one cycle, the address of a new instruction is loaded. In the
following cycle, an instruction word is read. In case of multiword instructions,
several such instruction fetch sequences are needed.
Loads PB with the Loads DAB with the data1 read Executes the instruction
fetched instruction address, if required and loads EB with write
word Loads CAB with the data2 read data
address, if required
Updates auxiliary registers and
stack pointer
Time
During the third stage of the pipeline, decode, the fetched instruction is
decoded so that appropriate control sequences are activated for proper
execution of the instruction.
The next two pipeline stages, access and read, are an operand read
sequence. If required by the instruction, the data address of one or two oper-
ands are loaded in the access phase and the operand or operands are read
in the following read phase.
Any write operation is spread over two stages of the pipeline, the read and
execute stages. During the read phase, the data address of the write operand
is loaded onto EAB. In the following cycle, the operand is written to memory
using EB.
Each memory access is performed in two phases by the C54x DSP pipeline.
In the first phase, an address bus is loaded with the memory address. In the
second phase, a corresponding data bus reads from or writes to that memory
address. Figure 7–2 shows how various memory accesses are performed by
the C54x DSP pipeline. It is assumed that all memory accesses in the figure
are performed by single-cycle, single-word instructions to on-chip dual-access
memory. The on-chip dual-access memory can actually support two accesses
in a single pipeline cycle. This is discussed in section 7.3, Dual-Access
Memory and the Pipeline, on page 7-27.
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Figure 7–2. Pipelined Memory Accesses
ÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
(a) Instruction word fetch (one cycle)
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Prefetch Fetch Decode Access Read Execute/Write
ÁÁ
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load PAB
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
Read from PB
ÁÁ
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
(b) Instruction performing single operand read (for example, LD *AR1, A; one cycle)
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
Prefetch Fetch Decode Access Read Execute/Write
ÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
ÁÁ
Load DAB Read from DB
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁÁÁÁÁ
(c) Instruction performing dual-operand read (for example, MAC *AR2+, *AR3+, A or DLD *AR2, A; one cycle)
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Prefetch
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Fetch Decode Access Read Execute/Write
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load DAB Read from DB
ÁÁ ÁÁ
and CAB and CB
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
(d) Instruction performing single-operand write (for example, STH A, *AR1; one cycle)
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Prefetch
ÁÁFetch Decode Access Read Execute/Write
ÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load EAB Write to EB
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
(e) Instruction performing dual-operand write, (for example, DST A, *AR1; two cycles)
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
Prefetch
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Fetch
ÁÁÁÁÁÁÁDecode Access Read Execute
ÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load EAB Write to EAB
ÁÁ
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
Prefetch ÁÁ
ÁÁFetch Decode Access Read Execute/Write
ÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load EAB Write to EB
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
(f) Instruction performing operand read and operand write (for example, ST A, *AR2 || LD *AR3, B; one cycle)
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Prefetch
ÁÁFetch Decode Access Read Execute/Write
ÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Read from DB
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Load DAB Write to EB
Loads EAB
ÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
7-4 Pipeline SPRU131G
Pipeline Operation
The following sections provide examples that demonstrate how the pipeline
works while executing different types of instructions. Unless otherwise noted,
all instructions shown in the examples are considered single-cycle, single-
word instructions residing in on-chip memory.
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Example 7–1. Sample Pipeline Diagram
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address Instruction
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ a1, a2
ÁÁ
B b1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
This is a four-cycle, two-word branch instruction
ÁÁ ÁÁ
a3 i3 This is any one-cycle, one-word instruction
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁ
a4 i4 This is any one cycle, one-word instruction
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
... ...
b1 j1
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
2
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ3 4 5 6 7 8 9 10
ÁÁ
ÁÁÁÁ
ÁÁ
B ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
Prefetch
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ
PAB = a1 ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
Fetch
ÁÁÁ
ÁÁÁÁ
PB = B ÁÁÁÁ
ÁÁÁ ÁÁ
Decode
ÁÁÁÁ
ÁÁ
IR = B
Access Read Execute
ÁÁ
ÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁ
b1
ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
Prefetch
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
PAB = a2
ÁÁ
ÁÁÁÁ
Fetch
ÁÁ
PB = b1
Decode
IR = b1
Access Read Execute
b1
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Pipeline flush PAB = a3 PB = i3
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Pipeline flush PAB = a4 PB = i4
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
Á ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁÁ
j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ PAB = b1 PB = j1 IR = j1 j1
ÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Each row in the example is labeled on the left as an instruction, an operand,
a multicycle instruction, or a pipeline flush. The numbers across the top repre-
sent single instruction cycles. Some cycles do not show all pipeline stages—
this is done intentionally to avoid displaying unnecessary information.
Each box in the example contains relevant actions that occur at that pipeline
stage. The name of each pipeline stage is shown above the box in which the
action occurs.
Shading represents all instruction fetches and pipeline flushes that are neces-
sary to complete the instruction whose operation is shown.
Example 7–2 and Example 7–3 show the pipeline’s behavior during the
execution of a branch (B) instruction and a delayed-branch (BD) instruction,
respectively.
ÁÁÁ
a1, a2
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
B b1
Á
a3 i3
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
a4 i4
... ...
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
b1
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
1 ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
2 ÁÁÁÁ
ÁÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
j1
3 4 5 6 7 8 9 10
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
B PAB = a1 PB = B IR = B B
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
b1 ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
Prefetch
ÁÁÁÁ
ÁÁÁÁ
PAB = a2 Á
Á
Fetch
PB = b1
Decode
IR = b1
Access Read Execute
b1
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁ
Prefetch
PAB = a3
Fetch
PB = i3
Decode Access Read Execute
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
Pipeline flush PAB = a4 PB = i4
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
j1 PAB = b1 PB = j1 IR = j1 j1
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
For the branch instruction in Example 7–2 to execute completely, the following
events occur:
Cycles 4 and 5: Two more instructions, i3 and i4, are fetched. Although the
two instructions after the branch instruction, i3 and i4, are
fetched by the C54x CPU, they are not allowed to move
past the decode stage and are eventually discarded. After
the second word of the branch instruction (represented by
b1 in the left column) is decoded, PAB is loaded with this
new value (in cycle 5).
Cycles 6 and 7: The two-word branch instruction enters the execution
stage of the pipeline in cycles 6 and 7. Also, j1 is fetched
from address b1 in cycle 6.
Cycles 8 and 9: These cycles are also consumed by the same branch
instruction since the next two instructions, i3 and i4, were
not allowed to complete their execution; this is why a
branch instruction takes four cycles to execute.
Cycle 10: j1 completes execution.
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address
ÁÁ
Instruction
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁ
a1, a2 BD b1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁ
a3 i3
a4 i4
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁ
ÁÁÁÁ
...
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
...
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
b1
ÁÁÁ
j1 ÁÁ
ÁÁ
ÁÁ
Á ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
1
ÁÁÁÁ
ÁÁÁÁ
Prefetch
ÁÁÁÁ
ÁÁÁ
2
Á
Fetch
ÁÁÁ
ÁÁÁÁÁ ÁÁÁ
ÁÁÁÁÁ ÁÁ
ÁÁÁÁÁÁÁ
3
Decode
4
Access
5
Read
6
Execute
7 8 9 10
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
BD PAB = a1 PB = BD IR = BD BD
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁÁ
b1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
PAB = a2 PB = b1 IR = b1 b1
ÁÁ
ÁÁÁÁ
ÁÁ
ÁÁÁÁ
i3 ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
Prefetch
ÁÁ
PAB = a3
Fetch
PB = i3
Decode Access Read Execute
i3
ÁÁ
ÁÁÁÁ
ÁÁ
ÁÁÁÁ
i4
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁ
Prefetch
PAB = a4
Fetch
PB = i4
Decode Access Read Execute
i4
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
j1 PAB = b1 PB = j1 IR = j1 j1
ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
SPRU131G Pipeline 7-7
Pipeline Operation
In this case, the pipeline behaves in the same manner as it did for the regular
branch instruction. However, the two instructions following the branch, i3 and
i4, are allowed to complete their execution. Therefore, only cycles 6 and 7 are
consumed by the delayed-branch instruction, making the delayed branch into
a 2-cycle instruction.
Example 7–4 shows the pipeline’s behavior during the execution of a call
instruction.
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address Instruction
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
a1, a2 CALL b1
a3 i3
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
a4
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á i4
Á
... ...
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
b1 j1
ÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
Á ÁÁÁ
ÁÁÁÁÁ ÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁ
1 2 3 4 5 6 7 8 9 10
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
PB = IR = EAB = SP
CALL PAB = a1 SP– – EB = RTN
CALL CALL RTN = a3
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
PAB =
ÁÁÁÁ
Prefetch
Á Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
b1 a2
PB = b1 IR = b1 b1
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ Prefetch
PAB =
Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Pipeline flush PB = i3
a3
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ Prefetch
PAB =
Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
PB = i4
a4
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
Á
PAB = b1 PB = j1 IR = j1 j1
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
7-8 Pipeline SPRU131G
Pipeline Operation
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
Address Instruction
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
a1, a2 CALLD b1
a3 i3
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
a4
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á i4
Á
... ...
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
b1 j1
ÁÁÁÁ
Á ÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
Á ÁÁÁ
ÁÁÁÁÁ ÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁ
1 2 3 4 5 6 7 8 9 10
Prefetch Fetch Decode Access Read Execute
PB = IR = EAB = SP
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
CALLD PAB = a1 SP–– EB = RTN
CALLD CALLD RTN = a3
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
Prefetch
Á Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
b1 PAB = a2 PB = b1 IR = b1 b1
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
i3 PAB = a3 PB = i3 IR = i3 i3
ÁÁÁÁ
i4
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ Prefetch
PAB = a4
Fetch
PB = i4
Decode
IR = i4
Access Read Execute
i4
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁ
Á
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
j1
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ PAB = b1 PB = j1 IR = j1 j1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
In this case, the pipeline behaves in the same manner as with the normal call
instruction. However, in this case the following two instructions, i3 and i4, are
allowed to complete their execution. Therefore, only cycles 6 and 7 are
consumed by the delayed-call instruction, making it a 2-cycle instruction.
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
Example 7–6. Interrupt (INTR) Instruction in the Pipeline
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Address
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Instruction
ÁÁÁ
a1, a2
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
INTR n
ÁÁ
a3 i2
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
a4 i3
... ...
ÁÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
vect
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
1
ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
2
ÁÁ
j1
3 4 5 6 7 8 9
ÁÁÁ
ÁÁÁÁ
INTR
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Prefetch
PAB = a1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Fetch
PB = INTR
Decode
IR = INTR
Access
SP––
Read
EAB = SP
Execute
EB = RTN
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
RTN = a2
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ PAB = a3 PB = i3
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
j1 PAB = vect PB = j1 j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
Example 7–7. Return (RET) Instruction in the Pipeline
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ Á
Á
Address Instruction
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a1 RET
ÁÁÁ
a2
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Ái2
ÁÁÁ
a3
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Ái3
Á
... ...
ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ Á
b1 j1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁ Á
1 2 3 4 5 6 7 8 9 10 11
Prefetch Fetch Decode Access Read Execute
PB = IR = SP++
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
RET PAB = a1 RET RET DAB=SP DB = b1 RET
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
Prefetch
Á
Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
PAB = a2 PB = i2
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
PAB = a3 PB = i3
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
No No
Dummy cycle prefetch fetch
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á Prefetch
No
Fetch
No
Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Á ÁÁ
ÁÁÁÁ Á
Dummy cycle prefetch fetch
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
j1
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
PAB = b1 PB = j1 j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Á
Cycle 1: The PAB is loaded with the address of the return instruc-
tion.
Cycle 2: The return instruction opcode is fetched.
Cycles 3 and 4: Two more instructions, i2 and i3, are fetched. Although
these two instructions are fetched by the device, they are
not allowed to move past the decode stage and are
discarded. In cycle 4, SP is incremented (represented by
SP ++) and DAB is loaded with the contents of SP in order
to read the return address from the stack.
Cycle 5: The top of the stack is read using DB.
Cycle 6: The return instruction enters the execution stage of the
pipeline. The address fetched from the stack is loaded
onto PAB. This allows for fetching the next instruction, j1,
from the return address.
Cycles 7 and 8: These cycles are consumed by the return instruction,
because the next two instructions, i3 and i4, do not com-
plete their execution.
Cycles 9 and 10: Because no instructions were fetched in cycles 4 and 5,
cycles 9 and 10 are dummy cycles.
Cycle 11 j1 completes execution.
Example 7–8 shows the pipeline’s behavior during the execution of a delayed-
return instruction.
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Example 7–8. Delayed-Return (RETD) Instruction in the Pipeline
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Address
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a1 ÁÁÁ
ÁÁÁ
Instruction
RETD
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a2 i2
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a3 i3
ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
... ...
b1 j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
1
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
2
ÁÁÁÁ
ÁÁÁ 3 4 5 6 7 8 9 10 11
ÁÁÁ
ÁÁÁÁ
RETD
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Prefetch
PAB = ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
Fetch
PB = ÁÁÁ Decode
IR =
Access
SP++
Read
DB = b1
Execute
RETD
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
a1 RETD RETD DAB = SP
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
PAB =
Pipeline flush a2 PB = i2
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
PAB =
Pipeline flush a3 PB= i3
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ Prefetch
No
Fetch
No
Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
i2 prefetch fetch IR = i2 i2
ÁÁÁ
ÁÁÁÁ
i3
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ Prefetch
No
Fetch
No
Decode Access Read Execute
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Á ÁÁ
ÁÁÁÁ
ÁÁÁ
prefetch fetch IR = i3 i3
ÁÁÁ
ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ
j1 ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Prefetch Fetch
PAB = b1 PB = j1
Decode Access Read Execute
j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
Example 7–9 and Example 7–10 show the pipeline behavior for a return-with-
interrupt-enable (RETE) instruction and a delayed return-with-interrupt-
enable (RETED) instruction, respectively. The pipeline behavior for these
instructions is similar to that of the standard return and delayed-return instruc-
tions, respectively, and these instructions also take same number of cycles to
execute. The difference is that these two instructions enable interrupts globally
by resetting the INTM bit during the execute stage of the pipeline.
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁ
Address Instruction
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁÁ
a1 RETE
a2 i2
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
a3
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
... ÁÁÁ
ÁÁÁ
i3
...
ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
b1 j1
ÁÁÁ
Á ÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Á ÁÁÁ
ÁÁÁÁÁ ÁÁ
ÁÁÁÁÁÁ
Á
ÁÁÁ ÁÁ
ÁÁÁ
1 2 3 4 5 6 7 8 9 10 11
Prefetch Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
PAB = PB = IR = SP++
RETE DB = b1 INTM = 0
a1 RETE RETE DAB = SP
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
PAB =
ÁÁÁ
Prefetch
ÁÁÁ
ÁÁÁ
Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Pipeline flush PB = i2
a2
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Prefetch
PAB =
Fetch Decode Access Read Execute
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Pipeline flush PB = i3
a3
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ Prefetch
No
Fetch
No
Decode Access Read Execute
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Dummy cycle
prefetch fetch
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Dummy cycle
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ Prefetch
No
Fetch
No
Decode Access Read Execute
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
prefetch fetch
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁÁ
j1
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
PAB = b1 PB = j1 j1
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
Example 7–10. Delayed Return-With-Interrupt-Enable (RETED) Instruction in the Pipeline
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Address
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a1
ÁÁÁ
Instruction
RETED
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
a2 i2
a3 i3
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
...
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
b1
ÁÁÁ
...
j1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
1
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
2
ÁÁÁ 3 4 5 6 7 8 9 10 11
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
PAB = PB = IR = SP++
RETED a1 RETED RETED DAB = SP DB = b1 INTM = 0
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
PAB =
Pipeline flush a2 PB = i2
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ Prefetch
PAB =
Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Pipeline flush a3 PB = i3
ÁÁÁÁ
i2
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ Prefetch
No
Fetch
No
Decode
IR = i2
Access Read Execute
i2
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
prefetch fetch
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
No No
i3 IR = i3 i3
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
prefetch fetch
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
PAB =
j1 b1 PB = j1 j1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Example 7–11 and Example 7–12 show pipeline behavior for a return-fast
(RETF) instruction and for a delayed return-fast (RETFD) instruction, respec-
tively. The RETF instruction, unlike the RETE instruction, does not read the
return address from the stack. Instead, it reads it from the RTN register. This
allows the instruction to load PAB with the return address two cycles earlier
than a RETE instruction can. As shown in the examples, the RETF instruction
takes only three cycles to execute; the delayed version of the instruction,
RETFD, executes in one cycle.
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Example 7–11. Return-Fast (RETF) Instruction in the Pipeline
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address
a1
Instruction
RETF
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
a2
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a3
i2
i3
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
... ...
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
b1 j1
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
1 2 3 4 5 6 7 8 9
Prefetch Fetch Decode Access Read Execute
PB = IR = SP++
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
RETF PAB = a1 RETF RETF Read RTN INTM = 0
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Prefetch
PAB = a2
Fetch
PB = i2
Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Pipeline flush
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ PAB = a3 PB = i3
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
j1 PAB = b1 PB = j1 j1
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Example 7–12. Delayed Return-Fast (RETFD) Instruction in the Pipeline
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
Address
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a1
Instruction
RETFD
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
a2 i2
a3 i3
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
...
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
b1
...
j1
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
1
ÁÁÁÁ
Prefetch
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
2
Fetch
3
Decode
4
Access
5
Read
6
Execute
7 8 9
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
PB = IR = SP++
RETFD PAB = a1 RETFD RETFD Read RTN INTM = 0
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
i2 PAB = a2 PB = i2 i2
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
i3 PAB = a3 PB = i3 i3
ÁÁÁÁ
j1
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Prefetch
PAB = b1
Fetch
PB = j1
Decode Access Read Execute
j1
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁ
Example 7–13. Execute-Conditionally (XC) Instruction in the Pipeline
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
Instruction
ÁÁÁ
ÁÁ a1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
i1
ÁÁÁ
ÁÁ ÁÁ
a2 i2
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁ
a3 i3
a4 XC 2, cond
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁ
ÁÁÁ
a5
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ ÁÁ
i5
ÁÁÁ
ÁÁ ÁÁ
a6 i6
ÁÁ
ÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ
1
ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ
Prefetch ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
2
ÁÁÁ ÁÁÁ
ÁÁÁÁ
Fetch ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁ
ÁÁ
3
Decode
4
Access
5
Read
6
Execute
7 8 9 10 11
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
i1 PAB = a1 PB = i1 IR = i1 i1
ÁÁ
ÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁ
i2 ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
Prefetch
ÁÁÁÁ ÁÁÁ
ÁÁÁ
PAB= a2 ÁÁÁ
ÁÁÁ ÁÁ
Fetch
ÁÁÁ
ÁÁ
PB = i2
Decode
IR = i2
Access Read Execute
i2
ÁÁ
ÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁ
i3
ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁ
Prefetch
ÁÁÁ
ÁÁ
PAB = a3
Fetch
PB = i3
Decode
IR = i3
Access Read Execute
i3
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
XC PAB = a4 PB = XC IR = XC Evaluate
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
i5 or NOP PAB = a5 PB = i5 Conditional execution of i5
ÁÁÁÁ
ÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
Prefetch Fetch Decode Access Read Execute
ÁÁÁÁ
i6 or NOP
ÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
PAB = a6 PB = i6 Conditional execution of i6
To execute XC in one cycle, the CPU evaluates test conditions in the access
stage of the pipeline. This means that the two 1-word instructions (or one
2-word instruction) immediately prior to the XC instruction will not have com-
pletely executed before the conditions are tested. Because the condition
codes are affected only by instructions in the execute stage, those two instruc-
tions have no effect on the operation of XC.
Because a call instruction consists of two instruction words, you would expect
it to take at least two cycles to execute completely. A standard conditional-call
instruction actually takes either five cycles to execute if the call is taken or three
cycles to execute if the call is not taken.
If the evaluated conditions are true, i4 and i5 do not execute in cycles 10 and
11. In this case, the CC instruction becomes a 5-cycle instruction. However,
if the evaluated conditions are false, i4 and i5 execute, making CC a 3-cycle
instruction.
The pipeline behaves in the same manner as it does for the CC instruction.
However, the following two instructions, i3 and i4, are allowed to complete their
execution regardless of whether the tested conditions are true or not. Only
cycles 7, 8, and 9 are consumed by the CCD instruction, making it a 3-cycle
instruction.
i1 PAB = a1 PB = i1 IR = i1 i1
b1 PAB = a3 PB = b1 IR = b1
i6 or j1 PAB = PB = IR = i6 or j1
a6 or b1 i6 or j1 i6 or j1
i1 PAB = PB = i1 IR = i1 i1
a1
EAB = SP EB =
CCD PAB = a2 PB = CCD IR = CCD SP– – RTN
RTN = a4
Evaluate
b1 PAB = a3 PB = b1 IR = b1
i4 No No IR = i4 i4
prefetch fetch
i5 PAB = a5 PB = i5 IR = i5 i5
i6 or j1 PAB = PB = IR = i6 or j1
a6 or b1 i6 or j1 i6 or j1
Example 7–16 and Example 7–17 show the pipeline’s behavior during the
execution of a conditional branch (BC) instruction and a delayed conditional
branch (BCD) instruction.
The behavior of the conditional branch (BC) and the delayed conditional
branch (BCD) instructions in the pipeline is similar to that of the CC and CCD
instructions, respectively. The difference is that no return address is written to
the stack in this case. As shown in Example 7–16, a BC instruction takes either
three or five cycles to execute, depending on whether or not the branch is
taken. A BCD instruction executes in three cycles.
i1 PAB = a1 PB = i1 IR = i1 i1
BC PAB = a2 PB = BC IR = BC Evaluate
b1 PAB = a3 PB = b1 IR = b1
i6 or j1 PAB = PB = IR = i6 or j1
a6 or b1 i6 or j1 i6 or j1
i1 PAB = a1 PB = i1 IR = i1 i1
b1 PAB = a3 PB = b1 IR = b1
i4 No No IR = i4 i4
prefetch fetch
i5 PAB = PB = i5 IR = i5 i5
a5
i6 or j1 PAB = PB = IR = i6 or j1
a6 or b1 i6 or j1 i6 or j1
i1 PAB = a1 PB = i1 IR = i1 i1
INTR IR = INTR
PAB = a2 PB = i2 RTN = a2 SP– – EAB = SP EB = RTN
(inserted)
j1 PAB = PB = j1 IR = j1 j1
vect2
j2 PAB = PB = j2 IR = j2 j2
vect3
i2 PAB = a2 PB= i2 IR = i2 i2
The C54x DSP features on-chip memory that supports two accesses in a
single cycle. This dual-access memory is organized as several independent
memory blocks. Simultaneous accesses to different blocks are supported with
no conflicts: while one instruction in the pipeline accesses one block, another
instruction at the same stage in the pipeline can access a different block with-
out conflict. Furthermore, each memory block supports two accesses in a
single cycle: two instructions, each in different stages of the pipeline, can
access the same block simultaneously. However, a conflict can occur when
two simultaneous accesses are performed on the same block. The C54x CPU
resolves these conflicts automatically; this is discussed later in this section.
Table 7–1 shows the block size and number of blocks for some C54x devices.
For more information about DARAM organization, see section 3.3.2, On-Chip
RAM Organization, on page 3-23.
C542 2K words 5
C543 2K words 5
C545 2K words 3
C546 2K words 3
C548 2K words 4
C549 2K words 4
C5402 8K words 2
C5410 2K words 4
† Note that the first block is slightly smaller due to the memory-mapped registers and the scratch-
pad RAM.
Each dual-access memory block supports two accesses in one cycle by per-
forming one access in the first half-cycle and the other in the next half-cycle.
Table 7–2 lists the accesses performed in each half-cycle, and Figure 7–3
shows how the different types are performed. Address bus loads are omitted
from the diagram for simplicity.
Because two types of access are scheduled and only one access is performed
in each half-cycle, conflicts can occur. These conflicts are automatically
resolved by the CPU either by rearranging the order of accesses or by delaying
an access by one cycle. The following sections describe these resolved
memory access conflicts. Keep in mind that these conflicts appear only if all
accesses are being performed on the same dual-access memory block.
LD *AR2+, A; AR2 is pointing to the same DARAM block where the code resides.
i2
i3
i4
i2 Read PB
i3 Read
ÈÈÈÈ
PB
ÈÈÈÈ
Prefetch Fetch Decode Access Read Execute
ÈÈÈÈ
Dummy cycle (instruction fetch is
supposed to occur here) Read PB
ÈÈÈ
Legend: ÈÈÈ
ÈÈÈ
Where instruction fetch is supposed to occur
Where a memory access actually
occurs
There is a conflict between the operand write access (EB bus) and the second
data read access (CB bus). This conflict is resolved automatically by delaying
the write access by one cycle. The actual execution time of these instructions
does not increase, because the delayed write access is performed while the
second instruction is in the execute stage.
If any read access (via DB or CB) is from the same memory location in on-chip
memory where the write access should occur, the CPU bypasses reading the
actual memory location; instead, it reads the data directly from an internal bus.
This allows the pipeline to perform a write access in a later pipeline stage than
that in which the next instruction reads from the same memory location.
STL A, *AR3+
LD #0, A
ADD *AR4+, *AR5+, A ; AR3 and AR5 both point to the same dual-access memory block.
ÈÈÈÈ Execute
STL A, *AR3+
(write access delayed until next cycle)
ÈÈÈÈ
ÈÈÈÈ
Write EB
ÈÈÈ
Legend:
ÈÈÈ Where an access is supposed to occur Where an access actually occurs
7.3.3 Resolved Conflict Among Operand Write, Operand Write, and Dual-Operand
Read
If the second instruction in the case described above is an operand-write type
instruction, then the write access requested by the first instruction cannot be
moved to the next cycle. The CPU resolves the conflict by inserting a dummy
cycle after the first instruction. This is illustrated in Example 7–21, in which
AR3 and AR5 point to the same dual-access memory block.
STL A, *AR3+
STH A, *AR2
ADD *AR4+, *AR5+, A ; AR3 and AR5 both point to the same dual-access memory block
Dummy cycle
A conflict can occur when two simultaneous accesses are performed on the
same memory block. In case of such a conflict, only one access is performed
in that cycle and the second access is delayed until the following cycle. This
results in a one-cycle pipeline latency.
A pipeline conflict due to single access memory may occur in several different
situations.
However, certain instructions can access these registers without causing pipe-
line conflicts if you observe appropriate latency cycles. Table 7–3 lists these
instructions.
ÁÁÁÁÁÁÁÁ
MVMD circular addressing
ÁÁÁÁÁÁÁÁ
an accumulator STH or 3 words (BK) must not not write to any ARx, BK,
ÁÁÁÁÁÁÁÁ
STL use the same register. or SP using STM, MVDK,
Store type‡ or MVMD.
3 Popping ARx/BK from POPM The next 1 word (ARx) or Do not precede a category
stack 2 words (BK) must not 3 instruction with any cate-
use the same register. gory 2 or 5 instruction that
writes to any ARx, BK, or
SP.
5 Writing to SP using an STLM The next 2 (if CPL = 0) or The next instruction must
accumulator STH 3 (if CPL = 1) words must not write to ARx, BK, or SP
STL not use SP#. using STM, MVDK, or
Store type‡ MVMD.
18 Writing to DROM bit ANDM The next 3 words must not An external-bus cycle
ORM access the DROM’s ad- may cause additional
XORM dress range. latency.
All other instructions that write to these registers perform their writes in the
execute stage and are store-type instructions. They are listed in Table 7–5.
Table 7–4. Instructions That Access DAGEN Registers in the Read Stage
ÈÈÈÈ
Prefetch Fetch Decode Access Read Execute
ÈÈÈÈ
STM #1, AR2 (1st word) Write to Write to
ÈÈÈÈ
(write delayed by 1 cycle) AR2 AR2
ÈÈÈ
Legend: ÈÈÈ
ÈÈÈ
Where a write conflict
occurs
Where the write actually occurs
1 2 3 4 5 6 7 8 9 10
Prefetch Fetch Decode Access Read Execute
ÈÈÈÈ
Prefetch Fetch Decode Access Read Execute
ÈÈÈÈ
STM #1, AR2 (1st word) Write Write to
ÈÈÈÈ
(write delayed by 1 cycle) to AR2 AR2
ÈÈÈ
Legend:
ÈÈÈ Where a write conflict occurs Where the write actually occurs
1 2 3 4 5 6 7 8
Prefetch Fetch Decode Access Read Execute
STLM B, BK Write to
BK
ÈÈÈÈAR1
Write to
AR1
ÈÈÈ
Legend:
ÈÈÈ
ÈÈÈ
Where a write conflict
occurs
Where the write actually occurs
Example 7–24. Resolving Conflict When Updating SP, BK, and ARx
1 2 3 4 5 6 7 8 9 10
Prefetch Fetch Decode Access Read Execute
STLM Write to
A, SP SP
ÈÈÈ
Prefetch Fetch Decode Access Read Execute
ÈÈÈ
POPM BK (write Write to Write to
BK BK
ÈÈÈÈ
delayed by 1 cycle)
ÈÈÈÈ
Prefetch Fetch Decode Access Read Execute
ÈÈÈÈ
STM #1, AR1 (1st word) Write to Write to
(write delayed by 1 cycle) AR1 AR1
ÈÈÈÈ
Legend:
ÈÈÈÈ
ÈÈÈÈ
Where a write conflict
occurs
Where the write actually occurs
These conflicts are automatically resolved by the C54x CPU. This generally
does not affect instruction-execution behavior. However, there is one case in
which resolution by the CPU can cause an unprotected pipeline conflict. This
is explained in section 7.5.3, Rules to Determine DAGEN Register Access
Conflicts.
The following set of conditions determines when such a conflict can occur:
- The third instruction uses the same register as the second instruction in
indirect addressing mode.
- The next instruction uses the same auxiliary register as an address pointer
or index in indirect addressing mode, or uses BK in circular addressing
mode. This instruction could also be an MVMM or a CMPR that reads BK
or the same ARx.
This conflict occurs because the first instruction updates ARx or BK in either
the read or execute stage of the pipeline and the following instruction uses BK
or the same ARx when it is in the access stage of the pipeline. This results in
an incorrect ARx or BK read by the second instruction, because the previous
instruction has not yet updated the register’s contents.
Certain instructions (see Table 7–6) do not have any latency in updating ARx.
Use these instructions wherever possible to avoid pipeline conflicts.
STM and MVDK do not conflict with the next instruction for two reasons:
- They update ARx when the first instruction word is in the read stage of the
pipeline.
Table 7–7 shows the latencies between instructions that update and subse-
quently use ARx. The second and third instructions must access the same
auxiliary register or BK to cause a latency. Any instruction not mentioned in the
table has no latency.
Table 7–8 shows the latencies between instructions that update and subse-
quently use BK.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
(b)
ADD A, B ; This instruction does not create
; a DAGEN conflict.
MVDK 200h, AR7 ; This instruction has zero latency.
STH B, *AR7+
(c)
STLM A, AR1 ; This instruction updates AR1 in
; the execute stage, possibly
; creating a DAGEN conflict.
MVDK *(200h),AR2 ; However, this instruction uses a
; long offset modifier. Therefore,
; it creates no DAGEN conflict.
MAR *AR2+ ; No latency is required to use AR2.
(b)
STLM A, AR1 ; This instruction updates AR1 in
; the execute stage.
POPM BK ; This instruction tries to update
; BK in the read stage. The CPU
; delays the update by one cycle.
STM #1, AR2 ; This instruction tries to update
NOP ; AR2 in the read stage. The CPU
; delays this update by one cycle.
LD *AR2+, B ; This is why one NOP is required.
- The next instruction uses SP as the base address for direct addressing in
compiler mode (CPL = 1), or an interrupt occurs. (Interrupts cause an
update of SP. This update of SP can interfere with a previous write to SP.
Therefore, special considerations must be made when using interrupts
while executing instructions that update SP.)
The conflict occurs because the second instruction tries to use SP in a pipeline
stage that occurs before the previous instruction updates it.
Table 7–9 lists the latencies between instructions that update and subse-
quently use SP in compiler mode.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate for SP latencies.
Third Instruction
Second Instruction Category I Category II
STM #lk, SP 1† 0†
ST #lk, SP
MVDK Smem, SP 1† 0†
MVMD MMR, SP
MVKD dmad, SP 2 1
MVDM dmad, SP
MVPD pmad, SP
MVDD Xmem, spind 2† 1†
POPM SP
POPD SP
FRAME k 1 0
MVMM MMR, SP
POPM MMR
POPD Smem
PSHM MMR
PSHD Smem
RETFD
Store-type instructions (see Table 7–5) 3 2
Category I Category II
(b)
(b)
(c)
7.5.5.2 SP Used in Push, Pop, Call, Return, FRAME, and MVMM Operations
- The next instruction uses the stack for a push, pop, call, return, FRAME,
or MVMM operation.
The conflict occurs because the second instruction tries to use SP in a pipeline
stage that occurs before the stage in which the previous instruction updates
SP.
Table 7–10 lists instructions that do not have any latency in updating SP when
the CPU is not in compiler mode (CPL = 0). These instructions should be used
wherever possible to avoid conflicts.
Table 7–11 lists the latencies between instructions that update and use SP in
noncompiler mode (CPL = 0).
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate SP latencies.
MVDK Smem, SP 0† 0
MVMD MMR, SP
MVKD dmad, SP 1 0
MVDM dmad, SP
MVPD pmad, SP
Category I Category II
PSHM MMR PSHM MMR
PSHD Smem Without a long-offset PSHD Smem With a long-offset
POPM MMR modifier POPM MMR modifier
PSHM Smem PSHM Smem
CALL[D] address CALA[D] address
CC[D] address FCALA[D]
FCALL[D]
FRET[D]
FRETE[D]
INTR k
RC[D]
RET[D]
RETE[D]
RETF[D]
MVMM SP, MMR
FRAME k
TRAP n
Legend: SP Destination operand pointing to the stack pointer in either direct or indirect addressing modes
MMR Any memory-mapped register except SP
spind Destination operand pointing to the stack pointer using indirect addressing mode
† Add one more cycle of latency if the first instruction meets the DAGEN register conflict criteria. See section 7.5.3,
Rules to Determine DAGEN Register Access Conflicts, for more information.
Notes: 1) Any instruction that does not fit in either of the two categories has zero latency.
2) The first instruction can be any C54x DSP instruction.
(b)
STH A, 100h ; This instruction does not create
; a DAGEN conflict.
MVDK 200h, SP ; This SP update does not require any
; latency according to the above table.
FRAME 10
Example 7–37. SP Load With and Without a 1-Cycle Latency in Noncompiler Mode
(CPL = 0)
(a) SP Load With a One-Cycle Latency
STLM A, AR1 ; This instruction causes a DAGEN
; conflict with the next instruction.
MVDK 200h, SP ; This SP update requires a one-cycle
NOP ; latency.
PSHM AR2
The conflict occurs because the second instruction tries to use T in a pipeline
stage that occurs before the previous instruction updates it.
Table 7–12 lists instructions that do not have any latency in updating T. Use
these instructions wherever possible to avoid any conflicts.
Table 7–13 lists the latencies between instructions that update and use T.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate T latencies.
Second Instruction
First Instruction Category I
MVKD dmad, T 1
MVDM dmad, T
POPM T 1
POPD T
DELAY T
MVDD Xmem, Tind
EXP src 1
Category I
LD Smem, TS, dst
ADD Smem, TS, src Without a long-offset modifier
SUB Smem, TS, src
NORM src, dst
BITT Xmem
DADST Lmem, dst
DSADT Lmem, dst
DSUBT Lmem, dst
Legend: T Destination operand pointing at T in either direct or indirect addressing
modes.
Tind Destination operand pointing at T using indirect addressing mode.
Note: Any instruction that does not fit in Category I has zero latency.
(b)
STM #100h, T ; This T update does not require
LD *AR5+,TS,A ; any latency.
(b)
EXP A ; This instruction requires a one-
NOP ; cycle latency.
NORM A
Some instructions write to ST1 in the execute stage of the pipeline. If any of
these instructions is immediately followed by a RPTB[D] instruction that sets
the BRAF flag in ST1 an incomplete repeat-block loop results. This occurs
because RPTB[D] sets BRAF in the access stage of the pipeline and the
previous instruction overwrites ST1 one cycle later.
- The next instruction uses ARP or CMPT to update the address pointer in
indirect addressing mode.
The conflict occurs because the second instruction uses ARP or CMPT in a
pipeline stage that occurs before the previous instruction updates ARP or
CMPT.
Table 7–15 lists one instruction that does not have any latency in updating
ARP when the CPU is in compatibility mode. Use this instruction wherever
possible to avoid any conflicts.
Table 7–16 lists the latencies between instructions that update and use ARP
or CMPT.
Notes:
1) You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
2) In compatibility mode (CMPT = 1), ARP is automatically updated by
instructions that use indirect addressing mode. There is no pipeline
conflict associated with such an ARP update.
3) ARP must always be cleared to 0 when the DSP is in standard mode
(CMPT = 0). At reset, both ARP and CMPT are cleared to 0 automatically.
Table 7–16. Latencies for ARP in Compatibility Mode (CMPT = 1) and CMPT bit
(a) Latencies based on second-instruction category
Second Instruction
First Instruction Category I Category II
STM #lk, status 2 2
ST #lk, status
POPM status 3 2
POPD status
DELAY status
LTD status
MVDD status
SSBX statbit 3 2
RSBX statbit
Category I Category II
MVKD dmad, auxind MVKD dmad, auxind
MVDM dmad, auxind With a long-offset MVDM dmad, auxind
MVPD dmad, auxind modifier MVPD pmad, auxind Without a long-
MACP dmad, auxind, pmad, src MACP auxind, pmad, src offset modifier
MACD auxind, pmad, src MACD auxind, pmad, src
ADD auxind, shift, src, dst ADD auxind, shift, src, dst With an
With an
LD auxind, shift, dst extended shift† LD auxind, shift, dst extended shift†
STH src, shift, auxind and a long offset STH src, shift, auxind and without a
STL arc, shift, auxind modifier STL src, shift, auxind long-offset
SUB auxind, shift, src, dst SUB auxind, shift, src, dst modifier
All other instructions that use ARP or
CMPT in indirect addressing mode
with or without a long offset modifier.
Legend: status Destination operand pointing to ST0 or ST1 to update ARP or CMPT respectively in either direct or
indirect addressing modes
MMR Any memory-mapped register
auxind A read or write operand using indirect addressing mode
statbit Destination operand writing to a bit in ARP or CMPT
† Shift value between –16 and 15.
Note: Any instruction that does not fit in either of the two categories has zero latency.
Example 7–42. ARP Load With a 2-Cycle Latency in Compatibility Mode (CMPT = 1)
STLM A, ST0 ; The ARP field of ST0 is updated here.
NOP
NOP
ADD *AR0+,–3,B ; The new ARP value is used here
Example 7–43. ARP Load With a 3-Cycle Latency in Compatibility Mode (CMPT = 1)
POPM ST0 ; The ARP field of ST0 is updated here.
NOP
NOP
NOP
LD *AR0+, A ; The new ARP value is used here.
- The next instruction uses DP as the base address for direct addressing in
noncompiler mode (CPL = 0).
The conflict occurs because the second instruction uses DP in a pipeline stage
that occurs before the previous instruction updates it.
Table 7–17 lists instructions that do not have any latency in writing to DP. It is
recommended that these instructions be used wherever possible to avoid
conflicts.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Table 7–17. Recommended Instructions to Update DP in Noncompiler Mode (CPL = 0)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
To do this:
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Load an immediate number to DP
Use this instruction:
LD #k, DP
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Copy contents of a memory location to DP LD Smem, DP
Table 7–18 lists the latencies between instructions that update DP and
subsequently use it.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
POPM status 3 2
POPD status
MVDD status
Category I Category II
All instructions that use DP for MVKD dmad, dirmem
direct addressing mode except MVPD pmad, dirmem
those listed in Category II. MACP dirmem, pmad, src
MACD dirmem, pmad, src
ADD dirmem, shift, src, dst
LD dirmem, shift, dst With an extended
STH src, shift, dirmem shift†
STL src, shift, dirmem
SUB dirmem, shift, src, dst
Legend: status Destination operand pointing to ST0 to update DP in either direct or indirect addressing modes
MMR Any memory-mapped register
statbit Destination operand writing to a bit in DP field of ST0
dirmem A read or write operand using direct addressing mode when CPL = 0
† Shift value between –16 and 15.
Note: Any instruction that does not fit in either of the two categories has zero latency.
(b)
LD 100h, DP ; This DP load does not require any
; latency.
LD 27h, A
The conflict occurs because the second instruction reads CPL in a pipeline
stage that occurs before the previous instruction updates it.
Table 7–19 lists the latencies between instructions that update CPL and
subsequently use it.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
POPM status 3 2
POPD status
MVDD status
SSBX CPL 3 2
RSBX CPL
Category I Category II
All instructions that use direct MVKD dmad, dirmem
addressing mode except those MVPD pmad, dirmem
listed in Category II. MACP dirmem, pmad, src
MACD dirmem, pmad, src
ADD dirmem, shift, src, dst
LD dirmem, shift, dst
With an extended
STH src, shift, dirmem shift†
STL arc, shift, dirmem
SUB dirmem, shift, src, dst
Legend: MMR Any memory-mapped register
dirmem A read or write operand using direct addressing mode when CPL = 0
status Destination operand pointing to ST1 to modify CPL in either direct, indirect, or memory-mapped
addressing mode
† Shift value between –16 and 15.
Note: Any instruction that does not fit in either of the two categories has zero latency.
The conflict occurs because the second instruction uses SXM in a pipeline
stage that occurs before the previous instruction updates it.
Table 7–20 lists the latencies between instructions that update SXM and
subsequently use it.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
SSBX SXM 1
RSBX SXM
Category I
All instructions affected by the sign-extension mode bit, except those that require
an Smem operand with a long offset modifier (for example, LD *+AR1 (100h), A)
Legend: status Destination operand pointing at ST1 to update SXM in either direct,
indirect, or memory-mapped addressing mode
Note: Any instruction that does not fit in Category I has zero latency.
(b)
POPM ST1 ; This instruction modifies the SXM bit of
NOP ; ST1.
ADD *AR2+,A
(c)
STLM A, ST1 ; This instruction modifies the SXM bit of
; ST1.
NOP
SUB *AR2-,A
The conflict occurs because the second instruction reads ASM in a pipeline
stage that occurs before the previous instruction updates it.
Table 7–21 lists instructions that do not have any latency for writing to the ASM
bit field. Use these instructions wherever possible to avoid any conflicts.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
To do this: Use this instruction:
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Load an immediate number to ASM LD #k, ASM
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Copy contents of a memory location to ASM LD Smem, ASM
Table 7–22 lists the latencies between instructions that write to ASM and those
that subsequently use it.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
Category I
STH src, ASM, Smem
STL src, ASM, Smem Without a long-offset modifier
ST src, Ymem
|| LD/ADD/SUB/MAC/MAS/MPY
SACCD src, Smem, cond
LD src, ASM, dst
ADD src, ASM, dst
SUB src, ASM, dst
Legend: asmbit Destination operand writing to a bit in ASM field of ST1
status Destination operand pointing at ST1 to update ASM in direct, indirect,or
memory-mapped addressing mode
Note: Any instruction that does not fit in either of the two categories has zero latency.
(b)
LD 100h, ASM ; This instruction loads ASM with no
; latency
ADD A,ASM,B
(c)
STLM A, ST1 ; This instruction modifies the ASM
; field of ST1. No latency is needed
; since STL uses a long offset
; modifier.
STL A,ASM,*+AR5(100h)
The conflict occurs because the second instruction reads BRC in a pipeline
stage that occurs before the previous instruction updates it.
There are certain instructions which do not cause any pipeline conflicts when
updating BRC. Use these instructions wherever possible to avoid conflicts.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 7–23. Recommended Instructions for Writing to BRC Before an RPTB Loop
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
To do this Use this instruction
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Write an immediate value to BRC STM #lk, BRC
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Copy a memory location to BRC MVDK Smem, BRC
Table 7–24 lists latencies between instructions that update BRC and an
RPTB[D] instruction.
Notes:
1) Do not place instructions that modify BRC in the delay slots of a RPTBD
instruction.
2) You are responsible for rearranging instructions or inserting NOPS, if
necessary, to accommodate latencies.
(b)
MVDK count,BRC ; There is no latency when BRC is
RPTBD endloop–1 ; loaded using MVDK before a new
... ; RPTB loop
endloop:
(c)
STLM A,BRC ; There is a 1 cycle latency when
NOP ; BRC is loaded using an STLM
RPTB endloop–1 ; instruction.
...
endloop:
(d)
POPM BRC ; There is a 1 cycle latency when
NOP ; BRC is loaded using a POPM
RPTBD endloop–1 ; instruction.
...
endloop:
There is also a 5-to-6-cycle latency when writing a new value to BRC from with-
in a RPTB loop. The latencies described in Table 7–25 are relevant only if BRC
is modified while a RPTB loop is active. See Example 7–57 for details.
Table 7–25. Latencies for Updating BRC From Within an RPTB Loop
Instruction Latency
STM #lk, BRC The next 5 instruction words must not contain
ST #lk, BRC the last instruction in the RPTB loop.
MVDK Smem, BRC
MVMD MMR, BRC
All other instructions that modify The next 6 instruction words must not contain
BRC the last instruction in the RPTB loop.
The C54x DSP sets the block-repeat active flag (BRAF) to 1 to indicate that
the repeat-block loop is active. BRAF is set or cleared in the decode stage of
the first instruction of the repeat-block loop during the last loop iteration
(BRC = 0). BRAF is tested by the device at the end of each loop iteration to
determine whether the next prefetch will be from the top of the loop or not.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
Table 7–27 lists the latencies between instructions that write to the DROM bit
of PMST and those that subsequently read from or write to the DROM address
range.
Note:
You are is responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
(a) Latencies based on second-instruction category
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
And second instruction is
First instruction is... Category I, the latency is...
STM #lk, drom 2
ST #lk, drom
MVDK dmad, drom
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
MVMD MMR, drom
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
All other instructions that modify
ÁÁÁÁÁÁÁÁÁÁÁ
DROM
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
3
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
(b) Catagory for the second-instruction
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Category I
All instructions that read from or write to the DROM address range
Legend: drom Destination operand pointing at PMST to modify DROM bit in either direct ,
indirect, or memory-mapped addressing modes
Notes: 1. Additional latency cycles are required if an external memory access is occurring
at the time when an instruction is trying to modify the DROM bit field.
2. Any instruction not listed in this table that modifies DROM bit of PMST register
has zero latency.
When the two accumulators are accessed using instructions that do not
access them as memory-mapped registers, no pipeline latencies occur. In rare
cases when you access the accumulators through the memory-mapped regis-
ters AG, AH, AL, BG, BH, and BL, you can use any instruction that uses
memory-mapped, direct, or indirect addressing modes to access operands.
Examples of such instructions are POPM AL and PSHM AH. Note that DP
must be zero in order to access memory-mapped registers via direct addres-
sing modes.
A pipeline conflict can occur when two conditions are simultaneously met:
The conflict occurs because the first instruction updates an accumulator at the
same time when the next instruction tries to read it as a memory-mapped
register.
(b)
STLM A, BH ; BH is written using memory-mapped
; addressing here.
; No conflict occurs because the
; next instruction also accesses the
; same accumulator as a memory-
; mapped register.
PSHM BH ; Reads BH as a memory–mapped
; register.
(c)
STLM A, BH ; BH is written using memory-mapped
; addressing here.
; No conflict occurs because the
; next instruction accesses the same
; accumulator directly.
NEG B ; This instruction reads B directly.
Table 7–28 lists the latencies between instructions that update an accumulator
directly and instructions that access the same accumulator as a memory-
mapped register.
Note:
You are responsible for rearranging instructions or inserting NOPs, if
necessary, to accommodate latencies.
Category I Category II
All instructions that read an All instructions that read an ac-
accumulator as a memory- cumulator as memory-mapped
mapped register (AG, AH, AL, register (AG, AH, AL, BG, BH,
BG, BH, and BL) without using BL) using a long-offset modifier
a long-offset modifier.
MVKD accum, Smem
MVDM accum, MMR
ADD accum, shift, src, dst
With extended shift
LD accum, shift, dst
value of –16 to 15
SUB accum, shift, src, dst
(b)
ADD Smem,A ; A is updated directly by this
; instruction. No latency is
; required since the next
; instruction uses a long offset
; modifier.
LD *(AL),ASM ; This instruction reads A as a
; memory–mapped register.
On-Chip Peripherals
On-chip peripherals for the TMS320C54x DSP are specific to the individual
device. This chapter, along with Chapter 9, Serial Ports, and Chapter 10,
External Bus Operation, describes some of the available on-chip peripherals;
however, your device may contain only a subset of them.
All C54x devices have general-purpose I/O pins, a timer, a clock generator, a
software-programmable wait-state generator, and a programmable bank-
switching module. Different types of serial ports, host port interfaces, and clock
generators are device-specific peripherals. The serial ports are discussed in
Chapter 9, Serial Ports, and the software-programmable wait-state generator
and programmable bank-switching module are discussed in Chapter 10,
External Bus Operation.
Topic Page
8-1
Available
Available On-Chip
On-Chip Peripherals / Peripheral Memory-Mapped Registers
The peripheral registers are mapped into data page 0. Table 8–1 through
Table 8–7 list the individual peripheral memory-mapped registers for some
C54x devices.
23 ––– Reserved
27 ––– Reserved
Address
(Hex) Name Description
20 BDRR0 Buffered serial port data receive register
27 ––– Reserved
27 ––– Reserved
27 ––– Reserved
27 ––– Reserved
Address
(Hex) Name Description
27 ––– Reserved
27 ––– Reserved
2A ––– Reserved
Address
(Hex) Name Description
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
20 DRR20 McBSP0 data receive register 2
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
21 DRR10 McBSP0 data receive register 1
22 DXR20
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
McBSP0 data transmit register 2
23 DXR10
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
McBSP0 data transmit register 1
24 TIM
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Timer0 register
25
26
PRD
TCR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Timer0 period counter
27 ––– Reserved
28 SWWSR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Software wait-state register
29 BSCR ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Bank-switching control register
2A –––
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Reserved
2B
2C
SWCR
HPIC
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Software wait-state control register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
30 TIM1 Timer1 register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
31 PRD1 Timer1 period register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 8–11 on page 8-17.)
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
39
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
SPSD0
McBSP0 serial port sub-bank data register (See
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 8–11 on page 8-17.)
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
3A–3B ––– Reserved
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
3C
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
3D
GPIOCR General purpose I/O pins control register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
GPIOSR General purpose I/O pins status register
40 DRR21
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
McBSP1 data receive register 2
41 DRR11
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
McBSP1 data receive register 1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
42 DXR21 McBSP1 data transmit register 2
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
43 DXR11 McBSP1 data transmit register 1
44–47 –––
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Reserved
48 SPSA1 ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
McBSP1 serial port sub-bank address register (See
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Table 8–11 on page 8-17.)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
54 DMPREC DMA channel priority and enable control register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMA sub-bank address register (See Table 8–12 on
55 DMSA
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
page 8-18.)
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMA sub-bank data register with sub-bank address
56 DMSDI
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
auto-increment (See Table 8–12 on page 8-18.)
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMA sub-bank data register (See Table 8–12 on page
57 DMSDN
8-18.)
27 ––– Reserved
2A ––– Reserved
59 – 5F ––– Reserved
Table 8–10. C5420 Peripheral Memory-Mapped Registers For Each DSP Subsystem
Address
(Hex) Name Description
20 DRR20 MCBSP 0 data receive register 2
27 ––– Reserved
2A ––– Reserved
Table 8–10. C5420 Peripheral Memory-Mapped Registers For Each DSP Subsystem
(Continued)
Address
(Hex) Name Description
3A–3B ––– Reserved
ÁÁÁÁ
ÁÁÁÁ
SPCR10
Á ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ
39
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
SPCR11 49 SPCR12 35 00 Serial port control register 1
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
Á
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Á Á
SPCR20 39 SPCR21 49 SPCR22 35 01 Serial port control register 2
ÁÁÁÁ
ÁÁÁÁ
Á ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
RCR10 39 RCR11 49 RCR12 35 02 Receive control register 1
ÁÁÁÁ
ÁÁÁÁ
RCR20
ÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁ
XCR10
ÁÁÁÁ
Á ÁÁÁÁ Á
ÁÁÁÁ
Á ÁÁÁÁ
39
ÁÁÁÁ
ÁÁÁÁ
39
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
RCR21
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
XCR11
49
49
RCR22
XCR12
35
35
03
04
Receive control register 2
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
Á
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Á ÁÁÁÁ ÁÁÁÁ
Á ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
XCR20 39 XCR21 49 XCR22 35 05 Transmit control register 2
ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
register 1
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
Sample rate generator
SRGR20 39 SRGR21 49 SRGR22 35 07
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
Á ÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁ
Á ÁÁÁÁ
Á ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
register 2
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
MCR10 39 MCR11 49 MCR12 35 08 Multichannel register 1
ÁÁÁÁ
ÁÁÁÁ
MCR20
Á ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ
39
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
MCR21 49 MCR22 35 09 Multichannel register 2
ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
RCERA0 39 RCERA1 49 RCERA2 35 0A
register partition A
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
Á
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ Receive channel enable
Á ÁÁÁÁÁÁÁÁ
Á ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
RCERB0 39 RCERB1 49 RCERA2 35 0B
register partition B
ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ Á ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
XCERA0 39 XCERA1 49 XCERA2 35 0C
register partition A
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ Á
ÁÁÁÁ
ÁÁÁÁ ÁÁÁÁ
Á
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ Transmit channel enable
Á ÁÁÁÁÁÁÁÁ
Á ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
XCERB0 39 XCERB1 49 XCERA2 35 0D
register partition B
DMDST0
ÁÁÁÁÁ
ÁÁÁÁÁ
56/57 01 DMA channel 0 destination address register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMCTR0 56/57 02 DMA channel 0 element count register
ÁÁÁÁÁ
ÁÁÁÁ
DMSFC0
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁ
DMMCR0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
56/57
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57
03
04
DMA channel 0 sync select and frame count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
DMSRC1ÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 05 DMA channel 1 source address register
ÁÁÁÁÁ
ÁÁÁÁ
DMDST1
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 06 DMA channel 1 destination address register
ÁÁÁÁÁ
ÁÁÁÁ
DMCTR1
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 07 DMA channel 1 element count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMSFC1 56/57 08 DMA channel 1 sync select and frame count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMMCR1 56/57 09 DMA channel 1 transfer mode control register
ÁÁÁÁÁ
ÁÁÁÁ
DMSRC2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 0A DMA channel 2 source address register
ÁÁÁÁÁ
ÁÁÁÁ
DMDST2
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 0B DMA channel 2 destination address register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMCTR2 56/57 0C DMA channel 2 element count register
ÁÁÁÁÁ
ÁÁÁÁ
DMSFC2
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁ
DMMCR2
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
56/57
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57
0D
0E
DMA channel 2 sync select and frame count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
DMSRC3
ÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 0F DMA channel 3 source address register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMDST3 56/57 10 DMA channel 3 destination address register
ÁÁÁÁÁ
ÁÁÁÁ
DMCTR3
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 11 DMA channel 3 element count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMSFC3 56/57 12 DMA channel 3 sync select and frame count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMMCR3 56/57 13 DMA channel 3 transfer mode control register
ÁÁÁÁÁ
ÁÁÁÁ
DMSRC4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 14 DMA channel 4 source address register
ÁÁÁÁÁ
ÁÁÁÁ
DMDST4
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 15 DMA channel 4 destination address register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMCTR4 56/57 16 DMA channel 4 element count register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
†Accesses to address 57h update the subaddressed register and postincrement the subaddress contained in DMSBAR.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Accesses to 56h update the subaddressed register without modifying DMSBAR.
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
address
Name (Hex){ (Hex) Description
ÁÁÁÁÁ
ÁÁÁÁ
DMSFC4
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁ
DMMCR4
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
56/57
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57
17
18
DMA channel 4 sync select and frame count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
DMSRC5 ÁÁÁÁÁ
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 19 DMA channel 5 source address register
ÁÁÁÁÁ
ÁÁÁÁ
DMDST5
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 1A DMA channel 5 destination address register
ÁÁÁÁÁ
ÁÁÁÁ
DMCTR5
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 1B DMA channel 5 element count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMSFC5 56/57 1C DMA channel 5 sync select and frame count register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMMCR5 56/57 1D DMA channel 5 transfer mode control register
ÁÁÁÁÁ
ÁÁÁÁ
DMSRCP
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 1E DMA source program page address (common channel)
ÁÁÁÁÁ
ÁÁÁÁ
DMDSTP
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 1F DMA destination program page address (common channel)
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMIDX0 56/57 20 DMA element index address register 0
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMIDX1 56/57 21 DMA element index address register 1
ÁÁÁÁÁ
ÁÁÁÁ
DMFRI0
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 22 DMA frame index register 0
ÁÁÁÁÁ
ÁÁÁÁ
DMFRI1
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57 23 DMA frame index register 1
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMGSA 56/57 24 DMA global source address reload register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMGDA 56/57 25 DMA global destination address reload register
ÁÁÁÁÁ
ÁÁÁÁ
DMGCR
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
56/57
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
26 DMA global count reload register
ÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DMGFR 56/57 27 DMA global frame count reload register
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
†Accesses to address 57h update the subaddressed register and postincrement the subaddress contained in DMSBAR.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Accesses to 56h update the subaddressed register without modifying DMSBAR.
CLKOUT
SSBX or RSBX instruction Delay
A(15–0)
XF
8.4 Timer
The on-chip timer is a software-programmable timer that consists of three
registers and can be used to periodically generate interrupts. The timer resolu-
tion is the CPU clock rate of the processor.The high dynamic range of the timer
is achieved with a 16-bit counter with a 4-bit prescaler. The C5402 and the
C5420 have two on-chip timers.
- Timer period register (PRD). The 16-bit memory-mapped timer period reg-
ister (PRD) is used to reload the timer register (TIM).
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁÁÁÁ
15–12 ÁÁÁ
ÁÁÁ ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ 11 10 9–6 5 4 3–0
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁ
Reserved
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁ Soft Free PSC TRB TSS TDDR
Reset
Bit Name Value Function
11 Soft 0 Used in conjunction with the Free bit to determine the state of the timer when a
breakpoint is encountered in the HLL debugger. When the Free bit is cleared, the
Soft bit selects the timer mode.
10 Free 0 Used in conjunction with the Soft bit to determine the state of the timer when a
breakpoint is encountered in the HLL debugger. When the Free bit is cleared, the
Soft bit selects the timer mode.
9–6 PSC — Timer prescaler counter. Specifies the count for the on-chip timer. When PSC is
decremented past 0 or the timer is reset, PSC is loaded with the contents of TDDR
and the TIM is decremented.
5 TRB — Timer reload. Resets the on-chip timer. When TRB is set, the TIM is loaded with
the value in the PRD and the PSC is loaded with the value in TDDR. TRB is always
read as a 0.
4 TSS 0 Timer stop status. Stops or starts the on-chip timer. At reset, TSS is cleared and
the timer immediately starts timing.
3–0 TDDR 0000 Timer divide-down ratio. Specifies the timer divide-down ratio (period) for the
on-chip timer. When PSC is decremented past 0, PSC is loaded with the contents
of TDDR.
Figure 8–3 shows a logical block diagram of the timer. It consists of two basic
blocks: the main timer block, consisting of PRD and TIM; and a prescaler
block, consisting of TDDR and PSC bits in TCR. The timer is clocked by the
CPU clock.
PRD TDDR
CPU clock
TIM PSC TSS
Borrow Borrow
TINT
TOUT
Under normal operation, TIM is loaded with the contents of PRD when TIM
decrements to 0. The contents of PRD are also loaded into TIM when the
device is reset (SRESET input in Figure 8–3) or when the timer is individually
reset (TRB input in Figure 8–3). TIM is clocked by the prescaler block. Each
output clock from the prescaler block decrements TIM by 1. The output of the
main timer block is the timer interrupt (TINT) signal that is sent to the CPU and
to the timer output (TOUT) pin. The duration of the TOUT pulse is equal to the
period of CLKOUT. (Note that on the C5402, the timer1 output (TOUT1) is only
available when the HPI-8 is disabled, and the TOUT1 bit is set in the GPIO
control register.)
The prescaler block has two elements similar to the TIM and PRD. These are
the prescale counter (PSC) and timer divide-down ratio (TDDR). Both PSC
and TDDR are fields in the timer control register (TCR). Under normal opera-
tion, PSC is loaded with the contents of TDDR when PSC decrements to 0. The
contents of TDDR are also loaded into PSC when the device is reset or when
the timer is individually reset. PSC is clocked by the device CPU clock. Each
CPU clock decrements PSC by 1. PSC can be read by reading TCR, but it can-
not be written to directly.
The timer can be stopped by making use of the TSS input to turn off the clock
input to the timer. Stopping the timer’s operation allows the device to run in a
low-power mode when the timer is not needed.
The timer interrupt (TINT) rate is equal to the CPU clock frequency divided by
two independent factors:
TINT rate + 1 + 1
t c(C) u v t c(C) (TDDR ) 1) (PRD ) 1)
In the equation, tc(C) is the period of CPU clock, u is the sum of the TDDR
contents plus 1, and v is the sum of the PRD contents plus 1.
The current value in the timer can be read by reading TIM; PSC can be read
by reading TCR. Because it takes two instructions to read both registers, there
may be a change between the two reads as the counter decrements. There-
fore, when precise timing measurements are needed, it is more accurate to
stop the timer before reading these two values. The timer can be stopped by
setting the TSS bit and restarted by clearing it.
The timer can be used to generate a sample clock for peripheral circuits such
as an analog interface. This can be accomplished by using the TOUT signal
to clock a device or by using the interrupt to periodically read a register. (Note
that on the C5402, the timer1 output (TOUT1) is only available when the HPI-8
is disabled, and the TOUT1 bit is set in the GPIO control register.)
The timer is initialized with the following steps:
1) Stop the timer by writing a 1 to TSS in TCR.
2) Load PRD.
3) Start the timer by reloading TCR to initialize TDDR. Enable the timer by
setting TSS to 0 and TRB to 1 to reload the timer period.
The clock generator allows system designers to select the clock source. The
sources that drive the clock generator are:
- A crystal resonator with the internal oscillator circuit. The crystal resonator
circuit is connected across the X1 and X2/CLKIN pins of the C54x DSP.
The CLKMD pins must be configured to enable the internal oscillator.
The clock generator on the C54x devices consists of an internal oscillator and
a phase-locked loop (PLL) circuit. Currently, there are two different types of
PLL circuits on C54x devices. Some devices have hardware-configurable PLL
circuits while others have software-programmable PLL circuits.
The PLL functions with a lower external frequency source than the machine
cycle rate of the CPU. This feature reduces high-frequency noise from a high-
speed switching clock. The internal oscillator or the external clock source is
fed into the PLL. The internal CPU clock is generated by multiplying the exter-
nal clock source or the internal oscillator frequency by a factor N (PLL N).
If you are using the internal oscillator circuit, the clock source is divided by 2
to generate the internal CPU clock. If you are using the external clock, the inter-
nal CPU clock is a factor of PLL N.
The clock mode is determined by the CLKMD1, CLKMD2, and CLKMD3 pins.
Table 8–15 shows how these pins select the clock mode. For non-PLL use, the
frequency of the CPU clock is half the crystal’s oscillating frequency or the
external clock frequency.
The clock mode must not be reconfigured with the clock mode pins during
normal operation. During IDLE3 mode, the clock mode can be reconfigured
after CLKOUT is set high.
0 1 0 PLL 1.5 with external source PLL 4.5 with external source
- DIV (divider) mode. The input clock (CLKIN) is divided by 2 or 4. When DIV
mode is used, all of the analog parts, including the PLL circuitry, are
disabled in order to minimize power dissipation.
Immediately following reset, the clock mode is determined by the values of the
three external pins, CLKMD1, CLKMD2, and CLKMD3. The modes corre-
sponding to the CLKMD pins are shown in Table 8–16 and Table 8–17.
The VC5420 device does not have CLKMD pins. Following reset, the VC5420
operates in bypass mode (PLL is off).
0 1 1 — Stop mode
† Reserved on C549 and C5410
ÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
Figure 8–4. Clock Mode Register (CLKMD) Diagram
ÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
15–12
ÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁ ÁÁÁÁÁ
ÁÁÁÁÁ
11
ÁÁÁÁÁ
10–3 2 1 0
ÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
ÁÁÁÁÁ
PLLMUL PLLDIV PLLCOUNT PLLON/OFF PLLNDIV PLLSTATUS
R/W† R/W† R/W† R/W† R/W R
† When in DIV mode (PLLSTATUS is low), PLLMUL, PLLDIV, PLLCOUNT, and PLLON/OFF are don’t cares, and their contents
are indeterminate.
11 PLLDIV PLL divider. Defines the frequency multiplier in conjunction with PLLMUL and
PLLNDIV, as shown in Table 8–19 on page 8-30.
10–3 PLLCOUNT PLL counter value. Specifies the number of input clock cycles (in increments of
16 cycles) for the PLL lock timer to count before the PLL begins clocking the processor
after the PLL is started. The PLL counter is a down-counter, which is driven by the
input clock divided by 16; therefore, for every 16 input clocks, the PLL counter
decrements by 1. See section Using the PLLCOUNT Programmable Lock Timer, on
page 8-31 for more information about PLLCOUNT.
The PLL counter can be used to ensure that the processor is not clocked until the PLL
is locked, so that only valid clock signals are sent to the device.
2 PLLON/OFF PLL on/off. Enables or disables the PLL part of the clock generator in conjunction with
PLLNDIV. PLLON/OFF and PLLNDIV both force the PLL to operate; when PLLON/
OFF is high, the PLL runs independently of the state of PLLNDIV:
0 0 off
0 1 on
1 0 on
1 1 on
0 PLLSTATUS PLL status. Indicates the mode that the clock generator is operating.
Table 8–19. PLL Multiplier Ratio as a Function of PLLNDIV, PLLDIV, and PLLMUL
PLLNDIV PLLDIV PLLMUL Multiplier†
0 x 0 – 14 0.5
0 x 15 0.25
1 0 0 – 14 PLLMUL + 1
1 0 15 1 (bypass)}
1 1 0 or even (PLLMUL + 1) B 2
1 1 odd PLLMUL B 4
† CLKOUT = CLKIN Multiplier
‡ This is the default mode for the C5420 after reset.
During the lockup period, the PLL should not be used to clock the C54x DSP.
The PLLCOUNT programmable lock timer provides a convenient method of
automatically delaying clocking of the device by the PLL until lock is achieved.
The PLL lock timer is a counter, loaded from the PLLCOUNT field in the
CLKMD register, that decrements from its preset value to 0. The timer can be
preset to any value from 0 to 255, and its input clock is CLKIN divided by 16.
The resulting lockup delay can therefore be set from 0 to 255 16 CLKIN
cycles.
The lock timer is activated when the clock generator operating mode is
switched from DIV to PLL (see section Switching From DIV Mode to PLL Mode,
on page 8-32). During the lockup period, the clock generator continues to
operate in DIV mode; after the PLL lock timer has decremented to 0, the PLL
begins clocking the C54x DSP.
LockupTime
PLLCOUNT u
16 T CLKIN
where TCLKIN is the input reference clock period and LockupTime is the
required PLL lockup time as shown in Figure 8–5.
50
44
45
Lockup Time ( µs)
40
’549, and ’5410 35
35
30
23 29
25
22 24
20
16 17 16 19
15
10
5
0
2.5 10 20 30 40 50 60 70 80 100
CLKOUT frequency (MHz)
Example 8–1. Switching Clock Mode From PLL × 3 Mode to Divide-by-2 Mode
Once the PLLNDIV bit is set, the PLLCOUNT timer begins being decremented
from its preset value. When the PLLCOUNT timer reaches 0, the new PLL
mode takes effect after 6 CLKIN cycles plus 3.5 PLL cycles.
Note that a direct switch between divide-by-2 mode and divide-by-4 mode is
not possible. To switch between these two modes, the clock generator must
first be set to PLL mode with an integer-only (nonfractional) multiplier ratio and
then set back to DIV mode in the desired divider configuration (see section
Switching From DIV Mode to PLL Mode, on page 8-32).
Example 8–2 shows a code sequence that can be used to switch the clock
mode from PLL × X mode to PLL × 1 mode.
Example 8–2. Switching Clock Mode From PLL × X Mode to PLL × 1 Mode
Note that when the PLL is stopped during an IDLE state and the C54x device
is restarted and the clock generator is switched back to PLL mode, the PLL
lockup delay occurs in the same manner as in a normal device startup. There-
fore, in this case, the lockup delay must also be accounted for, either externally
or by using the PLL lockup counter timer.
Example 8–3 shows a code sequence that switches the clock generator from
PLL 3 mode to divide-by-2 mode, turns off the PLL, and enters IDLE3. After
waking up from IDLE3, the clock generator is switched from DIV mode to
PLL 3 mode using a single STM instruction, with a PLLCOUNT of 64
(decimal) used for the lock timer value.
(After IDLE3 wake-up – switch the PLL from DIV mode to PLL 3 mode)
On the C545A and C546A, for compatibility, the bootloader configures the PLL
to the same mode as would have resulted if the same CLKMD(1–3) input bits
had been provided to the option-1 or option-2 hardware-programmable PLL
(see Table 8–15 on page 8-27), according to whether the C545A or C546A is
an option-1 or option-2 device. Once the bootloader program has finished
executing and control is transferred to the user’s program, the PLL can be
reprogrammed to any desired configuration.
Enhanced host port interfaces are available on the C5402, C5410 (HPI-8), and
C5420 (HPI-16) devices. This chapter does not describe these enhanced
HPIs. For more information on the HPI-8 and HPI-16, see TMS320C54x DSP
Enhanced Peripherals Reference Guide (SPRU302).
The HPI interfaces to the host device as a peripheral, with the host device as
master of the interface, facilitating ease of access by the host. The host device
communicates with the HPI through dedicated address and data registers, to
which the C54x DSP does not have direct access, and the HPI control register,
using the external data and interface control signals (see Figure 8–6). Both the
host device and the C54x DSP have access to the HPI control register.
ÁÁ
ÁÁ
Figure 8–6. Host Port Interface Block Diagram
ÁÁ
HPI
ÁÁ
control
register
Á ÁÁÁ ÁÁ
Data latch
8
ÁÁ
HD(7–0)
ÁÁÁ
ÁÁÁ
8
ÁÁ ÁÁ
ÁÁÁ
ÁÁ ÁÁ 16 16
DSP data
ÁÁ Á
ÁÁÁ MUX
16
ÁÁÁÁ ÁÁÁ
ÁÁ DSP address
Á ÁÁÁ
Á ÁÁÁÁÁÁÁÁÁ
Á
MUX
ÁÁÁÁÁÁÁÁÁ
Address register
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Data Address
ÁÁÁÁ ÁÁÁÁÁÁÁÁÁ
HPI memory block
Interface
ÁÁÁÁÁÁÁ HPI
ÁÁÁÁ
control control
signals logic
The HPI provides 16-bit data to the C54x DSP while maintaining the
economical 8-bit external interface by automatically combining successive
bytes transferred into 16-bit words. When the host device performs a data
transfer with the HPI registers, the HPI control logic automatically performs an
access to a dedicated 2K-word block of internal C54x DSP dual-access RAM
to complete the transaction. The C54x DSP can then access the data within
its memory space. The HPI RAM can also be used as general-purpose dual-
access data or program RAM.
The HPI has two modes of operation, shared-access mode (SAM) and host-
only mode (HOM). In shared-access mode (the normal mode of operation),
both the C54x DSP and the host can access HPI memory. In this mode,
asynchronous host accesses are resynchronized internally and, in the case
of a conflict between a C54x DSP and a host cycle (where both accesses are
reads or writes), the host has access priority and the C54x DSP waits one
cycle. In host-only mode, only the host can access HPI memory while the C54x
DSP is in reset or in IDLE2 with all internal and external clocks stopped. The
host can therefore access the HPI RAM while the C54x DSP is in its minimum
power consumption configuration.
The external HPI interface consists of the 8-bit HPI data bus and control sig-
nals that configure and control the interface. The interface can connect to a
variety of host devices with little or no additional logic necessary. Figure 8–7
shows a simplified diagram of a connection between the HPI and a host
device.
ÁÁÁÁÁÁÁÁÁÁ
Á ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Host device
Á
TMS320C54x DSP
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ 8
ÁÁÁÁÁÁÁÁÁÁ Á Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Data HD0–HD7
ÁÁÁÁÁÁÁÁÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
2
HCNTL0/1 (address)
ÁÁÁÁÁÁÁÁÁÁ Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address Sampled by internal
HBIL (1st/2nd byte)
strobe or HAS
ÁÁÁÁÁÁÁÁÁÁ Á ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Read/Write HR/W
ÁÁÁÁÁÁÁÁÁÁ Á Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
HDS1
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
Data strobe HDS2 Internal strobe (controls transfer)
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
HCS
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Address Latch Enable
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
HAS (Samples Address and Read/Write
(if used) signals, if used)
Á Á
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Ready HRDY
ÁÁÁÁÁÁÁÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Interrupt HINT
Á
The 8-bit data bus (HD0–HD7) exchanges information with the host. Because
of the 16-bit word structure of the C54x DSP, all transfers with a host must
consist of two consecutive bytes. The dedicated HBIL pin indicates whether
the first or second byte is being transferred. An internal control register bit
determines whether the first or second byte is placed into the most significant
byte of a 16-bit word. The host must not break the first byte/second byte (HBIL
low/high) sequence of an ongoing HPI access. If this sequence is broken, data
can be lost, and unpredictable operation can result.
The two control inputs (HCNTL0 and HCNTL1) indicate which internal HPI
register is being accessed and the type of access to the register. These inputs,
along with HBIL, are commonly driven by host address bus bits or a function
of these bits. Using the HCNTL0/1 inputs, the host can specify an access to
the HPI control (HPIC) register, the HPI address (HPIA) register (which serves
as the pointer into HPI memory), or HPI data (HPID) register. The HPID regis-
ter can also be accessed with an optional automatic address increment.
Table 8–20 summarizes the three registers that the HPI utilizes for commu-
nication between the host device and the C54x CPU and their functions.
HPIC 002Ch HPI control register. Directly accessible by either the host or by the C54x DSP. Con-
tains control and status bits for HPI operations.
HPID – HPI data register. Directly accessible only by the host. Contains the data that was
read from the HPI memory if the current access is a read, or the data that will be
written to HPI memory if the current access is a write.
The two data strobes (HDS1 and HDS2), the read/write strobe (HR/W), and
the address strobe (HAS) enable the HPI to interface to a variety of industry-
standard host devices with little or no additional logic required. The HPI is easi-
ly interfaced to hosts with multiplexed address/data bus, separate address
and data buses, one data strobe and a read/write strobe, or two separate
strobes for read and write. This is described in detail later in this section.
The HPI ready pin (HRDY) allows insertion of wait states for hosts that support
a ready input to allow deferred completion of access cycles and have faster
cycle times than the HPI can accept due to C54x CPU operating clock rates.
If HRDY, when used directly from the C54x CPU, does not meet host timing
requirements, the signal can be resynchronized using external logic if neces-
sary. HRDY is useful when the C54x CPU operating frequency is variable, or
when the host is capable of accessing at a faster rate than the maximum
shared-access mode access rate (up to the host-only mode maximum access
rate). In both cases, the HRDY pin provides a convenient way to automatically
(no software handshake needed) adjust the host access rate to a faster C54x
CPU clock rate or switch the HPI mode.
All of these features combined allow the HPI to provide a flexible and efficient
interface to a wide variety of industry-standard host devices. Also, the simplic-
ity of the HPI interface greatly simplifies data transfers both from the host and
the C54x DSP sides of the interface. Once the interface is configured, data
transfers are made with a minimum of overhead at a maximum speed.
HBIL Address or control I Byte identification input. Identifies first or second byte of transfer (but
lines not most significant or least significant — this is specified by the BOB
bit in the HPIC register, described later in this section). HBIL is low
for the first byte and high for the second byte.
HCNTL0, Address or control I Host control inputs. Selects a host access to the HPIA register, the
HCNTL1 lines HPI data latches (with optional address increment), or the HPIC
register.
HCS Address or control I Chip select. Serves as the enable input for the HPI and must be low
lines during an access but may stay low between accesses. HCS normally
precedes HDS1 and HDS2, but this signal also samples HCNTL0/1,
HR/W, and HBIL if HAS is not used and HDS1 or HDS2 are already
low (this is explained in further detail later in this section). Figure 8–8
on page 8-42 shows the equivalent circuit of the HCS, HDS1 and
HDS2 inputs.
HD0–HD7 Data bus I/O/Z Parallel bidirectional 3-state data bus. HD7 (MSB) through HD0
(LSB) are placed in the high-impedance state when not outputting
(HDSx | HCS = 1) or when EMU1/OFF is active (low).
† I = Input, O = Output, Z = High impedance
HINT Host interrupt O/Z Host interrupt output. Controlled by the HINT bit in the HPIC. Driven
input high when the C54x DSP is being reset. Placed in the high
impedance state when EMU1/OFF is active (low).
HRDY Asynchronous O/Z HPI ready output. When high, indicates that the HPI is ready for a
ready transfer to be performed. When low, indicates that the HPI is busy
completing the internal portion of the previous transaction. Placed in
high impedance when EMU1/OFF is active (low). HCS enables
HRDY; that is, HRDY is always high when HCS is high.
HR/W Read/Write strobe, I Read/write input. Hosts must drive HR/W high to read HPI and low
address line, or to write HPI. Hosts without a read/write strobe can use an address
multiplexed line for this function.
address/data
† I = Input, O = Output, Z = High impedance
The HCS input serves primarily as the enable input for the HPI, and the HDS1
and HDS2 signals control the HPI data transfer; however, the logic with which
these inputs are implemented allows their functions to be interchanged if de-
sired. If HCS is used in place of HDS1 and HDS2 to control HPI access cycles,
HRDY operation is affected (since HCS enables HRDY and HRDY is always
high when HCS is high). The equivalent circuit for these inputs is shown in
Figure 8–8. The figure shows that the internal strobe signal that samples the
HCNTL0/1, HBIL, and HR/W inputs (when HAS is not used) is derived from all
three of the input signals, as the logic illustrates. Therefore, the latest of HDS1,
HDS2, or HCS is the one which actually controls sampling of the HCNTL0/1,
HBIL, and HR/W inputs. Because HDS1 and HDS2 are exclusive-NORed,
both these inputs being low does not constitute an enabled condition.
Internal Strobe
HCS
When using the HAS input to sample HCNTL0/1, HBIL, and HR/W, this allows
these signals to be removed earlier in an access cycle, therefore allowing more
time to switch bus states from address to data information, facilitating interface
to multiplexed address and data type buses. In this type of system, an ALE
signal is often provided and would normally be the signal connected to HAS.
The two control pins (HCNTL0 and HCNTL1) indicate which internal HPI regis-
ter is being accessed and the type of access to the register. The states of these
two pins select access to the HPI address (HPIA), HPI data (HPID), or HPI
control (HPIC) registers. The HPIA register serves as the pointer into HPI
memory, the HPIC contains control and status bits for the transfers, and the
HPID contains the actual data transferred. Additionally, the HPID register can
be accessed with an optional automatic address increment. Table 8–22
describes the HCNTL0/1 bit functions.
0 1 Host can read or write the HPI data latches. HPIA is automatically postincremented each
time a read is performed and preincremented each time a write is performed.
1 0 Host can read or write the address register, HPIA. This register points to the HPI
memory.
1 1 Host can read or write the HPI data latches. HPIA is not affected.
Four bits control HPI operation. These bits are BOB (which selects first or se-
cond byte as most significant), SMOD (which selects host or shared-access
mode), and DSPINT and HINT (which can be used to generate C54x DSP and
host interrupts, respectively) and are located in the HPI control register
(HPIC). A detailed description of the HPIC bit functions is presented in
Table 8–23.
SMOD Read Read/Write If SMOD = 1, shared-access mode (SAM) is enabled: the HPI
memory can be accessed by the C54x DSP. If SMOD = 0,
host-only mode (HOM) is enabled: the C54x DSP is denied
access to the entire HPI RAM block. SMOD = 0 during reset;
SMOD = 1 after reset. SMOD can be modified only by the C54x
DSP but can be read by both the C54x DSP and the host.
DSPINT Write – The host processor-to-C54x interrupt. This bit can be written
only by the host and is not readable by the host or the C54x DSP.
When the host writes a 1 to this bit, an interrupt is generated to
the C54x DSP. Writing a 0 to this bit has no effect. Always read
as 0. When the host writes to HPIC, both bytes must write the
same value. See this section for a detailed description of
DSPINT function.
Because the host interface always performs transfers with 8-bit bytes and the
control register is normally the first register accessed to set configuration bits
and initialize the interface, the HPIC is organized on the host side as a 16-bit
register with the same high and low byte contents (although access to certain
bits is limited, as described previously) and with the upper bits unused on the
C54x DSP side. The control/status bits are located in the least significant four
bits. The host accesses the HPIC register with the appropriate selection of
HCNTL0/1, as described previously, and two consecutive byte accesses to the
8-bit HPI data bus. When the host writes to HPIC, both the first and second
byte written must be the same value. The C54x DSP accesses the HPIC at
002Ch in data memory space.
The layout of the HPIC bits is shown in Figure 8–9 through Figure 8–12. In the
figures for read operations, if 0 is specified, this value is always read; if X is
specified, an unknown value is read. For write operations, if X is specified, any
value can be written. On a host write, both bytes must be identical. Note that
bits 4–7 and 12–15 on the host side and bits 4–15 on the C54x DSP side are
reserved for future expansion.
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
15–12 ÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁÁ
11 10 9 8 7–4 3 2 1 0
ÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
X
ÁÁÁ
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
HINT 0 SMOD BOB X HINT 0 SMOD BOB
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
Figure 8–10. HPIC Diagram — Host Writes to HPIC
ÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁ
15–12
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
11 10 9 8 7–4 3 2 1 0
ÁÁÁÁÁÁÁ
Note:
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
X
ÁÁ
ÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
HINT
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
Figure 8–11.HPIC Diagram — TMS320C54x DSP Reads From HPIC
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ
ÁÁÁ
15–4 3 2 1 0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
X HINT 0 SMOD 0
X
3
HINT
2
X
1
SMOD
0
Because the C54x DSP can write to the SMOD and HINT bits, and these bits
are read twice on the host interface side, the first and second byte reads by
the host may yield different data if the C54x DSP changes the state of one or
both of these bits in between the two read operations. The characteristics of
host and C54x HPIC read/write cycles are summarized in Table 8–24.
previous access, and the current access serves as the initiation of the next
cycle. A similar sequence occurs for a write operation: the data written to HPID
is not written to HPI memory until after the external cycle is completed. If an
HPID read operation immediately follows an HPID write operation, the same
data (the data written) is read.
When the host performs an external access to the HPI, there are two distinctly
different types of cycles that can occur: those for which wait states are gener-
ated (the HRDY signal is active) and those without wait states. In general,
when in shared-access mode (SAM), the HRDY signal is used; when in host-
only mode (HOM), HRDY is not active and remains high; however, there are
exceptions to this, which will be discussed.
For accesses utilizing the HRDY signal, during the time when the internal por-
tion of the transfer is being performed (either for a read or a write), HRDY is
low, indicating that another transfer cannot yet be initiated. Once the internal
cycle is completed and another external cycle can begin, HRDY is driven high
by the HPI. This occurs after a fixed delay following a cycle initiation (refer to
the TMS320C54x DSP data sheet for detailed timing information for HPI exter-
nal interface timings). Therefore, unless back-to-back cycles are being
performed, HRDY is normally high when the first byte of a cycle is transferred.
The external HPI cycle using HRDY is shown in the timing diagram in
Figure 8–13.
HBIL
HCS
HAS
(if used)
ÁÁ ÁÁ Á Á
HDS1,
HDS2
HD
ÁÁ Á ÁÁ Á Á Á
ÁÁ Á ÁÁ Á Á
Valid Valid
read
HD
ÁÁ Á Á
Á ÁÁ Á Á
Valid Valid
write
HRDY
In a typical external access, as shown in Figure 8–13, the cycle begins with
the host driving HCNTL0/1, HR/W, HBIL, and HCS, indicating specifically what
type of transfer is to occur and whether the cycle is to be read or a write. Then
the host asserts the HAS signal (if used) followed by one of the data strobe
signals. If HRDY is not already high, it goes high when the previous internal
cycle is complete, allowing data to be transferred, and the control signals are
deasserted. Following the external HPI cycle, HRDY goes low and stays low
for a period of approximately five CLKOUT cycles (refer to the TMS320C54x
DSP data sheet for HPI timing information) while the C54x DSP completes the
internal HPI memory access, and then HRDY is driven high again. Note, how-
ever, HRDY is always high when HCS is high.
Host access cycles, when in HOM, have timings different from the SAM
timings described previously. In HOM, the CPU is not involved (with one
exception), and the access can be completed after a short, fixed delay time.
The exception to this occurs when writing 1s to the DSPINT or HINT bits in
HPIC. In this case, the host access takes several CPU clock cycles, and SAM
timings apply. Besides the HRDY timings and a faster cycle time, HOM access
cycles are logically the same as SAM access cycles. A summary of the condi-
tions under which the HRDY signal is active (where SAM timings apply) for
host accesses is shown in Table 8–25. When HRDY is not active (HRDY stays
high), HOM timings apply. Refer to the TMS320C54x DSP data sheet for
detailed HPI timing specifications.
HPIA No HOM – No
SAM – Yes
Access Sequences
A complete host access cycle always involves two bytes, the first with HBIL
low, and the second with HBIL high. This 2-byte sequence must be followed
regardless of the type of host access (HPIA, HPIC, or data access) and the
host must not break the first byte/second byte (HBIL low/high) sequence of an
ongoing HPI access. If this sequence is broken, data may be lost, and an un-
predictable operation may result.
Before accessing data, the host must first initialize HPIC, in particular the BOB
bit, and then HPIA (in this order, because BOB affects the HPIA access). After
initializing BOB, the host can then write to HPIA with the correct byte align-
ment. On an HPI memory read operation, after completion of the HPIA write,
the HPI memory is read and the contents at the given address are transferred
to the two 8-bit data latches, the first byte data latch and the second byte data
latch. Table 8–26 illustrates the sequence involved in initializing BOB and
HPIA for an HPI memory read. In this example, BOB is set to 0 and a read is
requested of the first HPI memory location (in this case 1000h), which contains
FFFEh.
In the cycle shown in Table 8–26, BOB and HPIA are initialized, and by loading
HPIA, an internal HPI memory access is initiated. The last line of Table 8–26
shows the condition of the HPI after the internal RAM read is complete; that
is, after some delay following the end of the host write of the second byte to
HPIA, the read is completed and the data has been placed in the upper and
lower byte data latches. For the host to actually retrieve this data, it must per-
form an additional read of HPID. During this HPID read access, the contents
of the first byte data latch appears on the HD pins when HBIL is low and the
content of the second byte data latch appears on the HD pins when HBIL is
high. Then the address is incremented if autoincrement is selected and the
memory is read again into the data latches. The sequence involved in this
access is shown in Table 8–27.
In the access shown in Table 8–27, the data obtained from reading HPID is the
data from the read initiated in the previous cycle (the one shown in Table 8–26)
and the access performed as shown in Table 8–27 also initiates a further read,
this time at location 1001h (because autoincrement was specified in this
access by setting HCNTL1/0 to 01). Also, when autoincrement is selected, the
increment occurs with each 16-bit word transferred (not with each byte); there-
fore, as shown in Table 8–27, the HPIA is incremented by only 1. The last line
of Table 8–27 indicates that after the second internal RAM read is complete,
the contents of location 1001h (6ABCh) has been read and placed into the
upper and lower byte data latches.
During a write access to the HPI, the first byte data latch is overwritten by the
data coming from the host while the HBIL pin is low, and the second byte data
latch is overwritten by the data coming from the host while the HBIL pin is high.
At the end of this write access, the data in both data latches is transferred as
a 16-bit word to the HPI memory at the address specified by the HPIA register.
The address is incremented prior to the memory write because autoincrement
is selected.
An HPI write access is illustrated in Table 8–28. In this example, after the inter-
nal portion of the write is completed, location 1002h of HPI RAM contains
1234h. If a read of the same address follows this write, the same data just writ-
ten in the data latches (1234h) is read back.
On the C54x DSP, the host-to-C54x interrupt vector address is xx64h. This in-
terrupt is located in bit 9 of the IMR/IFR. Since the C54x CPU interrupt vectors
can be remapped into the HPI memory, the host can instruct the C54x DSP to
execute preprogrammed functions by simply writing the start address of a
function to address xx65h in the HPI memory prior to interrupting the C54x
CPU with a branch instruction located at address xx64h. If the interrupts are
remapped to the host port accessible on-chip RAM, you must use SAM and
the host must not write to location xx00h to xx7Fh, except for xx65h.
Host Port Interface (C54x) Using HINT to Interrupt the Host Device
When the C54x DSP writes a 1 to the HINT bit in HPIC, the HINT output is driv-
en low; the HINT bit is read as a 1 by the C54x DSP or the host. The HINT signal
can be used to interrupt the host device. The host device, after detecting the
HINT interrupt line, can acknowledge and clear the C54x CPU interrupt and
the HINT bit by writing a 1 to the HINT bit. The HINT bit is cleared and then read
as a 0 by the C54x DSP or the host, and the HINT pin is driven high. If the C54x
DSP or the host writes a 0, the HINT bit remains unchanged. While accessing
the SMOD bit, the C54x DSP should not write a 1 to the HINT bit unless it also
wants to interrupt the host.
The HPI host-only mode (HOM) allows the host to access HPI RAM while the
C54x CPU is in IDLE2/3 (that is, completely halted). Additionally, the external
clock input to the C54x CPU can be stopped for the lowest power consumption
configuration. Under these conditions, random accesses can still be made
without having to restart the external clock for each access and wait for its
lockup time if the C54x on-chip PLL is used. The external clock need only be
restarted before taking the C54x CPU out of IDLE2/3.
The host cannot access HPI RAM in SAM when the C54x CPU is in IDLE2/3,
because CPU clocks are required for access in this mode of operation. There-
fore, if the host requires access to the HPI RAM while the C54x CPU is in
IDLE2/3, the C54x CPU must change HPI mode to HOM before entering
IDLE2/3. When the HPI is in HOM, the C54x CPU can access HPIC to toggle
the SMOD bit or send an interrupt to the host, but cannot access the HPI RAM
block; a C54x CPU access to the HPI RAM is disregarded in HOM. In order
for the C54x CPU to again access the HPI RAM block, HPI mode must be
changed to SAM after exiting IDLE2/3.
To select HOM, a 0 must be written to the SMOD bit in HPIC. To select SAM,
a 1 must be written to SMOD. When changing between HOM and SAM, two
considerations must be met for proper operation. First, the instruction immedi-
ately following the one that changes from SAM to HOM must not be an IDLE 2
or IDLE 3. This is because in this case, due to the C54x CPU pipeline and
delays in the SAM to HOM mode switch, the IDLE2/3 takes effect before the
mode switch occurs, causing the HPI to remain in SAM; therefore, no host
accesses can occur.
The second consideration is that when changing from HOM to SAM, the
instruction immediately following the one that changes from HOM to SAM can-
not read the HPI RAM block. This requirement is due to the fact that the mode
has not yet changed when the HPI RAM read occurs and the RAM read is
ignored because the mode switch has not yet occurred. HPI RAM writes are
not included in this restriction because these operations occur much later in
the pipeline, so it is possible to write to HPI RAM in the instruction following the
one which changes from HOM to SAM.
On the host side, there are no specific considerations associated with the
mode changes. For example, it is possible to have a third device wake up the
C54x CPU from IDLE2/3 and the C54x CPU changing to SAM upon wake-up
without a software handshake with the host. The host can continue accessing
while the HPI mode changes. However, if the host accesses the HPI RAM
while the mode is being changed, the actual mode change will be delayed until
the host access is completed. In this case, a C54x CPU access to the HPI
memory is also delayed.
Table 8–29 illustrates the sequence of events involved in entering and exiting
an IDLE2/3 state on the C54x CPU when using the HPI. Throughout the pro-
cess, the HPI is accessible to the host.
Table 8–29. Sequence for Entering and Exiting IDLE2 and IDLE3
The C54x DSP is not operational during reset, but the host can access the HPI,
allowing program or data downloads to the HPI memory. When this capability
is used, it is often convenient for the host to control the C54x DSP reset input.
The sequence of events for resetting the C54x DSP and downloading a
program to HPI memory while the C54x DSP is in reset is summarized in
Table 8–30 and corresponds to the reset of the C54x DSP.
Initially, the host stops accessing the HPI at least six C54x CPU periods before
driving the C54x DSP reset line low. The host then drives the C54x DSP reset
line low and can start accessing the HPI after a minimum of four C54x CPU
periods. The HPI mode is automatically set to HOM during reset, allowing high-
speed program download. The C54x CPU clock can even be stopped at this
time; however, the clock must be running when the reset line falls and rises for
proper reset operation of the C54x DSP.
Once the host has finished downloading into HPI memory, the host stops
accessing the HPI and drives the C54x DSP reset line high. At least 20 C54x
CPU periods after the reset line rising edge, the host can again begin acces-
sing the HPI. This number of periods corresponds to the internal reset delay
of the C54x DSP. The HPI mode is automatically set to SAM upon exiting reset.
If the host writes a 1 to DSPINT while the C54x DSP is in reset, the interrupt
is lost when the C54x DSP comes out of reset. The C54x DSP warm boot can
use the HPI memory and start execution from the lowest HPI address.
Brings RESET low and waits 4 clocks Goes into reset HOM Running
Writes program and/or data in HPI memory In reset HOM Stopped or running
Waits 20 C54x CPU clock periods Comes out of reset SAM Running
† Sufficient wake-up time must be ensured when the C54x on-chip PLL is used.
Serial Ports
This chapter discusses the four serial port interfaces connected to the
TMS320C54x DSP core CPU:
These peripherals are controlled through registers that reside in the memory
map. The serial ports are synchronized to the core CPU by way of interrupts.
Topic Page
Table 9–1 lists the serial ports available on various C54x devices.
C542 0 1 0 1
C543 0 1 0 1
C545 1 1 0 0
C546 1 1 0 0
C548 0 2 0 1
C549 0 2 0 1
C5402 0 0 2 0
C5410 0 0 3 0
C5420 0 0 6 0
Table 9–2 lists the sections that should be consulted for the various serial ports
and their modes.
Buffered Autobuffering section 9.3, Buffered Serial Port (BSP) Interface, on page 9-33.
TDM TDM section 9.4, Time-Division Multiplexed (TDM) Serial Port Interface, on
page 9-56.
Four different types of serial port interfaces are available on C54x devices.
The basic standard serial port interface is implemented on C541, C545, and
C546 devices. The TDM serial port interface is implemented on the C542,
C543, C548, and C549 devices. The C542, C543, C545, C546, C548, and
C549 devices include a buffered serial port (BSP) that implements an
automatic buffering feature, which greatly reduces CPU overhead required in
handling serial data transfers. The C5402, C5410, and C5420 devices include
multichannel buffered serial ports (McBSPs). See Table 9–1 for information
about the features included in various C54x devices.
Operation of the TDM serial port in TDM mode is described in section 9.4,
Time-Division Multiplexed (TDM) Serial Port Interface, on page 9-56. Note that
the BSP and TDM serial ports initialize to a standard serial port compatible
mode upon reset.
In all C54x DSP serial ports, both receive and transmit operations are double-
buffered, thus allowing a continuous communications stream with either 8-bit
or 16-bit data packets. The continuous mode provides operation that, once
initiated, requires no further frame synchronization pulses (FSR and FSX)
when transmitting at maximum packet frequency. The serial ports are fully
static and thus will function at arbitrarily low clocking frequencies. The
maximum operating frequency for the standard serial port of one-fourth of
CLKOUT (10 Mbit/s at 25 ns, 12.5 Mbit/s at 20 ns) is achieved when using
internal serial port clocks. The maximum operating frequency for the BSP is
CLKOUT. When the serial ports are in reset, the device may be configured to
turn off the internal serial port clocks, allowing the device to run in a lower
power mode of operation.
- Serial port control register (SPC). The 16-bit memory-mapped serial port
control register (SPC) contains the mode control and status bits of the
serial port.
- Data receive shift register (RSR). The 16-bit data receive shift register
(RSR) holds the incoming serial data from the serial data receive (DR) pin
and controls the transfer of the data to the DRR.
- Data transmit shift register (XSR). The 16-bit data transmit shift register
(XSR) controls the transfer of the outgoing data from the DXR and holds
the data to be transmitted on the serial data transmit (DX) pin.
During normal serial port operation, the DXR is typically loaded with data to
be transmitted on the serial port by the executing program, and its contents
read automatically by the serial port logic to be sent out when a transmission
is initiated. The DRR is loaded automatically by the serial port logic with data
received on the serial port and read by the executing program to retrieve the
received data.
At times during normal serial port operation, however, it may be desirable for
a program to perform other operations with the memory-mapped serial port
registers besides simply writing to DXR and reading from DRR.
On the SP, the DXR and DRR may be read or written at any time regardless
of whether the serial port is in reset or not. On the BSP, access to these regis-
ters is restricted; the DRR can only be read, and the DXR can only be written
when autobuffering is disabled (see section 9.3.2, Autobuffering Unit (ABU)
Operation, on page 9-40). The DRR can only be written when the BSP is in
reset. The DXR can be read at any time.
Note, however, that on both the SP and the BSP, care should be exercised
when reading or writing to these registers during normal operation. With the
DRR, since, as mentioned previously, this register is written automatically by
the serial port logic when data is received, if a write to DRR is performed,
subsequent reads may not yield the result written if a serial port receive occurs
after the write but before the read is performed. With the DXR, care should be
exercised when this register is written, since if previously written contents
intended for transmission have not yet been sent, these contents will be over-
written and the original data lost. As mentioned previously, the DXR can be
read at any time.
Alternatively, DXR and DRR may also serve as general purpose storage if they
are not required for serial port use. If these registers are to be used for general
purpose storage, the transmit and/or receive sections of the serial port should
be disabled either by tying off (by pulling up or down, whichever is appropriate)
external input pins which could spuriously cause serial port transfers, or by
putting the port in reset.
This section describes operation of the basic standard serial port interface,
which includes operation of the TDM and BSP serial ports when configured in
standard mode. Table 9–4 lists the pins used in serial port operation.
Figure 9–1 shows these pins for two C54x DSP serial ports connected for a
one-way transfer from device 0 to device 1. Only three signals are required to
connect from a serial port transmitter to a receiver for data transmission. The
transmitted serial data signal (DX) sends the actual data. The transmit frame
synchronization signal (FSX) initiates the transfer (at the beginning of the
packet), and the transmit clock signal (CLKX) clocks the bit transfer. The corre-
sponding pins on the receive device are DR, FSR and CLKR, respectively.
Pin Description
CLKR Receive clock signal
DX DR
FSX FSR
CLKX CLKR
Figure 9–2 shows how the pins and registers are configured in the serial port
logic and how the double-buffering is implemented.
Transmit data is written to the DXR, while received data is read from the DRR.
A transmit is initiated by writing data to the DXR, which copies the data to the
XSR when the XSR is empty (when the last word has been transmitted serially,
that is, driven on the DX pin). The XSR manages shifting the data to the DX
pin, thus allowing another write to DXR as soon as the DXR-to-XSR copy is
completed.
The process is similar in the receiver. Data from the DR pin is shifted into the
RSR, which is then copied into the DRR from which it may be read. Upon
completion of the RSR-to-DRR copy, a 0-to-1 transition occurs on the receive
ready (RRDY) bit in the SPC. This 0-to-1 transition generates a serial port
receive interrupt (RINT). Thus, the serial port is double-buffered because data
16 16
Load
(Load) control
DRR (16) logic DXR (16)
16 16
RINT on Load XINT on
RSR-DRR (Load) DXR-XSR
Control
transfer Logic transfer
(Clear) (Clear)
Byte/word Byte/word
counter (Clock) (Clock) counter
FSR FSX
DR CLKR CLKX DX
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁ
Á ÁÁÁ
ÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁ ÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
Free Soft RSRFULL XSREMPTY XRDY RRDY IN1 IN0 RRST XRST TXM MCM FSM FO DLB Res
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
R/W R/W R R R R R R R/W R/W R/W R/W R/W R/W R/W R
Note: R = Read, W = Write
15 Free 0 This bit is used in conjunction with the Soft bit to determine the state of the serial
port clock when a breakpoint is encountered in the HLL debugger. See Table 9–6
on page 9-17 for the serial port clock configurations.
Free = 1 The serial port clock runs free regardless of the Soft bit.
14 Soft 0 This bit is used in conjunction with the Free bit to determine the state of the serial
port clock when a breakpoint is encountered in the HLL debugger. When the Free
bit is cleared to 0, the Soft bit selects the emulation mode. See Table 9–6 on page
9-17 for the serial port clock configurations.
Soft = 0 The serial port clock stops immediately, thus aborting any
transmission.
13 RSRFULL 0 Receive Shift Register Full. This bit indicates whether the receiver has experi-
enced overrun. Overrun occurs when RSR is full and DRR has not been read since
the last RSR-to-DRR transfer. On the SP, when FSM = 1, the occurrence of a frame
sync pulse on FSR qualifies the generation of RSRFULL = 1. When FSM = 0, and
on the BSP, only the basic two conditions apply; that is, RSRFULL goes high with-
out waiting for an FSR pulse.
RSRFULL = 0 Any one of the following three events clears the RSRFULL
bit to 0: reading DRR, resetting the receiver (RRST bit to 0),
or resetting the device.
12 XSREMPTY 0 Transmit Shift Register Empty. This bit indicates whether the transmitter has expe-
rienced underflow. Underflow occurs when XSR is empty and DXR has not been
loaded since the last DXR-to-XSR transfer.
XSREMPTY = 0 Any one of the following three events clears the XSREMPTY
bit to 0: underflow has occurred, resetting the transmitter
(XRST bit to 0), or resetting the device.
Table 9–5. Serial Port Control Register (SPC) Bit Summary (Continued)
Reset
Bit Name Value Function
11 XRDY 1 Transmit Ready. A transition from 0 to 1 of the XRDY bit indicates that the DXR
contents have been copied to XSR and that DXR is ready to be loaded with a new
data word. A transmit interrupt (XINT) is generated upon the transition. This bit can
be polled in software instead of using serial port interrupts. Note that on the SP,
XRDY is generated directly as a result of writing to DXR; while on the BSP, XRDY
is only generated after DXR is loaded followed by the occurrence of an FSX pulse.
At reset or serial port transmitter reset (XRST = 0), the XRDY bit is set to 1.
10 RRDY 0 Receive Ready. A transition from 0 to 1 of the RRDY bit indicates that the RSR
contents have been copied to the DRR and that the data can be read. A receive
interrupt (RINT) is generated upon the transition. This bit can be polled in software
instead of using serial port interrupts. At reset or serial port receiver reset
(RRST = 0), the RRDY bit is cleared to 0.
9 IN1 x Input 1. This bit allows the CLKX pin to be used as a bit input. IN1 reflects the
current level of the CLKX pin of the device. When CLKX switches levels, there is
a latency of between 0.5 and 1.5 CLKOUT cycles before the new CLKX value is
represented in the SPC.
8 IN0 x Input 0. This bit allows the CLKR pin to be used as a bit input. IN0 reflects the
current level of the CLKR pin of the device. When CLKR switches levels, there is
a latency of between 0.5 and 1.5 CLKOUT cycles before the new CLKR value is
represented in the SPC.
7 RRST 0 Receive Reset. This signal resets and enables the receiver. When a 0 is written
to the RRST bit, activity in the receiver halts.
6 XRST 0 Transmitter Reset. This signal is used to reset and enable the transmitter. When
a 0 is written to the XRST bit, activity in the transmitter halts. When the XRDY bit
is 0, writing a 0 to XRST generates a transmit interrupt (XINT).
Table 9–5. Serial Port Control Register (SPC) Bit Summary (Continued)
Reset
Bit Name Value Function
5 TXM 0 Transmit Mode. This bit configures the FSX pin as an input (TXM = 0) or as an out-
put (TXM = 1).
4 MCM 0 Clock Mode. This bit specifies the clock source for CLKX.
3 FSM 0 Frame Sync Mode. This bit specifies whether frame synchronization pulses (FSX
and FSR) are required after the initial frame sync pulse for serial port operation.
See section 9.2.2, Serial Port Interface Operation, on page 9-6 for more details
on the frame sync signals.
2 FO 0 Format. This bit specifies the word length of the serial port transmitter and receiver.
Table 9–5. Serial Port Control Register (SPC) Bit Summary (Continued)
Reset
Bit Name Value Function
1 DLB 0 Digital Loopback Mode. This bit can be used to put the serial port in digital loopback
mode.
DLB = 0 The digital loopback mode is disabled. The DR, FSR, and
CLKR signals are taken from their respective device pins.
DLB = 1 The digital loopback mode is enabled. The DR and FSR sig-
nals are connected to DX and FSX, respectively, through
multiplexers, as shown in Figure 9–4(a) and (b) on page
9-13. Additionally, CLKR is driven by CLKX if MCM = 1. If
DLB = 1 and MCM = 0, CLKR is taken from the CLKR pin of
the device. This configuration allows CLKX and CLKR to be
tied together externally and supplied by a common external
clock source. The logic diagram for CLKR is shown in
Figure 9–4(c) on page 9-13. Note also that in DLB mode, the
FSX and DX signals appear on the device pins, but FSR and
DR do not. Either internal or external FSX signals may be
used in DLB mode, as defined by the TXM bit.
0 Res 0 Reserved. Always read as a 0 in the serial port. This bit performs a function in
the TDM serial port discussed in section 9.4, Time-Division-Multiplexed (TDM)
Serial Port Interface, on page 9-56.
Reserved Bit
DLB Bit
The DLB (bit 1) selects digital loopback mode, which allows testing of serial
port code with a single C54x device. When DLB = 1, DR and FSR are
connected to DX and FSX, respectively, through multiplexers, as shown in
Figure 9–4.
When in loopback mode, CLKR is driven by CLKX if on-chip serial port clock
generation is selected (MCM = 1), but if MCM = 0, then CLKR is driven by the
external CLKR signal. This allows for the capability of external serial port clock
generation in digital loopback mode. If DLB = 0, then normal operation occurs
where DR, FSR, and CLKR are all taken from their respective pins.
DR 0 FSR 0
MUX
MUX
DR (internal) FSR (internal)
(c)
DX 1 FSX 1
CLKR 0
DLB DLB
MUX
CLKR (internal)
CLKX 1
DLB
MCM
FO Bit
The FO (bit 2) specifies whether data is transmitted as 16-bit words (FO = 0)
or 8-bit bytes (FO = 1). Note that in the latter case, only the lower byte of what-
ever is written to DXR is transmitted, and the lower byte of data read from DRR
is what was received. To transmit a whole 16-bit word in 8-bit mode, two writes
to DXR are necessary, with the appropriate shifts of the value because the
upper eight bits written to DXR are ignored. Similarly, to receive a whole 16-bit
word in 8-bit mode, two reads from DRR are required, with the appropriate
shifts of the value. In the SP, the upper eight bits of DRR are indeterminate in
8-bit receptions; in the BSP, the unused bits of DRR are sign-extended.
Additionally, in the BSP, transfers of 10- and 12-bit words are provided for
additional flexibility. For a detailed description of this feature, refer to section
9.3, Buffered Serial Port (BSP) Interface, on page 9-33.
FSM Bit
The FSM (bit 3) specifies whether or not frame sync pulses are required in
consecutive serial port transmits. If FSM = 1, a frame sync must be present for
every transfer, although FSX may be either externally or internally generated
depending on TXM. This mode is referred to as burst mode, because there are
normally periods of inactivity on the serial port between transmits.
The frequency with which serial port transmissions occur is called packet
frequency, and data packets can be 8, 10, 12, or 16 bits long. Therefore, as
packet frequency increases, it reaches a maximum that occurs when the time,
in serial port clock cycles, from one packet to the next, is equal to the number
of bits being transferred. If transmission occurs at the maximum rate for
multiple transfers in a row, however, frame sync essentially becomes
redundant. Note that frame sync actually becomes redundant in burst mode
only at maximum packet frequency with FSX configured as an output
(TXM = 1). When FSX is an input (TXM = 0), its presence is required for trans-
missions to occur.
FSM = 0 selects the continuous mode of operation which requires only an
initial frame sync pulse as long as a write to DXR (for transmit), or a read from
DRR (for receive), is executed during each transfer. Note that when FSM = 0,
frame sync pulses are not required, but they are not ignored, therefore,
improperly timed frame syncs may cause errors in serial transfers. The timing
of burst and continuous modes is discussed in detail in sections 9.2.4, 9.2.5,
and 9.2.6.
MCM Bit
The serial port clock source is set by MCM (bit 4). If MCM = 0, CLKX is config-
ured as an input and thus accepts an external clock. If MCM = 1, then CLKX
is configured as an output, and is driven by an internal clock source. For the
SP, and the BSP operating in standard mode, this on-chip clock is at a frequen-
cy of one-fourth of CLKOUT. The BSP also allows the option of generating
clock frequencies at additional ratios of CLKOUT. For a detailed description
of this feature, refer to section 9.3, Buffered Serial Port (BSP) Interface, on
page 9-33. Note that the CLKR pin is always configured as an input.
TXM Bit
The transmit frame synchronization pulse source is set by TXM (bit 5). Like
MCM, if TXM = 1, FSX is configured as an output and generates a pulse at the
beginning of every transmit. If TXM = 0, FSX is configured as an input, and
accepts an external frame sync signal. Note that the FSR pin is always config-
ured as an input.
The second write takes the serial port out of reset. Note that the transmitter and
receiver may be reset individually if desired. When a 0 is written to XRST or
RRST, activity in the corresponding section of the serial port stops. This
minimizes the switching and allows the device to operate with lower power
consumption. When XRST = RRST = MCM = 0, power requirements are
further reduced since CLKX is no longer driven as an output.
In IDLE2 and IDLE3 mode, SP operation halts as with other parts of the C54x
device. On the BSP, however, if the external serial port clock is being used,
operation continues after an IDLE2/3 is executed. This allows power savings
to still be realized in IDLE2/3, while still maintaining operation of critical serial
port functions if necessary (see section 9.3, Buffered Serial Port (BSP) Inter-
face, on page 9-33 for further information about BSP operation).
It should also be noted that, on the SP, the serial port may be taken out of reset
at any time. Depending on the timing of exiting reset, however, a frame sync
pulse may be missed. On the BSP, for receive and transmit with external frame
sync, a setup of at least one CLKOUT cycle plus 1/2 serial port clock cycle is
required prior to FSX being sampled active in standard mode. In autobuffering
mode, additional setup is required (see section 9.3, Buffered Serial Port (BSP)
Interface, on page 9-33 for further information about BSP initialization timing
requirements).
A transition from 0 to 1 of the XRDY bit indicates that the DXR contents have
been copied to XSR and that DXR is ready to be loaded with a new data word.
A transmit interrupt (XINT) is generated upon this transition. Polling XRDY and
RRDY in software may either substitute for or complement the use of serial
port interrupts (both polling and interrupts may be used together if so desired).
Note that with external FSX, on the SP, XSR is loaded directly as a result of
loading DXR, while on the BSP, XSR is not loaded until an FSX occurs.
XSREMPTY Bit
The XSREMPTY (bit 12) indicates whether the transmitter has experienced
underflow. XSREMPTY is an active low bit; therefore, when XSREMPTY = 0,
an underflow has occurred.
- DXR has not been loaded since the last DXR-to-XSR transfer, and XSR
empties (the actual transition of XSREMPTY occurs after the last bit has
been shifted out of XSR),
When XSREMPTY = 0, the transmitter halts and stops driving DX (the DX pin
is in a high-impedance state) until the next frame sync pulse. Note that under-
flow does not constitute an error condition in the burst mode, although it does
in the continuous mode (error conditions are further discussed in section 9.2.6,
Serial Port Interface Exception Conditions, on page 9-26).
- A write to DXR occurs on the SP, or on the BSP a write to DXR occurs
followed by an FSX pulse (see section 9.2.4, Burst Mode Transmit and
Receive Operations, on page 9-18 for further information about transmit
timing).
RSRFULL Bit
The RSRFULL (bit 13) indicates whether the receiver has experienced over-
run. RSRFULL is an active high bit; therefore, when RSRFULL = 1, RSR is full.
In burst mode (FSM = 1), all three of the following must occur to cause
RSRFULL to become active (RSRFULL = 1):
- The DRR has not been read since the last RSR-to-DRR transfer,
- RSR is full,
- and a frame sync pulse appears on FSR.
In continuous mode (FSM = 0), and on the BSP, only the first two conditions
are necessary to set RSRFULL:
- The DRR has not been read since the last RSR-to-DRR transfer
- and RSR is full.
Therefore, in continuous mode, and on the BSP, RSRFULL occurs after the
last bit has been received.
When RSRFULL = 1, the receiver halts and waits for the DRR to be read, and
any data sent on DR is lost. On the SP, the data in RSR is preserved; on the
BSP, the RSR contents are lost.
Any one of the following three conditions causes RSRFULL to become inactive
(RSRFULL = 0):
- The DRR is read,
- or the serial port is reset (RRST = 0),
- or the C54x device is reset (RS = 0).
1 X Free run.
Note: X = Don’t care
FSX
(TXM = 1)
DX A1 A2 A3 A4 A5 A6 A7 A8 B1
(FO = 1)
MSB LSB
XRDY
(SP)
XINT
(SP)
XSREMPTY
(SP)
XRDY
(BSP)
XINT
(BSP)
XSREMPTY
(BSP)
Note that in both the SP and the BSP, DXR to XSR transfers occur only if the
XSR is empty and the DXR has been loaded since the last DXR to XSR trans-
fer. If DXR is reloaded before the old DXR contents have been transferred to
XSR, the previous DXR contents are overwritten. Accordingly, unless overwrit-
ing DXR is intended, the DXR should only be loaded if XRDY = 1. This is
assured if DXR writes are made only in response to a transmit interrupt or
polling XRDY.
It should be noted that in the following discussions, the timings are slightly
different for internally (TXM = 1, FSX is an output) and externally (TXM = 0,
FSX is an input) generated frame syncs. This distinction is made because in
the former case, the frame sync pulse is generated by the transmitting device
as a direct result of a write to DXR. In the latter case, there is no such direct
effect. Instead, the transmitting device must write to DXR and wait for an exter-
nally generated frame sync.
If internal frame sync pulse generation is selected (TXM = 1), a frame sync
pulse is generated on the second rising edge of CLKX following a write to DXR.
For externally generated frame syncs, the events described here will occur as
soon as a properly timed frame sync pulse occurs (see the data sheet for
detailed serial port interface timings).
On the next rising edge of CLKX after FSX goes high, the first data bit (MSB
first) is driven on the DX pin. Thus, if the frame sync pulse is generated internal-
ly (TXM = 1), there is a 2-CLKX cycle latency (approximately) after DXR is
loaded, before the data is driven on the line. If frame sync is externally gener-
ated, data transmission is delayed indefinitely after a DXR load until the FSX
pulse occurs (this is described in further detail later in this section). With the
falling edge of frame sync, the rest of the bits are shifted out. When all the bits
are transferred, DX enters a high-impedance state.
At the end of each transmission, if DXR was not reloaded when XINT was gen-
erated, XSREMPTY becomes active (low) at this point, indicating underflow.
With externally generated frame sync, if XSREMPTY is active and a frame
sync pulse is generated, any old data in the DXR is transmitted. This is
explained in detail in section 9.2.6, Serial Port Interface Exception Conditions,
on page 9-26.
Note that the first data bit transferred could have variable length if frame sync
is generated externally and does not fall within one CLKX cycle (this is illus-
trated in Figure 9–6). Internally generated frame syncs are assured by C54x
DSP timings to be one CLKX cycle in duration.
CLKX
FSX
Serial port transmit with external frame sync pulses is similar to that with inter-
nal frame sync, with the exception that transfers do not actually begin until the
external frame sync occurs. If the external frame sync occurs many CLKX
cycles after DXR is loaded, however, the double buffer is filled and frozen until
frame sync appears.
On the SP (Figure 9–7), when the delayed frame sync occurs, A is transmitted
on DX; after the transmit, a DXR-to-XSR copy of B occurs, XINT is generated,
and again, the transmitter remains frozen until the next frame sync. When
frame sync finally occurs, B is transmitted on DX. Note that when B is loaded
into DXR, a DXR-to-XSR copy of B does not occur immediately because A has
not been transmitted, and no XINT is generated. Any subsequent writes to
DXR before the next delayed frame sync occurs overwrite B in the DXR.
Figure 9–7. Burst Mode Serial Port Transmit Operation With Delayed Frame Sync
in External Frame Sync Mode (SP)
CLKX
FSX
(TXM = 0)
DX A1 A7 A8 B1 B2
(F0 = 1)
MSB LSB
XRDY
(SP)
XINT
(SP)
XSREMPTY
(SP)
On the BSP (Figure 9–8), since DXR was reloaded with B shortly after being
loaded with A when the delayed frame sync finally occurs, B is transmitted on
DX. After the transmit, the transmitter remains frozen until the next frame sync.
When frame sync finally occurs, B is again transmitted on DX. Note that when
B is loaded into DXR, a DXR-to-XSR copy of B does not occur immediately
since the BSP requires a frame sync to initiate transmitting. Any subsequent
writes to DXR before the next delayed frame sync occurs overwrite B in the
DXR.
Figure 9–8. Burst Mode Serial Port Transmit Operation With Delayed Frame Sync
in External Frame Sync Mode (BSP)
CLKX
FSX
(TXM = 0)
DX B1 B2
(F0 = 1) B1 B7 B8
MSB LSB
XRDY
(BSP)
XINT
(BSP)
XSREMPTY
(BSP)
During a receive operation, shifting into RSR begins on the falling edge of the
CLKR cycle after frame sync has gone low (as shown in Figure 9–9). Then,
as the last data bit is being received, the contents of the RSR are transferred
to the DRR on the falling edge of CLKR, and RRDY goes high, generating a
receive interrupt (RINT).
CLKR
FSR
DR
(FO = 1) A1 A2 A3 A4 A5 A6 A7 A8 B1 B2
MSB LSB
RRDY
RINT
DRR DRR
loaded read
from RSR
If the DRR from a previous receive has not been read, and another word is
received, no more bits can be accepted without causing data corruption since
DRR and RSR are both full. In this case, the RSRFULL bit is set indicating this
condition. On the SP, this occurs with the next FSR; on the BSP, RSRFULL is
set on the falling edge of CLKR during the last bit received. RSRFULL timing
on both the SP and BSP is shown in Figure 9–10.
CLKR
FSR
DR A1 A8 B1 B8 C1 C2 C3 C4 C5
MSB LSB MSB LSB MSB
RRDY
RINT
RSRFULL(SP)
RSRFULL(BSP)
Overrun is handled differently on the SP and on the BSP. On the SP, the
contents of RSR are preserved on overrun, but since RSRFULL is not set to
1 until the next FSR occurs after the overflowing reception, incoming data
usually begins being lost as soon as RSRFULL is set. Data loss can only be
avoided if RSRFULL is polled in software and the DRR is read immediately
after RSRFULL is set to 1. This is normally possible only if the CLKR frequency
is slow with respect to CLKOUT, since RSRFULL is set on the falling edge of
CLKR during FSR, and data begins being received on the following rising edge
of CLKR. The time available for polling RSRFULL and reading the DRR to
avoid data loss is, therefore, only half of one CLKR cycle.
On the BSP, RSRFULL is set on the last valid bit received, but the contents of
RSR are never transferred to DRR, therefore, the complete transferred word
in RSR is lost. If the DRR is read (clearing RSRFULL) before the next FSR
occurs, subsequent transfers can be received properly.
Overrun and various other serial port exception conditions such as the occur-
rence of frame sync during a receive are discussed in further detail in section
9.2.6, Serial Port Interface Exception Conditions, on page 9-26.
If the serial port receiver is provided with FSR pulses significantly longer than
one CLKR cycle, timing of data reception is effected in a similar fashion as with
long FSX pulses. With long FSR pulses, however, the reception of all bits,
including the first one, is simply delayed until FSR goes low. Serial port receive
operation with a long FSR pulse is illustrated in Figure 9–11.
CLKR
FSR
Note that if the packet transmit frequency is increased, the inactivity period
between the data packets for adjacent transfers decreases to zero. This corre-
sponds to a minimum period between frame sync pulses (equivalent to 8 or
16 CLKX/R cycles, depending on FO) that corresponds to a maximum packet
frequency at which the serial port may operate. At maximum packet frequency,
transmit timing is a compressed version of Figure 9–5, as shown in
Figure 9–12.
Figure 9–12. Burst Mode Serial Port Transmit at Maximum Packet Frequency
CLKX
FSX
(TXM = 1)
DX
(FO = 1) A7 A8 B1 B2 B3 B4 B5 B6 B7 B8 C1 C2 C3 C4
MSB LSB
XRDY
(SP)
XINT
(SP)
XRDY
(BSP)
XINT
(BSP)
Figure 9–13. Burst Mode Serial Port Receive at Maximum Packet Frequency
CLKR
FSR
DR A8 B4
B1 B2 B3 B5 B6 B7 B8 C1 C2 C3 C4 C5
(FO = 1)
MSB LSB
RRDY
RINT
As shown in Figure 9–12 and Figure 9–13, with the transfer of multiple data
packets at maximum packet frequency in burst mode, packets are transmitted
at a constant rate, and the serial port clock provides sufficient timing informa-
tion for the transfer, which permits a continuous stream of data. Therefore, the
frame sync pulses are essentially redundant. Theoretically, then, only an initial
frame sync signal is required to initiate the multipacket transfer. The C54x DSP
does support operation of the serial port in this fashion, referred to as
continuous mode, which is selected by clearing the FSM bit in the SPC to 0.
Continuous mode serial port operation is described in detail in section 9.2.5,
Continuous Mode Transmit and Receive Operations.
The distinction between internal and external frame syncs for continuous
mode is similar to that of burst mode, as discussed in section 9.2.4, Burst Mode
Transmit and Receive Operations, on page 9-18. If frame sync is externally
generated (TXM = 0), then when DXR is loaded, the appearance of the frame
sync pulse initiates continuous mode transmission. Continuous mode trans-
mission may be discontinued (and burst mode resumed) only by reconfiguring
and resetting the serial port (see section 9.2.2, Serial Port Interface Operation,
on page 9-6). Simply changing the FSM bit during transmit or halt will not
properly switch to burst mode.
CLKX
FSX
(TXM = 1)
DX
(FO = 1) A1 A2 A3 A4 A5 A6 A7 A8 B1 B2 B3 B4
MSB LSB
XRDY
(SP)
XINT
(SP)
XRDY
(BSP)
XINT
(BSP)
Continuous mode reception is similar to the transmit operation. After the initial
frame sync pulse on FSR, no further frame syncs are required. This mode will
continue as long as DRR is read every transmission. If DRR is not read by the
end of the next transfer, the receiver will halt, and RSRFULL is set, indicating
overrun. See section 9.2.6, Serial Port Interface Exception Conditions.
Overrun in continuous mode effects the SP and the BSP differently. On the SP,
once overrun has occurred, reading DRR will restart continuous mode at the
next word/byte boundary after DRR is read; no new FSR pulse is required. On
the BSP, continuous mode reception does not resume until DRR is read and
an FSR occurs.
CLKR
FSR
DR B5
(FO = 1) A1 A2 A3 A4 A5 A6 A7 A8 B1 B2 B3 B4
MSB LSB
RRDY
RINT
DRR DRR
loaded read
from RSR
Figure 9–15 shows only one frame sync pulse; otherwise, it is similar to
Figure 9–13. If a pulse occurs on FSR during a transfer (an error), then the
receive operation is aborted, one packet is lost, and a new receive cycle is
begun. This is discussed in more detail in section 9.2.2, Serial Port Interface
Operation, on page 9-6 and in section 9.2.6, Serial Port Interface Exception
Conditions.
Burst Mode
In burst mode, one type of error condition (presented in section 9.2.2, Serial
Port Interface Operation) is receive overrun, indicated by the RSRFULL flag.
This flag is set when the device has not read incoming data and more data is
being sent. If this condition occurs, the processor halts serial port receives until
DRR is read. Thus, any further data sent may be lost.
Overrun is handled differently on the SP and on the BSP. On the SP, the
contents of RSR are preserved on overrun, but since RSRFULL is not set to
1 until the next FSR occurs after the overflowing reception, incoming data
usually begins being lost as soon as RSRFULL is set. Data loss can only be
avoided if RSRFULL is polled in software and the DRR is read immediately
after RSRFULL is set to 1. This is normally possible only if the CLKR frequency
is slow with respect to CLKOUT, since RSRFULL is set on the falling edge of
CLKR during FSR, and data begins being received on the following rising edge
of CLKR. The time available for polling RSRFULL and reading the DRR to
avoid data loss is, therefore, only half of one CLKR cycle.
On the BSP, RSRFULL is set on the last valid bit received, but the contents of
RSR are never transferred to DRR, therefore, the complete transferred word
in RSR is lost. If the DRR is read (clearing RSRFULL) before the next FSR
occurs, subsequent transfers can be received properly.
Another type of receive error is caused if frame sync occurs during a receive
(that is, data is being shifted into RSR from DR). If this happens, the present
receive is aborted and a new one begins. Thus, the data that was being loaded
into RSR is lost, but the data in DRR is not (no RSR-to-DRR copy occurs).
Burst mode serial port receiver behavior under normal and error conditions for
the SP is shown in Figure 9–16 and for the BSP is shown in Figure 9–17.
Receive in No Is No Is RSR No
RSRFULL Start new
progress ? full ? data receive
set ?
Ignore
FSR pulse
Yes Yes
Abort receive. Start Ignore
next reception. FSR pulse
(No RSR to DRR,
thus, 1 word lost)
Transmitter exception conditions in burst mode may occur for several possible
reasons. Underflow, which is described in section 9.2.3, Configuring the Serial
Port Interface, on page 9-8 is an exception condition that may occur in burst
mode, however, underflow is not normally considered an error. An exception
condition that causes errors in transmitted data occurs when frame sync
pulses occur at inappropriate times during a transfer. If a transmit is in progress
(that is, XSR data is being driven on DX) when a frame sync pulse occurs, the
transmission is aborted, and the data in XSR is lost. Then, whatever data is
in DXR at the time of the frame sync pulse is transferred to XSR (DXR-to-XSR
copy) and is transmitted. Note, however, that in this case an XINT is generated
only if the DXR has been written to since the last transmit. Also, if XSREMPTY
is active and a frame sync pulse occurs, the old data in DXR is shifted out.
Figure 9–18 summarizes serial port transmit behavior under error and non-
error conditions. Note that if an FSX occurs when no transmit is in progress,
and DXR has been reloaded since the last transmit, the DXR-to-XSR copy and
generation of transmit interrupt occur at this point only on the BSP. On the SP,
these two events occur at the time the DXR was reloaded.
Yes
DXR-to-XSR copy.
Transmit interrupt.
Start transmit (1 word is lost).
Continuous Mode
The SP and the BSP are affected differently when overrun occurs in continu-
ous mode. In the SP, when DRR is read to deactivate RSRFULL, a frame sync
pulse is not required in order to resume continuous mode operation. The
receiver keeps track of the transfer word boundary, even though it is not
receiving data. Therefore, when the RSRFULL flag is deactivated by a read
from DRR, the receiver begins reading from the correct bit. On the BSP, since
an FSR pulse is required to restart continuous reception, this also
reestablishes the proper bit alignment, in addition to restarting reception.
Figure 9–19 shows receiver functional operation in continuous mode.
Ignore
Receive in No pulse, since
progress ? RSRFULL is
active
Yes
Abort current receive.
Start next reception. (No
RSR-to-DRR copy; thus,
current word is lost)
During a receive in continuous mode, if a frame sync pulse occurs, this causes
a receive abort condition, and one packet of data is lost (this is caused because
the frame sync pulse resets the RSR bit counter). The data present on DR then
begins being shifted into RSR, starting again from the first bit. Note that if a
frame sync occurs after deactivating the RSRFULL flag by reading DRR, but
before the beginning of the next word boundary, this also creates a receive
abort condition.
Another cause for error is the appearance of extraneous frame syncs during
a transmission. After the initial frame sync in continuous mode, no others are
required; if an improperly timed frame sync pulse occurs during a transmit, the
current transfer (that is, serially driving XSR data onto DX) is aborted, and data
in XSR is lost. A new transmit cycle is initiated, and transfers continue as long
as the DXR is updated once per transmission afterward. Figure 9–20 shows
continuous mode transmitter functional operation.
XSREMPTY is low,
Transmit in No DXR-to-XSR copy
progress ? occurs. No transmit
interrupt. Start
transmit.
Yes
Abort transmit
Yes
DXR-to-XSR copy.
Transmit interrupt.
Start new transmit. (Current
word is lost)
2) Clear any pending serial port inter- Eliminate any interrupts that may have occurred before initializa-
rupts by writing 00C0h to IFR. tion.
3) Enable the serial port interrupts by Enable both transmit and receive interrupts. A common alterna-
ORing 00C0h with IMR. tive when transmit and receive are synchronized to one another
is to enable only one or the other, by ORing 0080h or 0040h with
IMR, and performing both I/O operations with the same interrupt
service routine (ISR).
4) Enable interrupts globally (if neces- Interrupts must be globally enabled for the CPU to respond.
sary) by clearing the INTM bit in ST1.
5) Start the serial port by writing 00F8h This takes both the transmit and receive portions of the serial port
(or 00C8h) to SPC. out of reset and starts operations with the conditions defined in
step 1.
6) Write the first data value to DXR. (If This initiates serial port transmit operations if FSX and CLKX are
the serial port is connected to the se- internally generated or prepares the serial port transmit for opera-
rial port of another processor and tion when the first FSX arrives.
this processor will be generating
FSX, a handshake must be per-
formed prior to writing the first data
value to DXR.)
2) Read the DRR or write the DXR or Read the received data for the receive ISR. Write the new transmit
both. The data read form DRR data for the transmit ISR. Or, do both if the ISR is combined for
should be written to a predetermined transmit and receive.
location in memory. The data written
to DXR should be read from a prede-
termined location in memory.
3) Restore the context that was saved The operating context of the interrupted code must be maintained.
in step 1.
4) Return from the ISR with an RETE to Interrupts must be reenabled for the CPU to respond to the next
reenable interrupts. interrupt.
The full duplex BSP serial interface provides direct communication with serial
devices such as codecs, serial A/D converters, and other serial devices with
a minimum of external hardware. The double-buffered BSP allows transfer of
a continuous communication stream in 8-,10-,12- or 16-bit data packets.
Frame synchronization pulses as well as a programmable frequency serial
clock can be provided by the BSP for transmission and reception. The polarity
of frame sync and clock signals are also programmable. The maximum operat-
ing frequency is CLKOUT (40 Mbit/s at 25 ns, 50 Mbit/s at 30 ns). The BSP
transmit section includes a pulse code modulation (PCM) mode that allows
easy interface with a PCM line. Operation of the BSP in standard (nonbuffered)
mode is detailed in section 9.3.1 on page 9-35.
The ABU has its own set of circular addressing registers, each with corre-
sponding address generation units. Memory for transmit and receive buffers
resides within a special 2K word block of C54x DSP internal memory. This
memory can also be used by the CPU as general purpose storage, however,
this is the only memory block in which autobuffering can occur.
Using autobuffering, word transfers occur directly between the serial port
section and the C54x DSP internal memory automatically using the ABU
embedded address generators. The length and starting addresses of the
buffers within the 2K block are programmable, and a buffer empty/full interrupt
can be generated to the CPU. Buffering can easily be halted using the auto-
disabling capability. ABU operation is detailed in section 9.3.2 on page 9-40.
The BSP autobuffering capability can be separately enabled for the transmit
and receive sections. When autobuffering is disabled (standard mode), data
transfers with the serial port section occur under software control in the same
fashion as with the standard C54x DSP serial port. In this mode, the ABU is
transparent, and the WXINT and WRINT interrupts generated each time a
word is transmitted or received are sent to the CPU as transmit interrupt
(BXINT) and receive interrupt (BRINT). When autobuffering is enabled, the
BXINT and BRINT interrupts are only generated to the CPU each time half of
the buffer is transferred.
ADDRESS
DATA BUS
11 Read Write
BUS
C54x CPU
interface
BCLKR
BDRR BSPC
BFSR
BSP operation in standard mode is discussed in section 9.2, Serial Port Inter-
face, on page 9-4. This section summarizes the differences between serial
port operation and standard mode BSP operation and describes the enhanced
features that the BSP offers. The enhanced BSP features are available both
in standard mode and in autobuffering mode. ABU is discussed in section 9.3.2
on page 9-40. Information presented in this section assumes familiarity with
standard mode operation as described in section 9.2, Serial Port Interface.
The BSP uses its own dedicated memory-mapped data transmit, data receive
and serial port control registers (BDXR, BDRR, and BSPC). The BSP also
utilizes an additional control register, the BSP control extension register
(BSPCE), in implementing its enhanced features and controlling the ABU. The
BDRR, BDXR, and BSPC registers function similarly to their counterparts in
the serial port as described in section 9.2, Serial Port Interface. As with the
serial port, the BSP transmit and receive shift registers (BXSR and BRSR) are
not directly accessible in software but facilitate the double-buffering capability.
If the serial port is not being used, the BDXR and the BDRR registers can be
used as general purpose registers. In this case, BFSR should be set to an
inactive state to prevent a possible receive operation from being initiated.
Note, however, that program access to BDXR or BDRR is limited when auto-
buffering is enabled for transmit or receive, respectively. BDRR can only be
read, and BDXR can only be written when the ABU is disabled. BDRR can only
be written when the BSP is in reset. BDXR can be read any time.
The buffered serial port registers are summarized in Table 9–7. The ABU
utilizes several additional registers which are discussed in section 9.3.2, Auto-
buffering Unit (ABU) Operation, on page 9-40.
9.3.1.1 Differences Between Serial Port and BSP Operation in Standard Mode
The differences between serial port and BSP operation in standard mode are
discussed in detail in the standard mode serial port operation (section 9.2 on
page 9-4). These differences relate primarily to boundary conditions, how-
ever, in some systems, these differences may be significant. The differences
are summarized in Table 9–8.
Table 9–8. Differences Between Serial Port and BSP Operation in Standard
Mode
Condition Serial Port BSP
RSRFULL is set. RSRFULL is set when RSR is full RSRFULL is set as soon as BRSR
and then an FSR occurs, except in is full.
continuous mode where RSRFULL
is set as soon as RSR is full.
Preservation of data in RSR on RSR contents are preserved on BRSR contents are not preserved
overrun. overrun. on overrun.
Continuous mode receive restart Receive restarts as soon as DRR Receive does not restart until
after overrun. is read (see section 9.2.6, Serial BDRR is read and then a BFSR
Port Interface Exception Condi- occurs.
tions, on page 9-26).
XSR load, XSREMPTY clear, Occur when DXR is loaded. Occur when when a BFSX occurs
XRDY/XINT generation. after BDXR is loaded.
Program accessibility to DXR and DRR and DXR can be read or writ- BDRR can only be read and BDXR
DRR. ten under program control at any can only be written when the ABU
time. Note that caution should be is disabled. BDRR can only be
exercised when reads and writes of written when the BSP is in reset.
the DRR may be close in time to BDXR can be read any time. The
serial port receptions. In this case, same precautions with regard to
a DRR read may not yield the reads and writes to these registers
result that was previously written apply as in serial port.
by the program. Also note that
rewrites of DXR may cause loss
(and therefore non-transmission) of
previously written data depending
on the relative timing of the writes
and FSX (see section 9.2.4, Burst
Mode Transmit and Receive
Operations, on page 9-18).
Table 9–8. Differences Between Serial Port and BSP Operation in Standard
Mode (Continued)
Condition Serial Port BSP
Initialization timing requirements. On the serial port, the serial port On the BSP, exiting serial port
may be taken out of reset at any reset under certain conditions must
time with respect to FSX/FSR, precede FSX timing by one
however, if XRST/RRST go high CLKOUT cycle in standard mode
during or after the frame sync, the and by six CLKOUT cycles in
frame sync may be ignored. autobuffering mode (see section
9.3.3, System Considerations of
BSP Operation, on page 9-49).
The enhanced features that the BSP offers include the capability to generate
programmable rate serial port clocks, select positive or negative polarities for
clock and frame sync signals, and to perform transfers of 10- and 12-bit words,
in addition to the 8- and 16-bit transfers offered by the serial port. Additionally,
the BSP implements the capability to specify that frame sync signals be
ignored until instructed otherwise, and provides a dedicated operating mode
which facilitates its use with PCM interfaces.
The BSPCE contains the control and status bits that are used in the imple-
mentation of these enhanced BSP features and the ABU. The 10 LSBs of
BSPCE are dedicated to the enhanced features control, whereas the 6 MSBs
are used for ABU control, which is discussed in section 9.3.2, Autobuffering
Unit (ABU) Operation, on page 9-40. Figure 9–22 shows the BSPCE bit posi-
tions and Table 9–9 summarizes the function of the BSPCE bits. The value of
the BSPCE upon reset is 3. This results in standard mode operation compat-
ible with the serial port.
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
15–10 9 8 7 6 5 4–0
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ABU control PCM FIG FE CLKP FSP CLKDV
ÁÁÁ
ÁÁÁ
ÁÁÁ
Note: ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁ
R = Read, W = Write
R/W R/W R/W R/W R/W R/W
15–10 ABU — Reserved for autobuffering unit control (see section 9.3.2, Autobuffering Unit
control (ABU) Operation, on page 9-40).
9 PCM 0 Pulse Code Modulation Mode. This control bit puts the serial port in pulse code
modulation (PCM) mode. The PCM mode only affects the transmitter. BDXR-to-
BXSR transfer is not affected by the PCM bit value.
8 FIG 0 Frame Ignore. This control bit operates only in transmit continuous mode with
external frame and in receive continuous mode.
FIG = 0 Frame sync pulses following the first frame pulse restart the
transfer.
FIG = 1 Frame sync pulses following the first frame pulse that initiates a
transfer operation are ignored.
7 FE 0 Format Extension. The FE bit in conjunction with FO in SPC (section 9.2.3, Setting
the Serial Port Configuration, on page 9-8) specifies the word length. When
FO FE = 00, the format is 16-bit words; when FO FE = 01, the format is 10-bit
words; when FO FE = 10, the format is 8-bit words; and when FO FE = 11, the for-
mat is 12-bit words. Note that for 8-, 10-, and 12-bit words, the received words are
right justified and the sign bit is extended to form a 16-bit word. Words to transmit
must be right justified. See Table 9–10 for the word length configurations.
6 CLKP 0 Clock Polarity. This control bit specifies when the data is sampled by the receiver
and transmitter.
CLKP = 0 Data is sampled by the receiver on BCLKR falling edge and sent
by the transmitter on BCLKX rising edge.
CLKP = 1 Data is sampled by the receiver on BCLKR rising edge and sent
by the transmitter on BCLKX falling edge.
5 FSP 0 Frame Sync Polarity. This control bit specifies whether frame sync pulses (BFSX
and BFSR) are active high or low.
FSP = 0 Frame sync pulses (BFSX and BFSR) are active high.
FSP = 1 Frame sync pulses (BFSX and BFSR) are active low.
Figure 9–23. Transmit Continuous Mode with External Frame and FIG = 1
(Format Is 16 Bits)
CLKX/
CLKR
Frame ignored
FSX/FSR
DX/DR MSB
RRDY
XRDY
DXR
reloaded
Figure 9–24 shows the block diagram of the ABU. The BSPCE contains bits
which control ABU operation and will be discussed in detail later in this section.
AXR, BKX, ARR, and BKR, along with their associated circular addressing
logic, allow address generation for accessing words to be transferred between
the C54x DSP internal memory and the BSP data transmit register (BDXR)
and BSP data receive register (BDRR) in autobuffering mode. The address
and block size registers as well as circular addressing are also discussed in
detail later in this section.
Note that the 11-bit memory mapped AXR, BKX, ARR, and BKR registers are
read as 16-bit words, with the five most significant bits read as zeroes and the
11-bit register contents right justified in the least significant 11 bits. If autobuf-
fering is not used, these registers can be used for general purpose storage of
11-bit data.
The transmit and receive sections of the ABU can be enabled separately.
When either section is enabled, access to its corresponding serial port data
register (BDXR or BDRR) through software is limited. The BDRR can only be
read, and the BDXR can only be written when the ABU is disabled. The BDRR
can only be written when the BSP is in reset. The BDXR can be read any time.
When either transmit or receive autobuffering is disabled, that section oper-
ates in standard mode, and its portion of the ABU is transparent.
The ABU also implements CPU interrupts when transmit and receive buffers
have been halfway or entirely filled or emptied. These interrupts take the place
of the transmit and receive interrupts in standard mode operation (the receive
interrupt is the CPU). They are not generated in autobuffering mode. This
mechanism features an autodisabling capability that can be used to automati-
cally terminate autobuffering when either the half-of-buffer or bottom-of-buffer
boundary is crossed. These features are described in detail later in this
section.
BUS
11 Read Write
BCLKR
BDRR BSPC
BFSR
The internal C54x DSP memory used for autobuffering consists of a 2K-word
block of dual-access memory that can be configured as data, program, or both
(as with other dual-access memory blocks). This memory can also be used by
the CPU as general purpose storage, however, this is the only memory block
in which autobuffering can occur. Since the BSP is implemented on several
different C54x devices, the actual base address of the ABU memory may not
be the same in all cases. The memory map for the particular device being used
should be consulted for the actual base address of its ABU memory.
When the ABU is enabled, this 2K-word block of memory can still be accessed
by the CPU within data and/or program spaces. Conflicts may therefore occur
between the CPU and the ABU if the 2K-word block is accessed at the same
time by both. If a conflict does occur, priority is given to the ABU, resulting in
the CPU access being delayed by one cycle. Accordingly, the worst case situa-
tion is that a CPU access could be delayed one cycle each time the ABU
accesses the memory block, that is, for every new word transmitted or
received. Note that when on-chip program memory is secured using the ROM
protection feature, the 2K-word block of ABU memory cannot be mapped to
program memory. For further information regarding the ROM protection
feature, see section 3.5, Program and Data Security, on page 3-30.
When the ABU is enabled for both transmit and receive, if transmit and receive
requests from the serial port interface occur at same time, the transmit request
takes priority over the receive request. In this case, the transmit memory
access occurs first, delaying the receive memory access by generating a wait
state. When the transmit memory access is completed, the receive memory
access takes place.
The most-significant six bits in the BSPCE constitute the ABU control register
(ABUC). Some of these bits are read only, while others are read/write.
Figure 9–25 shows the ABUC bit positions and Table 9–12 summarizes the
function of each ABUC bit in the BSPCE. The value of the BSPCE upon reset
is 3.
Figure 9–25. BSP Control Extension Register (BSPCE) Diagram — ABU Control Bits
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁÁ ÁÁÁ
ÁÁÁ ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
15 14 13 12 11 10 9–0
ÁÁÁ
ÁÁÁ
ÁÁÁ
HALTR
ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RH BRE HALTX XH BXE Serial Port control
ÁÁÁ
ÁÁÁ
ÁÁÁ
R/W
Note: ÁÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
R R/W
R = Read, W = Write
R/W R R/W
HALTR = 1 Autobuffering is halted when the current half of the buffer has
been received. When this occurs, the BRE bit is cleared to 0
and the serial port continues to operate in standard mode.
14 RH 0 Receive Buffer Half Received. This read-only bit indicates which half of the
receive buffer has been filled. Reading RH when the RINT interrupt occurs
(seen either as a program interrupt or by polling IFR) is a convenient way to
identify which boundary has just been crossed.
RH = 0 The first half of the buffer has been filled and that receptions
are currently placing data in the second half of the buffer.
RH = 1 The second half of the buffer has been filled and that recep-
tions are currently placing data in the first half of the buffer.
13 BRE 0 Autobuffering Receive Enable. This control bit enables autobuffering receive.
12 HALTX 0 Autobuffering Transmit Halt. This control bit determines whether autobuffering
transmit is halted when the current half of the buffer has been transmitted.
HALTX = 1 Autobuffering is halted when the current half of the buffer has
been transmitted. When this occurs, the BXE bit is cleared to
0 and the serial port continues to operate in standard mode.
XH = 0 The first half of the buffer has been transmitted and transmis-
sions are currently taking data from the second half of the
buffer.
XH = 1 The second half of the buffer has been transmitted and trans-
missions are currently taking data from the first half of the
buffer.
10 BXE 0 Autobuffering Transmit Enable. This control bit enables the autobuffering
transmit.
9–0 Serial Port — Serial Port Interface Control bits (see section 9.3.1.2, Enhanced BSP Features,
control on page 9-37).
The autobuffering process occurs between the ABU and the 2K-word block of
ABU memory. Each time a serial port transfer occurs, the data involved is auto-
matically transferred to or from a buffer in the 2K-word block of memory under
control of the ABU. During serial port transfers in autobuffering mode, inter-
rupts are not generated with each word transferred as they are in standard
mode operation. This prevents the overhead of having the CPU directly
involved in each serial port transfer. Interrupts are generated to the CPU only
each time one of the half-buffer boundaries is crossed.
Within the 2K-word block of ABU memory, the starting address and size of the
buffers allocated is programmable using the 11-bit address registers (AXR and
ARR) and the 11-bit block size registers (BKX and BKR). The transmit and
receive buffers can reside in independent areas, overlapping areas or the
same area, which allows transmitting from a buffer while receiving into the
same buffer if desired.
Once initialized, BKX/R can be considered to consist of two parts; the most
significant or higher part (BKH), which corresponds to the all of the most signifi-
cant 0 bits of BKX/R, and the lower part (BKL), which is the remaining bits, of
which the most significant bit is a 1 and whose bit position is designated bit
position N. The N bit position also defines the two parts (ARH and ARL) of the
address register. The top of buffer address (TBA) is defined by the concatena-
tion of ARH with N+1 least significant 0 bits. The bottom of buffer address
(BBA) is defined by the concatenation of ARH and BKL–1, and the current
address within the buffer is specified by the complete contents of ARX/R. A
circular buffer of size BKX/R must therefore start on an N-bit boundary (the N
least significant bits of the address register are 0) where N is smallest integer
that satisfies 2N > BKX/R, or at the lowest address within the 2K memory
block. The buffer consists of two halves: the address range for the first half is
TBA (BKL/2) – 1 and for the second half BKL/2 (BKL – 1). Figure 9–26
illustrates all of the relationships between the defined buffer and the BKX/R
and ARX/R registers, the bottom of circular buffer address (BBA), and the top
of circular buffer address (TBA).
10 N 0
FIRST HALF
ARH ARL Current location in buffer
0––––0 1–––––
SECOND HALF
BKH BKL
Block size register (BKX/R)
BBA
The minimum block size for an ABU buffer is two; the maximum block size is
2047, and any buffer of 2047 to 1024 words must start at a relative address
of 0x0000 with respect to the base address of the 2K block of ABU memory.
If either of the address registers (AXR or ARR) is loaded with a value specifying
a location that is outside the range of the currently allocated buffer size as
defined by BKX/R, improper operation may result. Subsequent memory
accesses will be performed starting at the location specified, despite the fact
that they will be to locations which are outside the range of the desired buffer,
and the ARX/R will be incremented with each access until its contents reach
the next permitted buffer start address. Any further accesses are then per-
formed using the correct circular buffering algorithm with the new ARX/R
contents as the updated buffer start address. It should be noted that any
accesses performed with improperly loaded ARX/Rs may therefore unexpect-
edly corrupt some memory locations.
The following example illustrates some of these functional aspects of the auto-
buffering process. Consider a transmit buffer of size 5 (BKX = 5) and a receive
buffer of size 8 (BKR = 8) as shown in Figure 9–27. The transmit buffer may
start at any relative address that is a multiple of 8 (address 0x0000, 0x0008,
0x0010, 0x0018, ..., 0x07F8), and the receive buffer may start at any relative
address that is a multiple of 16 (0x0000, 0x0010, 0x0020, ..., 0x07F0). In this
example, the transmit buffer starts at relative address 0x0008 and the receive
buffer starts at relative address 0x0010. AXR may therefore contain any value
in the range 0x0008–0x000C and ARR may contain any value in the range
0x0010–0x0017. If AXR in this example had been loaded with the value
0x000D (not acceptable in a modulo 5 buffer), memory accesses would be
performed and AXR incremented until it reaches address 0x0010 which is an
acceptable starting address for a modulo 5 buffer. Note, however, that if this
had occurred, AXR would then specify a transmit buffer starting at the same
base address as the receive buffer, which may cause improper buffer opera-
tion.
0000h
0008h
Transmit
000Ah
AXR
BKX = 5
000Ch
0010h
Receive
ARR
0014h
BKR = 8
0017h
The autobuffering process is activated upon request from serial port interface
when XRDY or RRDY goes high, indicating that a word has been received. The
required memory access is then performed, following which an interrupt is
generated if half of the defined buffer (first or second) has been processed.
The RH and XH flags in BSPCE indicate which half has been processed when
the interrupt occurs.
When autodisabling is selected (HALTX or HALTR bit is set), then when the
next half (first or second) buffer boundary is encountered, the autobuffering
enable bit in the BSPCE (BXE or BRE) is cleared so that autobuffering is
disabled and does not generate any further requests. When transmit autobuf-
fering is halted, transmission of the current XSR contents and the last value
loaded in DXR are completed, since these transfers have already been initi-
ated. Therefore, when using the HALTX function, some delay will normally
occur between crossing a buffer boundary and transmission actually stopping.
If it is necessary to identify when transmission has actually ended, software
should poll for the condition of XRDY = 1 and XSREMPTY = 0, which occurs
after last bit has been transmitted.
In the receiver, when using HALTR, since autobuffering is stopped when the
most recent buffer boundary is crossed, future receptions may be lost, unless
software begins servicing receive interrupts at this point, since BDRR is no
longer being read and transferred to memory automatically by the ABU. For
explanation of how the serial port operates in standard mode when DRR is not
being read, refer to section 9.2.6, Serial Port Interface Exception Conditions,
on page 9-26.
4) Autodisable the ABU if this function has been selected and if the half buffer
or bottom of buffer boundary has been crossed.
The C54x device utilizes a fully static design, and accordingly, in both the serial
port and the BSP, serial port clocks need not be running between transfers or
prior to initialization. Therefore, proper operation can still result if FSX/FSR
occurs simultaneously with CLKX/CLKR starting. Regardless of whether
serial port clocks have been running previously, however, the timing of serial
port initialization, and most importantly, when the port is taken out of reset, can
be critical for proper serial port operation. The most significant consideration
of this is when the port is taken out of reset with respect to when the first frame
sync pulse occurs.
Initialization timing requirements differ on the serial port and the BSP. On the
serial port, the serial port may be taken out of reset at any time with respect
to FSX/FSR, however, if XRST/RRST go high during or after the frame sync,
the frame sync may be ignored. In standard mode operation on the BSP for
receive, and for transmit with external frame sync (TXM = 0), the BSP must be
taken out of reset at least two full CLKOUT cycles plus 1/2 serial port clock
cycle prior to the edge of the clock which detects the active frame sync pulse
(whether the clock has been running previously or not) for proper operation.
See Figure 9–28.
Transmit operations with internal clock and frame sync are not subject to this
requirement since frame sync is internally generated automatically (after
XRST is cleared (set to 1)) when BDXR is loaded.
Note, however, that if external serial port clock is used with internal frame sync,
frame sync generation may be delayed depending on the timing of clearing
XRST with respect to the clock.
BCLKX
BFSX
BDX
XRST
In autobuffering mode, for receive, and transmit with external frame sync
(TXM = 1), the BSP must be taken out of reset at least six CLKOUT cycles plus
1/2 serial port clock cycle prior to the edge of the clock which detects the active
frame sync pulse (whether the clock has been running previously or not) for
proper operation. This is due to the time delay for the ABU logic to be activated.
See Figure 9–29.
Transmit operations with internal clock and frame sync are not subject to this
requirement since frame sync is internally generated automatically after XRST
is cleared.
Note, however, that if external serial port clock is used with internal frame sync,
and if the clock is not running when XRST is cleared, frame sync generation
may be delayed depending on the timing of clearing XRST with respect to the
clock.
BCLKX
BFSX
BDX
XRST
XRDY
In order to start or restart BSP operation in standard mode, the same steps are
performed in software as with initializing the serial port (see section 9.2, Serial
Port Interface, on page 9-4), in addition to which, the BSPCE must be
initialized to configure any of the enhanced features desired. To start or restart
the BSP in autobuffering mode, a similar set of steps must also be performed,
in addition to which, the autobuffering registers must be initialized.
Example 9–3 initializes the serial port for transmit operations only, with burst
mode, external frame sync, and external clock selected. The selected data
format is 16 bits, with frame sync and clock polarities selected to be high true.
Transmit autobuffering is enabled by setting the BXE bit in the ABUC section
of BSPCE, and HALTX has been set to 1, which causes transmission to halt
when half of the defined buffer is transmitted.
Example 9–4 initializes the serial port for receive operations only, with
continuous mode selected. Frame sync and clock polarities are selected to be
low true, data format is 16 bits, and frame ignore is selected so that two
received data bytes are packed into a single received word to minimize
memory requirements. Receive autobuffering is enabled by setting the BRE
bit in the ABUC section of BSPCE.
In Example 9–3 and Example 9–4, the transmit and receive interrupts used
are those that the BSP occupies on the C542, C543, C545, C546, C548, and
C549, the devices that include the BSP. However, on other devices that use
the BSP, different interrupts may be used; and therefore, you should consult
the appropriate device documentation.
2) Clear any pending serial port in- Eliminate any interrupts that may have occurred before initialization.
terrupts by writing 0020h to IFR.
4) Enable interrupts globally (if nec- Interrupts must be globally enabled for the CPU to respond.
essary) by clearing the INTM bit
in ST1.
5) Initialize the ABU transmit by This causes the BSP to stop transmitting at the end of the buffer until
writing 1400h to BSPCE. another FSX is received.
6) Write the buffer start address to Identify the first buffer address to the ABU.
AXR.
7) Write the buffer size to BKX. Identify the buffer size to the ABU.
8) Start the serial port by writing This takes the transmit portion of the serial port out of reset and starts
0048h to BSPC. operations with the conditions defined in steps 1 and 5.
2) Clear any pending serial port in- Eliminate any interrupts that may have occurred before initialization.
terrupts by writing 0010h to IFR.
4) Enable interrupts globally (if nec- Interrupts must be globally enabled for the CPU to respond.
essary) by clearing the INTM bit
in ST1.
5) Initialize the ABU receive by writ- This causes the BSP to receive continuously and not restart if a new
ing 2160h to BSPCE. FSR is received.
6) Write the buffer start address to Identify the first buffer address to the ABU.
ARR.
7) Write the buffer size to BKR. Identify the buffer size to the ABU.
8) Start the serial port by writing This takes the receive portion of the serial port out of reset and starts
0080h to BSPC. operations with the conditions defined in steps 1 and 5.
BMINT is useful for detecting buffer misalignment only when the buffer point-
er(s) are initially loaded with the top of the buffer address and a frame of data
contains the same number of words as the buffer length. These are the only
conditions under which a frame sync occurring at a buffer address other than
the top of the buffer constitute an error condition. In cases where these condi-
tions are met, a frame sync always occurs when the buffer pointer is at the top
of the buffer address (if the interface is functioning properly).
When in IDLE or HOLD mode, the BSP continues to operate, as is the case
with the serial port. When in IDLE2/3, unlike the serial port and other on-chip
peripherals which are stopped with this power-down mode, the BSP can still
be operated.
In standard mode, if the BSP is using external clock and frame sync while the
device is in IDLE2/3, the port will continue to operate, and a transmit interrupt
(BXINT) or receive interrupt (BRINT) will take the device out of IDLE2/3 mode
if INTM = 0 before the device executes the IDLE 2 or IDLE 3 instruction. With
internal clock and/or frame sync, the BSP remains in IDLE2/3 until the CPU
resumes operation.
In autobuffering mode, if the BSP is using external clock and frame sync while
the device is in IDLE2/3, a transmit/receive event will cause the internal BSP
clock to be turned on for the cycles required to perform the DXR (or DRR) to
memory transfer. The internal BSP clock is then turned off automatically as
soon as the transfer is complete so the device will remain in IDLE2/3. The
device is awakened from IDLE2/3 by the ABU transmit interrupt (BXINT) or
receive interrupt (BRINT) when the transmit/receive buffer has been halfway
or entirely emptied or filled if INTM = 0 before the device executes the IDLE 2
or IDLE 3 instruction.
chan chan chan chan chan chan chan chan chan chan chan
1 2 3 4 1 2 3 4 1 2 3 •••
0
time
The C54x TDM port uses eight TDM channels. Which device is to transmit and
which device or devices is/are to receive for each channel may be indepen-
dently specified. This results in a high degree of flexibility in interprocessor
communications.
- TDM data receive register (TRCV). The 16-bit TDM data receive register
(TRCV) holds the incoming TDM serial data. The TRCV has the same
function as the DRR, described on page 9-5.
- TDM data transmit register (TDXR). The 16-bit TDM data transmit register
(TDXR) holds the outgoing TDM serial data. The TDXR has the same
function as the DXR, described on page 9-5.
- TDM serial port control register (TSPC). The 16-bit TDM serial port control
register (TSPC) contains the mode control and status bits of the TDM
serial port interface. The TSPC is identical to the SPC (Figure 9–3) except
that bit 0 serves as the TDM mode enable control bit in the TSPC. The
TDM bit configures the port in TDM mode (TDM = 1) or stand-alone mode
(TDM = 0). In stand-alone mode, the port operates as a standard serial
port as described on page 9-4.
- TDM channel select register (TCSR). The 16-bit TDM channel select
register (TCSR) specifies in which time slot(s) each C54x device is to
transmit.
- TDM receive address register (TRAD). The 16-bit TDM receive address
register (TRAD) contains various information regarding the status of the
TDM address line (TADD).
- TDM data receive shift register (TRSR). The 16-bit TDM data receive shift
register (TRSR) controls the storing of the data, from the input pin, to the
TRCV. The TRSR has the same function as the RSR, described on page
9-5.
- TDM data transmit shift register (TXSR). The 16-bit TDM data transmit
shift register (TXSR) controls the transfer of the outgoing data from the
TDXR and holds the data to be transmitted on the data-transmit (TDX) pin.
The TXSR has the same function as the XSR, described on page 9-5.
Figure 9–31(a) shows the C54x TDM port architecture. Up to eight devices
can be placed on the four-wire serial bus. This four-wire bus consists of a
conventional serial port’s bus of clock, frame, and data (TCLK, TFRM, and
TDAT) wires plus an additional wire (TADD) that carries the device addressing
information. Note that the TDAT and TADD signals are bidirectional signals
and are often driven by different devices on the bus during different time slots
within a given frame of operation.
(a)
TFRM
TADD
TCLK
TDAT
(b)
TDX TDAT
TDR
TFSX TFRM
C54x DSP
TFSR TADD
TCLKX TCLK
TCLKR
The TADD line, which is driven by a particular device for a particular time slot,
determines which device(s) in the TDM configuration should execute a valid
TDM receive during that time slot. This is similar to a valid serial port read
operation, as described in section 9.2, Serial Port Interface, on page 9-4
except that some corresponding TDM registers are named differently. The
TDM receive register is TRCV, and the TDM receive shift register is TRSR.
Data is transmitted on the bidirectional TDAT line.
Note that in Figure 9–31(b) the device TDX and TDR pins are tied together
externally to form the TDAT line. Also, note that only one device can drive the
data and address line (TDAT and TADD) in a particular slot. All other devices’
TDAT and TADD outputs should be in the high-impedance state during that
slot, which is accomplished through proper programming of the TDM port
control registers (this is described in detail later in this section). Meanwhile, in
that particular slot, all the devices (including the one driving that slot) sample
the TDAT and TADD lines to determine if the current transmission represents
valid data to be read by any one of the devices on the bus (this is also
discussed in detail later in this section). When a device recognizes an address
to which it is supposed to respond, a valid TDM read then occurs, the value
is transferred from TRSR to TRCV. A receive interrupt (TRINT) is generated,
which indicates that TRCV has valid receive data and can be read.
All TDM port operations are synchronized by the TCLK and TFRM signals.
Each of them are generated by only one device (typically the same device),
referred to as the TCLK and TFRM source(s). The word master is not used
here because it implies that one device controls the other, which is not the
case, and TCSR must be set to prevent slot contention. Consequently, the
remaining devices in the TDM configuration use these signals as inputs.
Figure 9–31(b) shows that TCLKX and TCLKR are externally tied together to
form the TCLK line. Also, TFRM and TADD originate from the TFSX and TFSR
pins respectively. This is done to make the TDM serial port also easy to use
in standard mode.
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
Figure 9–32. TDM Serial Port Registers Diagram
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
15
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
14
ÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
13
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
TRCV
12 11 10 9 8 7
Receive Data
6 5 4 3 2 1 0
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
TDXR Transmit Data
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ
TSPC
ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁ
Free
ÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁ ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁ
Soft
ÁÁ
ÁÁÁÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁ
X
ÁÁ
X XRDY RRDY IN1 IN0 RRST XRST TXM MCM X 0 0 TDM
ÁÁÁ
ÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁ ÁÁ
ÁÁÁÁÁÁ
ÁÁÁ ÁÁ
ÁÁÁ ÁÁ
ÁÁÁÁÁÁ ÁÁ
ÁÁÁ
TCSR X X X X X X X X CH7 CH6 CH5 CH4 CH3 CH2 CH1 CH0
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
TRTA TA7 TA6 TA5 TA4 TA3 TA2 TA1 TA0 RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁ
TRAD X X X2 X1 X0 S2 S1 S0 A7 A6 A5 A4 A3 A2 A1 A0
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Note: X=Don’t care.
When TDM mode is selected, the DLB and FO bits in the TSPC are
hard-configured to 0, resulting in no access to the digital loopback mode and
in a fixed word length of 16 bits (a different type of loopback is discussed in the
example in section 9.4.6 on page 9-64). Also, the value of FSM does not affect
the port when TDM = 1, and the states of the underflow and overrun flags are
indeterminate (section 9.4.5, TDM Serial Port Interface Exception Conditions,
on page 9-64 explains how exceptions are handled in TDM mode). If TDM = 1,
changes made to the contents of the TSPC become effective upon completion
of channel 7 of the current frame. Thus the TSPC value cannot be changed
for the current frame; any changes made will take effect in the next frame.
The source device for the TCLK and TFRM timing signals is set by the MCM
and TXM bits, respectively. The TCLK source device is identified by setting the
MCM bit of its TSPC to 1. Typically, this device is the same one that supplies
the TDM port clock signal TCLK. The TCLKX pin is configured as an input if
MCM = 0 and an output if MCM = 1. In the latter case (internal C54x clock),
the device whose MCM = 1 supplies the clock (TCLK frequency = one fourth
of CLKOUT frequency) for all devices on the TDM bus. The clock can be
supplied by an external source if MCM = 0 for all devices. TFRM can also be
supplied externally if TXM = 0. An external TFRM, however, must meet TDM
receive timing specifications with respect to TCLK for proper operation. No
more than one device should have MCM or TXM set to 1 at any given time. The
specification of which device is to supply clock and framing signals is typically
made only once, during system initialization.
The TDM channel select register (TCSR) of a given device specifies in which
time slot(s) that device is to transmit. A 1 in any one or more of bits 0–7 of the
TCSR sets the transmitter active during the corresponding time slot. Again, a
key system-level constraint is that no more than one device can transmit
during the same time slot; devices do not check for bus contention, and slots
The transmit address (TA7–TA0, refer to Figure 9–32) is the address that the
device drives on the TADD line during a transmit operation on an assigned slot.
The transmit address establishes which receiving devices may execute a valid
TDM receive on the driven data.
Only one device at a time can drive a transmit address on TADD. Each
processor bit-wise-logically-ANDs the value it samples on the TADD line with
its receive address (RA7–RA0). If this operation results in a nonzero value,
then a valid TDM receive is executed on the processor(s) whose receive
addresses match the transmitted address. Thus, for one device to transmit to
another, there must be at least one bit in the upper half of the transmitting
device’s TRTA (the transmit address) with a value of 1 that matches one bit
with a value of 1 in the lower half of TRTA (the receive address) of the receiving
device. This method of configuration of TRTA allows one device to transmit to
one or more devices, and for any one device to receive from one or more than
one transmitter. This can also allow the transmitting device to control which
devices receive, without the receive address on any of the devices having to
be changed.
Bits 13–11 (X2–X0) contain the current slot number value, regardless of
whether a valid data receive was executed in that slot or not. This value is
latched at the beginning of the slot and retained only until the end of the slot.
Bits 10–8 (S02–S0) hold the number of the last slot plus one (modulo eight)
in which data was received (that is, if the last valid data read occurred in slot 5
in the previous frame, these bits would contain the number six). This value is
latched during the TDM receive interrupt (TRINT) at the end of the slot in which
the last valid data receive occurred, and maintained until the end of the next
slot in which a valid receive occurs.
Bits 7–0 (A7–A0) hold the last address sampled on the TADD line, regardless
of whether a valid data receive was executed or not. This value is latched half-
way through each slot (so the value on the TADD may be shifted in) and main-
tained until halfway through the next slot, whether a valid receive is executed
or not.
TCLK
TDAT bit 17 bit 07 bit 150 bit 140 bit 130 bit 80 bit 70 bit 00 bit 151 bit 141
TFRM
Simultaneous with data transfer, the transmitting device also drives the TADD
line with the transmit address for each slot. This information, unlike that on
TDAT, is only one byte long and is transmitted with the LSB first for the first half
of the slot. During the second half of the slot (that is, the last eight TCLK
periods) the TADD line is driven high. The TDM receive logic samples the
TADD line only for the first eight TCLK periods, ignoring it during the second
half of the slot. Therefore, the transmitting device (if not a C54x DSP) could
drive TADD high or low during that time period. Note that, like TDAT, the first
TADD bit transmitted lasts for only one half of one TCLK cycle.
If no device on the TDM bus is configured to transmit in a slot (that is, none of
the devices has a 1 for the corresponding slot in their TCSR), that slot is
considered empty. In an empty slot, both TADD and TDAT are high impedance.
This condition has the potential for spurious receives, however, because TDAT
and TADD are always sampled, and a device performs a valid TDM reception
if its receive address matches the address on the TADD line. To avoid spurious
reads, a 1-kilohm pull-down resistor must be tied to the TADD line. This causes
the TADD line to read low on empty slots. Otherwise, any noise on the TADD
line that happens to match a particular receive address would result in a
spurious read. If power dissipation is a concern and the resistor is not desired,
then an arbitrary processor with transmit address equal to 0h can drive empty
slots by writing to TDXR in those slots. Slot manipulation is explained later in
this section. The 1-kilohm resistor is not required on the TDAT line.
An empty TDM slot can result in the following cases: the first obvious case, as
mentioned above, occurs when no device has its TCSR configured to transmit
in that slot. A second more subtle case occurs when TDXR has not been
loaded before a transmit slot in a particular frame. This may also happen when
the TCSR contents are changed, since the actual TCSR contents are not
updated until the next TFRM pulse occurs. Therefore, any subsequent change
takes effect only in the next frame. The same is true for the receive address
(the lower half of TRTA). The transmit address (upper half of TRTA), however,
and TDXR, clearly, may be changed within the current frame for a particular
slot, assuming that the slot has not yet been reached when the instruction to
load the TRTA or TDXR is executed. Note that it is not necessary to load the
transmit address each time TDXR is loaded; when a TDXR load occurs and
a transmission begins, the current transmit address in TRTA is transmitted on
TADD.
The current slot number may be obtained by reading the X2–X0 bits in TRAD.
This affords the flexibility of reconfiguring the TDM port on a slot-by-slot basis,
and even slot sharing if desired. The key to utilizing this capability is to
understand the timing relationship between the instructions being executed
and the frame/slots of the TDM port. If the TDM port is to be manipulated on
Note that if the transmit address is being changed on the fly, care should be
exercised not to corrupt the receive address, since both addresses are located
in the TRTA, thus maintaining the convention of allowing the transmitting
device to specify which devices can receive.
In the receiver, if TRCV has not been read and a valid receive operation is
initiated (because of the value on TADD and the device’s receive address), the
present value of TRCV is overwritten; the receiver is not halted. On the other
hand, if TDXR has not been updated before a transmission, the TADD or TDAT
lines are not driven, and these pins remain in the high-impedance state. This
mode of operation prevents spurious transmits from occurring.
If a TFRM pulse occurs at an improper time during a frame, the TDM port is
not able to continue functioning properly, since slot and bit numbers become
ambiguous when this occurs. Therefore, only one TFRM should occur every
128 TCLK cycles. Unlike the serial port, the TDM port cannot be reinitialized
with a frame sync pulse during transmission. To correct an improperly timed
TFRM pulse, the TDM port must be reset.
Table 9–14 shows the TADD value during each of the eight channels given the
transmitter and receiver designations shown. This example shows the config-
uration for eight devices to communicate with each other. In this example,
device 0 broadcasts to all other device addresses during slot 0. In subsequent
time slots, devices 1–7 each communicate to one other processor.
TFRM
TADD
TCLK
TDAT
Transmitter Receiver
Channel TADD Data Device Device(s)
0 FEh 0 1–7
1 40h 7 6
2 20h 6 5
3 10h 5 4
4 08h 4 3
5 04h 3 2
6 02h 2 1
7 01h 1 0
Table 9–15 shows the TDM serial port register contents of each device that
results in the scenario given in Table 9–14. Device 0 provides the clock and
frame control signals for all channels and devices. The TCSR and TRTA
contents specify which device is to transmit on a given channel and which
devices are to receive.
In this example, the transmit address of a given device (the upper byte of
TRTA) matches the receive address (the lower byte of TRTA) of the receiving
device. Note, however, that it is not necessary for the transmit and receive
addresses to match exactly; the matching operation implemented in the
receiver is a bitwise AND operation. Thus, it is only necessary that one bit in
the field matches for a receive to occur. The advantage of this scheme is that
a transmitting device can select the device or devices to receive its transmitted
data by simply changing its transmit address (as long as each devices’ receive
address is unique, the receive address of the receiving device does not need
to be changed). In the example, device 0 can transmit to any combination of
the other devices by merely writing to the upper byte of TRTA. Therefore, if a
transmitting device changed its TRTA to 8001h on the fly, it would transmit only
to device 7.
A device may also transmit to itself, because both the transmit and receive
operations are executed on the rising edge of TCLK (see the C54x DSP data
sheet for TDM interface timings). To enable this type of loopback, it is necessary
to use the standard TDM port interface connections as shown in Figure 9–31.
Then, if device 0 has a TRTA of 0101h, it would transmit only to itself.
As an illustration of the proper operation of a TDM serial port, Example 9–5
through Example 9–8 define a sequence of actions. This illustration is based
on the use of interrupts to handle the normal I/O between the serial port and
CPU. The C542 peripheral configuration has been used as a reference for
these examples.
In Example 9–5 the procedure for a one-way transmit of a sequence of values
from device 0 to device 1 is shown. Device 0 transmits in slot 0 and has a
transmit address of 01h. Example 9–7 shows the procedure for device 1. It
has a receive address of 01h.
Action Description
1) Reset and initialize the TDM seri- This places both the transmit and receive portions of the TDM serial
al port by writing 0039h to TSPC. port in reset and sets up the serial port to operate with internally
generated TFRM and TCLK signals in TDM mode.
2) Clear any pending TDM serial Eliminate any interrupts that may have occurred before initialization.
port transmit interrupts by writing
0080h to IFR.
4) Enable interrupts globally (if nec- Interrupts must be globally enabled for the CPU to respond.
essary) by clearing the INTM bit
in ST1.
5) Write 0001h to TCSR. This selects time slot 0 as the transmission time slot for this device.
6) Write 0100h to TRTA. This sets up this device to transmit data to the device receiving at
address 01h. It also sets up this device to ignore all received data.
7) Start the serial port by writing This takes the transmit portion of the serial port out of reset and starts
0049h to TSPC. operations with the conditions defined in steps 1, 5 and 6.
8) Perform a handshake to verify For a single device pair, this could make use of BIO and XF. For sever-
that the receiving device is ready al devices this might mean that the device generating TFRM and
to receive data. TCLK broadcasts a command to all other devices until each one
returns an acknowledge.
9) Write the first data value to TDXR This initiates serial port transmit operations since TADD and TDAT
(if not already done in step 8). are not driven if new data is not written to TDXR.
Action Description
1) Save any context that may be The operating context of the interrupted code must be maintained.
modified on the stack.
2) Write TDXR with a new value Write the new transmit data for the ISR.
from a predetermined location in
memory.
3) Restore the context that was The operating context of the interrupted code must be maintained.
saved in step 1.
4) Return from the ISR with an Interrupts must be reenabled for the CPU to respond to the next
RETE to reenable interrupts. interrupt.
2) Clear any pending TDM serial Eliminate any interrupts that may have occurred before initialization.
port receive interrupts by writing
0040h to IFR.
4) Enable interrupts globally (if nec- Interrupts must be globally enabled for the CPU to respond.
essary) by clearing the INTM bit
in ST1.
5) Write 0000h to TCSR. This sets up this device to not transmit in any time slot.
6) Write 0001h to TRTA. This sets up this device to not address any device. It also sets up this
device to receive data sent to address 01h.
7) Perform a handshake to notify For a single device pair, this could make use of BIO and XF. For sever-
the transmitting device that it is al devices, this might mean that the device waits for a broadcast com-
okay to send data. mand and then returns an acknowledge.
2) Read TDRR and write the value Read the new received data for the ISR.
to a predetermined location in
memory.
3) Restore the context that was The operating context of the interrupted code must be maintained.
saved in step 1.
4) Return from the ISR with an Interrupts must be reenabled for the CPU to respond to the next
RETE to reenable interrupts. interrupt.
This chapter describes the external bus operation and control for memory and
I/O accesses. Some of the external bus operation and control features of the
TMS320C54x DSP include software wait states, bank-switching logic, and
hold logic. The C54x DSP supports a wide range of system interfacing
requirements.
The C5410 enhanced external parallel interface (XIO) is not described in this
chapter. See the TMS320C5410 datasheet for details about the external
memory interface.
Topic Page
10-1
External Bus Interface
C541
C542, C543, C548, C549
Signal Name C545, C546 C5410 C5402 C5420 Description
The external ready input signal (READY) and the software-generated wait
states allow the processor to interface with memory and I/O devices of varying
speeds. When communicating with slower devices, the CPU waits until the
other device completes its function and sends the READY signal to continue
execution.
In some cases, wait states are needed only when transitions are made
between two external memory devices. The programmable bank-switching
logic provides automatic insertion of a wait state in these situations.
The hold mode allows an external device to take control of the C54x DSP
external buses to access the resources in the C54x DSP external program,
data, and I/O memory spaces. Two hold mode types, normal mode and
concurrent DMA mode are available.
When the CPU addresses internal memory, the data bus is placed in the high-
impedance state. However, the address bus and the memory-select signals
(program select (PS), data select (DS), and I/O select (IS)) maintain the
previous state. The MSTRB, IOSTRB, R/W, IAQ, and MSC signals remain
inactive. If the address visibility mode (AVIS) bit, located in the PMST, is set
to 1, the internal program address is placed on the address bus with an active
IAQ.
When the CPU addresses external data or I/O space, the extended address
lines are driven to logic 0. This is also the case when the CPU addresses inter-
nal memory with the AVIS (address visibility) set to 1.
Figure 10–1 shows multiple CPU accesses to fetch an instruction, and to write
and read data operands over the external interface in one cycle. Data
accesses have a higher priority than program-memory fetches: the program-
memory fetch cannot begin until all CPU data accesses are completed.
CLKOUT
PB Fetch
CB/DB Reads
EB Write
A(22 – 0)
Pipeline conflicts occur when the program and data are in external memory
and a single-operand write instruction is followed by a dual-operand read or
a 32-bit operand read. The following sequence of instructions shows the pipe-
line conflict discussed.
ST T,*AR6 ;Smem write operation
LD *AR4+,A ;Xmem and Ymem read operation
||MAC *AR5+, B
The program and data spaces each consist of two 32K-word blocks; the I/O
space consists of one 64K-word block. Each of these blocks has a correspond-
ing 3-bit field in the SWWSR. These fields are shown in Figure 10–2 and
described in Table 10–2. The SWWSR bit fields of the C548, C549, C5402,
C5410, and C5420 are described in Table 10–3.
The value of a 3-bit field in SWWSR specifies the number of wait states to be
inserted for each access in the corresponding space and address range. The
minimum value, which adds no wait states, is 0 (000b). A value of 7 (111b)
provides the maximum number of wait states.
14–12 I/O 1 I/O space. The field value (0–7) corresponds to the number of wait states for I/O
space 0000–FFFFh.
11–9 Data 1 Data space. The field value (0–7) corresponds to the number of wait states
for data space 8000–FFFFh.
8–6 Data 1 Data space. The field value (0–7) corresponds to the number of wait states
for data space 0000–7FFFh.
5–3 Program 1 Program space. The field value (0–7) corresponds to the number of wait
states for program space 8000–FFFFh.
2–0 Program 1 Program space. The field value (0–7) corresponds to the number of wait
states for program space 0000–7FFFh.
When SWWSM is set to 1, the wait states are multiplied by two extending the
maximum number of wait states from 7 to 14.
The C549, C5402, C5410, and C5420 have an extra bit (software wait-state
multiplier, SWSM) that resides in SWCR (Figure 10–3), which is memory
mapped to address 002Bh in data space.
14–12 I/O 1 I/O space. The field value (0–7) corresponds to the number of wait states for I/O
space 0000–FFFFh.
11–9 Data 1 Data space. The field value (0–7) corresponds to the number of wait states
for data space 8000–FFFFh.
8–6 Data 1 Data space. The field value (0–7) corresponds to the number of wait states
for data space 0000–7FFFh.
5–3 Program 1 Program space. The field value (0–7) corresponds to the number of wait
states for:
- XPA = 0: xx8000 – xxFFFFh
- XPA = 1: 400000h–7FFFFF
2–0 Program 1 Program space. The field value (0–7) corresponds to the number of wait
states for:
- XPA = 0: xx0000–xx7FFFh
- XPA = 1: 000000–3FFFFFh
Figure 10–4 is a block diagram of the wait-state generator logic for external
program space. When an external program access is decoded, the appropri-
ate field of the SWWSR is loaded into the counter. If the field is not 000, a
not-ready signal is sent to the CPU and the wait-state counter is started. The
not-ready condition is maintained until the counter decrements to 0 and the
external READY line is set high. The external READY and the wait-state
READY are ORed together to generate the CPU WAIT signal. The READY line
is machine-sampled at the falling edge of CLKOUT. The processor detects
READY only if a minimum of two software wait states are programmed. The
external READY line is not sampled until the last wait-state cycle.
SWWSR
PSEL G
1-to-2 Y0 5–3
CPU decoder
Y1 2–0
A15 A
External
logic
CYCLE 3-bit
counter
WAIT READY
At reset, all fields in the SWWSR are set to 111b (SWWSR = 7FFFh), the
maximum number of wait states for external accesses. This feature ensures
that the CPU can communicate with slow external memories during processor
initialization.
Table 10–4. Number of CLKOUT1 Cycles Per Access for Various Numbers of Wait States
Number of CLKOUT1 Cycles†
Hardware Wait State Software Wait State
1 NA NA 2 3n
2 3 4n 3 4n
3 4 5n 4 5n
† Where n is the number of consecutive write cycles.
11 PS–DS – Program read–data read access. Inserts an extra cycle between consecutive
accesses of program read and data read, or data read and program read.
PS–DS = 0 No extra cycles are inserted by this feature except when banks
are crossed.
BH = 1 The bus holder is enabled. The data bus, D(15–0), is held in the
previous logic level.
0 EXIO 0 External bus interface off. The EXIO bit controls the external-bus-off function.
Table 10–6 summarizes the relationship between BNKCMP, the address bits
to be compared, and the bank size. BNKCMP values not listed in the table are
not allowed. Table 10–7 lists the state of the ports when the external bus inter-
face is disabled (EXIO = 1).
BNKCMP
Bank Size
Bit 15 Bit 14 Bit 13 Bit 12 MSBs to Compare (16-Bit Words)
0 0 0 0 None 64K
1 0 0 0 15 32K
1 1 0 0 15–14 16K
1 1 1 0 15–13 8K
1 1 1 1 15–12 4K
Table 10–7. State of Signals When External Bus Interface is Disabled (EXIO = 1)
Signal State Signal State
A(22–0) Previous state R/W High level
The EXIO and BH bits control the use of the external address and data buses.
These bits should be set to 0 for normal operation. To reduce power dissipa-
tion, especially if external memory is never or only infrequently accessed,
EXIO and BH can be set to 1.
When the EXIO bit in BSCR is set to 1, the CPU cannot modify the the HM bit
in ST1 and cannot modify the memory map by changing the value of the
DROM, MP/MC, and OVLY bits in PMST.
The C54x DSP has an internal register that contains the MSBs (as defined by
the BNKCMP field) of the last address used for a read or write operation in
program or data space. If the MSBs of the address used for the current read
do not match those contained in this internal register, the MSTRB (memory
strobe) signal is not asserted for one CLKOUT cycle. During this extra cycle,
the address bus switches to the new address. The contents of the internal
register are replaced with the MSBs for the read of the current address. If the
MSBs of the address used for the current read match the bits in the register,
a normal read cycle occurs.
If repeated reads are performed from the same memory bank, no extra cycles
are inserted. When a read is performed from a different memory bank, memory
conflicts are avoided by inserting an extra cycle. An extra cycle is inserted only
if a read memory access is followed by another read memory access. This
feature can be disabled by clearing BNKCMP to 0.
Figure 10–6 illustrates the addition of an inactive cycle when memory banks
are switched.
CLKOUT
Address
R/W
PS or DS
Extra
MSTRB cycle
Figure 10–7 illustrates the insertion of the extra cycle between a consecutive
program read and a data read.
Figure 10–7. Bank Switching Between Program Space and Data Space
CLKOUT
Address
R/W
PS
DS
MSTRB Extra
cycle
- MSTRB is high.
- MSTRB goes high for one cycle during read-to-write transitions to frame
the address and R/W signal changes.
CLKOUT
Address
R/W
PS
DS
MSTRB
- MSTRB goes high at the end of every write cycle to disable the memory
while the address and/or R/W signal changes.
CLKOUT
Address
R/W
DS, PS
IS†
MSTRB
CLKOUT
Address
R/W
PS
DS
MSTRB
- IOSTRB goes high at the end of each access to frame address and R/W
signal changes.
CLKOUT
Address
R/W
IS
IOSTRB
Figure 10–12 shows the same I/O space access with one wait-state access.
Each read and write access is extended by an additional cycle.
Figure 10–12. Parallel I/O Operation for Read-Write-Read (I/O-Space Wait States)
CLKOUT
Address
R/W
IS
IOSTRB
- I/O reads and writes take at least three cycles when they follow a memory
read or write.
- Memory reads take two cycles when they follow an I/O read or write.
CLKOUT
Address
R/W
PS
IS
MSTRB
IOSTRB
CLKOUT
Address
I/O read
Data Read
R/W
PS
IS
MSTRB
IOSTRB
CLKOUT
Address
R/W
PS
IS
MSTRB
IOSTRB
CLKOUT
Address
I/O read
Data Write data
R/W
PS
IS
MSTRB
IOSTRB
Address
R/W
PS
IS
MSTRB
IOSTRB
CLKOUT
Address
R/W
PS
IS
MSTRB
IOSTRB
Address
I/O read
Data Write
R/W
PS
IS
MSTRB
IOSTRB
CLKOUT
Address
I/O read
Data Read
R/W
PS
IS
MSTRB
IOSTRB
Entering or leaving the first two modes, IDLE1 or IDLE2, requires no special
consideration because the clocks to both the CPU and the on-chip peripherals
remain active. However, special considerations are necessary when entering
or leaving the other two modes:
- IDLE3. The device makes a transition from a state where neither the CPU
nor the on-chip peripherals are being clocked to an active state.
10.5.1 Reset
Figure 10–21 shows the reset sequence of the external bus. For proper reset
operation, the RS signal must be active for at least two CLKOUT cycles. How-
ever, power-up and IDLE3 power-down mode require the reset signal to be
active for more than two CLKOUT cycles. See section 6.11, Power-Down
Modes, on page 6-50 for more detailed information.
When the C54x CPU acknowledges a reset, the CPU terminates program
execution and forces the program counter to FF80h. The address bus is driven
with FF80h while RS is low.
The device enters its reset state, in reference to the external bus, according
to three steps:
1) Four cycles after RS is asserted low, PS, MSTRB, and IAQ are driven high.
2) Five cycles after RS is asserted low, R/W is driven high, the data bus (if
driven) goes into the high-impedance state, and the address bus is driven
with 00FF80h.
When reset becomes inactive, program execution starts from the program
memory location FF80h. The instruction acquisition signal (IAQ) and the inter-
rupt acknowledge signal (IACK) become active, as shown in Figure 10–21,
regardless of the state of the MP/MC signal.
The device enters its active state, in reference to the external bus, according
to three steps:
2) Six cycles after RS is asserted high, MSTRB and IACK are driven low.
3) One half-cycle later, the device is ready to read data and the device moves
into its active state.
RS
CLKOUT
Data
R/W
PS
MSTRB
IAQ or
IACK
Bank
switching
Reset state
Notes: 1) RS is an asynchronous input and can be asserted at any point during a clock cycle. If the specified timings are met,
the sequence shown occurs; otherwise, an additional delay of one clock cycle can occur.
2) During reset, the data bus, is placed in high impedance and the control signals are de-asserted.
3) The reset vector is fetched with seven wait states.
4) The bank-switching cycle is inserted in the first access after reset.
10.5.2 IDLE3
The execution of the IDLE 3 instruction initiates the IDLE3 power-down mode.
In this power-down mode, the PLL is halted completely to reduce power
consumption. In the IDLE mode, the input clock can be kept running without
additional power consumption because a transfer gate inside the C54x DSP
isolates the clock from the internal logic. The PLL must be restarted and locked
before the C54x DSP can resume processing when it exits IDLE3. This power-
down mode is terminated by activating the external interrupt pins, INTn, NMI
and RS, in a particular sequence.
Table 10–8 shows the wake-up time of IDLE3 with the INTn and NMI signals.
These times are defined for the hardware-configurable PLL. The times for the
software programmable PLL are given in section 8.5.2. When an interrupt pin
goes low, an internal counter counts the input clock cycles. The initial value
loaded in the counter depends on the PLL multiplication factor to ensure the
counter down-time is greater than 50 ms for a 40 MIPS DSP.
Table 10–8. Counter Down-Time With PLL Multiplication Factors at 40 MHz Operation
512 5 2560 64
The counter down-times in Table 10–8 are valid when the input clock frequen-
cy is such that the CLKOUT frequency is 40 MHz when the PLL is locked. After
the counter counts down to 0, the output from the locked PLL is fed to the inter-
nal logic.
When reset is used to wake up from IDLE3, the counter is not used; the output
from the PLL is immediately fed to the internal logic and the CLKOUT pin is
asserted. The lock-up time is 50 µs for the PLL and CLKOUT to be stable.
Therefore, it is necessary to keep the reset line low during this 50-ms lock-up
time so that the C54x CPU does not start processing using an unstable clock.
PLL
operation
CLKOUT
INTn, NMI
The hold mode (HM) status bit, located in ST1, determines the following oper-
ating modes for the hold function:
When HM = 1, the C54x DSP operates in the normal mode. When HM = 0, the
C54x DSP operates in the concurrent mode. In this mode, the C54x DSP
enters the hold state only if program execution is from external memory or if
an external-memory operand is being accessed. However, if program
execution is from internal memory and no external memory operands are
accessed, the C54x DSP enters the hold state externally but program
execution continues internally. Thus, a program can continue executing while
an external operation is performed. This makes the system operation more
efficient.
Program execution ceases until HOLD is removed if the C54x DSP is in a hold
state with HM = 0 and an internally executing program requires an external
access, or a branch to an external address. Also, if a repeat instruction that
requires the use of the external bus is executing with HM = 0 when a hold
occurs, the hold state is entered after the current bus cycle. If a hold occurs
when a repeat instruction is executing with HM = 1, the C54x DSP halts the
execution after the current bus cycle, for either internal or external accesses.
Upon reset, HM is cleared to 0. HM is set and reset by the SSBX and RSBX
instructions, respectively.
HOLD is not treated as an interrupt. The hold is accepted while executing the
IDLE1 instruction regardless of the HM values. The hold is not accepted while
executing the IDLE2 or IDLE3 instructions regardless of the HM value. If HOLD
is received, the CPU continues to execute the IDLE instruction even though
the external buses and the control signals are placed in high impedance.
Figure 10–23 shows the timing for HOLD and HOLDA. If HOLD meets the set-
up time before CLKOUT is low, a minimum of three machine cycles are needed
before the buses and control signals go into high impedance. The HOLD is an
external asynchronous input which is not latched. The external device must
keep HOLD low. The external device can determine that the hold state has
been entered when it receives a HOLDA signal from the C54x DSP.
CLKOUT
HOLD
HOLDA
Address
Data
R/W
PS, DS,
or IS
MSTRB
IOSTRB
Bank Switching
Notes: 1) The timing shows the hold mode when HM = 0. When HM = 1, another cycle is required before HOLDA becomes
inactive.
2) The first cycle after releasing the hold mode is a cycle of bank switching.
CLKOUT
RS
HOLD
HOLDA
Address FF80h FF80h
Data
R/W
PS/DS/IS
MSTRB
IOSTRB
IAQ or
IACK
Bank switching
(b) Hold is Asserted While Reset is Active and De-asserted While Reset is Inactive
CLKOUT
RS
HOLD
HOLDA
Address FF80h FF80h
Data
R/W
PS/DS/IS
MSTRB
IOSTRB
Bank switching
IAQ or
IACK
MP/MC =0 MP/MC =1
CLKOUT
RS
HOLD
HOLDA
Address FF80h
Data
R/W
PS/DS/IS
MSTRB
IOSTRB
Bank switching
IAQ or
IACK
MP/MC =0 MP/MC = 1
(d) Hold is Asserted While Reset is Inactive and De-asserted While Reset is Active
CLKOUT
RS
HOLD
HOLDA
Address FF80h
Data
R/W
PS/DS/IS
MSTRB
IOSTRB
IAQ or
IACK
Bank switching
This appendix assists you in meeting the design requirements of the Texas
Instruments XDS510 emulator with respect to IEEE-1149.1 designs and
discusses the XDS510 cable (manufacturing part number 2617698-0001).
This cable is identified by a label on the cable pod marked JTAG 3/5V and
supports both standard 3-V and 5-V target system power inputs.
The term JTAG, as used in this book, refers to TI scan-based emulation, which
is based on the IEEE 1149.1 standard.
For more information concerning the IEEE 1149.1 standard, contact IEEE
Customer Service:
Topic Page
A.1 Designing Your Target System’s Emulator Connector
(14-Pin Header) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
A.2 Bus Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
A.3 Emulator Cable Pod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
A.4 Emulator Cable Pod Signal Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
A.5 Emulation Timing Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7
A.6 Connections Between the Emulator and the Target System . . . . . . A-10
A.7 Physical Dimensions for the 14-Pin Emulator Connector . . . . . . . . A-14
A.8 Emulation Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-16
A-1
Designing Your Target System’s Emulator Connector (14-Pin Header)
Although you can use other headers, the recommended unshrouded, straight
header has these DuPont connector systems part numbers:
- 65610–114
- 65611–114
- 67996–114
- 67997–114
GND Ground
- The TMS and TDI inputs are sampled on the rising edge of the TCK signal
of the device.
- The TDO output is clocked from the falling edge of the TCK signal of the
device.
When these devices are daisy-chained together, the TDO of one device has
approximately a half TCK cycle setup time before the next device’s TDI signal.
This timing scheme minimizes race conditions that would occur if both TDO
and TDI were timed from the same TCK edge. The penalty for this timing
scheme is a reduced TCK frequency.
The IEEE 1149.1 specification does not provide rules for bus master (emula-
tor) devices. Instead, it states that the device expects a bus master to provide
bus slave compatible timings. The XDS510 provides timings that meet the bus
slave rules.
- A 10.368-MHz test clock source is provided. You can also provide your
own test clock for greater flexibility.
Figure A–2. Emulator Cable Pod Interface
5V
74F175
180 Ω 270 Ω
Q
JP1
TDO (pin 7) D Q
74LVT240
10.368 MHz 33 Ω
Y TMS (pin 1)
33 Ω
Y
GND (pins 4,6,8,10,12)
A Y
Y TDI (pin 3)
JP2 74AS1004
TCK_RET (pin 9){
PD(VCC) (pin 5)
100 Ω
RESIN
TL7705A
† The emulator pod uses TCK_RET as its clock source for internal synchronization. TCK is provided as an
optional target system test clock source.
The emulator pod uses TCK_RET as its clock source for internal synchroni-
zation. TCK is provided as an optional target system test clock source.
TCK_RET
2
3
TMS, TDI
4
5
6
TDO
ƪt d ǒTMSmaxǓ
) t su ǒTTMSǓ ƫ
t pd ǒTCK_RET-TMSńTDIǓ +
t TCKfactor
(20 ns ) 10 ns)
+
0.4
+ 75 ns, or 13.3 MHz
ƪt d ǒTTDOǓ
) t su ǒTDOminǓ ƫ
t pd ǒTCK_RET–TDOǓ +
t TCKfactor
(15 ns ) 3 ns)
+
0.4
+ 45 ns, or 22.2 MHz
Example A–2. Key Timing for a Single- or Multiple-Processor System With Buffered Input
and Output
ƪtd (TMSmax ) tsu (TTMS ) 2t bufmaxƫ
) )
t pd (TCK_RET*TMSńTDI) +
t TCKfactor
In this case also, because the TCK_RET-to-TMS/TDI path requires more time
to complete, it is the limiting factor.
Signals applied to the EMU0 and EMU1 pins on the JTAG target device can
be either input or output. In general, these two pins are used as both input and
output in multiprocessor systems to handle global run/stop operations. EMU0
and EMU1 signals are applied only as inputs to the XDS510 emulator header.
The distance between the header and the JTAG target device must be no more
than 6 inches. The EMU0 and EMU1 signals must have pullup resistors
connected to VCC to provide a signal rise time of less than 10 µs. A 4.7-kΩ
resistor is suggested for most applications.
VCC
VCC
JTAG device Emulator header
13 5
EMU0 EMU0 PD
14
EMU1 EMU1
2 4
TRST TRST GND
1 6
TMS TMS GND
3 8
TDI TDI GND
7 10
TDO TDO GND
11 12
TCK TCK GND
9
TCK_RET
GND
The EMU0 and EMU1 signals must have pullup resistors connected to VCC to
provide a signal rise time of less than 10 µs. A 4.7-kΩ resistor is suggested for
most applications.
The input buffers for TMS and TDI should have pullup resistors connected to
VCC to hold these signals at a known value when the emulator is not
connected. A resistor value of 4.7 kΩ or greater is suggested.
To have high-quality signals (especially the processor TCK and the emulator
TCK_RET signals), you may have to employ special care when routing the
printed wiring board trace. You also may have to use termination resistors to
match the trace impedance. The emulator pod provides optional internal paral-
lel terminators on the TCK_RET and TDO. TMS and TDI provide fixed series
termination.
VCC
JTAG device Emulator header
13 5
EMU0 EMU0 PD
14
EMU1 EMU1
2 4
TRST TRST GND
1 6
TMS TMS GND
3 8
TDI TDI GND
7 10
TDO TDO GND
11 12
TCK NC TCK GND
9
TCK_RET
GND
Note: When the TMS and TDI lines are buffered, pullup resistors must be used to hold the buffer
inputs at a known level when the emulator cable is not connected.
There are two benefits in generating the test clock in the target system:
- The emulator provides only a single 10.368-MHz test clock. If you allow
the target system to generate your test clock, you can set the frequency
to match your system requirements.
- In some cases, you may have other devices in your system that require
a test clock when the emulator is not connected. The system test clock
also serves this purpose.
- The processor TMS, TDI, TDO, and TCK signals must be buffered through
the same physical device package for better control of timing skew.
- The input buffers for TMS, TDI, and TCK should have pullup resistors
connected to VCC to hold these signals at a known value when the emula-
tor is not connected. A resistor value of 4.7 kΩ or greater is suggested.
VCC
TDO TDI TDO TDI
VCC
EMU0
EMU1
EMU0
EMU1
TRST
TRST
TMS
TMS
TCK
TCK
Emulator header
13 5
EMU0 PD
14
EMU1
2 4
TRST GND
1 6
TMS GND
3 8
TDI GND
7 10
TDO GND
11 12
TCK GND
9
TCK_RET
GND
0.90 in.,
nominal
Note: All dimensions are in inches and are nominal dimensions, unless otherwise specified. Pin-to-pin spacing on the connec-
tor is 0.100 inches in both the X and Y planes.
0.20 i nch,
nominal
Cable
0.66 inch,
nominal
13 14
11 12
9 10
7 8 0.87 inch,
Cable nominal
5 6
0.100 inch,
3 4 nominal
(pin spacing)
1 2
2 rows of pins
A system of multiple, secondary JTAG scan paths has better fault tolerance
and isolation than a single scan path. Since an SPL has the capability of adding
all secondary scan paths to the main scan path simultaneously, it can support
global emulation operations, such as starting or stopping a selected group of
processors.
Scan path selectors are not supported by this emulation system. The
TI ACT8999 scan path selector is similar to the SPL, but it can add only one
of its secondary scan paths at a time to the main JTAG scan path. Thus, global
emulation operations are not assured with the scan path selector.
You can insert an SPL on a backplane so that you can add up to four device
boards to the system without the jumper wiring required with nonbackplane
devices. You connect an SPL to the main JTAG scan path in the same way you
connect any other device. Figure A–10 shows how to connect a secondary
scan path to an SPL.
Figure A–10. Connecting a Secondary JTAG Scan Path to a Scan Path Linker
SPL
...
DTMS1
DTDI1
TDI JTAG N
DTDO2 TMS
DTMS2 TCK
DTDI2 TRST
DTDO3 TDO
DTMS3
DTDI3
The TRST signal from the main scan path drives all devices, even those on
the secondary scan paths of the SPL. The TCK signal on each target device
on the secondary scan path of an SPL is driven by the SPL’s DTCK signal. The
TMS signal on each device on the secondary scan path is driven by the respec-
tive DTMS signals on the SPL.
DTDO0 on the SPL is connected to the TDI signal of the first device on the sec-
ondary scan path. DTDI0 on the SPL is connected to the TDO signal of the last
device in the secondary scan path. Within each secondary scan path, the TDI
signal of a device is connected to the TDO signal of the device before it. If the
SPL is on a backplane, its secondary JTAG scan paths are on add-on boards;
if signal degradation is a problem, you may need to buffer both the TRST and
DTCK signals. Although degradation is less likely for DTMSn signals, you may
also need to buffer them for the same reasons.
Also, the examples use the following values from the SPL data sheet:
td(DTMSmax) Delay time, SPL DTMS/DTDO from TCK 31 ns
low, maximum
tsu(DTDLmin) Setup time, DTDI to SPL TCK high, 7 ns
minimum
td(DTCKHmin) Delay time, SPL DTCK from TCK high, 2 ns
minimum
td(DTCKLmax) Delay time, SPL DTCK from TCK low, 16 ns
maximum
There are two key timing paths to consider in the emulation design:
Of the following two cases, the worst-case path delay is calculated to deter-
mine the maximum system test clock frequency.
Example A–3. Key Timing for a Single-Processor System Without Buffering (SPL)
ƪt d ǒDTMSmaxǓ
) t d ǒDTCKHminǓ ) t su ǒTTMSǓ ƫ
t pd ǒTCK-DTMSǓ +
t TCKfactor
(31 ns ) 2 ns ) 10 ns)
+
0.4
+ 107.5 ns, or 9.3 MHz
ƪt d ǒTTDOǓ
) td ǒDTCKLmaxǓ ) tsu ǒDTDLminǓ ƫ
tpd ǒTCK-DTDIǓ +
tTCKfactor
(15 ns ) 16 ns ) 7 ns)
+
0.4
+ 9.5 ns, or 10.5 MHz
Example A–4. Key Timing for a Single- or Multiprocessor-System With Buffered Input
and Output (SPL)
(15 ns ) 15 ns ) 7 ns ) 10 ns)
+
0.4
+ 120 ns, or 8.3 MHz
- Signal Event. The EMU0/1 pins can be configured via software to signal
internal events. In this mode, driving one of these pins low can cause
devices to signal such events. To enable this operation, the EMU0/1 pins
function as open-collector sources. External devices such as logic analyz-
ers can also be connected to the EMU0/1 signals in this manner. If such
an external source is used, it must also be connected via an open-collector
source.
If you route the EMU0/1 signals between multiple boards, they require special
handling because they are more complex than normal emulation signals.
Figure A–11 shows an example configuration that allows any processor in the
system to stop any other processor in the system. Do not tie the EMU0/1 pins
of more than 16 processors together in a single group without using buffers.
Buffers provide the crisp signals that are required during a RUNB (run bench-
mark) debugger command or when the external analysis counter feature is
used.
Target board 1
Pullup
Open- resistor
collector ...
EMU0/1
drivers
Backplane Device ... Device
XCNT_ENABLE 1 n
EMU0/1-IN
...
PAL ...
Pullup
EMU0/1-OUT resistor
Target board m
Notes: 1) The low time on EMU0/1-IN should be at least one TCK cycle and less than 10 ms. Software sets the EMU0/1-OUT
pin to a high state.
2) To enable the open-collector driver and pullup resistor on EMU1 to provide rise/fall times of less than 25 ns, the modifi-
cation shown in this figure is suggested. Rise times of more than 25 ns can cause the emulator to detect false edges
during the RUNB command or when the external counter selected from the debugger analysis menu is used.
These seven important points apply to the circuitry shown in Figure A–11 and
the timing shown in Figure A–12:
- Open-collector drivers isolate each board. The EMU0/1 pins are tied
together on each board.
- At the board edge, the EMU0/1 signals are split to provide both input and
output connections. This is required to prevent the open-collector drivers
from acting as latches that can be set only once.
- The EMU0/1 signals are bused down the backplane. Pullup resistors must
be installed as required.
Figure A–12. Suggested Timings for the EMU0 and EMU1 Signals
TCK
EMU0/1-OUT
EMU0/1-IN
Figure A–13. EMU0/1 Configuration With Additional AND Gate to Meet Timing
Requirements of Greater Than 25 ns
Target board 1
Pullup
Open- resistor
collector ...
EMU0/1
drivers
Backplane Device ... Device
XCNT_ENABLE 1 n
EMU0/1-IN
...
...
...
PAL
Pullup
EMU0/1-OUT resistor
Target board m
Up to
To emulator EMU1
m boards EMU1 signal from other boards
Notes: 1) The low time on EMU0/1-IN should be at least one TCK cycle and less than 10 ms. Software will set the EMU0/1-OUT
port to a high state.
2) To enable the open-collector driver and pullup resistor on EMU1 to provide rise/fall time of greater than 25 ns, the
modification shown in this figure is suggested. Rise times of more than 25 ns can cause the emulator to detect false
edges during the RUNB command or when the external counter selected from the debugger analysis menu is used.
You do not need to have devices on one target board stop devices on another
target board using the EMU0/1 signals (see the circuit in Figure A–14). In this
configuration, the global-stop capability is lost. It is important not to overload
EMU0/1 with more than 16 devices.
Target board 1
Pullup
resistor
... EMU0/1
Pullup
resistor Device ... Device
1 n
To emulator
EMU0/1
...
...
Target board m
Pullup
resistor
...
EMU0/1
Note: The open-collector driver and pullup resistor on EMU1 must be able to provide rise/fall times of less than 25 ns. Rise times
of more than 25 ns can cause the emulator to detect false edges during the RUNB command or when the external counter
selected from the debugger analysis menu is used. If this condition cannot be met, then the EMU0/1 signals from the
individual boards must be ANDed together (as shown in Figure A–14) to produce an EMU0/1 signal for the emulator.
Clock VCC
TBC TCKI
TDO TDI JTAG 0
TMS0 TMS
TMS1 EMU0
TMS2/EVNT0 EMU1
TMS3/EVNT1 TRST
TMS4/EVNT2 TCK
TMS5/EVNT3 TDO
TCKO
TDI0
TDI1 TDI JTAG N
TMS
EMU0
EMU1
TRST
TCK
TDO
In the system design shown in Figure A–15, the TBC emulation signals TCKI,
TDO, TMS0, TMS2/EVNT0, TMS3/EVNT1, TMS5/EVNT3, TCKO, and TDI0
are used, and TMS1, TMS4/EVNT2, and TDI1 are not connected. The target
devices’ EMU0 and EMU1 signals are connected to VCC through pullup resis-
tors and tied to the TBC’s TMS2/EVNT0 and TMS3/EVNT1 pins, respectively.
The TBC’s TCKI pin is connected to a clock generator. The TCK signal for the
main JTAG scan path is driven by the TBC’s TCKO pin.
On the TBC, the TMS0 pin drives the TMS pins on each device on the main
JTAG scan path. TDO on the TBC connects to TDI on the first device on the
main JTAG scan path. TDI0 on the TBC is connected to the TDO signal of the
last device on the main JTAG scan path. Within the main JTAG scan path, the
TDI signal of a device is connected to the TDO signal of the device before it.
TRST for the devices can be generated either by inverting the TBC’s
TMS5/EVNT3 signal for software control or by logic on the board itself.
More than 100 third-party developers offer products that support the
TMS320 family of DSPs. For more information, refer to the TMS320 Third-
Party Support Reference Guide (SPRU052).
For information on pricing and availability, contact the nearest TI Field Sales
Office or authorized distributor. See the list at the back of this book.
Topic Page
Because the C2000, C3x, C4x, and C5x XDS510 emulators also come
with the same emulator board (or box) as the C54x emulator, you can buy
the C54x C Source Debugger Software as a separate product called the
C54x C Source Debugger Conversion Software. This enables you to
debug C54x DSP applications with a previously purchased emulator
board. The emulator cable that comes with the C3x XDS510 emulator can-
not be used with the C54x DSP emulator. You need the JTAG emulation
conversion cable (see section B.2) instead. The emulator cable that
comes with the C5x XDS510 emulator can be used with the C54x DSP
emulator without any restriction. See the TMS320C54x C Source Debug-
ger User’s Guide) for detailed information about the C54x DSP emulator.
B.1.4 Assistance
For assistance to TMS320 DSP questions on device problems, development
tools, documentation, software upgrades, and new products, you can contact
TI.
TMS devices and TMDS development support tools have been fully character-
ized, and the quality and reliability of the device has been fully demonstrated.
Texas Instruments standard warranty applies to these products.
Note:
It is expected that prototype devices (TMX or TMP) have a greater failure rate
than standard production devices. Texas Instruments recommends that
these devices not be used in any production system, because their expected
end-use failure rate is still undefined. Only qualified production devices
should be used.
1x DSP
2x DSP
20x DSP
24x DSP
27x DSP
28x DSP
3x DSP
† DIP = Dual-In-Line Package 4x DSP
PGA = Pin Grid Array 5x DSP
CC = Chip Carrier 54x DSP
55x DSP
QFP = Quad Flat Package 62x DSP
TQFP = Thin Quad Flat Package 64x DSP
BGA = Ball Grid Array 67x DSP
TMS320 DSP development tools are used to develop, test, refine, and finalize
the algorithms. The microprocessor/microcomputer (MP/MC) mode is avail-
able on all ROM-coded TMS320 DSP devices when accesses to either on-chip
or off-chip memory are required. The microprocessor mode is used to develop,
test, and refine a system application. In this mode of operation, the TMS320
DSP acts as a standard microprocessor by using external program memory.
When the algorithm has been finalized, the code can be submitted to Texas
Instruments for masking into the on-chip program ROM. At that time, the
TMS320 DSP becomes a microcomputer that executes customized programs
from the on-chip ROM. Should the code need changing or upgrading, the
TMS320 DSP can once again be used in the microprocessor mode. This
shortens the field-upgrade time and avoids the possibility of inventory
obsolescence.
Figure C–1 illustrates the procedural flow for developing and ordering
TMS320 DSP masked parts. When ordering, there is a one-time, nonrefund-
able charge for mask tooling. A minimum production order per year is required
for any masked-ROM device. ROM codes will be deleted from the TI system
one year after the final delivery.
C-1
Submitting ROM Codes to TI
Customer submits:
— TMS320 New Code Release Form
— Print Evaluation and Acceptance Form (PEAF)
— Purchase order for mask prototypes
— TMS320 DSP code
No Customer
approves
algorithm
Yes
TI produces prototypes
Customer
approves
No
prototypes (minimum
production order
required)
Yes
The TMS320 DSP ROM code may be submitted in one of the following
forms:
With each masked-device order, the customer must sign a disclaimer that
states:
The units to be shipped against this order were assembled, for expe-
diency purposes, on a prototype (that is, nonproduction qualified)
manufacturing line, the reliability of which is not fully characterized.
Therefore, the anticipated inherent reliability of these prototype units
cannot be expressly defined.
The use of the ROM-protect feature does not hold for this release statement.
Additional risk and charges are involved when the ROM-protect feature is
selected. Contact the nearest TI Field Sales Office for more information on
procedures, leadtimes, and cost associated with the ROM-protect feature.
Glossary
A
A: See accumulator A.
ABUC: ABU control register. A register that controls the operation of the
autobuffering unit.
accumulator shift mode field (ASM): A 5-bit field in status register 1 (ST1)
that specifies a shift value (from –16 to 15) used to shift an accumulator value
when executing certain instructions, such as instructions with parallel loads
and stores.
AG: accumulator guard bits. An 8-bit register that contains bits 39–32 (the
guard bits) of accumulator A.
D-1
Glossary
ALU: arithmetic logic unit. The part of the CPU that performs arithmetic
and logic operations.
ARR, ARR0, ARR1: ABU address receive register. A 16-bit register that
specifies the destination address at which the autobuffering unit begins
storing received data.
auxiliary register file: The area in data memory containing the eight 16-bit
auxiliary registers. See also auxiliary registers.
auxiliary register pointer (ARP): A 3-bit field in status register 0 (ST0) used
as a pointer to the currently-selected auxiliary register, when the device
is operating in ’C5x/’C2xx compatibility mode.
auxiliary registers: Eight 16-bit registers (AR7 – AR0) that are used as
pointers to an address within data space. These registers are operated on
by the auxiliary register arithmetic units (ARAUs) and are selected by the
auxiliary register pointer (ARP). See also auxiliary register arithmetic unit.
AXR, AXR0, AXR1: ABU address transmit register. A 16-bit register that
specifies the source address from which the autobuffering unit begins
transmitting data.
B
B: See accumulator B.
BDRR, BDRR0, BDRR1: BSP data receive register. Two 16-bit registers
used to receive data through the buffered serial ports. BDRR0
corresponds to buffered serial port 0; BDRR1 corresponds to buffered
serial port 1.
BDXR, BDXR0, BDXR1: BSP data transmit register. Two 16-bit registers
used to transmit data through the buffered serial ports. BDXR0
corresponds to buffered serial port 0; BDXR1 corresponds to buffered
serial port 1.
BG: accumulator B guard bits. An 8-bit register that contains bits 39–32
(the guard bits) of accumulator B.
BIO: A general purpose, branch-control, input pin that can be used to moni-
tor the status of peripheral devices.
BKR, BKR0, BKR1: ABU receive buffer size register. A 16-bit register that
sets the size of the receive buffer for the autobuffering unit.
BKX, BKX0, BKX1: ABU transmit buffer size register. A 16-bit register that
sets the size of the transmit buffer for the autobuffering unit.
block-repeat active flag (BRAF): A bit in status register 1 (ST1) that indi-
cates whether or not a block repeat is currently active.
block-repeat counter (BRC): A 16-bit register that specifies the number of
times a block of code is to be repeated when a block repeat is performed.
block-repeat end address register (REA): A 16-bit memory-mapped
register containing the end address of a code segment being repeated.
block-repeat start address register (RSA): A 16-bit memory-mapped
register containing the start address of a code segment being repeated.
BMINT: See buffer misalignment interrupt.
boot: The process of loading a program into program memory.
boot loader: A built-in segment of code that transfers code from an external
source to program memory at power-up.
BRAF: See block-repeat active flag.
BRC: See block-repeat counter.
BRE: See autobuffering receiver enable.
BRINT, BRINT0, BRINT1: See BSP receive interrupt.
BRSR: BSP data receive shift register. A 16-bit register that holds serial
data received from the BDR pin. See also BDRR.
BSCR: See bank-switching control register.
BSP: buffered serial port. An enhanced synchronous serial port that
includes an autobuffering unit (ABU) that reduces CPU overhead in
performing serial operations.
BSP receive interrupt (BRINT, BRINT0, BRINT1): A bit in the interrupt flag
register (IFR) that indicates the BSP data receive shift register (BRSR)
contents have been copied to the BSP data receive register (BDRR).
BRINT0 corresponds to buffered serial port 0; BRINT1 corresponds to buff-
ered serial port 1.
BSP transmit interrupt (BXINT, BXINT0, BXINT1): A bit in the interrupt flag
register (IFR) that indicates the the BSP data transmit register (BDXR)
contents has been copied to the BSP data transmit shift register (BXSR).
BXINT0 corresponds to buffered serial port 0; BXINT1 corresponds to buff-
ered serial port 1.
BSPC, BSPC0, BSPC1: Buffered serial port control registers 0 and 1. A
16-bit register that contains status and control bits for the buffered serial
port. BSPC0 corresponds to buffered serial port 0; BSPC1 corresponds
to buffered serial port 1.
burst mode: A synchronous serial port mode in which a single word is trans-
mitted following a frame synchronization pulse (FSX and FSR).
BXSR: BSP data transmit shift register. A 16-bit register that holds serial
data to be transmitted from the BDX pin. See also BDXR.
C
C: See carry bit.
C16: A bit in status register 1 (ST1) that determines whether the ALU
operates in dual 16-bit mode or in double-precision mode.
CAB: C address bus. A bus that carries addresses needed for accessing
data memory.
carry bit (C): A bit in status register 0 (ST0) used by the ALU in extended
arithmetic operations and accumulator shifts and rotates. The carry bit
can be tested by conditional instructions.
CB: C bus. A bus that carries operands that are read from data memory.
circular buffer size register (BK): A 16-bit register used by the auxiliary
register arithmetic units (ARAUs) to specify the data-block size in circular
addressing.
clock mode (MCM): A bit in the serial port control register (SPC), buffered
serial port control register (BSPC), and TDM serial port control register
(TSPC) that specifies the source of the clock for CLKX.
clock polarity (CLKP): A bit in the BSP control extension register (BSPCE)
that indicates when the data is sampled by the receiver and sent by the
transmitter.
continuous mode: A synchronous serial port mode in which only one frame
synchronization pulse (FSX and FSR) is necessary to transmit several
packets at maximum frequency.
D
DAB: D address bus. A bus that carries addresses needed for accessing
data memory.
DAB address register (DAR): A register that holds the address to be put
on the DAB to address data memory for reads via the DB.
data memory: A memory region used for storing and manipulating data.
Addresses 00h–1Fh of data memory contain CPU registers. Addresses
20h–5Fh of data memory contain peripheral registers.
data page pointer (DP): A 9-bit field in status register 0 (ST0) that specifies
which of 512, 128 × 16 word pages is currently selected for direct address
generation. DP provides the nine MSBs of the data-memory address; the
dma provides the lower seven. See also dma.
data ROM (DROM): A bit in processor mode status register (PMST) that
determines whether or not part of the on-chip ROM is mapped into data
space.
DB: D bus. A bus that carries operands that are read from data memory.
digital loopback mode: A synchronous serial port test mode in which the
DLB bit connects the receive pins to the transmit pins on the same device
to test if the port is operating correctly.
digital loopback mode (DLB) bit: A bit in the serial port control register
(SPC), buffered serial port control register (BSPC), and TDM serial port
control register (TSPC) that puts the serial port in digital loopback mode.
DRB: direct data-memory address bus. A 16-bit bus that carries the direct
address for data memory.
DRR, DRR0, DRR1: serial port data receive register. Two 16-bit registers
used to receive data through the synchronous serial ports. DRR0
corresponds to synchronous serial port 0; DRR1 corresponds to
synchronous serial port 1.
DSP interrupt (DSPINT): A bit in the HPI control register (HPIC) that
enables/disables an interrupt from a host device to the C54x DSP.
DXR, DXR0, DXR1: serial port data transmit register. Two 16-bit registers
used to transmit data through the synchronous serial ports. DXR0 corre-
sponds to synchronous serial port 0; DXR1 corresponds to synchronous
serial port 1.
E
EAB: E address bus. A bus that carries addresses needed for accessing
data memory.
EAB address register (EAR): A register that holds the address to be put on
the EAB to address data memory for reads via the EB.
F
fast Fourier transform (FFT): An efficient method of computing the discrete
Fourier transform, which transforms functions between the time domain
and frequency domain. The time-to-frequency domain is called the
forward transform, and the frequency-to-time domain is called the
inverse transformation. See also butterfly.
fast return register (RTN): A 16-bit register used to hold the return address
for the fast return from interrupt (RETF[D]) instruction.
format (FO): A bit in the serial port control register (SPC), buffered serial port
control register (BSPC), and TDM serial port control register (TSPC) that
specifies the word length of the serial port transmitter and receiver.
format extension (FE): A bit in the BSP control extension register (BSPCE)
used in conjunction with the format bit (FO) to specify the word length of
the BSP serial port transmitter and receiver.
frame ignore (FIG): A bit in the BSP control extension register (BSPCE)
used only in transmit continuous mode with external frame and in receive
continuous mode.
frame synchronization mode (FSM): A bit in the serial port control register
(SPC), buffered serial port control register (BSPC), and TDM serial port
control register (TSPC) that specifies whether frame synchronization
pulses (FSX and FSR) are required for serial port operation.
Free bit: A bit in the serial port control register (SPC), buffered serial port
control register (BSPC), timer control register (TCR), and TDM serial port
control register (TSPC) used in conjunction with the Soft bit to determine
the state of the serial port or timer clock when a breakpoint is encoun-
tered in the high-level language debugger. See also Soft bit.
G
general-purpose input/output pins: Pins that can be used to supply input
signals from an external device or output signals to an external device.
These pins are not linked to specific uses; rather, they provide input or
output signals for a variety of purposes. These pins include the general-
purpose BIO input pin and XF output pin.
H
HALTR: See autobuffering receiver halt.
hold mode (HM): A bit in status register ST1 that determines whether the
CPU enters the hold state in normal mode or concurrent mode.
host-only mode (HOM): The mode that allows the host to access HPI
memory while the C54x CPU is in IDLE2 (all internal clocks stopped) or
in reset mode.
host port interface (HPI): An 8-bit parallel interface that the CPU uses to
communicate with a host processor.
HPI address register (HPIA): A 16-bit register that stores the address of the
host port interface (HPI) memory block. The HPIA can be preincrem-
ented or postincremented.
HPI control register (HPIC): A 16-bit register that contains status and
control bits for the host port interface (HPI).
I
IFR: See interrupt flag register.
IN0: input 0 bit. A bit in the serial port control register (SPC), buffered serial
port control register (BSPC), and TDM serial port control register (TSPC)
that allows the CLKR pin to be used as an input. IN0 reflects the current
level of the CLKR pin of the device.
IN1: input 1 bit. A bit in the serial port control register (SPC), buffered serial
port control register (BSPC), and TDM serial port control register (TSPC)
that allows the CLKX pin to be used as an input. IN1 reflects the current
level of the CLKX pin of the device.
internal transmit clock division factor (CLKDV): A 5-bit field in the BSP
control extension register (BSPCE) that determines the internal transmit
clock duty cycle.
interrupt: A condition caused by internal hardware, an event external to the
CPU, or by a previously executed instruction that forces the current
program to be suspended and causes the processor to execute an inter-
rupt service routine corresponding to the interrupt.
interrupt flag register (IFR): A 16-bit memory-mapped register that flags
pending interrupts.
interrupt mask register (IMR): A 16-bit memory-mapped register that
masks external and internal interrupts.
interrupt mode (INTM): A bit in status register 1 (ST1) that globally masks
or enables all interrupts.
interrupt service routine (ISR): A module of code that is executed in
response to a hardware or software interrupt.
IPTR: interrupt vector pointer A 9-bit field in the processor mode status
register (PMST) that points to the 128-word page where interrupt vectors
reside.
IR: instruction register. A 16-bit register used to hold a fetched instruction.
L
latency: The delay between when a condition occurs and when the device
reacts to the condition. Also, in a pipeline, the necessary delay between
the execution of two instructions to ensure that the values used by the
second instruction are correct.
LSB: least significant bit. The lowest order bit in a word.
M
maskable interrupts: A hardware interrupt that can be enabled or disabled
through software.
McBSP: See multichannel buffered serial port.
MCM: See clock mode.
memory map: A map of the addressable memory space accessed by the
C54x CPU partitioned according to functionality (memory, registers,
etc.).
micro stack: A stack that provides temporary storage for the address of the
next instruction to be fetched when the program address generation logic
is used to generate sequential addresses in data space.
N
nested interrupt: A higher-priority interrupt that must be serviced before
completion of the current interrupt service routine (ISR). An executing
ISR can set the interrupt mask register (IMR) bits to prevent being
suspended by another interrupt.
O
OVA: overflow flag A. A bit in status register0 (ST0) that indicates the
overflow condition of accumulator A.
OVB: overflow flag B. A bit in status register 0 (ST0) that indicates the
overflow condition of accumulator B.
OVM: overflow mode bit. A bit in status register 1 (ST1) that specifies how
the ALU handles an overflow after an operation.
P
PAB: See program address bus.
PRD: timer period register. A 16-bit register that defines the period for the
on-chip timer.
program address bus (PAB): A 16-bit bus that provides the address for
program memory reads and writes.
R
RAM overlay (OVLY): A bit in the processor mode status register (PMST)
that determines whether or not on-chip RAM is mapped into the program
space in addition to data space.
RC: See repeat counter.
REA: See block-repeat end address.
receive buffer half received (RH): A bit in the BSP control extension regis-
ter (BSPCE) that indicates which half of the receive buffer has been
received.
receive ready (RRDY): A bit in the serial port control register (SPC),
buffered serial port control register (BSPC), and TDM serial port control
register (TSPC) that transitions from 0 to 1 to indicate the data receive
shift register (RSR) contents have been copied to the data receive regis-
ter (DRR) and that data can be read.
receiver reset (RRST): A bit in the serial port control register (SPC),
buffered serial port control register (BSPC), and TDM serial port control
register (TSPC) that resets the serial port receiver.
receive shift register full (RSRFULL): A bit in the serial port control register
(SPC) and buffered serial port control register (BSPC) that indicates if the
serial port receiver has experienced overrun.
register: A group of bits used for temporarily holding data or for controlling
or specifying the status of a device.
repeat counter (RC): A 16-bit register used to specify the number of times
a single instruction is executed.
reset: A means of bringing the CPU to a known state by setting the registers
and control bits to predetermined values and signaling execution to start
at a specified address.
RH: See receive buffer half received.
RINT, RINT0, RINT1: See serial port receive interrupt.
RRDY: See receive ready.
RRST: See receiver reset.
RSA: See block-repeat start address.
RSR: data receive shift register. A 16-bit register that holds serial data
received from the DR pin. See also data receive register (DRR).
RSRFULL: See receive shift register full.
RTN: See fast return register.
S
SARAM: single-access RAM. Memory that can be read written once during
one clock cycle.
saturation on multiplication (SMUL): A bit in the processor mode status
register (PMST) that determines whether saturation of a multiplication
result occurs before performing the accumulation in a MAC or MAS
instruction.
saturation on store (SST): A bit in the processor mode status register
(PMST) that determines whether saturation of the data from the accumu-
lator occurs before storing in memory.
serial port interface: An on-chip full-duplex serial port interface that
provides direct serial communication to serial devices with a minimum
of external hardware, such as codecs and serial analog-to-digital (A/D)
and digital-to-analog (D/A) converters. Status and control of the serial
port is specified in the serial port control register (SPC).
serial port receive interrupt (RINT, RINT0, RINT1): A bit in the interrupt
flag register (IFR) that indicates the data receive shift register (RSR)
contents have been copied to the data receive register (DRR). RINT0
corresponds to synchronous serial port 0; RINT1 corresponds to synchro-
nous serial port 1.
serial port transmit interrupt (XINT, XINT0, XINT1): A bit in the interrupt
flag register (IFR) that indicates the the data transmit register (DXR)
contents has been copied to the data transmit shift register (XSR). XINT0
corresponds to synchronous serial port 0; XINT1 corresponds to synchro-
nous serial port 1.
shared-access mode (SAM): The mode that allows both the C54x DSP and
the host to access HPI memory. In this mode, asynchronous host
accesses are synchronized internally and, in case of conflict, the host
has access priority and the C54x DSP waits one cycle.
shared-access mode (SMOD): A bit in the HPI control register (HPIC) that
enables/disables the shared access mode (SAM). See also shared-
access mode (SAM) and host-only mode (HOM).
shifter: A hardware unit that shifts bits in a word to the left or to the right.
sign extension: An operation that fills the high order bits of a number with
the sign bit.
Soft bit: A bit in the serial port control register (SPC), buffered serial port
control register (BSPC), timer control register (TCR), and TDM serial port
control register (TSPC) used in conjunction with the Free bit to determine
the state of the serial port or timer clock when a breakpoint is encoun-
tered in the high-level language debugger. See also Free bit.
SPC, SPC0, SPC1: serial port control register. A 16-bit register that
contains status and control bits for the synchronous serial port. SPC0
corresponds to synchronous serial port 0; SPC1 corresponds to synchro-
nous serial port 1.
ST0: A 16-bit register that contains C54x CPU status and control bits. See
also PMST; ST1.
ST1: A16-bit register that contains C54x CPU status and control bits. See
also PMST, ST0.
stack: A block of memory used for storing return addresses for subroutines
and interrupt service routines and for storing data.
stack pointer (SP): A register that always points to the last element pushed
onto the stack.
T
TADD: TDM address. A single, bidirectional address line that identifies
which devices on the four-wire serial bus should read in the data on the
TDM data (TDAT) line.
TC: test/control flag. A bit in status register 0 (ST0) that is affected by test
operations.
TCLK: TDM clock. A single, bidirectional clock line for TDM operation.
TDAT: TDM data. A single, bidirectional line from which all TDM data is
carried.
TDM receive interrupt (TRINT): A bit in the interrupt flag register (IFR) that
indicates the TDM data receive shift register (TRSR) contents have been
copied to the TDM data receive register (TRCV).
TDM transmit interrupt (TXINT): A bit in the interrupt flag register (IFR) that
indicates the TDM data transmit register (TDXR) contents have been
copied to the data transmit shift register (XSR).
TDXR: TDM data transmit register. A 16-bit register used to transmit data
through the TDM serial port. See also XSR.
temporary register (T): A 16-bit register that holds one of the operands for
multiply and store instructions, the dynamic shift count for the add and
subtract instructions, or the dynamic bit position for the bit test instruc-
tions.
TIM: timer counter register. A 16-bit memory-mapped register that
specifies the current count for the on-chip timer.
timer divide-down register (TDDR): A 4-bit field in the timer control register
(TCR) that specifies the timer divide-down ratio (period) for the on-chip
timer.
timer interrupt (TINT): A bit in the interrupt flag register (IFR) that indicates
the timer counter register (TIM) has decremented past 0.
timer prescaler counter (PSC): A 4-bit field in the timer control register
(TCR) that specifies the count for the on-chip timer.
timer reload (TRB): A bit in the timer control register (TCR) that resets the
on-chip timer.
timer stop status (TSS): A bit in the timer control register (TCR) that stops
and restarts the on-chip timer.
TINT: See timer interrupt.
transition register (TRN): A 16-bit register that holds the transition decision
for the path to new metrics to perform the Viterbi algorithm.
transmit buffer half transmitted (XH): A bit in the BSP control extension
register (BSPCE) that indicates which half of transmit buffer transmitted.
transmit mode (TXM): A bit in the serial port control register (SPC), buffered
serial port control register (BSPC), and TDM serial port control register
(TSPC) that specifies the source of the frame synchronization transmit
(FSX) pulse.
transmit ready (XRDY): A bit in the serial port control register (SPC),
buffered serial port control register (BSPC), and TDM serial port control
register (TSPC) that transitions from 0 to 1 to indicate the data transmit
register (DXR) contents have been copied to the data transmit shift regis-
ter (XSR) and that data is ready to be loaded with a new data word.
transmit shift register empty (XSREMPTY): A bit in the serial port control
register (SPC) and buffered serial port control register (BSPC) that indi-
cates if the serial port transmitter has experienced underflow.
transmitter reset (XRST): A bit in the serial port control register (SPC),
buffered serial port control register (BSPC), and TDM serial port control
register (TSPC) that resets the serial port transmitter.
TRCV: TDM data receive register. A register used to receive data through
the TDM serial port.
TRSR: TDM data receive shift register. A 16-bit register that holds serial
data received from the TDM data (TDAT) line. See also TRCV.
W
wait state: A period of time that the CPU must wait for external program,
data, or I/O memory to respond when reading from or writing to that
external memory. The CPU waits one extra cycle (one CLKOUT1 cycle)
for every wait state.
warm boot: The process by which the processor transfers control to the
entry address of a previously-loaded program.
X
XF: A general purpose, software-controlled, external flag output pin that
allows for signalling external devices.
XF status flag: A bit in status register ST1 that indicates the status of the XF
pin.
XSR: data transmit shift register. A 16-bit register that holds serial data to
be transmitted from the DX pin (or TDX pin when TDM = 1). See also
TDXR.
Z
ZA: zero detect A. A signal that indicates when accumulator A contains
a 0.
zero fill: A method of filling the low- or high-order bits with zeros when load-
ing a 16-bit number into a 32-bit field.
Index
Index-1
Index
Index-2
Index
Index-3
Index
Index-4
Index
Index-5
Index
Index-6
Index
Index-7
Index
Index-8
Index
Index-9
Index
Index-10
Index
Index-11
Index
Index-12
Index
Index-13
Index
Index-14
Index
Index-15
Index
Index-16
Index
Index-17
Index
Index-18
Index
TDM serial port receive address register (TRAD), timer prescaler counter (PSC), definition D-18
definition D-18 timer register (TIM) 8-21
TDM transmit interrupt (TXINT), definition D-17 timer registers 8-21
TDO output A-4 timer reload (TRB), definition D-18
TDO signal A-4, A-5, A-8, A-19, A-25 timer stop status (TSS), definition D-18
TDXR, definition D-17 timing, XF 8-20
telecommunications applications viii, xii timing calculations A-7 to A-9, A-18 to A-26
temporary register (T) 3-27, 3-28 timing diagrams
definition D-18 external bus interface priority 10-4
external bus reset sequence 10-25
test bus controller A-22, A-24
hold and reset interaction 10-31 to 10-35
test clock A-12 IDLE3 wake-up sequence 10-27
diagram A-12 memory interface 10-15 to 10-23
test/control (TC) 4-3 TINT D-18
definition D-17 definition D-18
third-party support B-3 TMS signal A-2, A-3, A-4, A-5, A-6, A-7, A-8, A-13,
TIM, definition D-18 A-17, A-18, A-19, A-25
time-division multiplexed (TDM), definition D-18 TMS/TDI inputs A-4
time-division multiplexing (TDM) TMS320 DSP family, applications 1-3 to 1-4
basic operation 9-56 TMS320 DSPs, applications, table 1-4
definition D-18 TMS320 DSP family 1-2 to 1-6
timer 2-13, 8-21 to 8-25 advantages 1-2
block diagram 8-23 characteristics 1-2
operation 8-23 development 1-2
registers 8-21 evolution (figure) 1-3
timer control register (TCR) 8-22 history 1-2
timer control register (TCR) 8-21 overview 1-2
bit summary 8-22 TMS320C54x DSP 1-5
definition D-17 TMS320 DSP ROM code submittal, figure C-2
diagram 8-22 TMS320C542
Free bit 8-22, D-9 mapping code 3-18
PSC bits 8-22 on-chip ROM 3-18
PSC field D-18 TMS320C54x DSP 1-5 to 1-8
Soft bit 8-22, D-16 advantages 1-5
TDDR bits 8-22 features 1-6
TDDR field D-18 CPU 1-6
TRB bit 8-22, D-18 emulation 1-9
TSS bit 8-22, D-18 instruction set 1-7
timer counter register (TIM), definition D-18 memory 1-6
timer divide-down register (TDDR), definition D-18 peripherals 1-7
timer enabling 8-25 ports 1-8
power 1-9
timer initialization 8-24 speed 1-8
timer interrupt (TINT), definition D-18 internal block diagram 2-2
timer interrupt rate equation 8-24 overview 1-5
timer operation 8-23 tools, part numbers B-7
timer period register (PRD) 8-21 tools nomenclature, prefixes B-5
definition D-13 TRAD, definition D-18
Index-19
Index
Index-20
Index
Index-21