Page 2 - IMPORTANT NOTICE
IMPORTANT NOTICE Texas Instruments and its subsidiaries (TI) reserve the right to make changes to their productsor to discontinue any product or service without notice, and advise customers to obtain the latestversion of relevant information to verify, before placing orders, that information being r...
Page 3 - Preface; Read This First; About This Manual; special typeface; bold
iii Read This First Preface Read This First About This Manual This user’s guide gives information for the MSP50C6xx mixed-signal proces-sor. This information includes a functional overview, a detailed architecturaldescription, device peripheral functional description, assembly languageinstruction li...
Page 4 - Here is a sample program listing:; LALK; This provides three choices:
Notational Conventions iv Here is a sample program listing: 0011 0005 0001 .field 1, 2 0012 0005 0003 .field 3, 4 0013 0005 0006 .field 6, 3 0014 0006 .even Here is an example of a system prompt and a command that you mightenter: C: csr –a /user/ti/simuboard/utilities - In syntax descriptions, the i...
Page 5 - value; Information About Cautions and Warnings; This book may contain cautions and warnings.; This is an example of a caution statement.; Trademarks; Intel, i486, and Pentium are trademarks of Intel Corporation.
Information About Cautions and Warnings v Read This First .byte value 1 [, ... , value n ] This syntax shows that .byte must have at least one value parameter, butyou have the option of supplying additional value parameters, separatedby commas. Information About Cautions and Warnings This book may c...
Page 7 - Contents; Introduction to the MSP50C6xx
Contents vii Contents 1 Introduction to the MSP50C6xx 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Features of the MSP50C6xx 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Appl...
Page 8 - Peripheral Functions
Contents viii 3 Peripheral Functions 3-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 I/O 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Page 9 - Code Development Tools
Contents ix Contents 4.4 Instruction Classification 4-22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.2 Class 2 Instructions: Accumulator and Constant Reference 4-28 . . . . . . . . . . . . . . 4.4.3 Class 3 Instruction: Accumulator Refe...
Page 10 - Applications
Contents x 5.6 Implementation Details 5-24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1 Comparisons 5-24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.2 Division 5-26 ...
Page 11 - Figures
Figures xi Contents Figures 1–1 Functional Block Diagram for the MSP50C614/MSP50P614 1-5 . . . . . . . . . . . . . . . . . . . . . . . . 1–2 Oscillator and PLL Connection 1-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–3 RESET Circuit 1-8 . ....
Page 12 - Tables
Tables xii Tables 2–1 Signed and Unsigned Integer Representation 2-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2 Summary of MSP50C614’s Peripheral Communications Ports 2-17 . . . . . . . . . . . . . . . . . . . . . 2–3 Programmable Bits Needed to Control Reduced Pow...
Page 15 - Topic; Features of the MSP50C6xx; Chapter 1
1-1 Introduction to the MSP50C6xx The MSP50C6xx is a low cost, mixed signal controller, that combines a speechsynthesizer, general-purpose input/output (I/O), onboard ROM, and directspeaker-drive in a single package. The computational unit utilizes a powerfulnew DSP which gives the MSP50C6xx unprece...
Page 17 - Consumer; Medical; Telecom
Applications 1-3 Introduction to the MSP50C6xx 1.2 Applications Due to its low cost, low-power consumption, and high programmability, theMSP50C6xx is suitable for a wide variety of applications incorporating flexibleI/O and high-quality speech: - Consumer - Education Toys and Games Electronic Learni...
Page 19 - Functional Description for the MSP50C614
Functional Description for the MSP50C614 1-5 Introduction to the MSP50C6xx 1.4 Functional Description for the MSP50C614 The MSP50C614 device consists of a micro-DSP core, embedded programand data memory, and a self-contained clock generation system. General-pur-pose periphery is comprised of 64 bits...
Page 21 - Figure 1–2. Oscillator and PLL Connection; a) Crystal Reference Oscillator Connections
Functional Description for the MSP50C614 1-7 Introduction to the MSP50C6xx Figure 1–2. Oscillator and PLL Connection MSP50P614 MSP50C6xx OSCIN OSCOUT PLL C(PLL) = 3300 pF† 22 pF† 22 pF† 10 M Ω † 10 M Ω † 32.768 kHz† † Keep these components as close as possible to the OSCIN, OSCOUT, and PLL pins. a) ...
Page 22 - Figure 1–3. RESET Circuit
Functional Description for the MSP50C614 1-8 Rounding out the MSP50C6xx periphery is a built in pulse-density-modulated(PDM) digital-to-analog converter (DAC) with direct speaker-drive capability. Typical connections to implement reset functionality are shown in Figure 1–3. An external reset circuit...
Page 25 - MSP50C6xx Architecture; Chapter 2
2-1 MSP50C6xx Architecture A detailed description of the MSP50C6xx architecture is included in this chap-ter. After reading this chapter, the reader will have in-depth knowledge of inter-nal blocks, memory organization, interrupt system, timers, clock control mech-anism, and various low power modes....
Page 26 - Architecture Overview
2-2 2.1 Architecture Overview The core processor in the C6xx is a medium performance mixed signal proces-sor with enhanced microcontroller features and a limited DSP instruction set.In addition to its basic multiply/accumulate structure for DSP routines, the coreprovides for a very efficient handlin...
Page 27 - Figure 2–1. MSP50C6xx Core Processor Block Diagram
2-3 MSP50C6xx Architecture Figure 2–1. MSP50C6xx Core Processor Block Diagram Multiplier (MR)† Shift Value (SV)† 17 x 17 Multiplier Product High (PH)† 16 bit ALU MUX 32 Accumulators (AC0–AC31)† Column Exchange Loop (R4) Index (R5) Page (R6) Stack (R7) R0 R1 R2 R3 Arithmetic Unit MUX MUX Data Memory ...
Page 28 - Figure 2–2. Computational Unit Block Diagram
2-4 Figure 2–2. Computational Unit Block Diagram Accumulators 5 16 AC3 AC2 AC1 AC0 Read/Write AC7 AC6 AC5 AC4 AC11 AC10 AC9 AC8 AC15 AC14 AC13 AC12 AC19 AC18 AC17 AC16 AC23 AC22 AC21 AC20 AC27 AC26 AC25 AC24 AC31 AC30 AC29 AC28 AP3 AP2 AP1 AP0 5 Internal Databus – 16 bit Shift Value (SV) Multiplier ...
Page 29 - Computation Unit; Multiplier; Table 2–1. Signed and Unsigned Integer Representation
Computation Unit 2-5 MSP50C6xx Architecture 2.2 Computation Unit The computational unit (CU) is comprised of a (17-bit by 17-bit) Booth’salgorithm multiplier and a 16-bit arithmetic logic unit (ALU). The block diagramof the CU is shown in Figure 2–2. The multiplier block is served by 4 systemregiste...
Page 31 - Figure 2–3. Overview of the Multiplier Unit Operation; Arithmetic Logic Unit
Computation Unit 2-7 MSP50C6xx Architecture Figure 2–3. Overview of the Multiplier Unit Operation MULTIPLIER UNIT INPUTS Multiplicand 16-bit - latched in a write-only registerfrom one of the following sources ... Data MemoryAccumulator Offset Accumulator X Multiplier - writeable and readable by Data...
Page 32 - Accumulator Block
Computation Unit 2-8 The all-zero values are necessary for data transfers and unitary operations.All-zeros also serve as default values for the registers, which helps to minimizeresidual power consumption. The databus path through ALU-A is used to inputmemory values (RAM) and constant values (progra...
Page 33 - Figure 2–4. Overview of the Arithmetic Logic Unit; Accumulator Pointer Block
Computation Unit 2-9 MSP50C6xx Architecture Figure 2–4. Overview of the Arithmetic Logic Unit ALU INPUTS ALU-A 16-bit - selects between ... all 0’sOffset Accumulator Register Data Memory ALU-B 16-bit - selects between ... (PH) (PL) ARITHMETIC LOGIC UNIT performs arithmetic, comparison, and logic ALU...
Page 34 - Figure 2–5. Overview of the Accumulators; Accumulator Block Pointers:; String Operations
Computation Unit 2-10 When writing an accumulator-referenced instruction, therefore, the workingaccumulator address is stored in one of AP0 to AP3. The C6xx instruction setprovides a two-bit field for all accumulator referenced instructions. The two-bitfield serves as a reference to the accumulator ...
Page 35 - Data Memory Address Unit
Data Memory Address Unit 2-11 MSP50C6xx Architecture For some instructions, the 5-bit string processor can also preincrement orpredecrement the AP pointer-value by +1 or –1, before being used by theaccumulator register block. This utility can be effectively used to minimizesoftware overhead in manip...
Page 36 - Figure 2–6. Data Memory Address Unit; RAM Configuration
Data Memory Address Unit 2-12 Figure 2–6. Data Memory Address Unit R3 R2 R1 R0 R7 R6 R5 R4 InternalDatabus Arithmetic Block RAM Address Internal Program Bus Register Addressing Mode STACK PAGE INDEX LOOP 2.3.1 RAM Configuration The data memory block (RAM) is physically organized into 17-bit parallel...
Page 37 - Data Memory Addressing Modes; Direct addressing
Data Memory Address Unit 2-13 MSP50C6xx Architecture There are two-byte instructions, for example MOVB, which cause the proces-sor to read or write data in a byte (8-bit) format. (The B appearing at the endof MOVB designates it as an instruction that uses byte-addressable argu-ments.) The byte-addre...
Page 38 - Program Counter Unit
Program Counter Unit 2-14 2.4 Program Counter Unit The program counter unit provides addressing for program memory (onboardROM). It includes a 16-bit arithmetic block for incrementing and loadingaddresses. It also consists of the program counter (PC), the data pointer (DP),a buffer register, a code ...
Page 39 - Memory Organization: RAM and ROM; Memory Map
Memory Organization: RAM and ROM 2-15 MSP50C6xx Architecture 2.6 Memory Organization: RAM and ROM Data memory (RAM) and program memory (ROM) are each restricted tointernal blocks on the C6xx. The program memory is read-only and limited to32K, 17-bit words. The lower 2048 of these words is reserved f...
Page 41 - Table 2–2. Summary of MSP50C614’s Peripheral Communications Ports
Memory Organization: RAM and ROM 2-17 MSP50C6xx Architecture When writing to any of the locations in the I/O address map, therefore, thebit-masking need only extend as far as width of location. Within a 16-bitaccumulator, the desired bits (width of location) should be right-justified. Thewrite opera...
Page 42 - Interrupt Vectors; Interrupt Name; ROM Locations that Hold Interrupt Vectors
Memory Organization: RAM and ROM 2-18 Table 2–2. Summary of C614’s Peripheral Communications Ports (Continued) I/O Map Address Width of Location Allowable Access Control Register Name Abbreviation State after RESET LOW Section for Reference 0x39 8 bits Read & Write Interrupt flag IFR Same state ...
Page 43 - ROM Code Security; Direct read and write protection, via the ROM scan circuit.
Memory Organization: RAM and ROM 2-19 MSP50C6xx Architecture The branch to the program location that is specified in the interrupt vector is,of course, contingent on the occurrence of the trigger event. Refer to Section3.1.5, Internal and External Interrupts, for more information regarding thespecif...
Page 44 - Instructions with References; Block Protection Word
Memory Organization: RAM and ROM 2-20 Note: Instructions with References Care must be taken when employing instructions that have either long stringconstant references or look-up table references. These instructions willexecute properly only if the address of the instruction and the address of theda...
Page 45 - Block Protection Mode
Memory Organization: RAM and ROM 2-21 MSP50C6xx Architecture [(N TM + 1) * 512 – 1] = highest ROM address within the block to be protected (N TM + 1) * 512 = lowest ROM address which is left unprotected N TM = the value programmed at TM5 … TM0 (true protection marker) N FM ≡ the binary complement of...
Page 46 - jeopardize code security.; Macro Call Vectors; Interrupt Logic
Interrupt Logic 2-22 When the device is powered up, the hardware initialization circuit reads thevalue stored in the block protection word. The value is then loaded to an inter-nal register and the security state of the ROM is identified. Until this occurs,execution of any instructions is suspended....
Page 47 - IFR
Interrupt Logic 2-23 MSP50C6xx Architecture automatically SET in the interrupt flag register (IFR). The IFR is an 8-bit wideport-addressed register; wherein, each interrupt level is represented. A set bitin the IFR indicates that the interrupt is pending and waiting to be serviced. Aclear bit indica...
Page 48 - Setting a Bit in the IFR Using the OUT Instruction
Interrupt Logic 2-24 Note: Setting a Bit in the IFR Using the OUT Instruction Setting a bit within the IFR using the OUT instruction is a valid way of obtain-ing a software interrupt. An IFR bit may also be cleared, using OUT, at anytime. Assuming the global interrupt enable is set and the specific ...
Page 49 - Figure 2–8. Interrupt Initialization Sequence
Interrupt Logic 2-25 MSP50C6xx Architecture Figure 2–8 provides an overview of the interrupt control sequence. INT0 is thehighest priority interrupt, and INT7 is the lowest priority interrupt. Figure 2–8. Interrupt Initialization Sequence INTD instruction CLEAR INTE instruction SET Global Interrupt ...
Page 50 - Clock Control; Oscillator Options; and OSC; and OSC; PLL Performance
Clock Control 2-26 In addition to being individually enabled, all interrupts must be GLOBALLYenabled before any one can be serviced. Whenever interrupts are globallydisabled, the interrupt flag register may still receive updates on pending triggerevents. Those trigger events, however, are not servic...
Page 51 - range. This rate applies to the speed of the core processor. Higher; Figure 2–9. PLL Performance
Clock Control 2-27 MSP50C6xx Architecture therefore, is 131.07 kHz, and the multiplier operates in increments of this basefrequency. The minimum multiplication of the base frequency is 1, and themaximum multiplication is 256. The resulting master clock frequency, there-fore, can be varied from a min...
Page 52 - Clock Speed Control Register; ClkSpdCtrl Bits 8 and 9; OSC; , the C6xx does not have a reference oscillator running. In the; MC
Clock Control 2-28 2.8.3 Clock Speed Control Register The ClkSpdCtrl is a 16-bit memory mapped register located at address 0x3D.The reference oscillator (RTO or CRO) is selected by setting one of the twocontrol bits located at bits 8 and 9. Setting bit 8 configures the C6xx for the RTOreference opti...
Page 53 - ClkSpdCtrl register; : PLLM multiplier bits for MC; Reference Oscillator Stopped by Programmed Disable; RTO Oscillator Trim Adjustment
Clock Control 2-29 MSP50C6xx Architecture The configuration of bits in the clock speed control register appears below: ClkSpdCtrl register address 0x3D (16-bit wide location) WRITE only 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 T5 T4 T3 T2 T1 I C or T0 R M M M M M M M M T : RTO oscillator-Trim...
Page 54 - Register Trim Value
Clock Control 2-30 RTRIM Register (Read Only) (Applies to MSP50C6xx Device Only) I/O Address 0x2Fh (17-bit wide location) 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 R R R R R R R R R R R T5 T4 T3 T2 T1 T0 T: RTO oscillator-trim storage (device specific) R: reserved for Texas Instruments use ...
Page 55 - Timer Registers
Timer Registers 2-31 MSP50C6xx Architecture This software-controlled trim for the RTO is not a replacement for the externalreference-resistor mounted at pins OSC IN and OSC OUT . Also, note that this adjustment has no effect on the rate of the CRO reference oscillator. 2.9 Timer Registers The C6xx c...
Page 56 - Writing to the TIM Register
Timer Registers 2-32 Reading from either the PRD or the TIM returns the current state of the register.This can be used to monitor the progress of the TIM register at any time. Writing to the PRD register does not change the TIM register until the TIMregister has finished decrementing to 0x0000. The ...
Page 57 - Reduced Power Modes
Reduced Power Modes 2-33 MSP50C6xx Architecture enable bit for TIMER2. Setting the enable bit enables the TIMER, i.e., startscount-down running. Clearing the enable bit disables the TIMER, i.e., stopsthe count-down. The default setting after a RESET LOW is zero: both TIMERsdisabled. Refer to Section...
Page 59 - . The advantage to having the ARM bit set is that the
Reduced Power Modes 2-35 MSP50C6xx Architecture If either of bits 8 or 9 are set, then the reference oscillator enable is consideredset. This enables the PLL circuitry to regulate to the reference frequency, 32kHz (assuming the idle state clock control is clear). Whichever state thereference oscilla...
Page 60 - Idle State Clock Control Bit; Table 2–3. Programmable Bits Needed to Control Reduced Power Modes; Should be cleared before any IDLE instruction.
Reduced Power Modes 2-36 Note: Idle State Clock Control Bit If the idle state clock control bit is set and the ARM bit is clear, the only eventthat can wake the C6xx after an IDLE instruction is a hardware RESET low-to-high. When at sleep, the device will not respond to the input ports, nor tothe in...
Page 63 - Assuming Wake-Up can occur
Reduced Power Modes 2-39 MSP50C6xx Architecture Under normal operation the DAC timer, when IMR enabled, triggers aninterrupt on underflow. Before any IDLE instruction, however, the entire DACcircuitry should be disabled. This ensures the effectiveness of the reducedpower mode and prevents any wake-u...
Page 64 - Execution Timing; Figure 2–10. Instruction Execution and Timing
Execution Timing 2-40 2.11 Execution Timing For executing program code, the C6xx’s core processor has a three-levelpipeline. The pipeline consists of instruction fetch, instruction decode, andinstruction execution. A single instruction cycle is limited to one program Fetchplus one data memory read o...
Page 65 - Comparator; Chapter 3
3-1 Peripheral Functions This chapter describes in detail the MSP50C6xx peripheral functions, i.e., I/Ocontrol ports, general purpose I/O ports, interrupt control registers, compara-tor and digital-to-analog (DAC) control mechanisms. Topic Page 3.1 I/O . . . 3–2 . . . . . . . . . . . . . . . . . . ....
Page 67 - Port A; Reading the Data Register
I/O 3-3 Peripheral Functions Port A Port B Port C Port D Port E Control register address 0x04h † 0x0Ch 0x14h 0x1Ch 0x24h Possible control values 0 = High-Z INPUT 1 = TOTEM-POLE OUTPUT Value after RESET low 0 = High-Z INPUT Data register address 0x00h 0x08h 0x10h 0x18h 0x20h Possible input data value...
Page 68 - Dedicated Input Port F
I/O 3-4 The following table shows the bit locations of the I/O port mapping: (8-bit wide location)07 06 05 04 03 02 01 00 A port data register address 0x00 . . . . . A7 A6 A5 A4 A3 A2 A1 A0 A port control register address 0x04 . . . C C C C C C C C B port data register address 0x08 . . . . . B7 B6 B...
Page 69 - Input Port F; Dedicated Output Port G
I/O 3-5 Peripheral Functions and setting the EP bit enables the eight pullups. After RESET low, the defaultsetting for the EP bit is 0 (F-port pullups disabled). Input Port F Data register address 0x28h Possible input data values Low = 0 High = 1 Possible output data values N/A Value after RESET low...
Page 70 - Totem-Pole Output Port G; Branch on D Port
I/O 3-6 Totem-Pole Output Port G Data register address 0x2Ch Possible input data values N/A Possible output data values 0 = Low 1 = High Value after RESET low 0 = Low The following table shows the bit locations of the port G address mapping: G port Data address 0x2Cread and write (16-bit wide locati...
Page 71 - Internal and External Interrupts; pins. These interrupts are supported
I/O 3-7 Peripheral Functions 3.1.5 Internal and External Interrupts INT3, INT4, INT6, and INT7 are external interrupts which may be triggered byevents on the PD 2 , PD 3 , PD 4 , and PD 5 pins. These interrupts are supported whether the D-port pins are programmed as inputs or outputs. (Whenprogramme...
Page 72 - A summary of the interrupts is given in Table 3–1.; Table 3–1. Interrupts; Interrupts in Reduced Power Mode
I/O 3-8 A summary of the interrupts is given in Table 3–1. Table 3–1. Interrupts Interrupt Vector Source Trigger Event Priority Comment INT0 0x7FF0 DAC Timer Timer underflow Highest Used to synch. speech data INT1 0x7FF1 TIMER1 Timer underflow 2 nd INT2 0x7FF2 TIMER2 Timer underflow 3 rd INT3 0x7FF3...
Page 73 - loudspeaker directly. To drive loud speakers other; Pulse-Density Modulation Rate; Output sampling rate = PDM Rate; DAC Control and Data Registers
Digital-to-Analog Converter (DAC) 3-9 Peripheral Functions 3.2 Digital-to-Analog Converter (DAC) The MSP50C6xx incorporates a two-pin pulse-density-modulated DAC whichis capable of driving a 32- Ω loudspeaker directly. To drive loud speakers other than 32 Ω , an external impedance-matching circuit i...
Page 74 - PDM Enable Bit; By default, the PDM enable bit is cleared: DAC function is off.
Digital-to-Analog Converter (DAC) 3-10 DAC Control registerAddress 0x34 (4-bit wide location)03 02 01 00 Set DAC resolution to 8 bits:Set DAC resolution to 9 bits:Set DAC resolution to 10 bits: DM E 0 0DM E 0 1DM E 1 0 DM : Drive Mode selection (0 = C3x style : 1 = C5x style) E : pulse-density-modul...
Page 75 - PDM Clock Divider; Figure 3–1. PDM Clock Divider
Digital-to-Analog Converter (DAC) 3-11 Peripheral Functions style. Their selection is made at bit 3 of the DAC control register (0x34). TheC3x style is selected by clearing bit 3, and the C5x style is selected by settingbit 3. The default value of the selection is zero which yields the C3x style. Th...
Page 76 - range. This rate applies to the
Digital-to-Analog Converter (DAC) 3-12 For a given sampling rate and DAC resolution, the CPU clock rate may beincreased, if necessary, through the use of over-sampling. In the previousexample, an original sampling rate of 8 kHz and a PDM rate of 4 MHz wasused. A 2-times over-sampling, therefore, wou...
Page 80 - IntGenCtrl Register Bit 15
Comparator 3-16 The INT6 Flag may also be SET or CLEARed deliberately, at any time, insoftware. Use the OUT instruction with the associated I/O port address (IFR,address 0x39). INT7 flag refers to bit 7 within the interrupt flag register. This bit is automaticallySET anytime that an INT7 event occur...
Page 82 - Interrupt/General Control Register; IntGenCtrl register
Interrupt/General Control Register 3-18 3.4 Interrupt/General Control Register The interrupt/general control (IntGenCtrl) is a 16-bit wide port-mapped registerlocated at address 0x38. The primary component in the IntGenCtrl is the 8-bitinterrupt mask register (IMR). The IMR is used to individually e...
Page 84 - Hardware Initialization States; Note: Internal Power Reset Function
Hardware Initialization States 3-20 3.5 Hardware Initialization States The RESET pin is configured at all times as an external interrupt. It providesfor a hardware initialization of the MSP50C6xx. When the RESET pin is heldlow, the device assumes a deep sleep state and various control registers arei...
Page 85 - Internal RAM State after Reset
Hardware Initialization States 3-21 Peripheral Functions Note: Internal RAM State after Reset The RESET low will not change the state of the internal RAM, assuming thereis no interruption in power. This applies also to the interrupt flag register. Thesame applies to the states of the accumulators in...
Page 86 - (Bits 5 through 16 are left uninitialized); Bit
Hardware Initialization States 3-22 Table 3–2. State of the Status Register (17 bit) after RESET Low-to-High (Bits 5 through 16 are left uninitialized) Bit Bit Name Initialized Value Description 0 XM 0 Extended sign mode disabled 1 UM 0 Unsigned multiplier mode disabled (allows signed multiplier mod...
Page 87 - Assembly Language Instructions; Chapter 4
4-1 Assembly Language Instructions This chapter describes in detail about MSP50P614/MSP50C614 assemblylanguage. Instruction classes, addressing modes, instruction encoding andexplanation of each instruction is described. Topic Page 4.1 Introduction 4–2 . . . . . . . . . . . . . . . . . . . . . . . ....
Page 88 - Introduction
Introduction 4-2 4.1 Introduction In this chapter each MSP50P614/MSP50C614 class of instructions isexplained in detail with examples and restrictions. Most instructions canindividually address bits, bytes, words or strings of words or bytes. Usableprogram memory is 30K by 17-bit wide and the entire ...
Page 92 - , in the STR register, defines a string length of n
System Registers 4-6 value of the STACK register should be stored before use and restored afteruse. This register must point to the beginning of the stack in the RESETinitialization routine before any CALL instruction or maskable interrupts can beused. CALL instructions increment R7 by 2., RET instr...
Page 94 - Instruction Syntax and Addressing Modes; where the symbols are described as follows:; name
Instruction Syntax and Addressing Modes 4-8 4.3 Instruction Syntax and Addressing Modes MSP50P614/MSP50C614 instructions can perform multiple operations perinstruction. Many instructions may have multiple source arguments. They canpremodify register values and can have only one destination. The addr...
Page 95 - Addressing Modes; Table 4–2. Addressing Mode Encoding
Instruction Syntax and Addressing Modes 4-9 Assembly Language Instructions 4.3.2 Addressing Modes The addressing modes on the MSP50P614/MSP50C614 are immediate, di-rect, indirect with post modification, and three relative modes. The relativemodes are: - Relative to the INDEX or R5 register. The effe...
Page 96 - Table 4–3. Rx Bit Description
Instruction Syntax and Addressing Modes 4-10 Table 4–3. Rx Bit Description Rx Operation 0 0 0 R0 0 0 1 R1 0 1 0 R2 0 1 1 R3 1 0 0 R4 or LOOP 1 0 1 R5 or INDEX 1 1 0 R6 or PAGE 1 1 1 R7 or STACK Table 4–4. Addressing Mode Bits and {adrs} Field Description Relative Repeat addressing mode encoding, adr...
Page 97 - Table 4–6. Auto Increment and Auto Decrement Modes; Operation
Instruction Syntax and Addressing Modes 4-11 Assembly Language Instructions Table 4–5. MSP50P614/MSP50C614 Addressing Modes Summary ADDRESSING SYNTAX OPERATION Direct name [dest,] [src,] *dma16 [*2] [, next A]name *dma16 [*2] [,src] [, next A] Second word operand (dma16) used directly as memoryaddre...
Page 98 - indicates all of the following (only partial
Instruction Syntax and Addressing Modes 4-12 For any particular addressing mode, replace the {adrs} with the syntax shownin Table 4–4. To encode the instruction, replace the am, Rx and pm bits withthe bits required by the addressing mode (Table 4–4). For example, theinstruction MOV An[~], {adrs} [, ...
Page 99 - Immediate Addressing
Instruction Syntax and Addressing Modes 4-13 Assembly Language Instructions 4.3.3 Immediate Addressing The address of the memory location is encoded in the instruction word or theword following the opcode is the immediate value. Single word instructionstake one clock cycle and double word instructio...
Page 100 - Direct Addressing
Instruction Syntax and Addressing Modes 4-14 4.3.4 Direct Addressing Direct addressing always requires two instruction words. The second wordoperand is used directly as the memory address. The memory operand maybe a label or an expression. Syntax: name [dest,] [src,] *dma16 [* 2] [, next A]name *dma...
Page 101 - Indirect Addressing; Table 4–9. Indirect Addressing Syntax; Syntax
Instruction Syntax and Addressing Modes 4-15 Assembly Language Instructions 4.3.5 Indirect Addressing Indirect addressing uses one of 8 registers (R0...R7) to point memoryaddresses. The selected register can be post-modified. Modifications includeincrements, decrements, or increments by the value in...
Page 102 - Relative Addressing; Relative to Index Register R5
Instruction Syntax and Addressing Modes 4-16 Example 4.3.12 MOV *R5++R5, A0~, ++A Refer to the initial processor state in Table 4–8 before execution of thisinstruction. Preincrement AP0. After preincrement, A0 is AC3 and A0~ isAC19. The contents of AC19 are stored in the data memory location in R5. ...
Page 103 - Short Relative
Instruction Syntax and Addressing Modes 4-17 Assembly Language Instructions Address + Rx (x = 0 – 7) Index Register (R5) Operand Example 4.3.17 AND A0, *R3+R5 Refer to the initial processor state in Table 4–8 before execution of this instruc-tion. A0 is accumulator AC2. The contents of the data memo...
Page 104 - Long Relative
Instruction Syntax and Addressing Modes 4-18 Example 4.3.20 MOV A3, *R6+0x10 Refer to the initial processor state in Table 4–8 before execution of this instruc-tion. Load A3 (AC29) with the contents of byte address, R6+0x10. The valueof R6 is unchanged. Final result, AC29=0x0112. Example 4.3.21 ADD ...
Page 105 - Flag Addressing; Figure 4–2. Relative Flag Addressing
Instruction Syntax and Addressing Modes 4-19 Assembly Language Instructions 4.3.7 Flag Addressing This addressing mode addresses only the 17 th bit (the flag/tag bit) located in data memory. This addressing applies to Class 8a instructions as explainedin section 4.4. Using flag addressing, the flag ...
Page 106 - bit of a word of data memory. There are 640 words of RAM,; RAM; + 1 is used to set a TAG, then the TAG for RAM; are functionally equivalent.
Instruction Syntax and Addressing Modes 4-20 4.3.8 Tag/Flag Bits The words TAG and flag may be used interchangeably in this manual. TheTAG bit is the 17 th bit of a word of data memory. There are 640 words of RAM, each 17 bits wide, on the C614. Therefore, there are 640 TAG bits on the C614.When an ...
Page 107 - Possible sources of confusion: Consider the following code,
Instruction Syntax and Addressing Modes 4-21 Assembly Language Instructions However, xFLAG instructions use {flagadrs} addressing modes. This includesglobal (dma6) and relative (R6 + 6–bit offset). Both take only one clock cycle. Possible sources of confusion: Consider the following code, ram0 equ 0...
Page 108 - Instruction Classification; Table 4–10. Symbols and Explanation; Symbol
Instruction Classification 4-22 4.4 Instruction Classification The machine level instruction set is divided into a number of classes. Theclasses are primarily divided according to field references associated withmemory, hardware registers, and control fields. The following descriptionsgive class-enc...
Page 109 - Class
Instruction Classification 4-23 Assembly Language Instructions Table 4–11. Symbols and Explanation (Continued) Symbol Explanation next A Accumulator control bits as described in Table 4–6. [next A] The preincrement (++A) or predecrement (– –A) operation on accumulator pointers An or An~. Not NOT con...
Page 111 - Table 4–12. Classes and Opcode Definition; Class 1 Instructions: Memory and Accumulator Reference
Instruction Classification 4-25 Assembly Language Instructions Table 4–12. Classes and Opcode Definition Bit 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Class 1a 0 0 C1a ~A~ next A An am Rx pm Class 1b 0 1 C1b s An am Rx pm Class 2a 1 0 1 0 C2a An imm8 Class 2b 1 1 1 0 0 next A An C2b 0 0 1 A~ ~A Class...
Page 112 - Table 4–13. Class 1 Instruction Encoding; Table 4–14. Class 1a Instruction Description
Instruction Classification 4-26 Class 1a provides the four basic instructions of load, store, add, and subtractbetween accumulator and data memory. Either the accumulator or the offsetaccumulator (A~ bit dependent) can be stored in memory with the MOVinstruction. The MOV instruction can load the acc...
Page 113 - Table 4–15. Class 1b Instruction Description
Instruction Classification 4-27 Assembly Language Instructions Table 4–15. Class 1b Instruction Description C1b Mnemonic Description 0 0 0 0 OR An, {adrs}ORS An, {adrs} Logical OR the contents of the data memory location in {adrs}and the selected accumulator. Result(s) stored inaccumulator(s). ALU s...
Page 114 - Class 2 Instructions: Accumulator and Constant Reference; +2 execution cycles for n
Instruction Classification 4-28 Table 4–15. Class 1b Instruction Description (Continued) C1b Mnemonic Description 1 0 1 1 MULAPL An, {adrs}MULAPLS An, {adrs} Multiply the MR register by the addressing mode {adrs} and addthe lower 16 bits of the product to the accumulator. Latch theupper 16 bits into...
Page 115 - Table 4–16. Class 2 Instruction Encoding; Table 4–17. Class 2a Instruction Description
Instruction Classification 4-29 Assembly Language Instructions constants. Long constants (16 bits) and long string constants differ in that ref-erences are made to constants in the second word of the two-word instructionword. References made to a single 16-bit integer constant are immediate. Thatis,...
Page 116 - Table 4–18. Class 2b Instruction Description; Class 3 Instruction: Accumulator Reference
Instruction Classification 4-30 Table 4–18. Class 2b Instruction Description C2b Mnemonic Description 0 0 0 ADD An[~], An[~], imm16 [, next A]ADDS An[~], An[~], pma16 Add long constant to accumulator (or offset accumulator ifA~=1) and store result to accumulator (~A=0) or offsetaccumulator (~A=1). A...
Page 117 - Table 4–19. Class 3 Instruction Encoding; Table 4–20. Class 3 Instruction Description
Instruction Classification 4-31 Assembly Language Instructions between the accumulator and the MR, SV, or PH register. As with all accumula-tor referenced instructions, string operations are possible as well as premodi-fication of one of 4 indirectly referenced accumulator pointer registers (AP). Ta...
Page 120 - Class 4 Instructions: Address Register and Memory Reference; Table 4–21. Class 4a Instruction Encoding
Instruction Classification 4-34 Table 4–20. Class 3 Instruction Description (Continued) C3 Mnemonic Description 1 1 1 1 0 MUL An[~] [, next A]MULS An[~] Multiply MR register by accumulator (A~=1) or offsetaccumulator (A~=0) and latch the rounded upper 16 bits ofthe resulting product into the PH regi...
Page 121 - Table 4–22. Class 4a Instruction Description; Table 4–24. Class 4c Instruction Description; Table 4–25. Class 4d Instruction Description
Instruction Classification 4-35 Assembly Language Instructions Table 4–22. Class 4a Instruction Description C4a Mnemonic Description 0 MOV {adrs}, Rx Store Rx register to data memory referred by addressing mode {adrs}. Modifytransfer status. 1 MOV Rx, {adrs} Load Rx with the value in data memory ref...
Page 122 - Class 5 Instructions: Memory Reference; Table 4–26. Class 5 Instruction Encoding; Table 4–27. Class 5 Instruction Description
Instruction Classification 4-36 4.4.5 Class 5 Instructions: Memory Reference Class 5 instructions provide transfer to and from data memory and all registersexcept accumulators and Rx which are included in classes 1 and 4. Theregisters referenced for both read and write operations are the multiplierr...
Page 124 - Class 6 Instructions: Port and Memory Reference; Table 4–28. Class 6a Instruction Encoding; Table 4–29. Class 6a Instruction Description
Instruction Classification 4-38 Table 4–27. Class 5 Instruction Description (Continued) C5 Mnemonic Description 1 1 1 1 0 RPT {adrs} 8 Load repeat counter with lower 8 bits of data memory location referred byaddressing mode {adrs}. Interrupts are queued during execution. 1 1 1 1 1 MOV STAT, {adrs} L...
Page 125 - Table 4–30. Class 6b Instruction Description; Class 7 Instructions: Program Control
Instruction Classification 4-39 Assembly Language Instructions Table 4–30. Class 6b Instruction Description C6b Mnemonic Description 0 IN An[~], port6INS An[~], port6 Transfer the port’s 16-bit value to an accumulator. Port addresses 0–63are valid. ALU status is modified. 1 OUT port6, An[~]OUTS port...
Page 126 - Table 4–31. Class 7 Instruction Encoding and Description
Instruction Classification 4-40 Table 4–31. Class 7 Instruction Encoding and Description Bit 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 VCALL vector8 1 1 1 1 1 1 1 0 1 vector8 Jcc 1 0 0 0 0 0 Not cc Rx pm JMP *An 1 0 0 0 1 0 x An x Ccc 1 0 0 0 0 1 Not cc x CALL *An 1 0 0 0 1 1 x An x cc cc names Descr...
Page 127 - Description; Class 8 Instructions: Logic and Bit; Table 4–32. Class 8a Instruction Encoding
Instruction Classification 4-41 Assembly Language Instructions Table 4–31. Class 7 Instruction Encoding and Description (Continued) cc cc names Description cc cc name Not cc name 1 0 1 0 1 Unconditional 1 0 1 1 0 Not assigned 1 0 1 1 1 Not assigned 1 1 0 0 0 XZ XNZ Conditional on XSF 1 1 0 0 1 XS XN...
Page 128 - Table 4–33. Class 8a Instruction Description; Table 4–34. Class 8b Instruction Description; Class 9 Instructions: Miscellaneous
Instruction Classification 4-42 Table 4–33. Class 8a Instruction Description C8a Mnemonic Description 0 0 0 MOV TFn, {flagadrs} Load flag bit (17 th bit) from data memory referred by flag addressing mode {flagadrs} to either TF1 or TF2 in status register. Load with inverted value ifNot =1. 0 1 0 OR ...
Page 129 - Table 4–35. Class 9a Instruction Encoding; Table 4–36. Class 9a Instruction Description; Table 4–37. Class 9b Instruction Description
Instruction Classification 4-43 Assembly Language Instructions Table 4–35. Class 9a Instruction Encoding Bit 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Class 9a 1 1 1 0 1 0 0 An C9a 0 Rx 1 1 Class 9b 1 1 1 1 1 1 0 C9a imm8 Class 9c 1 1 1 1 1 0 1 APn 0 C9c x imm5 Class 9d 1 1 1 1 1 1 1 1 0 C9d 0 0 0 0 ...
Page 130 - Table 4–38. Class 9c Instruction Description; Table 4–39. Class 9d Instruction Description
Bit, Byte, Word and String Addressing 4-44 Table 4–38. Class 9c Instruction Description C9c Mnemonic Description 0 MOV APn, imm6 Load the accumulator pointer (AP) with a 5-bit constant. 1 ADD APn, imm5 Add a 5-bit constant imm5 to the referenced accumulator pointer(AP). Table 4–39. Class 9d Instruct...
Page 131 - Data Memory Access; Figure 4–3. Data Memory Organization and Addressing
Bit, Byte, Word and String Addressing 4-45 Assembly Language Instructions is a string of bytes. The length of the byte string is stored in the string register(STR). To define the length of a string, the STR register should hold the lengthof the string minus 2. For example, if the length of a byte st...
Page 132 - bit is accessible. When a word memory location; Table 4–40. Data Memory Address and Data Relationship; Mode
Bit, Byte, Word and String Addressing 4-46 Flag Address: The flag (or TAG) address uses linear addressing from 0 to thesize of data memory in 17-bit wide words (0 to 639 for MSP50P614/MSP50C614). Only the 17 th bit is accessible. When a word memory location is read, the corresponding flag for that l...
Page 133 - Figure 4–4. Data Memory Example; Absolute Word; which uses the absolute word memory address.
Bit, Byte, Word and String Addressing 4-47 Assembly Language Instructions Figure 4–4. Data Memory Example Absolute Word Memory Location Data Memory Location (even) = 2 * (Absolute word memory location) MS Byte LS Byte Data Memory Location (odd) 0x0000 0x0000 0x12 0x34 0x0001 0x0001 0x0002 0x56 0x78 ...
Page 135 - Sign extension mode (bit 0 or XM bit of STAT)
MSP50P614/MSP50C614 Computational Modes 4-49 Assembly Language Instructions Example 4.5.10 MOV STR, 0 SFLAG *0x00032 MOVS A0, *0x0031 * 2 RFLAG *0x00032 MOVS A0, *0x0031 * 2 Refer to Figure 4–4 for this example. This example is to illustrate the effect ofthe tag/flag bit when used with a string inst...
Page 136 - bit of the multiplier/multiplicand to the 17
MSP50P614/MSP50C614 Computational Modes 4-50 Table 4–41. MSP50P614/MSP50C614 Computational Modes ComputationalMode SettingInstruction Resetting Instruction Function Sign extension SXM RXM STAT.XM = 1 produces sign extension on data as it ispassed into accumulators. This mode copies the 16 th bit of ...
Page 137 - SXM
MSP50P614/MSP50C614 Computational Modes 4-51 Assembly Language Instructions Example 4.6.2 SXM MOV STR, 2–2 ; string length=2 MOV MR, 0x8000 MOV A0, 0x8000, ++A ; load MS Byte MOV A0, 0x0000, ––A ; load LS Byte MULTPLS A0, A0 This example illustrates the sign extension mode on a string duringmultipli...
Page 139 - Hardware Loop Instructions
Hardware Loop Instructions 4-53 Assembly Language Instructions high word of the result is stored in the PH register and is 0x3FFF. The low wordis stored in A0~ as 0x0001. If the two numbers are considered as Q15 fraction-al numbers (all bits are to the right of the decimal point), then the result wi...
Page 141 - String Instructions; Table 4–43. Initial Processor State for String Instructions
String Instructions 4-55 Assembly Language Instructions 4.8 String Instructions Class 1, 2, 3, and 6 instructions can have string modes. During the executionof string instruction, STR register value plus 2 is assumed as string length. Anaccumulator string is a group of consecutive accumulators spann...
Page 142 - ) Interrupts can occur between these instructions.
String Instructions 4-56 A1 string is 0x233EFBCA1223 and *0x200 = 0x9086EE3412AC. STR =3–2=1, defines a string length of 3. Final result, A1~ string =0x233EFBCA1223 + 0x9086EE3412AC = 0xB3C5E9FE24CF, AC5=0x24CF,AC6=0xE9FE, AC7=0xB3C5, STR=2 (unchanged). Notice that this instructionhas accumulated a ...
Page 143 - Lookup Instructions; Table 4–44. Lookup Instructions; Instructions
Lookup Instructions 4-57 Assembly Language Instructions 4.9 Lookup Instructions Table lookup instructions transfer data from program memory (ROM) to datamemory or accumulators. These instructions are useful for reading permanentROM data into the user program for manipulation. For example, lookup tab...
Page 145 - Special Filter Instructions; Figure 4–5. FIR Filter Structure
Input/Output Instructions 4-59 Assembly Language Instructions 4.10 Input/Output Instructions The MSP50P614/MSP50C614 processor communicates with other on-chiplogic as well as external hardware through a parallel I/O interface. Up to 40 I/Oports are addressable with instructions that provide bidirect...
Page 147 - startOfBuff
Special Filter Instructions 4-61 Assembly Language Instructions theory requires). The second to last RAM location in the circular buffer istagged using an STAG instruction. Below is an example of how to set up circu-lar buffering with FIR or COR. When using the FIR or COR instruction with circular b...
Page 148 - After the FIR or COR instruction executes, the new
Special Filter Instructions 4-62 After the FIR or COR instruction executes, the new startOfBuff will be the last location in the circular buffer. After another FIR/COR instruction, the new startOfBuff will be the second to last location in the circular buffer, and so on. The second detail is the STA...
Page 150 - Use R5 to; After FIR/COR execution; by the next sample to be filtered,
Special Filter Instructions 4-64 Any combination of registers different from the above will yield incorrectresults with the FIR/COR instruction. Use R5 to wrap around R0 0x010 0x0100 0x0106 0x0102 x[k] x[k–1] x[k–2] x[k–3] tag After FIR/COR execution The STAT register is saved in the filterSTAT_tag ...
Page 151 - Important Note About Setting the STAT Register; rovm; The remaining FIRK/CORK code is almost the same as the FIR/COR code.
Special Filter Instructions 4-65 Assembly Language Instructions Important Note About Setting the STAT Register It is very important to consider the initial value of the filterSTAT_tag variable.Failure to set up the filterSTAT_tag variable can cause incorrect results in FIR/COR operations. Overflow m...
Page 152 - include
Special Filter Instructions 4-66 mov STAT,*filterSTAT_tag ;load STAT with last filter tag status rpt N–2 firk A0,*R0++ ;Do one sample ––> 32 bit result mov *filterSTAT_tag,STAT ;save STAT with last filter tag status ;R0 now points to the last sample movs *ySampleOut,A0 ;FIR outputs bits 0–15 in A...
Page 155 - Alternate
Conditionals 4-69 Assembly Language Instructions 4.12 Conditionals The condition bits in the status register (STAT) are used to modify programcontrol through conditional branches and calls. Various combinations of bitsare available to provide a rich set of conditional operations. These conditionbits...
Page 156 - Operands
Legend 4-70 4.13 Legend All instructions of the MSP50P614/MSP50C614 use the following syntax: name [dest] [, src] [, src1] [, mod] name Name of the instruction. Instruction names are shown in bold letter through out the text. dest Destination of the data to be stored after the execution of the instr...
Page 159 - Table 4–47. Flag Addressing Syntax and BIts
Legend 4-73 Assembly Language Instructions Table 4–45. Auto Increment and Decrement Operation next A b9 b8 No modification 0 0 Auto increment ++A 0 1 Auto Decrement – –A 1 0 Table 4–46. Addressing Mode Bits and adrs Field Description String† Addressing Mode Encoding Relative Addressing Clocks Words ...
Page 160 - Individual Instruction Descriptions
Individual Instruction Descriptions 4-74 4.14 Individual Instruction Descriptions In this section, individual instructions are discussed in detail. Use theconditionals in Section 4.12 and the legend in Section 4.13 to help withindividual instruction descriptions. Each instruction is discussed in det...
Page 161 - Add word; Execution; Flags Affected; TAG is set accordingly; Opcode
Individual Instruction Descriptions 4-75 Assembly Language Instructions 4.14.1 ADD Add word Syntax [label] name dest, src [, src1] [,mod] Clock, clk Words, w With RPT, clk Class ADD An[~], An, {adrs} [, next A] Table 4–46 Table 4–46 Table 4–46 1a ADD An[~], An[~], imm16 [, next A] 2 2 N/R 2b ADD An[...
Page 162 - See Also; Add immediate value of 0x1221 to A1 and store result in A1.; Add PH to accumulator A0~ and store result in accumulator A0.
Individual Instruction Descriptions 4-76 Description Syntax Description ADD dest, src ADD src with dest and store the result to dest. ADD dest, src, src1 [,mod] ADD src1 with src and store the result to dest. Premodify the mod beforeexecution. (if provided) See Also ADDB, ADDS, SUB, SUBB, SUBS Examp...
Page 163 - ADD BYTE; RCF, RZF are set accordingly; Add immediate 0xf2 to R5.
Individual Instruction Descriptions 4-77 Assembly Language Instructions 4.14.2 ADDB ADD BYTE Syntax [label] name dest, src Clock, clk Words, w With RPT, clk Class ADDB An, imm8 1 1 N/R 2a ADDB Rx, imm8 1 1 N/R 4b Execution dest ⇐ dest + src PC ⇐ PC + 1 Flags Affected dest is An: OF, SF, ZF, CF are s...
Page 164 - Add String; dest string
Individual Instruction Descriptions 4-78 4.14.3 ADDS Add String Syntax [label] name dest, src, src1 Clock, clk Words, w With RPT, clk Class ADDS An[~], An, {adrs} Table 4–46 Table 4–46 Table 4–46 1a ADDS An[~], An[~], pma16 n S +4 2 N/R 2b ADDS An[~], An~, An n S +2 1 n R +2 3 ADDS † An[~], An[~], P...
Page 166 - Bitwise AND
Individual Instruction Descriptions 4-80 4.14.4 AND Bitwise AND Syntax [label] name dest, src [, src1] [, mod] Clock, clk Word, w With RPT, clk Class AND An, {adrs} Table 4–46 Table 4–46 1b AND An[~], An[~], imm16 [, next A] 2 2 N/R 2b AND An[~], An~, An [, next A] 1 1 n R +3 3 AND TFn, [!]{flagadrs...
Page 167 - AND TF1 with TF2 bit in the STAT register and store result in TF1.
Individual Instruction Descriptions 4-81 Assembly Language Instructions See Also ANDS, ANDB, OR, ORB, ORS, XOR, XORB, XORS Example 4.14.4.1 AND A3, *R4— – And word at address in R4 to A3, store result in A3. Decrement value in R4 by 2 (word mode) after theAND operation. Example 4.14.4.2 AND A0~, A0,...
Page 168 - Bitwise AND Byte
Individual Instruction Descriptions 4-82 4.14.5 ANDB Bitwise AND Byte Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class ANDB An, imm8 1 1 N/R 2a Execution dest ⇐ dest AND src byte PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF are set accordingly Opcode Instructions 16 15 14 13 12 11 1...
Page 169 - Bitwise AND String; AND memory string beginning at address in R2 to A0~, put result in A0.
Individual Instruction Descriptions 4-83 Assembly Language Instructions 4.14.6 ANDS Bitwise AND String Syntax [label] name dest, src [, src1] Clock, clk Word, w With RPT, clk Class ANDS An, {adrs} Table 4–46 Table 4–46 1b ANDS An[~], An[~], pma16 n R +4 1 N/R 2b ANDS An[~], An~, An n R +3 1 n R +3 3...
Page 170 - Begin Loop; BEGLOOP and ENDLOOP block has following restrictions:
Individual Instruction Descriptions 4-84 4.14.7 BEGLOOP Begin Loop Syntax [label] name Clock, clk Word, w With RPT, clk Class BEGLOOP † 1 1 N/R 9d † Loop must end with ENDLOOP. Execution Save next instruction address (PC + 1)(mask interrupts)PC ⇐ PC + 1 Flags Affected none Opcode Instructions 16 15 ...
Page 171 - Unconditional Subroutine Call; TOS; PC; None; Call unconditionally program memory address 0x2010.
Individual Instruction Descriptions 4-85 Assembly Language Instructions 4.14.8 CALL Unconditional Subroutine Call Syntax [label] name address Clock, clk Word, w With RPT, clk Class CALL pma16 2 2 N/R 7c CALL *An 2 1 N/R 7c Execution R7 ⇐ R7 + 2 *R7 ⇐ TOS TOS ⇐ PC + 2 PC ⇐ *An or pma16 Flags Affected...
Page 173 - Conditional Subroutine Call; ELSE
Individual Instruction Descriptions 4-87 Assembly Language Instructions 4.14.9 Ccc Conditional Subroutine Call Syntax [label] name address Clock, clk Word, w With RPT, clk Class Ccc † pma16 2 2 N/R 7c † Cannot immediately follow a CALL instruction with a return instruction. If true If Not true [labe...
Page 174 - Table 4–48. Names for cc
Individual Instruction Descriptions 4-88 Table 4–48. Names for cc cc cc names Description cc cc name Not cc name p True condition (Not true condition) 0 0 0 0 0 Z NZ Conditional on ZF=1 (Not condition ZF=0) 0 0 0 0 1 S NS Conditional on SF=1 (Not condition SF=0) 0 0 0 1 0 C NC Conditional on CF=1 (N...
Page 177 - TAG bit is set accordingly
Individual Instruction Descriptions 4-91 Assembly Language Instructions 4.14.10 CMP Compare Two Words [label] name src, src1 [, mod] Clock, clk Word, w With RPT, clk Class CMP An, {adrs} Table 4–46 Table 4–46 1b CMP An[~], imm16 [, next A] 2 2 N/R 2b CMPCMP An, An~ [, next A]An~, An [, next A] 1 1 n...
Page 178 - Compare value at R0 to R5 and change the STAT flags accordingly.
Individual Instruction Descriptions 4-92 Example 4.14.10.3 CMP R2, 0xfe20 Compare value at R2 to immediate value 0xfe20 and change the STAT flags accordingly. Example 4.14.10.4 CMP R0, R5 Compare value at R0 to R5 and change the STAT flags accordingly.
Page 179 - Compare immediate value 0xf3 to accumulator A0.
Individual Instruction Descriptions 4-93 Assembly Language Instructions 4.14.11 CMPB Compare Two Bytes Syntax [label] name src, src1 Clock, clk Word, w With RPT, clk Class CMPB An, imm8 1 1 N/R 2a CMPB Rx, imm8 1 1 N/R 4b Execution status flags set by src – src1 bytePC ⇐ PC + 1 Flags Affected src is...
Page 181 - COR; When used with repeat will execute 16
Individual Instruction Descriptions 4-95 Assembly Language Instructions 4.14.13 COR Correlation Filter Function Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class COR An, *Rx 3 1 3(n R +2) 9a Execution With RPT N–2:(mask interrupts)RPT counter = N–2MR = h[0] = first filter coeffici...
Page 182 - ENDIF PC
Individual Instruction Descriptions 4-96 4.14.14 CORK Correlation Filter Function Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class CORK An, *Rx 3 1 3(n R +2) 9a Execution With RPT N–2:(mask interrupts)RPT counter = N–2MR = h[0] = first filter coefficientx = sample data pointed at...
Page 183 - ENDLOOP; first address after BEGLOOP
Individual Instruction Descriptions 4-97 Assembly Language Instructions 4.14.15 ENDLOOP End Loop Syntax [label] name # Clock, clk Word, w With RPT, clk Class ENDLOOP [n] 1 1 N/R 9d Execution If (R4 ≥ 0) decrement R4 by n (1 or 2) PC ⇐ first address after BEGLOOP else NOP PC ⇐ PC + 1 Flags Affected N...
Page 184 - EXTSGNS
Individual Instruction Descriptions 4-98 4.14.16 EXTSGN Sign Extend Word Syntax [label] name dest [, mod] Clock, clk Word, w With RPT, clk Class EXTSGN An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]new most significant word of dest ⇐ STAT.SF PC ⇐ PC + 1 Flags Affected None O...
Page 185 - new most significant word of dest; R0 POINTS TO VALUE IN MEMORY
Individual Instruction Descriptions 4-99 Assembly Language Instructions 4.14.17 EXTSGNS Sign Extend String Syntax [label] name dest Clock, clk Word, w With RPT, clk Class EXTSGNS An[~] n R +3 1 n R +3 3 Execution new most significant word of dest ⇐ STAT.SF PC ⇐ PC + 1 Flags Affected None Opcode Inst...
Page 186 - Point to loc corresponding to
Individual Instruction Descriptions 4-100 MOV AP1, 3 ; Point to loc corresponding to ; extended word in acc MOVS A0, *R0 ; R0 POINTS TO VALUE IN MEMORY EXTSGN A1 ; not string version as above Alternatively, the following code can do the same thing but requires more code: MOV AP0, 0 ; POINT TO LSW OF...
Page 187 - FIR; 6 multiplication between two indirect addressed
Individual Instruction Descriptions 4-101 Assembly Language Instructions 4.14.18 FIR FIR Filter Function (Coefficients in RAM) Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class FIR An, *Rx 2 1 2(n R +2) 9a Execution With RPT N–2:(mask interrupts)RPT counter = N–2MR = h[0] = first ...
Page 189 - 6 multiplication between indirect addressed data
Individual Instruction Descriptions 4-103 Assembly Language Instructions 4.14.19 FIRK FIR Filter Function (Coefficients in ROM) Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class FIRK An, *Rx 2 1 2(n R +2) 9a Execution With RPT N–2:(mask interrupts)RPT counter = N–2MR = h[0] = firs...
Page 190 - Read IntGenCtrl register value
Individual Instruction Descriptions 4-104 4.14.20 IDLE Halt Processor Syntax [label] name Clock, clk Word, w With RPT, clk Class IDLE 1 1 N/R 9d Execution Stop processor clocksPC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 IDLE 1 1 1 1 1 1 1 1 0 0 0 1 0 ...
Page 191 - Input data from port address 0x3d to accumulator A2~.
Individual Instruction Descriptions 4-105 Assembly Language Instructions 4.14.21 IN Input From Port Into Word Syntax [label] name dest, src1 Clock, clk Word, w With RPT, clk Class IN {adrs}, port4 Table 4–46 Table 4–46 6a IN An[~], port6 1 1 n R +3 6b Execution dest ⇐ content of port6 or port4 PC ⇐ ...
Page 192 - INS; +2 times. The first sample is stored in the lowest order accumula-
Individual Instruction Descriptions 4-106 4.14.22 INS Input From Port Into String Syntax [label] name src, src1 Clock, clk Word, w With RPT, clk Class INS An[~], port6 n S +2 1 n R +2 6b Execution dest ⇐ content of port6 PC ⇐ PC + 1 Flags Affected dest is An: OF, SF, ZF, CF are set accordingly Opcod...
Page 193 - INTD
Individual Instruction Descriptions 4-107 Assembly Language Instructions 4.14.23 INTD Interrupt Disable Syntax [label] name Clock, clk Word, w With RPT, clk Class INTD 1 1 N/R 9d Execution STAT.IM ⇐ 0 (IM is STAT bit 4) PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6...
Page 194 - INTE
Individual Instruction Descriptions 4-108 4.14.24 INTE Interrupt Enable Syntax [label] name Clock, clk Word, w With RPT, clk Class INTE 1 1 N/R 9d Execution STAT.IM ⇐ 1 (IM is STAT bit 4) PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 INTE 1 1 1 1 1 1 1 ...
Page 195 - Return from interrupt. Pop top of stack to program counter.
Individual Instruction Descriptions 4-109 Assembly Language Instructions 4.14.25 IRET Return From Interrupt Syntax [label] name Clock, clk Word, w With RPT, clk Class IRET 2 1 N/R 5 Execution PC ⇐ TOS R7 ⇐ R7 – 2 TOS ⇐ *R7 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 ...
Page 196 - Conditional Jumps; RCF and RZF affected by post-modification of Rx.
Individual Instruction Descriptions 4-110 4.14.26 Jcc Conditional Jumps Syntax [label] name pma16 [, Rmod] Clock, clk Word, w With RPT, clk Class Jcc pma16 [, Rmod] 2 2 N/R 7b If true If Not true [label][label][label][label][label][label][label][label][label][label][label][label][label][label][label...
Page 199 - Jump to program memory location 0x2010 if the result is not zero.; Jump to program memory location 0x2010 if I/O port address PD
Individual Instruction Descriptions 4-113 Assembly Language Instructions Syntax Description AlternateInstruction JRNLZP pma16 [, Rmod] Conditional jump on Rx ≥ 0 after post-mod JRZP pma16 [, Rmod] Conditional jump on Rx = 0 after post-mod JRNZP pma16 [, Rmod] Conditional jump on Rx ≠ 0 after post-mo...
Page 200 - JMP
Individual Instruction Descriptions 4-114 4.14.27 JMP Unconditional Jump Syntax [label] name dest [, mod] Clock, clk Word, w With RPT, clk Class JMP pma16 2 2 N/R 7b JMP pma16, Rx++ 2 2 N/R 7b JMP pma16, Rx– – 2 2 N/R 7b JMP pma16, Rx++R5 2 2 N/R 7b JMP *An 2 1 N/R 7b Execution PC ⇐ dest [Post–modif...
Page 201 - MOV
Individual Instruction Descriptions 4-115 Assembly Language Instructions 4.14.28 MOV Move Data Word From Source to Destination Syntax [label] name dest, src, [, next A] Clock, clk Word, w With RPT, clk Class MOV {adrs}, An[~] [, next A] Table 4–46 Table 4–46 1a MOV An[~], {adrs} [, next A] Table 4–4...
Page 202 - src
Individual Instruction Descriptions 4-116 [label] Class With RPT, clk Word, w Clock, clk dest, src, [, next A] name MOV TFn, {cc} [, Rx] 1 1 N/R 8b MOV STR, imm8 1 1 N/R 9b MOV SV, imm4 1 1 N/R 9b MOV APn, imm5 1 1 N/R 9c Execution [premodify AP if mod specified]dest ⇐ src PC ⇐ PC + w Flags Affected...
Page 205 - Move immediate byte to String Register (STR)
Individual Instruction Descriptions 4-119 Assembly Language Instructions Syntax Description MOV STR, imm8 Move immediate byte to String Register (STR) MOV APn, imm5 Move immediate 5-bit value to APn register † Accumulator condition flags are modified to reflect the value loaded into either An or An~...
Page 206 - Load immediate word memory address 0x0200 to R1.
Individual Instruction Descriptions 4-120 Example 4.14.28.13 MOV R1, 0x0200 * 2 Load immediate word memory address 0x0200 to R1. Example 4.14.28.14 MOV R7, (0x0280 – 32) * 2 Load R7 (stack register) with the starting value of stack, i.e., 0x0260. Example 4.14.28.15 MOV *0x0200 * 2, R0 Store R0 to da...
Page 207 - MOVAPH; Move RAM word to MR register, add PH to An in parallel.
Individual Instruction Descriptions 4-121 Assembly Language Instructions 4.14.29 MOVAPH Move With Adding PH Syntax [label] name dest, src, src1 Clock, clk Word, w With RPT, clk Class MOVAPH An, MR, {adrs} Table 4–46 Table 4–46 1b Execution An ⇐ An + PH MR ⇐ contents of {adrs} PC ⇐ PC + w Flags Affec...
Page 208 - MOVAPHS
Individual Instruction Descriptions 4-122 4.14.30 MOVAPHS Move With Adding PH Syntax [label] name dest, src, src1 Clock, clk Word, w With RPT, clk Class MOVAPHS An, MR, {adrs} Table 4–46 Table 4–46 1b Execution An ⇐ An + PH MR ⇐ contents of {adrs} PC ⇐ PC + w Flags Affected TAG, OF, SF, ZF, CF are s...
Page 209 - MOVB; Copy value of unsigned src byte to dest byte.; Copy data memory byte pointed by R2 to accumulator A0.
Individual Instruction Descriptions 4-123 Assembly Language Instructions 4.14.31 MOVB Move Byte From Source to Destination Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class MOVB An, {adrs} Table 4–46 Table 4–46 1b MOVB {adrs}, An Table 4–46 Table 4–46 1b MOVB An, imm8 1 1 N/R 2a M...
Page 210 - Load accumulator A0 with value of 0xf2.
Individual Instruction Descriptions 4-124 Example 4.14.29.2 MOVB *R2, A0 Copy lower 8 bits of accumulator A0 to the data memory byte pointed by R2. Example 4.14.29.3 MOVB A0, 0xf2 Load accumulator A0 with value of 0xf2. Example 4.14.29.4 MOVB MR, 34 Load MR register with immidiate value of 34 (decim...
Page 211 - MOVBS; Copy value of src byte to dest.
Individual Instruction Descriptions 4-125 Assembly Language Instructions 4.14.32 MOVBS Move Byte String from Source to Destination Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class MOVBS An, {adrs} 8 Table 4–46 Table 4–46 1b MOVBS {adrs}, An Table 4–46 Table 4–46 1b Execution dest...
Page 212 - MOVS
Individual Instruction Descriptions 4-126 4.14.33 MOVS Move String from Source to Destination Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class MOVS An[~], {adrs} Table 4–46 Table 4–46 1a MOVS {adrs}, An[~] Table 4–46 Table 4–46 1a MOVS {adrs}, *An Table 4–46 Table 4–46 1b MOVS An...
Page 214 - MOVSPH; An – PH; Move data memory to MR, subtract PH from An, store result in An.
Individual Instruction Descriptions 4-128 4.14.34 MOVSPH Move With Subtract from PH Syntax [label] name dest, src, src1 Clock, clk Word, w With RPT, clk Class MOVSPH An, MR, {adrs} Table 4–46 Table 4–46 1b Execution An ⇐ An – PH MR ⇐ contents of {adrs} PC ⇐ PC + w Flags Affected TAG, OF, SF, ZF, CF ...
Page 215 - MOVSPHS
Individual Instruction Descriptions 4-129 Assembly Language Instructions 4.14.35 MOVSPHS Move String With Subtract From PH Syntax [label] name dest, src, src1 Clock, clk Word, w With RPT, clk Class MOVSPHS An, MR, {adrs} Table 4–46 Table 4–46 1b Execution An ⇐ An (second word) – PH MR ⇐ contents of ...
Page 216 - MOVT; Copy the TF2 flag bit to the 17
Individual Instruction Descriptions 4-130 4.14.36 MOVT Move Tag From Source to Destination Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class MOVT {adrs}, TFn Table 4–46 Table 4–46 5 Execution dest ⇐ src PC ⇐ PC + w Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7...
Page 217 - MOVU; Copy the value pointed by R3 to MR.
Individual Instruction Descriptions 4-131 Assembly Language Instructions 4.14.37 MOVU Move Data Unsigned Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class MOVU MR, An[~] [, next A] 1 1 n R +3 3 MOVU MR, {adrs} Table 4–46 Table 4–46 5 Execution [premodify AP if mod specifie...
Page 219 - MUL
Individual Instruction Descriptions 4-133 Assembly Language Instructions 4.14.38 MUL Multiply (Rounded) Syntax [label] name src [, mod] Clock, clk Word, w With RPT, clk Class MUL An[~] [, next A] 1 1 n R +3 3 MUL {adrs} Table 4–46 Table 4–46 5 Execution [premodify AP if mod specified]PH,PL ⇐ MR * sr...
Page 220 - MULR
Individual Instruction Descriptions 4-134 4.14.39 MULR Multiply (Rounded) With No Data Transfer Syntax [label] name src Clock, clk Word, w With RPT, clk Class MULR {adrs} Table 4–0–46 Table 4–0–46 5 Execution PH,PL ⇐ MR * src PC ⇐ PC + 1 Flags Affected TAG bit is set accordingly Opcode Instructions ...
Page 221 - MULS; is the value in STR register.; MULS A0
Individual Instruction Descriptions 4-135 Assembly Language Instructions 4.14.40 MULS Multiply String With No Data Transfer Syntax [label] name src Clock, clk Word, w With RPT, clk Class MULS An [~] n S +3 1 n R +3 3 Execution PH,PL ⇐ MR * src string PC ⇐ PC + 1 Flags Affected None Opcode Instructio...
Page 222 - MULAPL
Individual Instruction Descriptions 4-136 4.14.41 MULAPL Multiply and Accumulate Result Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class MULAPL An, {adrs} Table 4–46 Table 4–46 1b MULAPL An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]PH,PL ⇐...
Page 223 - MULAPLS
Individual Instruction Descriptions 4-137 Assembly Language Instructions 4.14.42 MULAPLS Multiply String and Accumulate Result Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class MULAPLS An, {adrs} Table 4–46 Table 4–46 1b MULAPLS An[~], An[~] n S +3 1 n R +3 3 Execution PH,...
Page 224 - MULSPL
Individual Instruction Descriptions 4-138 4.14.43 MULSPL Multiply and Subtract PL From Accumulator Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class MULSPL An, {adrs} Table 4–46 Table 4–46 1b MULSPL An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specif...
Page 225 - MULSPLS
Individual Instruction Descriptions 4-139 Assembly Language Instructions 4.14.44 MULSPLS Multiply String and Subtract PL From Accumulator Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class MULSPLS An, {adrs} Table 4–46 Table 4–46 1b MULSPLS An[~], An[~] n S +3 1 n R +3 3 Execution ...
Page 226 - MULTPL; PL
Individual Instruction Descriptions 4-140 4.14.45 MULTPL Multiply and Transfer PL to Accumulator Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class MULTPL An, {adrs} Table 4–46 Table 4–46 1b MULTPL An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specifie...
Page 227 - MULTPLS
Individual Instruction Descriptions 4-141 Assembly Language Instructions 4.14.46 MULTPLS Multiply String and Transfer PL to Acumulator Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class MULTPLS An, {adrs} Table 4–46 Table 4–46 1b MULTPLS An[~], An[~] n S +3 1 n R +3 3 Execution PH,...
Page 228 - NEGAC; –src
Individual Instruction Descriptions 4-142 4.14.47 NEGAC Two’s Complement Negation of Accumulator Syntax [label] name dest, src [,mod] Clock, clk Word, w With RPT, clk Class NEGAC An[~], An[~] [, next A] n S +3 1 n R +3 3 Execution [premodify AP if mod specified]dest ⇐ –src PC ⇐ PC + 1 Flags Affected...
Page 229 - NEGACS
Individual Instruction Descriptions 4-143 Assembly Language Instructions 4.14.48 NEGACS Two’s Complement Negation of Accumulator String Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class NEGACS An[~], An[~] n S +3 1 n R +3 3 Execution dest ⇐ –src PC ⇐ PC + 1 Flags Affected OF, SF, ...
Page 230 - NOP
Individual Instruction Descriptions 4-144 4.14.49 NOP No Operation Syntax [label] name Clock, clk Word, w With RPT, clk Class NOP 1 1 n R +3 9d Execution PC ⇐ PC + 1 (No operation) Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 NOP 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
Page 231 - NOTAC; NOT src
Individual Instruction Descriptions 4-145 Assembly Language Instructions 4.14.50 NOTAC One’s Complement Negation of Accumulator Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class NOTAC An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]dest ⇐ NOT ...
Page 232 - NOTACS
Individual Instruction Descriptions 4-146 4.14.51 NOTACS One’s Complement Negation of Accumulator String Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class NOTACS An[~], An[~] n S +2 1 n R +2 3 Execution dest ⇐ NOT src PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF are set accordingly O...
Page 233 - OR; dest OR src1
Individual Instruction Descriptions 4-147 Assembly Language Instructions 4.14.52 OR Bitwise Logical OR Syntax [label] name dest, src [, src1] [, mod] Clock, clk Word, w With RPT, clk Class OR An, {adrs} Table 4–46 Table 4–46 1b OR An[~], An[~], imm16 [, next A] 2 2 N/R 2b OR An[~], An~, An [, next A...
Page 235 - ORB; OR 0x45 immediate to accumulator A2 lower 8 bits.
Individual Instruction Descriptions 4-149 Assembly Language Instructions 4.14.53 ORB Bitwise OR Byte Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class ORB An, imm8 1 1 N/R 2a Execution dest ⇐ dest OR src PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF are set accordingly Opcode Instruct...
Page 236 - ORS
Individual Instruction Descriptions 4-150 4.14.54 ORS Bitwise OR String Syntax [label] name dest, src [, src1] Clock, clk Word, w With RPT, clk Class ORS An, {adrs} Table 4–46 Table 4–46 1b ORS An[~], An[~], pma16 n S +4 2 N/R 2b ORS An[~], An~, An n S +2 1 n R +2 3 Execution dest ⇐ dest OR src (for...
Page 237 - port4 or port6
Individual Instruction Descriptions 4-151 Assembly Language Instructions 4.14.55 OUT Output to Port Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class OUT port4, {adrs} Table 4–46 n R +3 6a OUT port6, An[~] Table 4–46 n R +3 6a Execution port4 or port6 ⇐ src PC ⇐ PC + w Flags Affec...
Page 238 - OUTS
Individual Instruction Descriptions 4-152 4.14.56 OUTS Output String to Port Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class OUTS port6, An[~] n R +2 1 n R +2 6b Execution port6 ⇐ src PC ⇐ PC + 1 Flags Affected XSF, XZF are set accordingly Opcode Instructions 16 15 14 13 12 11 1...
Page 239 - RET
Individual Instruction Descriptions 4-153 Assembly Language Instructions 4.14.57 RET Return From Subroutine (CALL, Ccc) Syntax [label] name Clock, clk Word, w With RPT, clk Class RET 1 1 N/R 5 Execution PC ⇐ TOS TOS ⇐ *R7 R7 ⇐ R7 – 2 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7...
Page 240 - RFLAG; memory flag bit at {flagadrs} data memory location; for more information)
Individual Instruction Descriptions 4-154 4.14.58 RFLAG Reset Memory Flag Syntax [label] name src Clock, clk Word, w With RPT, clk Class RFLAG {flagadrs} 1 1 N/R 8a Execution memory flag bit at {flagadrs} data memory location ⇐ 0 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 ...
Page 241 - RFM; Resets the fractional mode. Clears FM bit of STAT.
Individual Instruction Descriptions 4-155 Assembly Language Instructions 4.14.59 RFM Reset Fractional Mode Syntax [label] name Clock, clk Word, w With RPT, clk Class RFM 1 1 N/R 9d Execution STAT.FM ⇐ 0 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RFM ...
Page 242 - ROVM
Individual Instruction Descriptions 4-156 4.14.60 ROVM Reset Overflow Mode Syntax [label] name Clock, clk Word, w With RPT, clk Class ROVM 1 1 N/R 9d Execution STAT.OM ⇐ 0 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RFM 1 1 1 1 1 1 1 1 0 1 1 0 1 0 0 0...
Page 243 - RPT; load src to repeat counter.
Individual Instruction Descriptions 4-157 Assembly Language Instructions 4.14.61 RPT Repeat Next Instruction Syntax [label] name src Clock, clk Word, w With RPT, clk Class RPT {adrs} 8 Table 4–46 N/R 5 RPT imm8 1 1 N/R 9b Execution IF RPT {adrs} 8 load src to repeat counter. ELSE load imm8 to repeat...
Page 244 - RTAG; memory tag bit at {adrs} data memory location; bit of the RAM
Individual Instruction Descriptions 4-158 4.14.62 RTAG Reset Tag Syntax [label] name dest Clock, clk Word, w With RPT, clk Class RTAG {adrs} Table 4–46 Table 4–46 5 Execution memory tag bit at {adrs} data memory location ⇐ 0 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 ...
Page 245 - Reset extended sign mode status register bit 0 (the XM bit) to 0.; RXM
Individual Instruction Descriptions 4-159 Assembly Language Instructions 4.14.63 RXM Reset Extended Sign Mode Syntax [label] name Clock, clk Word, w With RPT, clk Class RXM 1 1 N/R 9d Execution STAT.XM ⇐ 0 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 R...
Page 246 - SFLAG
Individual Instruction Descriptions 4-160 4.14.64 SFLAG Set Memory Flag Syntax [label] name dest Clock, clk Word, w With RPT, clk Class SFLAG {flagadrs} 1 1 N/R 8a Execution memory flag bit at {flagadrs} data memory location ⇐ 1 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 1...
Page 247 - SFM; Set fractional mode. Set FM bit of STAT to 1.
Individual Instruction Descriptions 4-161 Assembly Language Instructions 4.14.65 SFM Set Fractional Mode Syntax [label] name Clock, clk Word, w With RPT, clk Class SFM 1 1 N/R 9d Execution STAT.FM ⇐ 1 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RXM 1 ...
Page 248 - SHL
Individual Instruction Descriptions 4-162 4.14.66 SHL Shift Left Syntax [label] name dest [, mod] Clock, clk Word, w With RPT, clk Class SHL An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]PH, PL ⇐ src << SV PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF are set accordingly O...
Page 249 - SHLAC; Shift accumulator A1 by one bit to the left.
Individual Instruction Descriptions 4-163 Assembly Language Instructions 4.14.67 SHLAC Shift Left Accumulator Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class SHLAC An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]dest ⇐ src << 1 PC ⇐ PC...
Page 250 - SHLACS
Individual Instruction Descriptions 4-164 4.14.68 SHLACS Shift Left Accumulator String Individually Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class SHLACS An[~], An[~] n S +2 1 n R +2 3 Execution dest ⇐ src << 1 PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF are set accordingly...
Page 251 - SHLAPL; Shift the word pointed by the byte address stored in R4 by n; bits to the left, add the shifted
Individual Instruction Descriptions 4-165 Assembly Language Instructions 4.14.69 SHLAPL Shift Left with Accumulate Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class SHLAPL An, {adrs} Table 4–46 Table 4–46 1b SHLAPL An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify ...
Page 252 - SHLAPLS; bits; Shift the string pointed by the byte address stored in R4 by n
Individual Instruction Descriptions 4-166 4.14.70 SHLAPLS Shift Left String With Accumulate Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class SHLAPLS An, {adrs} Table 4–46 Table 4–46 1b SHLAPLS An[~], An[~] n S +3 1 n R +3 3 Execution PH, PL ⇐ src << SV dest ⇐ dest + PL PC ⇐...
Page 253 - SHLS; Shift accumulator string value left n; bits (as specified by the SV register) into; SHLS A0
Individual Instruction Descriptions 4-167 Assembly Language Instructions 4.14.71 SHLS Shift Left Accumulator String to Product Syntax [label] name dest Clock, clk Word, w With RPT, clk Class SHLS An[~] n S +3 1 n R +3 3 Execution PH, PL ⇐ src << SV PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF are...
Page 254 - SHLSPL; bits to the left, subtract the shifted value; bits to the left, subtract PL from
Individual Instruction Descriptions 4-168 4.14.72 SHLSPL Shift Left With Subtract PL Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class SHLSPL An, {adrs} Table 4–46 Table 4–46 1b SHLSPL An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]PH, PL ⇐ s...
Page 255 - SHLSPLS
Individual Instruction Descriptions 4-169 Assembly Language Instructions 4.14.73 SHLSPLS Shift Left String With Subtract PL Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class SHLSPLS An, {adrs} Table 4–46 Table 4–46 1b SHLSPLS An[~], An[~] n S +3 1 n R +3 3 Execution PH, PL ⇐ src &...
Page 256 - SHLTPL
Individual Instruction Descriptions 4-170 4.14.74 SHLTPL Shift Left and Transfer PL to Accumulator Syntax [label] name dest, src [, mod] Clock, clk Word, w With RPT, clk Class SHLTPL An, {adrs} Table 4–46 Table 4–46 1b SHLTPL An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specif...
Page 257 - SHLTPLS
Individual Instruction Descriptions 4-171 Assembly Language Instructions 4.14.75 SHLTPLS Shift Left String and Transfer PL to Accumulator Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class SHLTPLS An, {adrs} Table 4–46 Table 4–46 1b SHLTPLS An[~], An[~] n S +3 1 n R +3 3 Execution ...
Page 258 - SHRAC; Shift right one bit the accumulator A1.
Individual Instruction Descriptions 4-172 4.14.76 SHRAC Shift Accumulator Right Syntax [label] name dest, src, [, mod] Clock, clk Word, w With RPT, clk Class SHRAC An[~], An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]dest ⇐ src >> 1 PC ⇐ PC + 1 Flags Affected OF, SF, Z...
Page 259 - SHRACS; Shift accumulator string A0 1 bit right individually.
Individual Instruction Descriptions 4-173 Assembly Language Instructions 4.14.77 SHRACS Shift Accumulator String Right Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class SHRACS An[~], An[~] n S +3 1 n R +3 3 Execution dest ⇐ src >> 1 PC ⇐ PC + 1 Flags Affected OF, SF, ZF, CF ...
Page 260 - SOVM; Set OM bit of STAT to 1. This is the mode DSP algorithms should use.
Individual Instruction Descriptions 4-174 4.14.78 SOVM Set Overflow Mode Syntax [label] name Clock, clk Word, w With RPT, clk Class SOVM 1 1 N/R 9d Execution STAT.OM ⇐ 1 PC ⇐ PC + 1 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SOVM 1 1 1 1 1 1 1 1 0 1 1 0 1 0 0 0 ...
Page 261 - STAG; memory tag bit at address adrs
Individual Instruction Descriptions 4-175 Assembly Language Instructions 4.14.79 STAG Set Tag Syntax [label] name dest Clock, clk Word, w With RPT, clk Class STAG {adrs} Table 4–46 Table 4–46 5 Execution memory tag bit at address adrs ⇐ 1 PC ⇐ PC + w Flags Affected None Opcode Instructions 16 15 14 ...
Page 262 - SUB; dest – src1
Individual Instruction Descriptions 4-176 4.14.80 SUB Subtract Syntax [label] name dest, src, src1, [next A]] Clock, clk Word, w With RPT, clk Class SUB An[~], An, {adrs} [, next A] Table 4–46 Table 4–46 1a SUB An[~], An[~], imm16 [, next A] 2 2 N/R 2b SUB An[~], An[~], PH [, next A] 1 1 n R +3 3 SU...
Page 264 - SUBB; Subtract 0x45 from accumulator A2 byte.
Individual Instruction Descriptions 4-178 4.14.81 SUBB Subtract Byte Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class SUBB An, imm8 1 1 N/R 2a SUBB Rx, imm8 1 1 N/R 4b Execution dest ⇐ dest – imm8 PC ⇐ PC + 1 Flags Affected dest is An: OF, SF, ZF, CF are set accordingly dest is R...
Page 265 - SUBS; dest – src
Individual Instruction Descriptions 4-179 Assembly Language Instructions 4.14.82 SUBS Subtract Accumulataor String Syntax [label] name dest, src, src1 Clock, clk Word, w With RPT, clk Class SUBS An[~], An, {adrs} Table 4–46 Table 4–46 1a SUBS An[~], An[~], pma16 n s +4 2 N/R 32b SUBS An[~], An, An~ ...
Page 268 - VCALL
Individual Instruction Descriptions 4-182 4.14.84 VCALL Vectored Call Syntax [label] name dest Clock, clk Word, w With RPT, clk Class VCALL vector8 2 1 N/R 7a Execution Push PC + 1PC ⇐ *(0x7F00 + vector8) R7 ⇐ R7 + 2 Flags Affected None Opcode Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 VC...
Page 269 - XOR; dest XOR src
Individual Instruction Descriptions 4-183 Assembly Language Instructions 4.14.85 XOR Logical XOR Syntax [label] name dest, src, src1 [, mod] Clock, clk Word, w With RPT, clk Class XOR An, {adrs} Table 4–46 Table 4–46 1a XOR An[~], An[~], imm16 [, next A] 2 2 N/R 2b XOR An[~], An~, An [, next A] 1 1 ...
Page 271 - XORB; An XOR imm8
Individual Instruction Descriptions 4-185 Assembly Language Instructions 4.14.86 XORB Logical XOR Byte Syntax [label] name dest, src Clock, clk Word, w With RPT, clk Class XORB An, imm8 1 1 N/R 2a Execution An ⇐ An XOR imm8 (for two operands) PC ⇐ PC + 1 Flags Affected dest is An: OF, SF, ZF, CF are...
Page 272 - XORS
Individual Instruction Descriptions 4-186 4.14.87 XORS Logical XOR String Syntax [label] name dest, src [, src1] Clock, clk Word, w With RPT, clk Class XORS An, {adrs} Table 4–46 Table 4–46 1b XORS An[~], An[~], pma16 n S +4 2 N/R 2b XORS An[~], An~, An n S +3 1 n R +3 3 Execution dest ⇐ dest XOR sr...
Page 273 - ZAC; Reset the content of accumulator A0 to zero.
Individual Instruction Descriptions 4-187 Assembly Language Instructions 4.14.88 ZAC Zero Accumulator Syntax [label] name dest [, mod] Clock, clk Word, w With RPT, clk Class ZAC An[~] [, next A] 1 1 n R +3 3 Execution [premodify AP if mod specified]dest ⇐ 0 PC ⇐ PC + 1 Flags Affected ZF = 1 Instruct...
Page 274 - ZACS; Zero the specified accumulator string.; Reset the content of offset accumulator string A1~ to zero.; ZACS A0
Individual Instruction Descriptions 4-188 4.14.89 ZACS Zero Accumulator String Syntax [label] name dest Clock, clk Word, w With RPT, clk Class ZAC An n S +3 1 n R +3 3 Execution dest ⇐ 0 PC ⇐ PC + 1 Flags Affected ZF = 1 Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ZACS An[~] 1 1 1 0 0 1 1 ...
Page 275 - Instruction Set Encoding
Instruction Set Encoding 4-189 Assembly Language Instructions 4.15 Instruction Set Encoding Instructions 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADD An[~], An, {adrs} [, next A] 1 1 1 0 ~A next A An adrs x dma16 (for direct) or offset16 (long relative) [see section 4.13] ADD An[~], An[~], imm16 [, ...
Page 284 - Instruction Set Summary
Instruction Set Summary 4-198 4.16 Instruction Set Summary Use the legend in Section 4.13 and the following table to obtain a summary ofeach instruction and its format. For detail about the instruction refer to thedetail description of the instruction. name dest [, src] [, src1] [,mod] Clock, clk Wo...
Page 297 - Chapter 5
5-1 Code Development Tools This chapter describes the code development tools for the MSP50C6xx familyof devices. The MSP50C6xx code development tool is used to compile,assemble, link, and debug programs. A reduced function C compiler,(called C– –) is also part of the code development tool. Topic Pag...
Page 298 - resistor between
Introduction 5-2 5.1 Introduction The MSP50C6xx code development tool is a system made up of a personalcomputer (PC), the EMUC6xx software, an MSP scanport interface, and aMSP50P614 connected to the application circuits. EMUC6xx is the software that executes on the PC and provides a userinterface to...
Page 299 - resistor could be added in series with the reset circuit, as
Introduction 5-3 Code Development Tools Figure 5–1. 10-Pin IDC Connector (top view looking at the board) IDC2X5M RESET VPP SCANCLK PGMPULSE SYNC GND N/C SCANIN VDD SCANOUT 1 3 5 7 9 2 4 6 8 10 PINOUT DETAILS 10-PIN HEADER (3M PART# 2510–6002UB) LAYOUT DETAILS 0.1 I 0.800 I 0.1 I IDC2X5M HOLE DIA 0.0...
Page 300 - MSP50C6xx Development Tools Guidelines; Categories of MSP50Cxx Development Tools
MSP50C6xx Development Tools Guidelines 5-4 amplifiers, an 8-position DIP switch and two momentary switches connectedto I/O pins. These boards are discussed more in Sections 5.2.2 and 5.2.4. 5.2 MSP50C6xx Development Tools Guidelines This is a summary of the tools needed for code development and spee...
Page 301 - Hardware; Tools Definitions; Hardware Tools Definitions
MSP50C6xx Development Tools Guidelines 5-5 Code Development Tools - If the user is developing host code to be used with a catalog MSP50C604operating in slave mode: J Hardware H Catalog device H SPEECH-EVM † H PC50C604 † † These items are not needed if the customer designs their own preproduction app...
Page 302 - This board supports the following speaker drive options:
MSP50C6xx Development Tools Guidelines 5-6 The emulation personality card, for the speech-EVM, that supports codedevelopment on the MSP50C614, MSP50C605, MSP50C601, andMSP50C604 (being used in master mode). A MSP50P614 is used on thisboard to emulate the MSP50C6xx core. An EPROM is used on theSPEECH...
Page 303 - Software Tools Definitions
MSP50C6xx Development Tools Guidelines 5-7 Code Development Tools - EVA50C605 (see the following note) Same as SPEECH-EVM. Note: The SPEECH-EVM and EVA50C605 have similar functionality. They bothfunction as basic target boards that support code development. One of thedifferences is that the SPEECH-E...
Page 304 - Documentation; MSP50C6xx Code Development Tools; System Requirements
MSP50C6xx Development Tools Guidelines 5-8 5.2.3 Documentation - MSP50C6xx Product Folders http://www.ti.com/sc/docs/products/speechh/index.htm - MSP50C6xx User’s Guide - Datasheet MSP50C614: MSP50C605: MSP50C601: MSP50C604: - Applications Notes Documents that help users in developing code for MSP50...
Page 305 - Hardware Tools Setup; Direct drive; Step 4: Connect the scanport interface to the SPEECH-EVM or; the scanport interface should be ON.
MSP50C6xx Development Tools Guidelines 5-9 Code Development Tools 5.3.2 Hardware Tools Setup Step 1: Plug in an appropriate personality card (see the following note) on the SPEECH-EVM or EVA50C605. Note: EPC50C605: developing code for MSP50C604 (in master mode,MSP50C601, MSP50C605, or MSP50C614). EP...
Page 306 - Step 8: Open EMU50C6xx software. The yellow light on the scanport; interface should be ON.; Figure 5–2. Hardware Tools Setup; LED DESCRIPTION
MSP50C6xx Development Tools Guidelines 5-10 Note: There is a three-way switch at the edge of the SPEECH-EVM board. Afteryou apply power to the SPEECH-EVM, you have to turn on the SPEECH-EVM. There are two ways to turn on the board depending on the powersources: - If you are using the on board with A...
Page 307 - Assembler; Assembler Directives; equates to; number
Assembler 5-11 Code Development Tools 5.4 Assembler 5.4.1 Assembler Directives Assembler directives are texts which have special meaning to the assembler.Some of these directives are extremely helpful during conditional compiling,debugging, adding additional features to existing codes, multiple hard...
Page 308 - causes a compile time syntax error. But removing the
Assembler 5-12 | (expression) (~ indicates bitwise complement) symbol is any alphanumeric text starting with an alphabetic character, a number, or an expression. Examples: SYM1 EQU (12 * 256) SYM2 EQU SYM1 * (32 / 4) SYM3 EQU SYM1 * SYM2 – *0x200 From the above example SYM1, SYM2 and SYM3 are symbol...
Page 310 - symbol
Assembler 5-14 Example: #IFDEF symbol ; do something here#ELSE; do other things here#ENDIF #IFNDEF symbol ; do something here#ELSE; do other things here#ENDIF #START_FT: This directive is created by the C– – compiler when it outputs assembly code to a file. It marks the beginning of the function tab...
Page 311 - program. This directive generates the following assembly code; AORG 0xFFFF; created by the assembler.
Assembler 5-15 Code Development Tools END expression: Expression defines the start vector for the current assembly program. This directive generates the following assembly code; AORG 0xFFFF DATA expression which defines the start vector of the program, i.e., the program address whereexecution begins...
Page 312 - C– – Compiler; Foreword
C– – Compiler 5-16 label RESW expression: This directive is used to reserve the number of words indicated by expression, starting at the current RAM address. label is given thevalue of the current RAM address. If the current RAM address is not EVEN,the assembler increments it by 1 before allocating ...
Page 313 - Variable Types; Type Name; External References
C– – Compiler 5-17 Code Development Tools 5.5.2 Variable Types Type Name Mnemonic Range Size in Bytes Example Integer int [–32768,32767] 2 int i,j; Character char [0,255] 1 char c,d; Array of integer int Not Applicable Not Applicable int array[12]; Array of characters char Not Applicable forced to e...
Page 314 - C– – Directives
C– – Compiler 5-18 5.5.4 C– – Directives C– – has a limited number of directives and some additional directives notfound in ANSI C compilers. The following directives are recognized by thecompiler. 5.5.4.1 #define This directive is used to introduce 2 types of macros, in typical C fashion: Without A...
Page 315 - Include Files
C– – Compiler 5-19 Code Development Tools Example:#include “file.h”#include <stdio.h> The include directories are defined on the cmm_input structure passed to the compiler. There is no limit to the nesting of include files. 5.5.4.4 #asm All text following this directive is inserted as is in th...
Page 316 - Note the requirement that C– – function declarations (including
C– – Compiler 5-20 /********************************/ /* Prototypes for C– –functions */ /********************************/ cmm_func add_string(int *result,int *str1,int *str2,int lg); cmm_func sub_string(int *result,int *str1,int *str2,int lg); cmm_func mul_string(int *result,int *str1,int mult,int...
Page 317 - Function Prototypes and Declarations; .It should be linked with the C; Initializations; Initialization values are stored in program memory.; RAM Usage
C– – Compiler 5-21 Code Development Tools Although we have tried to keep the differences between regular C and C– –to a minimum, there are still a few that require explanation. 5.5.6 Function Prototypes and Declarations C– – function prototypes and declarations MUST be preceded with thekeyword cmm_f...
Page 318 - String Functions; Table 5–1. String Functions
C– – Compiler 5-22 5.5.9 String Functions Arithmetic string functions are special functions that perform string arithmetic.The functions currently implemented are shown in Table 5–1. Table 5–1. String Functions add_string(int *result,int *str1,int *str2,int lg) adds strings str1 and str2, of length ...
Page 319 - lg
C– – Compiler 5-23 Code Development Tools the MSP50C6xx length of the string. It is included in the cmm_macr.h file, and is called STR_LENGTH(lstr). For example, STR_LENGTH(8) is 8–2 = 6. Also note that the user has to supply the length of the input string and the lengthof the output string in the s...
Page 320 - Implementation Details; This section is C– – specific.; Comparisons; ACO
Implementation Details 5-24 5.6 Implementation Details This section is C– – specific. 5.6.1 Comparisons We use the CMP instruction for both signed and unsigned comparisons. Thetwo integers a and b to be compared are in A0 and A0~. CMP A0,A0~ : A0 contains a, A0~ contains b A0 A0~ ACO AZ ANEG 5 0 1 0...
Page 321 - Assembly
Implementation Details 5-25 Code Development Tools - Unsigned comparison of a and b. (a is in A0, b is in A0~) Assembly Test Condition _ult a < b AULT _ule a <= b !AUGT _uge a >= b !AULT _ugt a > b AUGT The small number of comparisons was an invitation to use them as vectorcalls. We retu...
Page 322 - Division; . A C– – program starts with a jump to the
Implementation Details 5-26 5.6.2 Division Integer division currently requires the use of several accumulator pointers. Wedivide a 16 bit integer located in A0 by a 16 bit integer located in A0~. We returnthe quotient in A0~, and the remainder in A0. We make use of A3~ and A3 forscratch pads. We als...
Page 323 - . We only allow the new style of function declarations /prototypes,; Programming Example
Implementation Details 5-27 Code Development Tools declarations ( or function prototypes) are introduced by the mnemonic cmm_func . We only allow the new style of function declarations /prototypes, where the type of the arguments is declared within the function’s parentheses.For example: cmm_func bi...
Page 324 - else
Implementation Details 5-28 #include “cmm_macr.h” constant int M1[4]={0x04CB,0x71FB,0x011F,0x0}; constant int M2[4]={0x85EB,0x8FD9,0x08FB,0x0}; cmm_func string_multiply(int *p,int lgp,int *m1,int lgm1,int *m2,int lgm2) { /* note: length of p,(lgp+2) must be at least (lgm1+2) + (lgm2+2) +1 */ /* this...
Page 325 - Programming Example, C – – With Assembly Routines; STACK
Implementation Details 5-29 Code Development Tools add_string(p,pp,p,lgm1+i+1); } if(sign == –1) { neg_string(pp,p,STR_LENGTH((lgp+2))); copy_string(p,pp,STR_LENGTH((lgp+2))); } free(mm1); free(mm2); free(pp); } cmm_func main(int argc,char *argv) { int m1[4],m2[4],product[9]; xfer_const(m1,M1,STR_LE...
Page 327 - Before call
Implementation Details 5-31 Code Development Tools | | | | | | |–––––––––––––––| |–––––––––––––––| |–––––––––––––––| | | | | | | |–––––––––––––––| |–––––––––––––––| |–––––––––––––––| | | | | | | |–––––––––––––––| |–––––––––––––––| |–––––––––––––––| | | | | | | |–––––––––––––––| |–––––––––––––––| |––...
Page 333 - C to ASM function return; C– – Efficiency
C– – Efficiency 5-37 Code Development Tools C to ASM function return | | | | |––––––––––––––| |––––––––––––––| | | | | |––––––––––––––| |––––––––––––––| | | | | |––––––––––––––| |––––––––––––––| | | | | |––––––––––––––| |––––––––––––––| | | | | |––––––––––––––| |––––––––––––––| |Return Addr | |Retur...
Page 335 - Real Time Clock Example; leaving these out can cause loss of a second; Example 5–1. First Project
C– – Efficiency 5-39 Code Development Tools 5.7.1 Real Time Clock Example The C– – clock works as follows. The Timer2 ISR is set to fire at 1-secondintervals. Inside the ISR a counter is incremented by one each time it fires. Anassembly routine in cmm1.asm (_getSecondsPassed) disables the interrupts...
Page 337 - to
C– – Efficiency 5-41 Code Development Tools Seven of the files are important to the functionality of this project. The Timer2ISR (tim2_isr.asm) forms the basis for the RTC so it will be discussed first. timer2_isr mov *save_tim2_stat,STAT ;save status mov *save_tim2_a0,a0 ;save a0 ; timer fired so 1...
Page 346 - New C– – callable functions were declared global.
C– – Efficiency 5-50 inteiret Cmm1.asm was modified to include routines for sleeping and speaking fromC– –. global _inportD global _getSecondsPassed global _sleepQuarterSec global _speakDays global _speakOnes global _speakTens global _speakTeens global _speakAMPM New C– – callable functions were dec...
Page 350 - Descriptions of files that are also in Project 2 have been omitted.
C– – Efficiency 5-54 Descriptions of files that are also in Project 2 have been omitted. [lcd] Directory holding files for writing to an LCD screen. lcd.asm Routines for writing to an LCD screen. lcd.irx Mnemonics used by lcd.asm. lcd_ram.irx Allocates RAM for lcd.asm. The only changes to the assemb...
Page 353 - Beware of Stack Corruption
Beware of Stack Corruption 5-57 Code Development Tools 5.8 Beware of Stack Corruption MSP50C614/MSP50P614 stack (pointed by R7 register) can easily getcorrupted if care is not taken. Notice the following table read code: SUBB R7, 4 MOV A0, *R7–– ADD A0, address MOV A0, *A0 ADD A0, *R7–– MOV A0, *A0 ...
Page 354 - Reported Bugs With Code Development Tool
Reported Bugs With Code Development Tool 5-58 5.9 Reported Bugs With Code Development Tool The following are reported bugs for code development tool version 2.39. Breakpoint: Placement of hardware breakpoints is important for reliableoperation. Pipeline latency and sleep modes affect the scan logic ...
Page 355 - Application Circuits; Chapter 6
6-1 Applications This chapter contains application information on application circuits,processor initialization sequence, resistor trim setting, synthesis code,memory overlays, and ROM usage. Topic Page 6.1 Application Circuits 6–2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Page 356 - Note, that there are five V
Application Circuits 6-2 6.1 Application Circuits Figure 6–1. Minimum Circuit Configuration for the C614/P614 Using a Resistor-TrimmedOscillator To pin 2 of Scan Port Connector † MSP50C614/MSP50P614 To pin 1 of Scan Port Connector † (optional ) 5 V 0.1 µ F (5) R REFERENCE 470 k Ω (1%) 3300 pF OSC IN...
Page 357 - pair which services the DAC. These pins are pad numbers 21 and
Application Circuits 6-3 Applications It is of particular importance to provide a separate decoupling capacitor for theV DD , V SS pair which services the DAC. These pins are pad numbers 21 and 19, respectively. The relatively high current demands of the digital-to-analogcircuitry make this a requir...
Page 358 - Initializing the MSP50C6xx
Initializing the MSP50C6xx 6-4 In any MSP50C614 application, it is important for certain components to belocated as close as possible to the MSP50C614 die or package. These includeany of the decoupling capacitors at V DD (0.1 µ F). It also includes all of the components in the crystal-reference netw...
Page 359 - File
Initializing the MSP50C6xx 6-5 Applications 6.2.1 File init.asm ;****************************************************************; INIT.ASM;; Revision 1.04;; Modified from revision 1.03: if not CRO, we check port 0x2F; to distinguish between P and ; C parts.;; Turn off TIMER 2 rather than leave it r...
Page 362 - TI-TALKS Example Code; Getting Started; Set the breakpoint at the
TI-TALKS Example Code 6-8 6.3 TI-TALKS Example Code The TI-TALKS code contains the four vocoders (MELP, CELP, ADPCM, andLPC) and demonstrates how to use the interrupts to scan the keys and flashthe LEDs. An LCD driver module is also included. TI-TALKS should be used as a starting point for code deve...
Page 363 - Creating a New Project; RAM Overlay
RAM Overlay 6-9 Applications Creating a New Project The easiest way to create a new project is to copy the entire TI–TALKS604directory into another directory and renaming the project file as desired. It isnot necessary to change the paths of the files in the project – this will be doneautomatically ...
Page 365 - Common Problems
RAM Overlay 6-11 Applications save_tim2_stat equ save_tim1_a0a + 2 * 1 save_tim2_a0 equ save_tim2_stat + 2 * 1 save_tim2_a0a equ save_tim2_a0 + 2 * 1 ;End of RAM RAMEND_CUSTOMER equ save_tim2_a0a RAMLENGTH_CUSTOMER equ RAMEND_CUSTOMER – RAMSTART_CUSTOMER After adding new_var the MAIN_RAM.IRX file wo...
Page 367 - Customer Information; Chapter 7
7-1 Customer Information Customer information regarding package configurations, development cycle,and ordering forms are included in this chapter. Topic Page 7.1 Mechanical Information 7–2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Customer Information Fields...
Page 368 - Mechanical Information; Scan Port Bond Out; and V; , test points connected to; Die Bond-Out Coordinates
Mechanical Information 7-2 7.1 Mechanical Information The MSP50C614, MSP50C605, and the MSP50C601 are normally sold in dieform, but are also available in a 100-pin QFP package. The MSP50C604 is aavailable in die form and in a 64-pin QFP package. The MSP50P614 isavailable in a 120-pin, PGA-windowed c...
Page 369 - Table 7–1. Signal and Pad Descriptions for the MSP50C614
Mechanical Information 7-3 Customer Information Table 7–1. Signal and Pad Descriptions for the MSP50C614 SIGNAL PIN NUMBER PAD NUMBER I/O DESCRIPTION Input/Output Ports PA0 – PA7 66 – 59 75 – 68 I/O Port A general-purpose I/O (1 Byte) PB0 – PB7 76 – 69 85 – 78 I/O Port B general-purpose I/O (1 Byte)...
Page 370 - Table 7–2. Signal and Pad Descriptions for the MSP50C605
Mechanical Information 7-4 Table 7–2. Signal and Pad Descriptions for the MSP50C605 SIGNAL PIN NUMBER PAD NUMBER I/O DESCRIPTION Input/Output Ports PC0 – PC7 89 – 82 8 – 1 I/O Port C general-purpose I/O (1 Byte) PD0 – PD7 99 – 92 18 – 11 I/O Port D general-purpose I/O (1 Byte) PE0 – PE7 46 – 39 48 –...
Page 371 - Table 7–3. Signal and Pad Descriptions for the MSP50C601
Mechanical Information 7-5 Customer Information Table 7–3. Signal and Pad Descriptions for the MSP50C601 SIGNAL PIN NUMBER PAD NUMBER I/O DESCRIPTION Input/Output Ports PC0 – PC7 89 – 82 8 – 1 I/O Port C general-purpose I/O (1 Byte) PD0 – PD7 99 – 92 18 – 11 I/O Port D general-purpose I/O (1 Byte) P...
Page 372 - Table 7–4. Signal and Pad Descriptions for the MSP50C604
Mechanical Information 7-6 Table 7–4. Signal and Pad Descriptions for the MSP50C604 SIGNAL PIN NUMBER PAD NUMBER I/O DESCRIPTION Input/Output Ports PC0 – PC7 89 – 82 8 – 1 I/O Port C general-purpose I/O (1 Byte) PD0 – PD7 99 – 92 18 – 11 I/O Port D general-purpose I/O (1 Byte) PE0 – PE7 46 – 39 48 –...
Page 373 - Figure 7–1. 100-Pin QFP Mechanical Information
Mechanical Information 7-7 Customer Information Figure 7–1. 100-Pin QFP Mechanical Information 4040022 / B 03/95 0,16 NOM 14,20 17,45 13,80 16,95 50 51 31 30 12,35 TYP 1,030,73 0,25 Seating Plane 0,25 MIN Gage Plane 0,380,22 80 1 81 100 22,95 23,45 20,2019,80 2,50 2,90 3,40 MAX 18,85 TYP 0 ° – 7 ° M...
Page 374 - Figure 7–2. 64-Pin QFP Mechanical Information
Mechanical Information 7-8 Figure 7–2. 64-Pin QFP Mechanical Information 4040152 / C 11/96 32 17 0,13 NOM 0,25 0,45 0,75 Seating Plane 0,05 MIN Gage Plane 0,27 33 16 48 1 0,17 49 64 SQ SQ 10,20 11,80 12,20 9,80 7,50 TYP 1,60 MAX 1,451,35 0,08 0,50 M 0,08 0 ° – 7 ° NOTES: A. All linear dimensions are...
Page 375 - The pin assignments for the 120-pin PGA are outlined in Figure 7–4.
Mechanical Information 7-9 Customer Information The MSP50C614 is available in a windowed-ceramic, 120-pin, grid array(PGA) packaged for use in software development and prototyping. This PGApackage is shown in Figure 7–3. Figure 7–3. 120-Pin, Grid Array Package for the Development Device, MSP50P614 e...
Page 377 - Customer Information Fields in the ROM
Customer Information Fields in the ROM 7-11 Customer Information 7.2 Customer Information Fields in the ROM Customer code information is inserted in the ROM by Texas Instruments. Thisinformation appears as seven distinct fields within the ROM test-area. TheROM test-area extends from address 0x0000 t...
Page 378 - Speech Development Cycle; Figure 7–5. Speech Development Cycle; Device Production Sequence
Speech Development Cycle 7-12 7.3 Speech Development Cycle A sample speech development cycle is shown in Figure 7–5. Some of thecomponents, such as speech recording, speech analysis, speech editing, andspeech evaluation, require different hardware and software. TI provides aspeech development tool, ...
Page 380 - Ordering Information; CSM
Ordering Information 7-14 7.5 Ordering Information Because the MSP50C6xx are custom devices, they receive a distinct identifi-cation, as follows: CSM Gate Code CSM: Custom Synthesizer With Memory 6xx XXX X X Family Member (614, 605, etc.) ROM Code Revision Letter Package or Die PJM: Loopin 100-Pin Q...
Page 381 - NEW PRODUCT RELEASE FORM FOR MSP50C614
New Product Release Forms (NPRF) 7-15 Customer Information NEW PRODUCT RELEASE FORM FOR MSP50C614 SECTION 1. OPTION SELECTION This section is to be completed by the customer and sent to TI along with the mi-croprocessor code and speech data. Company:_________________ Division:______________ Project ...
Page 383 - NEW PRODUCT RELEASE FORM FOR MSP50C604
New Product Release Forms (NPRF) 7-17 Customer Information NEW PRODUCT RELEASE FORM FOR MSP50C604 SECTION 1. OPTION SELECTION This section is to be completed by the customer and sent to TI along with the mi-croprocessor code and speech data. Company:_________________ Division:______________ Project ...
Page 385 - NEW PRODUCT RELEASE FORM FOR MSP50C605
New Product Release Forms (NPRF) 7-19 Customer Information NEW PRODUCT RELEASE FORM FOR MSP50C605 SECTION 1. OPTION SELECTION This section is to be completed by the customer and sent to TI along with the mi-croprocessor code and speech data. Company:_________________ Division:______________ Project ...
Page 387 - NEW PRODUCT RELEASE FORM FOR MSP50C601
New Product Release Forms (NPRF) 7-21 Customer Information NEW PRODUCT RELEASE FORM FOR MSP50C601 SECTION 1. OPTION SELECTION This section is to be completed by the customer and sent to TI along with the mi-croprocessor code and speech data. Company:_________________ Division:______________ Project ...
Page 389 - Additional Information; Appendix A
A-1 Appendix A Additional Information This appendix contains additional information for the MSP50C6xx mixed-sig-nal processor. Topic Page A.1 Additional Information A–2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendix A
Page 390 - A.1 Additional Information
Additional Information A-2 A.1 Additional Information For current information regarding the MSP50C6xx devices (data sheets, de-velopment tools, etc.), visit the TI Speech Web site: http://www.ti.com/sc/speech