NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
TMS370 SPNU127 SPNU127A SPNA017 SPNS029 SPNS012 SPNS018 SPNS015 SPNS039 SPNS016 - Datasheet Archive
Family User's Guide 1996 8-Bit Microcontroller Family Printed in U.S.A., March 1996 1604927-9761 revision C SPNU127 TMS370
TMS370 TMS370 Microcontroller Family User's Guide 1996 8-Bit Microcontroller Family Printed in U.S.A., March 1996 1604927-9761 revision C SPNU127 SPNU127 TMS370 TMS370 Microcontroller Family 1996 User's Guide TMS370 TMS370 Microcontroller Family User's Guide Literature Number: SPNU127A SPNU127A Manufacturing Part Number: 1604927-9761 revision C February 1997 Printed on Recycled Paper Chapter Title-Attribute Reference -1 IMPORTANT NOTICE Texas Instruments (TI) reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice, and advises its customers to obtain the latest version of relevant information to verify, before placing orders, that the information being relied on is current. TI warrants performance of its semiconductor products and related software to the specifications applicable at the time of sale in accordance with TI's standard warranty. Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty. Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements. Certain applications using semiconductor products may involve potential risks of death, personal injury, or severe property or environmental damage ("Critical Applications"). TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. Inclusion of TI products in such applications is understood to be fully at the risk of the customer. Use of TI products in such applications requires the written approval of an appropriate TI officer. Questions concerning potential risk applications should be directed to TI through a local SC sales office. In order to minimize risks associated with the customer's applications, adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards. TI assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. Nor does TI warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right of TI covering or relating to any combination, machine, or process in which such semiconductor products or services might be or are used. Copyright 1997, Texas Instruments Incorporated Preface Read This First About This Manual This user's guide describes the TMS370 TMS370 family of microcontroller devices. These devices have robust features that enhance performance and enable new application technologies. The specifications and descriptions included in this user's guide apply to the TMS370CxxxA devices; all differences for the TMS370Cxxx devices are described in Appendix A. The objective of this user's guide is to provide the information you need to implement a microcontroller design using a TMS370 TMS370 device. The user's guide contains the following chapters: Chapter 1 Introduction to the TMS370 TMS370 Family Devices. Discusses the key features and the major components of the TMS370 TMS370 family devices. Also includes block diagrams for each device category. Chapter 2 TMS370 TMS370 Family Pinouts and Pin Descriptions. Provides pinouts and pin descriptions for the TMS370 TMS370 family device categories. Chapters 315 Describe the operation and programming of each major function in the TMS370 TMS370 architecture. Chapter 16 Assembly Language Instruction Set. Describes the TMS370 TMS370 addressing modes and each of the 73 instructions, including samples and examples. Chapter 17 Development Support. Describes the hardware and software development tools available for the TMS370 TMS370 devices. Read This First iii About This Manual Chapter 18 Chapter 19 Customer Information. Describes mask-ROM prototyping, TMS370 TMS370 physical characteristics, and parts ordering. Appendix A Differences Among the TMS370CxxxA, TMS370CxxxB, and TMS370Cxxx Devices (Contact Options). Points out the differences between the TMS370CxxxA and TMS370CxxxB devices as described in this manual and the TMS370Cxxx devices. Appendix B Peripheral File Memory Map. Gives reference tables for the TMS370 TMS370 control bits and registers. Appendix C Block Diagrams. Gives reference block diagrams of the major circuits. Appendix D ASCII Character Set. Lists the ASCII character set that the TMS370 TMS370 assembler recognizes. Appendix E Opcode/Instruction Cross-Reference. Gives an opcode-to-instruction cross-reference of all 73 mnemonics and 274 opcodes of the TMS370 TMS370 instruction set. Appendix F Instruction/Opcode Cross-Reference and Bus Activity Table. Gives an instruction-to-opcode cross-reference of all 73 mnemonics and 274 opcodes of the TMS370 TMS370 instruction set and provides a cycle-by-cycle bus activity table. Appendix G Device Pinouts. Provides pinouts for the individual device categories. Appendix H PLCC-to-PGA Pinouts. Shows the pinouts for the standard PLCC-to-PGA sockets that are commonly used in prototype and production applications. You can use these pinouts when you wirewrap your breadboard with a socket. Appendix I PACT.H. Gives PACT.H macros used with PACT example programs. Appendix J iv Electrical Specifications and Timings. Gives timing diagrams and electrical specifications for each of the device categories. Glossary. Defines acronyms and key terms used in this book. Style and Symbol Conventions Style and Symbol Conventions This document uses the following conventions. Symbol or Term Example Description (xxxxxx.n) SPICTL.4 Bit location convention used in text and figures, where 'xxxxxx' is the name of the register (e.g., SPICTL) containing the bit and 'n' is the bit number (7 = MSB, 0 = LSB). h 1ABCh Designates a number in the hexadecimal number system. P0n P012 Hexadecimal Peripheral File (PF) address used in instructions accessing the PF. (i.e., P012 = P18) Pn P18 Decimal Peripheral File (PF) address used in instructions accessing the PF. (i.e., P18 = P012). R0n R010 Hexadecimal Register File (RF) address used in instructions accessing the RF. (i.e., R010 = R16) Rn R16 Decimal Register File (RF) address used in instructions accessing the RF. (i.e., R16 = R010) set When used in reference to bits, means to write a logic 1 to the bit. clear When used in reference to bits, means to write a logic 0 to the bit. MSbyte Most significant byte MSB Most significant bit LSbyte Least significant byte LSB Least significant bit bps bits per second - Program listings, program examples, interactive displays, filenames, and symbol names are shown in a special typeface similar to a typewriter's. Here is a sample program listing: LABEL SUB R19,B ;(B) minus (R19) is ;stored in B SUB #076h,A ;(A) minus 076h is stored ;in A SUB R4,R9 ;(R9) minus (R4) is stored ;in R9 Read This First v Style and Symbol Conventions / Information About Cautions and Warnings - In syntax descriptions, the instruction, command, or directive is in a bold typeface font, and parameters are in an italic typeface. Portions of a syntax that are in bold should be entered as shown; portions of a syntax that are in italics describe the type of information that should be entered. Here is an example of a directive syntax: MOV s,d MOV is the instruction. This instruction has two parameters, indicated by s and d. - Braces ( { and } ) indicate a list. The symbol | (read as or ) separates items within the list. Here's an example of a command that has a list: TST {A| B} This provides two choices: TST A or TST B. Unless the list is enclosed in square brackets, you must choose one item from the list. Information About Cautions and Warnings This book may contain cautions and warnings. This is an example of a caution statement. A caution statement describes a situation that could potentially damage your software or equipment. This is an example of a warning statement. A warning statement describes a situation that could potentially cause harm to you. The information in a caution or a warning is provided for your protection; please read each carefully. vi Related Documentation From Texas Instruments Related Documentation From Texas Instruments The following books describe the TMS370 TMS370 family devices and related support tools. To obtain a copy of any of these TI documents, call the Texas Instruments Literature Response Center at (800) 4778924. When ordering, please identify the book by its title and literature number. TMS370 TMS370 Microcontroller Family Applications Book (literature number SPNA017 SPNA017) provides examples of hardware setups and accompanying software routines for various applications of the TMS370 TMS370 microcontroller. TMS370Cxxx 8-Bit Microcontrollers Data Sheets describe the features of the device and provide pinouts, electrical specifications, and timings for the following microprocessors: TMS370Cx0x (literature number SPNS029 SPNS029) TMS370Cx1x (literature number SPNS012 SPNS012) TMS370Cx2x (literature number SPNS018 SPNS018) TMS370Cx32 (literature number SPNS015 SPNS015) TMS370Cx36 (literature number SPNS039 SPNS039) TMS370Cx4x (literature number SPNS016 SPNS016) TMS370Cx5x (literature number SPNS010 SPNS010) TMS370Cx6x (literature number SPNS033 SPNS033) TMS370Cx7x (literature number SPNS034 SPNS034) TMS370Cx8x (literature number SPNS035 SPNS035) TMS370Cx9x (literature number SPNS036 SPNS036) TMS370CxAx (literature number SPNS037 SPNS037) TMS370CxBx (literature number SPNS038 SPNS038) TMS370CxCx (literature number SPNS040 SPNS040) TMS370 TMS370 8-Bit Microcontrollers Data Book (literature number SPND003 SPND003) is a collection of the TMS370Cxxx microcontroller data sheets into a single book with additional chapters that discuss ordering information, an overview of development tools, a selection guide with a crossreference of device functions, and quality and reliability. TMS370 TMS370 and TMS370C8 TMS370C8 8-Bit Microcontroller Family Assembly Language Tools User's Guide (literature number SPNU010 SPNU010) describes the assembly language tools (assembler, linker, and other tools used to develop assembly code), assembler directives, macros, common object file format, and symbolic debugging directives for the TMS370/C8 TMS370/C8 8-bit family of devices. TMS370 TMS370 and TMS370C8 TMS370C8 8-Bit Microcontroller Family Optimizing C Compiler User's Guide (literature number SPNU022 SPNU022) describes the TMS370/C8 TMS370/C8 8-bit C compiler. This C compiler accepts ANSI standard C source code and produces assembly language source code for the TMS370/C8 TMS370/C8 8-bit family of devices. Read This First vii Related Documentation From Texas Instruments / Trademarks TMS370 TMS370 Family C Source Debugger User's Guide (literature number SPNU028 SPNU028) tells you how to invoke the '370 XDS/22 XDS/22 emulator and application board versions of the C source debugger interface. This book discusses various aspects of the debugger interface, including window management, command entry, code execution, data management, and breakpoints, and includes a tutorial that introduces basic debugger functionality. It also includes an advanced tutorial that introduces the breakpoint, trace, and timing features. Trademarks CROSSTALK is a trademark of Microstuf, Inc. HP700 HP700 is a trademark of Hewlett-Packard Company. Kermit is a registered trademark of Columbia University. MS-DOS is a registered trademark of Microsoft Corp. PC-DOS is a trademark of International Business Machines Corp. PROCOMM is a registered trademark of Datastorm Technologies Inc. UNIX is a registered trademark of Unix System Laboratories, Inc. VAX and VMS are trademarks of Digital Equipment Corp. XDS is a trademark of Texas Instruments Incorporated. viii If You Need Assistance If You Need Assistance. . . If you want to. . . Do this. . . Request more information about Texas Instruments microcontroller products Write to: Texas Instruments Incorporated Market Communications Manager, MS 736 P.O. Box 1443 Houston, Texas 772511443 Order Texas Instruments documentation Call the TI Literature Response Center: (800) 4778924 Ask questions about product operation or report suspected problems Call the Microcontroller Hotline: (713) 2742370 FAX: (713) 2744203 Product information Web address: http://www.ti.com/sc/micro Product Information Center: (214) 644-5580 Report mistakes in this document or any other TI documentation Send your comments to: Texas Instruments Incorporated Technical Publications Manager, MS 702 P.O. Box 1443 Houston, Texas 772511443 Read This First ix x Contents Contents 1 Introduction to the TMS370 TMS370 Family Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Discusses the key features and the major components of the TMS370 TMS370 family devices. Also includes block diagrams for each device category 1.1 1.2 1.3 1.4 1.5 1.6 1.7 2 TMS370 TMS370 Family Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 Provides pinouts and pin descriptions for the TMS370 TMS370 family device categories 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 3 Typical Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Available Development Support Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Device Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4 Key Features of the TMS370 TMS370 Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 Major Components of the TMS370 TMS370 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 Summary of Components by Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12 Device Block Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-21 TMS370Cx0x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 TMS370Cx1x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 TMS370Cx2x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 TMS370Cx32 Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 TMS370Cx36 Pinout and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11 TMS370Cx4x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14 TMS370Cx5x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16 TMS370Cx6x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20 TMS370Cx7x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24 TMS370Cx8x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27 TMS370Cx9x Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30 TMS370CxAx Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33 TMS370CxBx Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35 TMS370CxCx Pinouts and Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38 CPU and Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 The TMS370 TMS370 has a register-to-register architecture. This chapter describes the CPU registers and memory organization. 3.1 3.2 CPU/Register File Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Stack Pointer (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Status Register (ST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Program Counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 3-4 3-4 3-5 3-7 xi Contents 3.3 3.4 4 System and Digital I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Discusses the system and I/O configuration. Features and options are described, as well as the registers that control the configuration 4.1 4.2 4.3 4.4 5 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.1.1 Privilege Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.1.2 Clock Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.1.3 Oscillator Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.1.4 Automatic Wait States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 Low-Power and Idle Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 4.2.1 Standby Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8 4.2.2 Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 4.2.3 Using Interrupts to Exit From the Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . 4-10 4.2.4 Oscillator Power Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12 System Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 4.3.1 System Control and Configuration Register 0 (SCCR0) . . . . . . . . . . . . . . 4-13 4.3.2 System Control and Configuration Register 1 (SCCR1) . . . . . . . . . . . . . . 4-15 4.3.3 System Control and Configuration Register 2 (SCCR2) . . . . . . . . . . . . . . 4-16 Digital I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18 4.4.1 Configuration Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27 4.4.2 Microprocessor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29 4.4.3 Microcomputer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29 Interrupts and System Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 Discusses the internal and external interrupts of the TMS370 TMS370. The methods of device reset are also discussed. 5.1 xii Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 3.3.1 Register File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 3.3.2 Peripheral File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 3.3.3 Data EEPROM Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13 3.3.4 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 Memory Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16 3.4.1 Microcomputer Single-Chip Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 3.4.2 Microcomputer Mode With External Expansion (All Devices With Memory Expansion and Internal Program Memory) . . . . . . . . . . . . . . . . . . 3-19 3.4.3 Microprocessor Mode Without Internal Memory (Memory Expansion Devices Only) 3-24 3.4.4 Microprocessor Mode With Internal Program Memory (Memory Expansion Devices Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26 3.4.5 Memory Mode Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.1.1 Interrupt Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 5.1.2 External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 Contents 5.2 5.3 5.4 6 5-12 5-12 5-14 5-16 5-18 5-19 5-20 5-22 EPROM and EEPROM Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 Discusses the architecture and programming of the data EEPROM modules of the TMS370 TMS370 family and the program EPROM module of the TMS370C6xx and TMS370C7xx devices 6.1 6.2 6.3 6.4 7 Interrupt Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Interrupt 1 Control Register (INT1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Interrupt 2 Control Register (INT2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 Interrupt 3 Control Register (INT3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiple Interrupt Servicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1 Simple Reset Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.2 Reset Circuitry With Low-Voltage Detection . . . . . . . . . . . . . . . . . . . . . . . . Data EEPROM Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Data EEPROM Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 6.2.1 Write Protection Register (WPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 6.2.2 Data EEPROM Control Register (DEECTL) . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 Programming the Data EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 Program EPROM Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10 6.4.1 Erasing the EPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 6.4.2 Program EPROM Control Register (EPCTLx) . . . . . . . . . . . . . . . . . . . . . . . 6-12 6.4.3 Programming the Program EPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13 6.4.4 Write Protection of the Program EPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15 Timer 1 (T1) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 Discusses the architecture and programming of the timer 1 module 7.1 7.2 7.3 7.4 7.5 7.6 T1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 7.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 7.1.2 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 7.1.3 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5 General-Purpose Timer Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 7.2.1 16-Bit Resettable Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 7.2.2 Compare Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 7.2.3 Capture/Compare Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8 Operating Modes of the General-Purpose Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 7.3.1 Dual Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 7.3.2 Capture/Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13 Edge-Detection Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15 7.4.1 Dual Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15 7.4.2 Capture/Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15 Clock Prescaler/External Clock Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16 7.5.1 Event Counter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18 7.5.2 Pulse Accumulator Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20 Contents xiii Contents 7.7 7.8 7.9 8 7-21 7-23 7-25 7-27 7-28 7-29 7-29 7-29 7-30 7-32 7-34 7-36 7-38 7-40 7-43 Timer 2A (T2A) and Timer 2B (T2B) Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 Discusses the architecture and programming of the timer 2 module 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 xiv WD Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7.1 Standard WD Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7.2 Hard WD Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7.3 Simple Counter Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7.4 Summary of WD Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LowPower Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.8.1 Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.8.2 Standby Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.9.1 T1 Control Register 1 (T1CTL1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.9.2 T1 Control Register 2 (T1CTL2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.9.3 T1 Control Register 3 (T1CTL3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.9.4 T1 Control Register 4 (T1CTL4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.9.5 T1 Port Control Registers (T1PC1 and T1PC2) . . . . . . . . . . . . . . . . . . . . . 7.9.6 T1 Interrupt Priority Control Register (T1PRI) . . . . . . . . . . . . . . . . . . . . . . . T2n Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 8.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 8.1.2 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4 8.1.3 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4 T2n Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 8.2.1 16-Bit Resettable Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 8.2.2 Compare Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 8.2.3 Capture Register (Dual Capture Mode Only) . . . . . . . . . . . . . . . . . . . . . . . . . 8-7 8.2.4 Capture/Compare Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10 8.3.1 Dual Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10 8.3.2 Dual Capture Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11 Edge-Detection Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13 8.4.1 Dual Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13 8.4.2 Dual Capture Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13 Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14 8.5.1 Event Counter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15 8.5.2 Pulse Accumulator Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16 Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17 T2n Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17 8.8.1 T2n Control Register 1 (T2nCTL1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19 8.8.2 T2n Control Register 2 (T2nCTL2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20 8.8.3 T2n Control Register 3 (T2nCTL3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23 8.8.4 T2n Port Control Registers (T2nPC1 and T2nPC2) . . . . . . . . . . . . . . . . . . 8-26 8.8.5 T2n Interrupt Priority Control Register (T2nPRI) . . . . . . . . . . . . . . . . . . . . . 8-29 Contents 9 Serial Communications Interface 1 (SCI1) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1 Discusses the architecture and programming of serial communication interface SCI1 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 SCI1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2 9.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2 9.1.2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5 9.1.3 Communications Modes and Multiprocessing Modes . . . . . . . . . . . . . . . . . 9-5 9.1.4 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6 SCI1 Programmable Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7 Multiprocessor Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8 9.3.1 Idle Line Multiprocessor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9 9.3.2 Address Bit Multiprocessor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10 Communications Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12 9.4.1 Asynchronous Communications Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12 9.4.2 Isosynchronous Communications Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13 9.4.3 Receiver Signals in Communications Modes . . . . . . . . . . . . . . . . . . . . . . . 9-13 9.4.4 Transmitter Signals in Communications Modes . . . . . . . . . . . . . . . . . . . . . 9-14 Port Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15 Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16 Initialization Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-18 9.7.1 RS-232-C RS-232-C Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-18 9.7.2 RS-232-C RS-232-C Multiprocessor Mode Example . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19 SCI1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21 9.8.1 SCI Communication Control Register (SCICCR) . . . . . . . . . . . . . . . . . . . . 9-22 9.8.2 SCI Control Register (SCICTL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24 9.8.3 Baud Select Registers (BAUD MSB and BAUD LSB) . . . . . . . . . . . . . . . . 9-27 9.8.4 SCI Transmitter Interrupt Control and Status Register (TXCTL) . . . . . . . 9-28 9.8.5 SCI Receiver Interrupt Control and Status Register (RXCTL) . . . . . . . . . 9-29 9.8.6 SCI Receiver Data Buffer Register (RXBUF) . . . . . . . . . . . . . . . . . . . . . . . 9-31 9.8.7 SCI Transmitter Data Buffer Register (TXBUF) . . . . . . . . . . . . . . . . . . . . . . 9-31 9.8.8 SCI Port Control Register 1 (SCIPC1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32 9.8.9 SCI Port Control Register 2 (SCIPC2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33 9.8.10 SCI Priority Control Register (SCIPRI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-35 10 Serial Communications Interface 2 (SCI2) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1 Discusses the architecture and programming of serial communication interface SCI2 10.1 10.2 10.3 SCI2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.3 Communications Modes and Multiprocessing Modes . . . . . . . . . . . . . . . . 10.1.4 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Programmable Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiprocessor Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3.1 Idle Line Multiprocessor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3.2 Address Bit Multiprocessor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents 10-2 10-2 10-3 10-4 10-4 10-6 10-7 10-8 10-9 xv Contents 10.4 10.5 10.6 10.7 10.8 Asynchronous Communications Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.1 Receiver Signals in the Communication Mode . . . . . . . . . . . . . . . . . . . . . 10.4.2 Transmitter Signals in the Communication Mode . . . . . . . . . . . . . . . . . . . Port Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clock Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initialization Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.7.1 RS-232-C RS-232-C Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.7.2 RS-232-C RS-232-C Multiprocessor Mode Example . . . . . . . . . . . . . . . . . . . . . . . . . SCI2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.8.1 SCI Communication Control Register (SCICCR) . . . . . . . . . . . . . . . . . . . 10.8.2 SCI Control Register (SCICTL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.8.3 Baud Select Registers (BAUD MSB and BAUD LSB) . . . . . . . . . . . . . . . 10.8.4 SCI Transmitter Interrupt Control and Status Register (TXCTL) . . . . . . 10.8.5 SCI Receiver Interrupt Control and Status Register (RXCTL) . . . . . . . . 10.8.6 SCI Receiver Data Buffer Register (RXBUF) . . . . . . . . . . . . . . . . . . . . . . 10.8.7 SCI Transmitter Data Buffer Register (TXBUF) . . . . . . . . . . . . . . . . . . . . . 10.8.8 SCI Port Control Register 2 (SCIPC2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.8.9 SCI Priority Control Register (SCIPRI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10 10-10 10-10 10-12 10-13 10-14 10-14 10-15 10-17 10-18 10-20 10-22 10-23 10-24 10-26 10-26 10-27 10-29 11 Serial Peripheral Interface (SPI) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1 Discusses the architecture and programming of the serial peripheral interface 11.1 SPI Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 11.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 11.1.2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4 11.2 Communications Between the Master and the Slave . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5 11.3 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6 11.3.1 Master Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6 11.3.2 Slave Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6 11.4 Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8 11.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9 11.6 Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10 11.7 Initialization Upon Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11 11.8 SPI Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12 11.9 SPI Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-13 11.9.1 SPI Configuration Control Register (SPICCR) . . . . . . . . . . . . . . . . . . . . . 11-14 11.9.2 SPI Operation Control Register (SPICTL) . . . . . . . . . . . . . . . . . . . . . . . . . 11-16 11.9.3 Serial Input Buffer (SPIBUF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-18 11.9.4 Serial Data Register (SPIDAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-18 11.9.5 SPI Port Control Registers (SPIPC1 and SPIPC2) . . . . . . . . . . . . . . . . . . 11-19 11.9.6 SPI Interrupt Priority Control Register (SPIPRI) . . . . . . . . . . . . . . . . . . . . 11-22 12 Analog-To-Digital Converter 1 (ADC1) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Discusses the architecture and programming of the ADC1 12.1 Analog-to-Digital Converter 1 (ADC1) Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1.2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi 12-1 12-2 12-2 12-4 Contents 12.2 12.3 12.4 ADC1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5 12.2.1 Input/Output Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5 12.2.2 Sampling Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-6 12.2.3 ADC1 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-6 12.2.4 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7 12.2.5 Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8 ADC1 Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9 ADC1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-11 12.4.1 Analog Control Register (ADCTL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12 12.4.2 Analog Status and Interrupt Register (ADSTAT) . . . . . . . . . . . . . . . . . . . . 12-14 12.4.3 Analog Conversion Data Register (ADDATA) . . . . . . . . . . . . . . . . . . . . . . 12-15 12.4.4 Analog Port E Data Input Register (ADIN) . . . . . . . . . . . . . . . . . . . . . . . . . 12-15 12.4.5 Analog Port E Input Enable Register (ADENA) . . . . . . . . . . . . . . . . . . . . . 12-16 12.4.6 Analog Interrupt Priority Register (ADPRI) . . . . . . . . . . . . . . . . . . . . . . . . . 12-17 13 Analog-To-Digital Converter 2 (ADC2) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1 Discusses the architecture and programming of the ADC2 13.1 Analog-to-Digital Converter 2 (ADC2) Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2 13.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2 13.1.2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4 13.2 ADC2 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5 13.2.1 Input/Output Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5 13.2.2 Sampling Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5 13.2.3 ADC2 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5 13.2.4 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6 13.2.5 Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7 13.3 ADC2 Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-8 13.4 ADC2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-10 13.4.1 Analog Control Register (ADCTL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-11 13.4.2 Analog Status and Interrupt Register (ADSTAT) . . . . . . . . . . . . . . . . . . . . 13-13 13.4.3 Analog Conversion Data Register (ADDATA) . . . . . . . . . . . . . . . . . . . . . . 13-13 13.4.4 Analog Port E Data Input Register (ADIN) . . . . . . . . . . . . . . . . . . . . . . . . . 13-14 13.4.5 Analog Port E Input Enable Register (ADENA) . . . . . . . . . . . . . . . . . . . . . 13-14 13.4.6 Analog Interrupt Priority Register (ADPRI) . . . . . . . . . . . . . . . . . . . . . . . . . 13-15 14 Analog-To-Digital Converter 3 (ADC3) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Discusses the architecture and programming of the ADC3 14.1 Analog-to-Digital Converter 3 (ADC3) Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.1.2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.2 ADC3 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.2.1 Input/Output Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.2.2 Sampling Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.2.3 ADC3 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.2.4 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.2.5 Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents 14-1 14-2 14-2 14-4 14-5 14-5 14-5 14-6 14-7 14-8 xvii Contents 14.3 14.4 ADC3 Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-9 ADC3 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-11 14.4.1 Analog Control Register (ADCTL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-12 14.4.2 Analog Status and Interrupt Register (ADSTAT) . . . . . . . . . . . . . . . . . . . . 14-14 14.4.3 Analog Conversion Data Register (ADDATA) . . . . . . . . . . . . . . . . . . . . . . 14-15 14.4.4 Analog Port E Data Input Register (ADIN) . . . . . . . . . . . . . . . . . . . . . . . . . 14-15 14.4.5 Analog Port E Input Enable Register (ADENA) . . . . . . . . . . . . . . . . . . . . . 14-16 14.4.6 Analog Interrupt Priority Register (ADPRI) . . . . . . . . . . . . . . . . . . . . . . . . . 14-16 15 Programmable Acquisition and Control Timer (PACT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1 Discusses the architecture and programming of the programmable acquisition and control timer (PACT) module. Even if you have extensive experience with microcontroller timers, you should read this chapter to fully understand how to use the TMS370 TMS370 PACT module. 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 15.10 xviii PACT Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2 15.1.1 Physical Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2 15.1.2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4 PACT Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5 15.2.1 Hardware Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5 15.2.2 Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5 15.2.3 Time Base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7 15.2.4 Command/Definition File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7 15.2.5 Available Time Slots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7 Dual-Port RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-9 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-12 Control and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-15 15.5.1 Standard Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-16 15.5.2 Virtual Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-17 15.5.3 Double Event Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-18 15.5.4 Offset Timer Definition-Time From the Last Event . . . . . . . . . . . . . . . . . 15-19 15.5.5 Conditional Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-20 15.5.6 Baud Rate Timer Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-20 Command/Definition Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-21 15.6.1 Virtual Timer Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-22 15.6.2 Offset Timer Definition-Time From Last Event . . . . . . . . . . . . . . . . . . . . 15-23 15.6.3 Baud Rate Timer Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-24 15.6.4 Standard Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-25 15.6.5 Double Event Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-26 15.6.6 Conditional Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-28 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-29 WD Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-31 Mini-Serial Communications Interface (SCI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-32 PWM Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-33 15.10.1 Defining the Command/Definition Area . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-33 15.10.2 Copying the Command/Definition Area to Dual-Port RAM . . . . . . . . . . . 15-34 15.10.3 Initializing the PACT Peripheral Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-35 Contents 15.11 PACT Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.1 Setup Control Register (PACTSCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.2 Command/Definition Area Start Register (CDSTART) . . . . . . . . . . . . . . . 15.11.3 Command/Definition Area End Register (CDEND) . . . . . . . . . . . . . . . . . . 15.11.4 Buffer Pointer Register (BUFPTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.5 PACT-SCI Control Register (SCICTLP) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.6 PACT-SCI RX Data Register (RXBUFP) . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.7 PACT-SCI TX Data Register (TXBUFP) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.8 Output Pins 18 State Register (OPSTATE) . . . . . . . . . . . . . . . . . . . . . . . 15.11.9 Command/Definition Entry Flags Register (CDFLAGS) . . . . . . . . . . . . . 15.11.10 Setup CP Control Register 1 (CPCTL1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.11 Setup CP Control Register 2 (CPCTL2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.12 Setup CP Control Register 3 (CPCTL3) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.13 CP Input Control Register (CPPRE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.11.14 Global Function Control Register (PACTPRI) . . . . . . . . . . . . . . . . . . . . . . 15-36 15-38 15-40 15-42 15-44 15-46 15-48 15-48 15-49 15-50 15-51 15-53 15-55 15-57 15-59 16 Assembly Language Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-1 Summarizes the TMS370 TMS370 family assembly language instruction set and provides individual instruction descriptions 16.1 16.2 16.3 16.4 16.5 Instruction Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-2 Symbol Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-3 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-4 16.3.1 Data Manipulation Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-5 16.3.2 Program Flow Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-15 16.3.3 Additional Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-22 16.3.4 Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-22 Instruction Set Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-23 Instruction Set Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-32 17 Development Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-1 Discusses the key features of the TMS370 TMS370 development tools. These tools are currently available for PC-DOS or MS-DOS systems. 17.1 17.2 17.3 17.4 17.5 17.6 17.7 TMS370 TMS370 Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-2 The Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-4 The Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-5 Additional Software Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-7 17.4.1 The Archiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-7 17.4.2 The Hex Conversion Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-7 The Optimizing C Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-8 The C Source Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-9 The XDS/22 XDS/22 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-12 17.7.1 Breakpoint, Trace, and Timing (BTT) Functions . . . . . . . . . . . . . . . . . . . . 17-13 17.7.2 XDS System Configuration Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 17-16 17.7.3 XDS System Operating Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-17 17.7.4 XDS Target Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-17 Contents xix Contents 17.8 17.9 17.10 17.11 17.12 The CDT370 CDT370 (Compact Development Tool) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17.8.1 The CDT370 CDT370 PACT (Compact Development Tool PACT) . . . . . . . . . . . . 17.8.2 The CDT370 CDT370 Timer (Compact Development Tool Timer) . . . . . . . . . . . . The Design Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Starter Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Microcontroller Programmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reprogrammable EPROM and OTP Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-18 17-19 17-19 17-20 17-24 17-25 17-26 18 Electrical Specifications and Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-1 Contains electrical and timing information for the TMS370 TMS370 family devices 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 18.10 18.11 18.12 18.13 18.14 18.15 xx Timing Parameter Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2 Parameter Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2 Absolute Maximum Ratings for All TMS370 TMS370 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . 18-3 External Crystal/Clock Connections and Typical Circuits for Loads and Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-4 General-Purpose Output Signal Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6 EPROM/EEPROM Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-7 TMS370Cx0xA and TMS370Cx0x Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-8 18.7.1 TMS370Cx0xA and TMS370Cx0x Electrical Specifications . . . . . . . . . . . 18-8 18.7.2 TMS370Cx0xA and TMS370Cx0x Timings . . . . . . . . . . . . . . . . . . . . . . . . 18-10 TMS370Cx1xA and TMS370Cx1xB Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-12 18.8.1 TMS370Cx1xA and TMS370Cx1xB Electrical Specifications . . . . . . . . . 18-12 18.8.2 TMS370Cx1xA and TMS370Cx1xB Timings . . . . . . . . . . . . . . . . . . . . . . . 18-14 TMS370Cx2xA and TMS370Cx2x Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-16 18.9.1 TMS370Cx2xA and TMS370Cx2x Electrical Specifications . . . . . . . . . . 18-16 18.9.2 TMS370Cx2xA and TMS370Cx2x Timings . . . . . . . . . . . . . . . . . . . . . . . . 18-18 TMS370Cx32A Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-20 18.10.1 TMS370Cx32A Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . 18-20 18.10.2 TMS370Cx32A Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-22 TMS370Cx36A Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-24 18.11.1 TMS370Cx36A Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . 18-24 18.11.2 TMS370Cx36A Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-27 TMS370Cx4xA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-29 18.12.1 TMS370Cx4xA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-29 18.12.2 TMS370Cx4xA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-32 TMS370Cx5xA and TMS370Cx5xB Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-34 18.13.1 TMS370Cx5xA and TMS370Cx5xB Electrical Specifications . . . . . . . . . 18-34 18.13.2 TMS370Cx5xA and TMS370Cx5xB Timings . . . . . . . . . . . . . . . . . . . . . . . 18-38 TMS370Cx6xA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-43 18.14.1 TMS370Cx6xA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-43 18.14.2 TMS370Cx6xA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-46 TMS370Cx7xA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-51 18.15.1 TMS370Cx7xA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-51 18.15.2 TMS370Cx7xA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-54 Contents 18.16 18.17 18.18 18.19 18.20 18.21 18.22 18.23 18.24 18.25 TMS370Cx8xA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.16.1 TMS370Cx8xA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.16.2 TMS370Cx8xA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TMS370Cx9xA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.17.1 TMS370Cx9xA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.17.2 TMS370Cx9xA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TMS370CxAxA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.18.1 TMS370CxAxA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . 18.18.2 TMS370CxAxA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TMS370CxBxA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.19.1 TMS370CxBxA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . 18.19.2 TMS370CxBxA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TMS370CxCxA Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18.20.1 TMS370CxCxA Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . 18.20.2 TMS370CxCxA Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SCI Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SPI Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Analog-to-Digital Converter 1 (ADC1) Module Specifications . . . . . . . . . . . . . . . . . . Analog-to-Digital Converter 2 (ADC2) Module Specifications . . . . . . . . . . . . . . . . . . Analog-to-Digital Converter 3 (ADC3) Module Specifications . . . . . . . . . . . . . . . . . . 18-57 18-57 18-59 18-62 18-62 18-65 18-68 18-68 18-70 18-73 18-73 18-76 18-79 18-79 18-81 18-84 18-86 18-89 18-92 18-94 19 Customer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-1 Describes mask-ROM prototyping, TMS370 TMS370 physical characteristics, and parts ordering 19.1 Mask-ROM Prototype and Production Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-2 19.2 Mechanical Package Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-6 19.3 TMS370 TMS370 Family Numbering and Symbol Conventions . . . . . . . . . . . . . . . . . . . . . . . . 19-16 19.3.1 Production Device Prefix Designators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-16 19.3.2 Support Device Prefix Designators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-17 19.3.3 Device Numbering Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-17 19.3.4 Device Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-17 19.3.5 Symbolization by Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-20 19.4 Ordering Information for Development Support Tools . . . . . . . . . . . . . . . . . . . . . . . . . 19-25 19.4.1 TMS370 TMS370 Macro Assembler, Linker, C Compiler, and Utilities . . . . . . . . . 19-25 19.4.2 TMS370 TMS370 Design Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-25 19.4.3 TMS370 TMS370 Starter Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-25 19.4.4 TMS370 TMS370 Microcontroller Programmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-26 19.4.5 TMS370 TMS370 XDS Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-26 19.4.6 TMS370 TMS370 Compact Development Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-26 19.4.7 TMS370 TMS370 Converter Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-27 19.4.8 XDS Target Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-27 A Differences Among the TMS370CxxxA, TMS370C7xxB, and TMS370Cxxx Devices (Contact Options) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1 Describes the differences found in comparing the different devices identified by the suffixes A, B, and no suffix. A.1 Watchdog (WD) Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2 A.2 Clock Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3 A.3 Low-Power and Idle Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4 A.4 Timer 1 Control Register 2 (T1CTL2) Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5 Contents xxi Contents A.5 A.6 A.7 A.8 A.9 A.10 System Control and Configuration Register 2 (SCCR2) Bits . . . . . . . . . . . . . . . . . . . . . A-5 AP Bit in the DEECTL Register (DEECTL.2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6 Program EPROM Control Register (EPCTLx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7 VCC1 and VCC2 Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7 Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8 A.9.1 Differences for TMS370Cx5x Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8 A.9.2 Differences in SCI1 and SPI Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . A-9 A.9.3 Differences in EPROM Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10 Summary of Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-11 B Peripheral File Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1 Summarizes the peripheral file and control bit information B.1 Read/Write Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2 B.2 Peripheral File Frame 1: System Configuration Registers . . . . . . . . . . . . . . . . . . . . . . . B-3 B.3 Peripheral File Frame 2: Digital Port Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . B-4 B.4 Peripheral File Frame 3: SPI Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-5 B.5 Peripheral File Frame 4: Timer 1 (T1) Control Registers . . . . . . . . . . . . . . . . . . . . . . . . B-6 B.6 Peripheral File Frame 4: PACT Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-7 B.7 Peripheral File Frame 5: SCI1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-8 B.8 Peripheral File Frame 5: SCI2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-9 B.9 Peripheral File Frame 6: Timer 2A (T2A) Control Registers . . . . . . . . . . . . . . . . . . . . . B-10 B.10 Peripheral File Frame 7: ADC1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-11 B.11 Peripheral File Frame 7: ADC2 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-12 B.12 Peripheral File Frame 7: ADC3 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-13 B.13 Peripheral File Frame 8: Timer 2B (T2B) Control Registers . . . . . . . . . . . . . . . . . . . . . B-14 C Block Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1 Summarizes the block diagrams of the major circuits C.1 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2 C.2 Timer 1 (T1) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-4 C.3 Timer 2n (T2n) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-8 C.4 Serial Communications Interface 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-10 C.5 Serial Communications Interface 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-11 C.6 Serial Peripheral Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-12 C.7 Analog-to-Digital Converter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-13 C.8 Analog-to-Digital Converter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-14 C.9 Analog-to-Digital Converter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-15 D ASCII Character Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1 Lists the ASCII character set that the TMS370 TMS370 assembler recognizes E Opcode/Instruction Cross-Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1 Contains an opcode-to-instruction cross-reference F Instruction/Opcode Cross-Reference and Bus Activity Table . . . . . . . . . . . . . . . . . . . . . . . . F-1 Contains both an instruction-to-opcode cross reference and an instruction bus activity table. The bus activity table specifies the cycle-by-cycle actions of a given instruction. F.1 Instruction/Opcode Cross-Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-2 F.2 Bus Activity Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-6 xxii Contents G Device Pinouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-1 Provides pinouts for the individual device categories H PLCC-to-PGA Socket Pinouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H-1 Shows the pinouts for the standard PLCC to PGA sockets that are commonly used in prototype and production applications. You can use these pinouts when you wirewrap your breadboard with a socket. I PACT.H MACROS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-1 Lists and describes the macros that are defined in the PACT.H file I.1 I.2 I.3 J General Comments About Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I.1.1 Addressing Commands and Definitions in Dual-Port RAM . . . . . . . . . . . . . . I.1.2 Defining Output Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I.1.3 Defining Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comments About Specific Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I.2.1 Standard Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I.2.2 Conditional Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I.2.3 Virtual Timer Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I.2.4 Baud Timer Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PACT.H Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-2 I-2 I-3 I-3 I-4 I-4 I-4 I-4 I-4 I-5 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J-1 Defines acronyms and key terms used in this book Contents xxiii Figures Figures 11 12 13 14 15 16 17 18 19 110 111 112 113 114 21 22 23 24 25 26 27 28 29 210 211 212 213 214 31 32 33 34 35 36 37 38 xxiv TMS370Cx0x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-21 TMS370Cx1x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-22 TMS370Cx2x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23 TMS370Cx32 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24 TMS370Cx36 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-25 TMS370Cx4x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-26 TMS370Cx5x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27 TMS370Cx6x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-28 TMS370Cx7x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-29 TMS370Cx8x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-30 TMS370Cx9x Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31 TMS370CxAx Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-32 TMS370CxBx Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-33 TMS370CxCx Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-34 Pinouts for TMS370Cx0x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Pinouts for TMS370Cx1x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 Pinouts for TMS370Cx2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 Pinout for TMS370Cx32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 Pinout for TMS370Cx36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11 Pinouts for TMS370Cx4x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14 Pinouts for TMS370Cx5x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16 Pinouts for TMS370Cx6x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20 Pinouts for TMS370Cx7x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24 Pinouts for TMS370Cx8x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27 Pinouts for TMS370Cx9x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30 Pinouts for TMS370CxAx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33 Pinouts for TMS370CxBx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35 Pinouts for TMS370CxCx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38 Programmer's Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Stack Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Program Counter After Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 TMS370 TMS370 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Register File Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Microcomputer Single-Chip Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 Microcomputer Mode With Function A Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22 Microcomputer Mode With Function B Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23 Figures 39 310 41 42 43 44 45 46 51 52 53 54 55 56 61 62 63 71 72 73 74 75 76 77 78 79 710 81 82 83 84 85 91 92 93 94 95 96 97 98 99 910 101 102 Microprocessor Mode Without Internal Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25 Microprocessor Mode With Internal Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28 Peripheral File Frame 1: System Configuration and Control Registers . . . . . . . . . . . . . . . . 4-2 Correct Method to Enter Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 Improper Method to Enter Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 Peripheral File Frames 2 and 3: Digital Port Control Registers . . . . . . . . . . . . . . . . . . . . . 4-21 Typical Control-Register Operation Using Port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22 System Interface Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30 Interrupt Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Peripheral File Frame 1: External Interrupt Control Registers . . . . . . . . . . . . . . . . . . . . . . . 5-9 Interrupt 1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Interrupts 2 and 3 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 Simple Reset Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21 Typical Reset Circuit Using a Supply Voltage Supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 Write Protection Bits in an EEPROM Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 EEPROM Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7 EPROM Programming Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 T1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 Dual Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11 Capture/Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14 T1 System Clock Prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16 Pulse Accumulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19 WD Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22 Standard WD Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23 Hard WD Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25 Simple Counter Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27 Peripheral File Frame 4: T1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31 T2n Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3 Dual Compare Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11 Dual Capture Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12 T2n Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14 Peripheral File Frames 6 (T2A) and 8 (T2B): T2n Control Registers . . . . . . . . . . . . . . . . . 8-18 SCI1 Block Diagram - Three Pin Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4 SCI1 Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7 Idle Line Multiprocessor Communication Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9 Double-Buffered WUT and TXSHF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9 Address Bit Multiprocessor Communication Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11 Asynchronous Communication Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12 Isosynchronous Communication Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13 SCI1 RX Signals in Communications Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14 SCI1 TX Signals in Communications Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14 Peripheral File Frame 5: SCI1 Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21 SCI2 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3 SCI2 Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6 Contents xxv Figures 103 104 105 106 107 111 112 113 121 122 123 131 132 133 141 142 143 151 152 153 154 155 156 157 158 159 1510 161 162 163 164 165 166 167 168 169 1610 1611 1612 1613 1614 1615 1616 1617 xxvi Idle Line Multiprocessor Communication Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8 Double-Buffered WUT and TXSHF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8 Address Bit Multiprocessor Communication Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9 SCI2 RX Signals in Communications Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10 SCI2 TX Signals in the Communication Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11 SPI Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 SPI Master/Slave Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5 Peripheral File Frame 3: SPI Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-13 Analog-to-Digital Converter1 (ADC1) Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3 Ratiometric Conversion Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7 Peripheral File Frame 7: ADC1 Converter Control Registers . . . . . . . . . . . . . . . . . . . . . . 12-11 Analog-to-Digital Converter 2 (ADC2) Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3 Ratiometric Conversion Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6 Peripheral File Frame 7: ADC2 Converter Control Registers . . . . . . . . . . . . . . . . . . . . . . 13-10 Analog-to-Digital Converter 3 (ADC3) Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3 Ratiometric Conversion Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-7 Peripheral File Frame 7: ADC3 Converter Control Registers . . . . . . . . . . . . . . . . . . . . . . 14-11 PACT Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3 TMS370 TMS370 Memory Map Highlighting PACT Areas of the 'Cx36 and 'Cx32 . . . . . . . . . . . . . 15-6 Prescaler Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7 Dual-Port RAM Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-10 Input Capture Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-13 Output Control Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-15 Standard Compare Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-16 Virtual Timer Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-17 Interrupt Vector Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-29 Peripheral File Frame 4: PACT Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-37 Implied Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-6 Register Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-7 Peripheral Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-8 Immediate Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-9 Stack Pointer Relative Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-10 Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-11 Indexed Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-12 Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-13 Offset Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-14 Program Counter Relative Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-16 Absolute Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-17 Relative Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-17 Absolute Indexed Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-18 Relative Indexed Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-19 Absolute Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-20 Relative Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-20 Absolute Offset Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-21 Figures 1618 1619 171 172 173 174 175 176 177 178 179 1710 1711 181 182 183 184 185 186 187 188 189 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 Relative Offset Indirect Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-22 Status Register (ST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-22 Software Development Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-3 Linker Output Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-6 The Basic Debugger Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-9 Debugger Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-10 BTT Setup Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-13 Dialog Box for Defining Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-14 Example of the Inspect Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-14 Typical XDS System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-16 CDT370 CDT370 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-19 Application Board (Design Kit Board) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-21 Starter Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-24 Measurement Points for Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2 Recommended Crystal/Clock Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-4 Typical Output Load Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-4 Typical Buffer Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-5 Switching Time Measurement Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-10 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-11 SYSCLK TIming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-11 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-14 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-15 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-15 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-18 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-19 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-19 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-22 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-23 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-23 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-27 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-28 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-28 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-32 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-33 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-33 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-38 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-39 External Read Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-41 External Write Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-42 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-46 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-47 External Read Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-49 External Write Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-50 Contents xxvii Figures 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 191 192 193 194 195 196 197 198 199 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 xxviii External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-54 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-55 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-56 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-59 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-60 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-61 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-65 External Clock Timing for Divide-by-1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-66 SYSCLK Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-67 External Clock Timing for Divide-by-4 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-70 External Clock Timing for Divide-by-1 Clock . . . . . . .