T exas Instruments and its subsidiaries (TI) reserve the right to make changes to their products or to discontinue
any product or service without notice, and advise customers to obtain the latest version of relevant information
to verify, before placing orders, that information being relied on is current and complete. All products are sold
subject to the terms and conditions of sale supplied at the time of order acknowledgement, including those
pertaining to warranty, patent infringement, and limitation of liability.
TI warrants performance of its semiconductor products to the specifications applicable at the time of sale in
accordance with TI’s standard warranty. Testing and other quality control techniques are utilized to the extent
TI deems necessary to support this warranty . Specific testing of all parameters of each device is not necessarily
performed, except those mandated by government requirements.
CERTAIN APPLICATIONS USING SEMICONDUCTOR PRODUCTS MAY INVOLVE POTENTIAL RISKS OF
DEATH, PERSONAL INJURY, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE (“CRITICAL
APPLICATIONS”). TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, AUTHORIZED, OR
WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT DEVICES OR SYSTEMS OR OTHER
CRITICAL APPLICA TIONS. INCLUSION OF TI PRODUCTS IN SUCH APPLICATIONS IS UNDERST OOD TO
BE FULLY AT THE CUSTOMER’S RISK.
In order to minimize risks associated with the customer’s applications, adequate design and operating
safeguards must be provided by the customer to minimize inherent or procedural hazards.
TI assumes no liability for applications assistance or customer product design. TI does not warrant or represent
that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other
intellectual property right of TI covering or relating to any combination, machine, or process in which such
semiconductor products or services might be or are used. TI’s publication of information regarding any third
party’s products or services does not constitute TI’s approval, warranty or endorsement thereof.
Copyright 2000, Texas Instruments Incorporated
About This Manual
This user’s guide gives information for the MSP50C61 mixed-signal processor. This information includes a functional overview, a detailed architectural
description, device peripheral functional description, assembly language
instruction listing, code development tools, applications, customer information, and electrical characteristics (in data sheet). This document also contains
information for the MSP50C604 and MSP50C605, which are in the Product
Preview stage of development.
How to Use This Manual
This document contains the following chapters:
-
Preface
Read This First
Chapter 1 –Introduction to the MSP50C614
-
-
-
-
-
-
-
-
-
Notational Conventions
This document uses the following conventions.
-
Chapter 2 –MSP50C614 Architecture
Chapter 3 –Peripheral Functions
Chapter 4 –Assembly Language Instructions
Chapter 5 –Code Development Tools
Chapter 6 –Applications
Chapter 7 –Customer Information
Appendix A –MSP50C605 Preliminary Data
Appendix B –MSP50C604 Preliminary Data
Appendix C –MSP50C605 Data Sheet
Program listings, program examples, and interactive displays are shown
in a special typeface similar to a typewriter’s. Examples use a bold
Read This First
iii
Notational Conventions
version of the special typeface for emphasis; interactive displays use a
bold version of the special typeface to distinguish commands that you
enter from items that the system displays (such as prompts, command
output, error messages, etc.).
Here is an example of a system prompt and a command that you might
enter:
C: csr –a /user/ti/simuboard/utilities
-
In syntax descriptions, the instruction, command, or directive is in a bold
typeface font and parameters are in an
italic typeface
. Portions of a syntax
that are in bold should be entered as shown; portions of a syntax that are
italics
in
describe the type of information that should be entered. Here is
an example of a directive syntax:
.asect ”
section name
”,
address
.asect is the directive. This directive has two parameters, indicated by
tion name
and
address
. When you use .asect, the first parameter must be
an actual section name, enclosed in double quotes; the second parameter
must be an address.
-
Square brackets ( [ and ] ) identify an optional parameter. If you use an
optional parameter, you specify the information within the brackets; you
don’t enter the brackets themselves. Here’s an example of an instruction
that has an optional parameter:
LALK
The LALK instruction has two parameters. The first parameter,
stant
16–bit constant [, shift]
, is required. The second parameter,
16-bit con-
shift
, is optional. As this syntax
shows, if you use the optional second parameter, you must precede it with
a comma.
Square brackets are also used as part of the pathname specification for
VMS pathnames; in this case, the brackets are actually part of the pathname (they are not optional).
-
Braces ( { and } ) indicate a list. The symbol | (read as or) separates items
within the list. Here’s an example of a list:
{ * | *+ | *– }
sec-
This provides three choices: *, *+, or *–.
iv
Information About Cautions and Warnings
Unless the list is enclosed in square brackets, you must choose one item
from the list.
-
Some directives can have a varying number of parameters. For example,
the .byte directive can have up to 100 parameters. The syntax for this directive is:
.byte
value1 [, ... , valuen]
This syntax shows that .byte must have at least one value parameter, but
you have the option of supplying additional value parameters, separated
by commas.
Information About Cautions and Warnings
This book may contain cautions and warnings.
This is an example of a caution statement.
A caution statement describes a situation that could potentially
damage your software or equipment.
This is an example of a warning statement.
A warning statement describes a situation that could potentially
cause harm to you.
The information in a caution or a warning is provided for your protection.
Please read each caution and warning carefully.
Trademarks
Intel, i486, and Pentium are trademarks of Intel Corporation.
Microsoft, Windows, Windows 95, and Windows 98 are registered trademarks of Microsoft Corporation.
The MSP50C614 (C614) is a low cost, mixed signal controller, that combines
a speech synthesizer, general-purpose I/O, onboard ROM, and direct
speaker-drive in a single package. The computational unit utilizes a powerful
new DSP which gives the C614 unprecedented speed and computational
flexibility compared with previous devices of its type. The C614 supports a
variety of speech and audio coding algorithms, providing a range of options
with respect to speech duration and sound quality.
1.6T erminal Assignments and Signal Descriptions1–10. . . . . . . . . . . . . . .
1-1
Features of the C614
1.1Features of the C614
-
Advanced, integrated speech synthesizer for high quality sound
-
Operates up to 8 MHz (performs up to 8 MIPS)
-
Very low-power operation, ideal for hand-held devices
-
Low voltage operation, sustainable by three batteries
-
Reduced power stand-by modes, less than 10 µA in deep-sleep mode
-
Supports high-quality synthesis algorithms such as MELP, CELP, LPC,
and ADPCM
-
Contains 32K words onboard ROM (2K words reserved)
-
640 words RAM
-
40 general purpose, bit configurable I/O
-
8 inputs with programmable pullup resistors and a dedicated interrupt
(key-scan)
-
16 dedicated output pins
-
Direct speaker driver, 32 Ω (PDM)
-
One-bit comparator with edge-detection interrupt service (IMPORTANT:
Not currently supported)
-
Resistor-trimmed oscillator or 32-kHz crystal reference oscillator
-
Serial scan port for in-circuit emulation and diagnostics
-
The MSP50C614 is sold in die form; an emulator device for the
MSP50C614 is sold in a ceramic package for development.
1-2
1.2Applications
Applications
Due to its low cost, low-power needs, and high programmability, the C614 is
suitable for a wide variety of applications incorporating I/O control and highquality speech:
-
Talking Toys
-
Electronic Learning Aids
-
Games
-
Talking Clocks
-
Talking Books
-
Talking Dictionaries
-
Warning Systems
-
Equipment for the Handicapped
Introduction to the MSP50C614
1-3
Development Device: MSP50P614
1.3Development Device: MSP50P614
The MSP50P614 is an EPROM based version of the MSP50C614, and is
available in 120 pin windowed ceramic pin grid array. This EPROM based
version of the device is only available in limited quantities to support software
development. Since the MSP50P614 program memory is EPROM, each
person doing software development should have several of these PGA
packaged devices.
The MSP software development tool supports non-real-time debugging by
scanning the code sequence through the MSP50C614/MSP50P614 scanport
without programming the EPROM. However, the rate of code execution is limited by the speed of the PC parallel port. Any MSP50C614/MSP50P614 can
be used in this debugging mode.
The MSP50P614 EPROM must be programmed to debug the code in real
time. The MSP software development tool is used to program the EPROM, set
a breakpoint, and evaluate the internal registers after the breakpoint is
reached. If a change is made to the code, the code will need to be updated and
programmed into another device while erasing previous devices. This cycle
of programming, debugging, and erasing typically requires 10–15 devices to
be in the eraser at any one time, so 15–20 devices may be required to operate
efficiently . The windowed PGA version of the MSP50P614 is required for this
debugging mode.
1-4
1.4Functional Description
The device consists of a micro-DSP core, embedded program and data
memory , and a self-contained clock generation system. General-purpose periphery is comprised of 64 bits of partially configurable I/O.
The core processor is a general-purpose 16 bit micro-controller with DSP
capability. The basic core block includes a computational unit (CU), data
address unit, program address unit, two timers, eight level interrupt processor,
and several system and control registers. The core processor gives the P614
and C614 break-point capability in emulation.
The processor is a Harvard type for efficient DSP algorithm execution. It requires separate program and data memory blocks to permit simultaneous access. The ROM has a protection scheme to prevent third-party pirating. It is
configured in 32K 17-bit words.
The total ROM space is divided into two areas: 1) The lower 2K words are reserved by T exas Instruments for a built-in self-test, 2) the upper 30K is for user
program/data.
The data memory is internal static RAM. The RAM is configured in 640 17-bit
words. Both memories are designed to consume minimum power at a given
system clock and algorithm acquisition frequency.
Functional Description
A flexible clock generation system is included that enables the software to
control the clock over a wide frequency range. The implementation uses a
phase-locked loop (PLL) circuit that drives the processor clock at a selectable
frequency between the minimum and maximum achievable. Selectable
frequencies for the processor clock are spaced apart in 65.536-kHz steps. The
PLL clock-reference is also selectable; either a resistor-trimmed oscillator or
a crystal-referenced oscillator may be used. Internal and peripheral clock
sources are controlled separately to provide different levels of power
management (see Figure 1–2).
The peripheral consists of five 8-bit wide general-purpose I/O ports, one 8-bit
wide dedicated input port, and one 16-bit wide dedicated output port. The
bidirectional I/O can be configured under software control as either
high-impedance inputs or as totem-pole outputs. They are controlled via
addressable I/O registers. The input-only port has a programmable pullup
option (100-kΩ minimum resistance) and a dedicated service interrupt. These
features make the input port especially useful as a key-scan interface.
A simple one-bit comparator is also included in the periphery . The comparator
is enabled by a control register, and its pin access is shared with two pins in
one of the general-purpose I/O ports. Rounding out the C614 periphery is a
Introduction to the MSP50C614
1-5
C605 and C604 (Preliminary Information)
built in pulse-density-modulated DAC (digital-to-analog converter) with direct
speaker-drive capability . The block diagram appearing in Figure 1–1 gives an
overview of the C614 functionality. IMPORTANT: a one bit comparator is not
currently supported.
Typical connections to implement reset functionality are shown in Figure 1–3.
1.5C605 and C604 (Preliminary Information)
Two related products, the MSP50C605 (C605) and MSP50C604(C604) use
the C614 core. The C605 has a 224K byte data ROM built into the chip and
32 I/O port pins. The C605 can provide up to 30 minutes of uninterrupted
speech. The C604 is designed to support slave operation with an external host
microcontroller. In this mode the C604 can be programmed with a code that
communicates with the host via a command set. This command set can be designed to support LPC, CELP , MELP, and ADPCM coders by selecting the appropriate command. The C604 can also be used stand-alone in master mode.
The C604 and the C605 use the P614 as the development version device. Details on C605 and C604 processors are found in Appendix A and B.
Note: MSP50C605 and MSP50C604
MSP50C605 and MSP50C604 are in the Product Preview stage of development. For more information contact your local TI sales office. See Appendices A and B for more information.
1-6
Figure 1–1. Functional Block Diagram for the C614
C605 and C604 (Preliminary Information)
V
SCAN
SCAN
PGM
SCAN
PULSE
RESET
OSC
OSC
OUT
CLK
SYNC
TEST
DAC
DAC
OUT
PLL
V
Power(P614 only)
(EP)ROM32k x (16 + 1) bit
Test-Area
(reserved)
User ROM0x0800 to
INT vectors0x7FF0 to
Core
Instr. Decoder
PCUProg. Counter Unit
CUComputational Unit
TIMER1 PRD1
TIMER2
Clock Control
Gen. Control
Interrupt Processor
or
DMAU
RAM 640 x 17 bit
(data)
P
M
Scan Interface
Break Point
Emulation
OTP Program
Serial Comm.
(C614 only)
(P614 only)
DAC0x30
32 Ohm PDM
Initialization
Logic
OSC Reference
Resistor
Trimmed
32 kHz nominal
or
Crystal
Referenced
32.768 kHz
PLL Filter
IN
IN
DDVPP
SS
55
0x0000 to
0x3A
PRD2
0x3E
FLAG
0x39
Data Mem. Addr.
0x07FF
0x7FEF
0x7FFF
TIM1
0x3B
TIM2
0x3F
0x3D
0x38
MASK
0x38
0x000 to
0x027F
A port I/O
Data0x00
Control0x04
B port I/O
Data0x08
Control0x0C
C port I/O
Data0x10
Control0x14
Comparator
1 bit: PD5 vs PD
D port I/O
Data0x18
Control0x1C
E port I/O
Data0x20
Control0x24
F port INPUT
Data0x28
G port OUTPUT
Data0x2C
4
+–
PA
PB
PC
PD
PE
PF
PG
0–7
8
0–7
8
0–7
8
0–7
8
0–7
8
0–7
8
0–15
16
Introduction to the MSP50C614
1-7
C605 and C604 (Preliminary Information)
Figure 1–2. Oscillator and PLL Connection
a) Crystal Oscillator Operation Connections
MSP50P614
MSP50C614
OSC
IN
32.768 kHz†
10 Mن
†
Keep these components as close as possible to the OSCIN, OSC
22 pF†
OSCOUTPLL
10 Mن
b) Resistor Trim Operation Connections
MSP50C614
MSP50P614
OSC
R
(RTO)
IN
OSCOUTPLL
470 kΩ 1%†
=
22 pF†
, and PLL pins.
OUT
C
(PLL)
C
= 3300 pF†
(PLL)
= 3300 pF†
†
Keep these components as close as possible to the OSCIN, OSC
1-8
, and PLL pins.
OUT
Figure 1–3. RESET Circuit
V
PP
(MSP50P614 only)
IN914
C605 and C604 (Preliminary Information)
To Pin 1 of Optional (Scanport)
Connector
‡
V
DD
100 kΩ
†
Inside the
MSP50P614
MSP50C614
†
If it is necessary to use the software development tools to control the MSP50P614 in application board, the 1 kΩ resistor is needed to allow the development tool to over drive the RESET circuit on the application board.
‡
This Diode can be omitted (shorted) if the application does not require use of the scanport interface. See Section 7.1.1 regarding
scan port bond out.
RESET
V
SS
1 kΩ
1 µF
(20%)
To Pin 2 of optional (scan port) connector
5 V
IN914
Reset
Switch
†
Introduction to the MSP50C614
1-9
Terminal Assignments and Signal Descriptions
1.6Terminal Assignments and Signal Descriptions
Table 1–1. Signal and Pad Descriptions for the C614
SIGNALPAD NUMBERI/ODESCRIPTION
Input/Output Ports
PA0 – PA
PB0 – PB
PC0 – PC
PD0 – PD
PE0 – PE
PF0 – PF
PG0 – PG
PG8 – PG
Pins PD4 and PD5 may be dedicated to the comparator function, if the comparator enable bit is set.
Refer to Section 3.3,
SCANIN54IScan port data input
SCANOUT50OScan port data output
SCANCLK53IScan port clock
SYNC52IScan port synchronization
TEST
PGMPULSE
The scan port pins must be bonded out on any C614 production board.
Consult the “Important Note regarding Scan Port Bond Out”, Section 7.1.1,
OSC
OSC
PLL67OPhase-lock-loop filter
DAC
DAC
RESET55IInitialization
V
V
†
Pads VSS (19) and VDD (21) service the DAC circuitry. Their pins tend to sustain a higher current draw . A dedicated decoupling
capacitor across these pins is therefore required. Refer to Section 6.1,
7
7
7
7
7
7
7
15
Comparator
IN
OUT
P
M
SS
DD
75 → 68I/OPort A general-purpose I/O(1 Byte)
85 → 78I/OPort B general-purpose I/O(1 Byte)
8 → 1I/OPort C general-purpose I/O(1 Byte)
18 → 11I/OPort D general-purpose I/O(1 Byte)
63 → 56I/OPort E general-purpose I/O(1 Byte)
31 → 24IPort F key-scan input(1 Byte)
49 → 42
39 → 32
, for details. (Currently not supported)
Scan Port Control Signals
51IC614 : test modes
Oscillator Reference Signals
65IResistor/crystal reference in
66OResistor/crystal reference out
For software development and prototyping, a windowed ceramic 120-pin grid
array packaged P614 is available. The P614’s PGA package is shown in
Figure 1–5 and Table 1–3:
Figure 1–5. 120 Pin Grid Array Package for the Development Device, P614
MSP50P614
N
M
L
K
J
H
G
F
E
D
C
B
A
214365871012 11139
N
M
L
K
J
H
G
F
E
D
C
B
A
1
42 3
extra pin
5
(bottom view)(top view)
12 1310 118967
Note: PGA Package
The PGA package is only available in limited quantities for development purposes.
Introduction to the MSP50C614
1-13
Terminal Assignments and Signal Descriptions
The pin assignments for the 120-pin PGA package (P614 device only) are outlined in the following table. Refer to Section 1.6 for more information on the
signal functions.
ncncV
N
ncncDACMDACPPF
M
PD0ncncV
L
PD3PD
K
PD5PD4PD
J
V
H
DD
V
G
SS
PC2PC3PC
F
PC5PC
E
PC7ncncextrancV
D
ncncncncPB
C
ncncncPB
B
ncncncPB
A
1
PD7PD
PC1PC
6
†
DD
PF
ncPG
2
6
0
4
ncPE
SS
PF
7
†
V
PB
0
PB
2
DD
5
6
1
3
4
PF2V
PF
3
PF
4
(bottom view)RESETscaninPE
PB5V
PB
6
PB7V
PG15PG12PG
PP
PF1PG14PG11PG
PF0PG
PA
SS
PA0PA
PA
DD
13
PG
9
PA
3
7
PA
2
PA
1
5
4
PLLOSC
PA
V
10
8
ncncPG
PG
pgmpulsSYNCscanclk
PE
ncncncnc
OSC
6
6
2
4
0
OUT
IN
V
DD
PG
5
PG
PG0scanout
PE
PE
SS
ncnc
ncnc
PG
3
PE
5
PE
2
PE
SS
ncncPG
nc
7
4
1
7
6
3
1
12345678910111213
†
It is important to provide a separate decoupling capacitor for the VDD, VSS pair which services the DAC. These pins are PGA
numbers N3 and L4, respectively. The relatively high current demands of the digital-to-analog circuitry make this a requirement.
Refer to Section 6.1,
TBD
, for details.
1-14
Chapter 2
MSP50C614 Architecture
A detailed description of MSP50C614 architecture is included in this chapter.
After reading this chapter, the reader will have in-depth knowledge of internal
blocks, memory organization, interrupt system, timers, clock control mechanism, and various low power modes.
The core processor in the C614 is a medium performance mixed signal processor with enhanced microcontroller features and a limited DSP instruction
set. In addition to its basic multiply/accumulate structure for DSP routines, the
core provides for a very efficient handling of string and bit manipulation. A
unique accumulator-register file provides additional scratch pad memory and
minimizes memory thrashing for many operations. Five different addressing
modes and many short direct references provide enhanced execution and
code efficiency.
The basic elements of the C614 core are shown in Figure 2–1. In addition to
the main computational units, the core’s auxiliary functions include two timers,
an eight-level interrupt processor, a clock generation circuit, a serial scan-port
interface, and a general control register.
Oscillator Register†
Timer Period (PRD1 and PRD2)†
Timer Register (TIM1 and TIM2)†
AP0–AP3†
Accumulator Pointer
Peripheral
Interface
Serial
Interface
VCO
Frequency
Divider
Instruction
Decoder
+1
Column Exchange
Stack (R7)
Page (R6)
Index (R5)
Loop (R4)
R3
R2
R1
R0
MUX
Arithmetic Unit
MUX
Data Memory
640 x 17 bit
†
Indicates internal programmable registers.
Incrementor
Top Of Stack (TOS)†
Program Counter (PC)†
Protection Register (PR)†
Data Pointer (DP)†
MUX
String Register†
MUX
Repeat Counter†
Status Register (STAT)†
Flag Register†
Test Code
2k x 17 bit
Program Memory
30k x 17 bit
Macro Calls
Vectors
MSP50C614 Architecture
2-3
Figure 2–2. Computational Unit Block Diagram (The shaded boxes represent internal
programmable registers.)
16
16
16
16
16
16
5
Internal Databus – 16 bit
Shift Value (SV)
Multiplier Register (MR)
17 bit x 17 bit
Multiplexer
Product High (PH)
Accumulators
AP0
AP1
AP2
AP3
16
16
(Product Low, PL)
16 LSB
16 MSB
16
0
0
16
AB
ALU
16
Read/Write
AC0
AC1
AC2
AC3
AC4
5
AC5
AC6
AC7
AC8
AC9
AC10
AC11
AC12
AC13
AC14
AC15
AC16
AC17
AC18
AC19
AC20
AC21
AC22
AC23
AC24
AC25
AC26
AC27
AC28
AC29
AC30
AC31
16
16
2-4
2.2Computation Unit
The computational unit (CU) is comprised of a (17-bit by 17-bit) Booth’s
algorithm multiplier and a 16-bit arithmetic logic unit (ALU). The block diagram
of the CU is shown in Figure 2–2. The multiplier block is served by 4 system
registers: a 16-bit multiplier register (MR), a 16-bit write-only multiplicand
register, a 16-bit high word product register (PH), and a 4-bit shift value register
(SV). The output of the ALU is stored in one 16-bit accumulator from among
the 32 which compose the accumulator-register block. The accumulator
register block can supply either one operand to the ALU (addressed
accumulator register or its offset register) or two operands to the ALU (both the
addressed register and its offset).
2.2.1Multiplier
The multiplier executes a 17-bit by 17-bit 2s complement multiply and
multiply-accumulate in a single instruction cycle. The sign bit within each
operand is bit 16, and its value extends from bit 0 (LSB) to bit 15 (MSB). The
sign bit for either operand (multiplier or multiplicand) can assume a positive
value (zero) or a value equal to the MSB (bit 15). In assuming zero, the extra
bit supports unsigned multiplication. In assuming the value of bit 15, the extra
bit supports signed multiplication. Table 2–1 shows the greater magnitude
achievable when using unsigned multiplication (65535 as opposed to 32767).
Computation Unit
Table 2–1. Signed and Unsigned Integer Representation
During multiplication, the lower word (LSB) of the resulting product, product
low, is multiplexed to the ALU. Product low is either loaded to or arithmetically
combined with an accumulator register. These steps are performed within the
same instruction cycle. Refer to Figure 2–3. At the end of the current execution
cycle, the upper word (MSB) of the product is latched into the product high
register (PH).
0x000000x0000
0x8000
0x7FFF
MSP50C614 Architecture
2-5
Computation Unit
The multiplicand source can be either data memory, an accumulator, or an
accumulator offset. The multiplier source can be either the 16-bit multiplier
register (MR) or the 4-bit shift value (SV) register. For all multiply operations,
the MR register stores the multiplier operand. For barrel shift instructions, the
multiplier operand is a 4-to-16-bit value that is decoded from the 4-bit shift
value register (SV). Refer to Figure 2–4.
As an example of a barrel shift operation, a coded value of 0x7 in the SV
register results in a multiplier operand of 0000000010000000 (1 at bit 7). This
causes a left-shift 7-times on the 16 bit multiplicand. The output result is 32-bit.
On the other hand, if the status bit FM (multiplier shift mode) is SET, then the
multiplier operand (0000000010000000) is left-shifted once to form a 17
significant-bit operand (00000000100000000). This mode is included to avoid
a divide-by-2 of the product, when interpreting the input operands as signed
binary fractions. The multiplier shift mode status bit is located in the status
register (STAT).
All three multiplier registers (PH, SV, and MR) can be loaded from data
memory and stored to data memory . In addition, data can be transferred from
an accumulator register to the PH, or vice versa. Both long and short constants
can be directly loaded to the MR from program memory.
The multiplicand is latched in a write-only register from the internal data bus.
The value is not accessible by memory or other system registers.
2-6
Figure 2–3. Overview of the Multiplier Unit Operation
MULTIPLIER UNIT INPUTS
Computation Unit
Multiplicand 16-bit
- latched in a write-only register
from one of the following sources ...
Data Memory
Accumulator
Offset Accumulator
performs multiplication and barrel shifting
MSB 16-bitLSB 16-bit
(PH) Product High(PL) Product Low
- readable and writeable by Data Memory- a simulated register: PL is realized in ALU-A
- readable and writeable by ALU-A
†
Also write-able by Program Memory
XMultiplier
- writeable and readable by Data Memory
as one of the following ...
MULTIPLYING:16-bit
SHIFTING:
MULTIPLIER UNIT
MULTIPLIER UNIT INPUTS
(MR)
(SV)
Multiplier Register†
or
Shift Value Register
2.2.2Arithmetic Logic Unit
4-bit
The arithmetic logic unit is the focal point of the computational unit, where data
can be added, subtracted, and compared. Logical operations can also be
performed by the ALU. The basic hardware word-length of the ALU is 16 bits;
however, most ALU instructions can also operate on strings of 16-bit words
(i.e., a series or array of values). The ALU operates in conjunction with a
flexible, 16-bit accumulator register block. The accumulator register block is
composed of 32, 16-bit registers which further enhances execution and
promotes compact code.
The ALU has two distinct input paths, denoted ALU-A and ALU-B (see
Figure-2–4). The ALU-A input selects between all zeros, the internal databus,
the product high register (PH), the product low (PL), or the offset output of the
accumulator register block. The ALU-B input selects between all zeros and the
output from the accumulator register block.
MSP50C614 Architecture
2-7
Computation Unit
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 minimize
residual power consumption. The databus path through ALU-A is used to input
memory values (RAM) and constant values (program memory) to the ALU.
The PH and PL inputs are useful for supporting multiply-accumulate
operations (refer to Section 2.2.1,
The operations supported by the ALU include arithmetic, logic, and
comparison. The arithmetic operations are addition, subtraction, and load
(add to zero). The logical operations are AND, OR, XOR, and NOT.
Comparison includes equal-to and not-equal-to. The compare operations may
be used with constant, memory, or string values without destroying any
accumulator values.
2.2.2.1Accumulator Block
The output of the ALU is the accumulator block. The accumulator block is composed of 32, 16-bit registers. These registers are organized into two terminals,
denoted accumulator and OFFSET accumulator. The terminals provide references for all of the data which is to be held in the accumulator block. The accumulator incorporates one-half of the 32 accumulator registers: AC0..AC15.
The OFFSET accumulator incorporates the other half: AC16..AC31.
Multiplier
).
2-8
Figure 2–4. Overview of the Arithmetic Logic Unit
ALU INPUTS
ALU-A 16-bit
Computation Unit
ALU-B 16-bit
- selects between ...
all 0’s
Offset Accumulator Register
Data Memory
Program Memory
There are four 5-bit registers which are used to store pointers to members of
the accumulator block. The accumulator pointers (AP0, AP1, AP2, AP3) are
used in two modes: 1) as a direct reference to one of 32, or 2) as an indirect
reference. The indirect reference includes a direct reference to one of 16 and
an offset (optional) which increments the reference by 16: AC(N+16). For
example, AC0 has its offset register located at AC16. AC1 has an offset
register located at AC17, and so on. The block is circular: address 31, when
incremented, results in address 0. The offsets of AC16 through AC31,
therefore, are AC0 through AC15, respectively. See Figure 2–5 Indirect
referencing by the AP pointers is supported by most of the C614’s
accumulator-referenced instructions.
MSP50C614 Architecture
2-9
Computation Unit
When writing an accumulator-referenced instruction, therefore, the working
accumulator address is stored in one of AP0 to AP3. The C614 instruction set
provides a two-bit field for all accumulator referenced instructions. The two-bit
field serves as a reference to the accumulator pointer which, in turn, stores the
address of the actual 16-bit accumulator. Some MOV instructions store the
contents of the APn directly to memory or load from memory to the APn
register. Other instructions can add or load 5-bit constants to the current APn
register contents. A full description of the C614 instruction set is given in
Chapter 4,
– AP registers are served by a 5-bit processor for sequencing addresses or repetitive operations.
– Selection between the 4 AP’s is made in the 2-bit An field in all accumulator-referenced
instructions
2.2.2.3String Operations
The AP registers are served by a 5-bit processor that provides efficient
sequencing of accumulator addresses. The design automates repetitive
operations like long data strings or repeated operations on a list of data.
When operating on a multiword data string, the address is copied from the AP
register to fetch the least significant word of the string. This copy is then
consecutively incremented to fetch the next n words of the string. At the
completion of the consecutive operations, the actual address stored in the AP
register is left unchanged; its value still points to the least significant location.
The AP register, therefore, is loaded and ready for the next repeatable
operation.
For some instructions, the 5-bit string processor can also preincrement or
predecrement the AP pointer-value by +1 or –1, before being used by the
accumulator register block. This utility can be effectively used to minimize
software overhead in manipulating the accumulator address. The
premodification of the address avoids the software pipelining effect that
post-modification would cause.
Some C614 instructions reference only the accumulator register and cannot
use or modify the offset register that is fetched at the same time. Other instructions provide a selection field in the instruction word (A~ or ~A op-code bit).
This has the effect of exchanging the column addressing sense and thus the
source or order of the two registers. Also, some instructions can direct the ALU
output to be written either to the accumulator register or to the offset accumulator register. Refer to Chapter 4,
Instructions
, for more details.
The ALU’s accumulator block functions as a small workspace, which eliminates the need for many intermediate transfers to and from memory . This alleviates the memory thrashing which frequently occurs with single accumulator designs.
2.3Data Memory Address Unit
The data memory address unit (DMAU) provides addressing for data memory
(internal RAM). The block diagram of the DMAU is shown in Figure 2–6. The
unit consists of a dedicated arithmetic block and eight read/write registers (R0
through R7). Each read/write register is 16-bits in size. The arithmetic block
is used to add, subtract, and compare memory-address operands. The
register set includes four general-purpose registers (R0 to R3) and four
special-purpose registers. The special-purpose registers are: the LOOP
control register (R4), the INDEX register (R5), the P AGE register (R6), and the
STACK register (R7). The DMAU generates a RAM address as output. The
DMAU functions completely in parallel with the computational unit, which
helps the C614 maintain a high computational throughput.
MSP50C614 Architecture
2-11
Data Memory Address Unit
Figure 2–6. Data Memory Address Unit
Arithmetic Block
Internal
Databus
2.3.1RAM Configuration
The data memory block (RAM) is physically organized into 17-bit parallel
words. Within each word, the extra bit (bit 16) is used as a flag bit or tag for
op-codes in the instruction set. Specifically , the flag bit directs complex branch
conditions associated with certain instructions. The flag bit is also used by the
computational unit for signed or unsigned arithmetic operations (see
Section 2.2.1,
R0
R1
R2
R3
R4
R5
R6
R7
LOOP
INDEX
PAGE
STACK
RegisterAddressing Mode
Internal Program Bus
Multiplier
).
RAM Address
2-12
The size of the C614 RAM block is 640 17-bit locations. Each address provided
by the DMAU causes 17 bits of data to be addressed. These 17 bits are
operated on in different ways, depending on the instructions being executed.
For most instructions, the data is interpreted as 16-bit word format. This means
that bits 0 through 15 are used, and bit 16 is either ignored or designated as
a flag or status bit.
Data Memory Address Unit
There are two-byte instructions, for example MOVB, which cause the processor to read or write data in a byte (8-bit) format. (The B appearing at the end
of MOVB designates it as an instruction, which uses byte-addressable arguments.) The byte-addressable mode causes the hardware to read/write either
the upper or lower 8 bits of the 16-bit word based on the LSB of the address.
In this case, the address is a byte address, rather than a word address. Bits
0 through 7 within the word are used, so that a single byte is automatically rightjustified within the databus. Bits 8 through 15 may also be accessed as the upper byte at that same address.
A third data-addressing mode is the flag data mode, whereby , the instruction
operates on only the single flag bit (bit 16) at a given address. All flag mode
instructions execute in one instruction cycle. The flags can be referenced in
one of two addressing modes: 1) global address, whereby 64 global flags are
located at fixed locations in the first 64 RAM addresses, and 2) flag relative
address, whereby a reference is made relative to the current P AGE (R6). The
relative address supports 64 different flags whose PAGE-offset values are
stored in the PAGE register. The flag mode instructions cannot address
memory in the INDEX-relative modes. See Chapter 4,
Instructions
, for more
details.
2.3.2Data Memory Addressing Modes
The DMAU provides a powerful set of addressing modes to enhance the performance and flexibility of the C614 core processor. The addressing modes for
RAM fall into three categories:
-
Direct addressing
-
Indirect addressing with post-modification
-
Relative addressing
The relative addressing modes appear in three varieties:
-
Immediate Short, relative to the PAGE (R6) register.
The effective RAM address is: [*R6 + (a 7 bit direct offset)].
-
Relative to the INDEX (R5) register.
The effective RAM address is: [*R5 + (an indexed offset)].
-
Long Immediate, relative to the register base.
The effective RAM address is: [*Rx + (a 16 bit direct offset)].
Refer to Chapter 4,
used in conjunction with various instructions.
Instructions
, for a full description of how these modes are
MSP50C614 Architecture
2-13
Program Counter Unit
2.4Program Counter Unit
The program counter unit provides addressing for program memory (onboard
ROM). It includes a 16-bit arithmetic block for incrementing and loading
addresses. It also consists of the program counter (PC), the data pointer (DP),
a buffer register, a code protection write-only register, and a hardware loop
counter (for strings and repeated-instruction loops). The program counter unit
generates a ROM address as output.
The program counter value, PC, is automatically saved to the stack on various
CALL instructions and interrupt service branches. The stack consists of one
hardware-level register (TOS) which points to the top-of-stack. The TOS is
followed by a software stack. The software stack resides in RAM and is
addressed using the STACK register (R7) in indirect mode (see Section 2.3,
Data Memory Address Unit
The hardware loop counter controls the execution of repeated instructions
using one of two modes: 1) consecutive iterations of a single instruction
following the repeat (RPT) instruction, or 2) a single instruction which operates
on a string of data values (string loops). For all types of repeated execution,
interrupt service branches are automatically disabled (temporarily).
).
2.5Bit Logic Unit
The data pointer (DP) register is loaded at two instances: 1) from the
accumulator during lookup-table instructions, and 2) from the databus during
the fetch of long string constants. To simplify algorithms which require
sequential indices to lookup tables, the DP register may be stored in RAM.
The bit logic unit is a 1-bit unit which operates on flag bit data. It is controllable
by eleven different instructions, which generate the decision flags for
conditional program control. The results of operations performed by the bit
logic unit are sent either to the flag bit of RAM memory or to the TF1 and TF2
bits of the status register (STAT).
2-14
2.6Memory Organization: RAM and ROM
Data memory (RAM) and program memory (ROM) are each restricted to
internal blocks on the C614. The program memory is read-only and limited to
32K, 17-bit words. The lower 2048 of these words is reserved for an internal
test code and is not available to the user. The data memory is static RAM and
is limited to 640, 17-bit words. 16 bits of the 17-bit RAM are used for the data
value, while the extra bit is used as a status flag.
The C614 does not have the capability to execute instructions directly from
external memory. However, additional program memory (external ROM) can
be accessed using the general-purpose I/O. The interface for external ROM
must be configured in the software.
2.6.1Memory Map
The memory map for the C614 is shown in Figure 2–7. Refer to Section 2.6.3,
Interrupt Vectors
and to Section 2.7.2,
on the I/O communications ports.
, for more detailed information regarding the interrupt vectors,
Shaded boxes highlight dedicated ROM and control registers.
2.6.2Peripheral Communications (Ports)
Peripheral functions in the C614 are controlled using one or more of the I/O
address-mapped communications ports. Table 2–2 describes the ports.
The width of each mapped location, shown in width of location, is independent
of the address spacing. In other words, some registers are smaller in width
than the spacing between neighboring addresses. The few unused bits appear
to the right of the LSB values within the DAC Data register, address 0x30 (refer
2-16
to Section 3.2.2,
DAC Control and Data Registers
0x3B
0x3D
0x3E
0x3F
TIM1
ClkSpdCtrl
PRD2
TIM2
).
Memory Organization: RAM and ROM
When writing to any of the locations in the I/O address map, therefore, the
bit-masking need only extend as far as width of location. Within a 16-bit
accumulator, the desired bits (width of location) should be right-justified. The
write operation is accomplished using the OUT instruction, with the address
of the I/O port as an argument.
A read from these locations is accomplished using the IN instruction, with the
address of the I/O port as an argument. When reading from the I/O port to a
16-bit accumulator, the IN instruction automatically clears any extra bits in
excess of width of location. The desired bits in the result will be right-justified
within the accumulator.
Allowable access indicates whether the port is bidirectional, read-only, or
write-only. The last column of the table points to the section in this manual
where the functions of each bit have been defined in more detail.
Table 2–2. Summary of C614’s Peripheral Communications Ports
I/O Map
Address
0x008 bitsread & writeI/O port A dataPA
0x048 bitsread & writeI/O port A controlPA
0x088 bitsread & writeI/O port B dataPB
0x0C8 bitsread & writeI/O port B controlPB
0x108 bitsread & writeI/O port C dataPC
0x148 bitsread & writeI/O port C controlPC
0x188 bitsread & writeI/O port D dataPD
0x1C8 bitsread & writeI/O port D controlPD
0x208 bitsread & writeI/O port E dataPE
0x248 bitsread & writeI/O port E controlPE
0x288 bitsREAD onlyInput port F dataPF
When its event has triggered and its service has been enabled, an interrupt
causes the program counter to branch to a specific location. The destination
location is stored (programmed) in the interrupt vector, which resides in an upper address of ROM. The following table lists the ROM address associated
with each interrupt vector:
Interrupt Name
INT00x7FF0DAC TimerHighest
INT10x7FF1TIMER12nd
INT20x7FF2TIMER23rd
INT30x7FF3port D
INT40x7FF4port D
INT50x7FF5all port F6th
INT60x7FF6port D
INT70x7FF7port D
RESET
ROM address of
Vector
Event SourceInterrupt Priority
2
3
4
5
0x7FFEstorage for ROM Protection Word
0x7FFFstorage for initialization vector
Section for
Reference
4th
5th
7th
Lowest
2-18
Note: ROM Locations that Hold Interrupt Vectors
ROM locations that hold interrupt vectors are reserved specifically for this
purpose. Additional ROM locations 0x7FF8 - 0x7FFD are reserved for future
expansion. Like the interrupt vectors, they should not be used for general
program storage.
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 Section
3.1.5,
specific conditions for each interrupt-trigger event. The branch operation,
however, is also contingent on whether the interrupt service has been enabled.
This is done individually for each interrupt, using the interrupt mask bits within
the interrupt/general control register. Refer to Section 2.7,
more details.
The ROM location 0x7FFF holds the program destination associated with the
hardware RESET event (branch happens after RESET LOW-to-HIGH). The
location 0x7FFE holds the read/write block-protection word. Refer to Section 2.6.4,
scheme.
2.6.4ROM Code Security
The C614 provides a mechanism for protecting its internal ROM code from
third-party pirating. The protection scheme is composed of two levels, both of
which prevent the ROM contents from being read. Protection may be applied
to the entire program memory, or it can be applied to a block of memory
beginning at address 0x0000 and ending at an arbitrary address. The two
levels of ROM protection are designated as follows:
Internal and External Interrupts
ROM Code Security
, for an explanation of the ROM security
Memory Organization: RAM and ROM
, for more information regarding the
Interrupt Logic
, for
-
Direct read and write protection, via the ROM scan circuit.
-
Indirect read protection, which prohibits the execution of memory-lookup
instructions.
For the purposes of direct security , the ROM is divided into two blocks. The first
block begins at location 0x0000, and ends, inclusively, at location
(m × 512 – 1), where m is some integer. Each address specifies a 17-bit word
location. The second block begins at location (m × 512), and ends, inclusively ,
at 0x7FFF (the end of the ROM). The first block is protected from reads and
writes by programming a block protection bit, and the second block is
protected from reads and writes by programming a global protection bit.
The two-block system is designed in such a way that a secondary developer
is prevented from changing the partition address between blocks. Once the
block protection has been engaged, then the only security option available to
the secondary developer is engaging the global protection.
Note: Instructions with References
Care must be taken when employing instructions that have either long string
constant references or look-up table references. These instructions will
execute properly only if the address of the instruction and the address of the
data reference are within the same block.
MSP50C614 Architecture
2-19
Memory Organization: RAM and ROM
The protection modes are implemented on the C614 as follows. Within the
ROM is a dedicated storage for the block protection word (address 0x7FFE).
The block protection word is divided into two 6-bit fields and two single-bit
fields. The remainder of the 17-bit word is broken into three single-bit fields
which are reserved for future use.
050403020100050403020100
TM : True Protection Marker (NTM)GP : Global Protection (0 value protects)
FM : False Protection Marker (NFM)BP : Block Protection (0 value protects)
R : Reserved for future use (must be 1) 1 : Default value of cells on erasure
The two 6-bit fields are designated as the true protection marker, (TM5 through
TM0) and the false protection marker, (FM5 through FM0). When setting up
a partition for partial ROM protection, the address of the partition must be specified as:
2-20
Memory Organization: RAM and ROM
[(NTM + 1) * 512 – 1] = highest ROM address within the block to be
protected
(NTM + 1) * 512= lowest ROM address which is left unprotected
N
TM
= the value programmed at TM5…TM0 (true
protection marker)
N
N
FM
FM
≡ the binary complement of N
TM
= the value programmed at FM5…FM0 (false
protection marker)
The purpose of the true and false protection markers is to provide parity. An
erased P614 EPROM cell defaults to the value 1. Once programmed from 1
to 0, it cannot be programmed back to 1, unless the cell (and all other cells
along with it) are subject to erasure. A multi-pass programming, therefore, can
only lower the value stored at an EPROM address and never raise it. Once a
valid block-partition address has been properly specified in both TM and FM,
it is impossible to change TM to another address and still maintain parity with
FM.
Note: Block Protection Mode
When applying the block protection mode, bits FM5 through FM0 must be
programmed as the logical inverse of bits TM5 through TM0, respectively.
Across the span of the 32k word ROM space, there are 64 possible values for
NTM (including zero). Hence, the 6-bit-wide locations for TM and FM.
The two single-bit fields found within the block protection word are the block
protection bit (BP) and the global protection bit (GP). If BP and GP are both
SET (erased), then no protection is applied to the ROM.
If BP is CLEAR and GP is SET, then the block protection mode is engaged.
This means that read and write access is prevented at locations 0x0000
through [(N
+ 1) × 512 – 1]. Read and write access is permitted at locations
TM
[(NTM + 1) × 512] through 0x7FFF.
If GP is CLEAR, then the global protection mode is engaged. This prevents
read and write access to all addresses of the ROM, regardless of the value of
BP.
Note: Block Protection Word
The remaining bits in the block protection word are reserved for future use,
but must remain set in order to ensure future compatibility. These bits are
numbers 6, 15, and 16.
MSP50C614 Architecture
2-21
Interrupt Logic
When the device is powered up, the hardware initialization circuit reads the
value stored in the block protection word. The value is then loaded to an internal register and the security state of the ROM is identified. Until this occurs,
execution of any instructions is suspended.
The same initialization sequence is executed before entry into the special
test-modes available on the P614 and C614 (EPROM mode, emulation mode,
and trace mode). This insures that the protection scheme is always in force
when running the processor in one of these modes. A dedicated circuit
ensures that a switch between emulation mode and trace mode cannot occur
without going through the initialization (security check). This forces all look-up
tables and long constant references to originate from an external program
source, when in emulation mode. It is possible to switch from trace mode to
emulation mode by lowering V
jeopardize code security.
2.6.5Macro Call Vectors
Macro call vectors are similar to CALL instructions except they take an 8-bit
address. The upper 8 bits is always 7Fh. See Section 4.14.83,
more information on the VCALL instruction.
, but this transition, by design, does not
PP
VCALL
, for
2.7Interrupt Logic
2-22
An eight-level interrupt system is included as part of the C614’s core
processor. The initialization and control of these interrupts is governed by the
following components: the global interrupt enable, the interrupt flag register,
the interrupt mask register, and the interrupt service branch. Each of these is
described below.
Interrupts must be globally enabled using the INTE instruction, and they are
globally disabled using the INTD instruction. INTE sets the global interrupt
enable bit, and INTD clears the global interrupt enable bit. The state of this bit
specifically determines whether any interrupt service branches will be taken.
The global interrupt enable appears as bit 4 within the status register (ST AT).
Each interrupt level waits for the conditions of its trigger event (refer to
Figure 2–8). At the time that a trigger event occurs, the respective bit is
automatically SET in the interrupt flag register (IFR). The IFR is an 8-bit wide
port-addressed register; wherein, each interrupt level is represented. A set bit
in the IFR indicates that the interrupt is pending and waiting to be serviced. A
clear bit indicates that the interrupt is not currently pending. The address of the
IFR is 0x39. After a RESET low, the IFR is left in the same state it was before
Interrupt Logic
the RESET low, assuming there is no interruption in power. For a full
description of the interrupt-trigger events, refer to Section 3.1.5,
External Interrupts
IFR
Interrupt Flag register
address 0x39
D5 : port D5 falling-edge
D4 : port D4 rising-edge
D3 : port D3 falling-edgeT1 : TIMER1 underflow
D2 : port D2 rising-edgeDA : DAC timer underflow
1 : A bit value 1 indicates pending interrupt waiting to be serviced.
RESET: The IFR is left in the same state it was before RESET low, assuming no interruption in power .
†
INT6 and INT7 may be associated instead with the Comparator function, if the Comparator Enable bit has been set. Refer to
Section 3.3,
Comparator
†
†
, for details.
.
(8-bit wide location)
0706050403020100← INT number
D5
D4 PFD3 D2T2T1 DA
lowhigh
priority priority
PF : any port F falling-edge
T2 : TIMER2 underflow
Internal and
Individual interrupts are enabled or disabled for service by setting or clearing
the respective bit in the interrupt mask register (IMR, 8 bits). If an interrupt level
has its bit cleared in the IMR, then the interrupt service associated with that
interrupt is disabled. Setting the bit in the IMR allows service to occur (pending
the trigger-event which is registered in the IFR).
The IMR is accessible as part of another (larger) register, namely, the
interrupt/general control register (peripheral port 0x38). After a RESET LOW,
the default value of each bit in the IMR is zero: no interrupt service enabled.
A full description of the bit locations in the interrupt/general control register can
be found in Section 3.4,
Interrupt/General Control Register
.
The IMR functions independently of the IFR, in the sense that interrupt-trigger
events can be registered in the IFR, even if the respective IMR bit is clear. Both
the IFR and IMR are readable and writeable as port addressed registers. To
read the register, use the IN instruction in conjunction with the port address
(0x38 or 0x39). Use the OUT instruction to write. (Refer to Section 2.6.2,
Peripheral Communications (Ports)
, for more information.)
MSP50C614 Architecture
2-23
Interrupt Logic
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 obtaining a software interrupt. An IFR bit may also be cleared, using OUT, at any
time.
Assuming the global interrupt enable is set and the specific bit within the IMR
is set, then, at the time of the interrupt-trigger event, an interrupt service
branch is initiated. (The trigger event is marked by a 0-to-1 transition in the IFR
bit). At that time, the core processor searches all interrupt levels which have
both: 1) pending interrupt flag, and 2) interrupt service enabled. The highest
priority interrupt among these is selected. The program then branches to the
location which is stored in the associated Interrupt Vector (Section 2.6.3,
rupt Vectors
). This location constitutes the start of the interrupt service routine.
Inter-
Instructions in the interrupt service routine are executed until the IRET (return)
instruction is encountered. Afterwards, any other pending interrupts will be
similarly serviced, in the order of their priority . Eventually , the program returns
to whatever point it was before the first interrupt service branch.
When an interrupt service branch is taken, the global interrupt enable is
automatically cleared by the core processor. This disables all further interrupt
service branches while still in the pending service routine. As a result, the
programmer must re-enable the interrupts globally using the INTE instruction.
If performed as the second-to-last instruction in the service routine, then no
nesting of multiple interrupts will occur. If, on the other hand, a nesting of
certain interrupts is desired, then the INTE instruction may be included as the
first instruction (or anywhere else) within the service routine.
2-24
When an interrupt service branch is taken, the processor core also clears
another status, namely , the respective bit in the IFR. This action automatically
communicates to the IFR that the current pending interrupt is now being
serviced. Once cleared, the IFR bit is ready to receive another SET whenever
the next trigger event occurs for that interrupt.
Note: Interrupt Service Branch
If the interrupt service branch is not enabled by the respective bit in the mask
register, then neither the global interrupt enable nor the respective flag bit is
cleared. No program vectoring occurs.
Figure 2–8 provides an overview of the interrupt control sequence. INT0 is the
highest priority interrupt, and INT7 is the lowest priority interrupt.
Figure 2–8. Interrupt Initialization Sequence
Interrupt Logic
INTD
instruction
INTE
instruction
CLEAR
SET
Global Interrupt Enable
CLEAR
CLEAR BIT
Associated With the Interrupt-Trigger Event
INT7 INT6 INT5 INT4 INT3 INT2 INT1 INT0
Interrupt / General Control Register (0x38)†
INT7 INT6 INT5 INT4 INT3 INT2 INT1 INT0
Interrupt-Trigger Event
• Internal Timer Underflow
• External Input Falling-Edge
• External Input Rising-Edge
• Software Write Instruction
INT Flag bits (IFR)
Interrupt Flag Register (0x39)
INT Mask bits (IMR)
Specific Enable for Interrupt Service
†
SET BIT
Interrupt
Service
Routine
(1 of 8)
INTE
IRET
†
The port-addressed write instruction (OUT) can be used to SET or CLEAR bits in the IFR and IMR.
In addition to being individually enabled, all interrupts must be GLOBALLY
enabled before any one can be serviced. Whenever interrupts are globally
disabled, the interrupt flag register may still receive updates on pending trigger
events. Those trigger events, however, are not serviced until the next INTE
instruction is encountered.
After an interrupt service branch, it is the responsibility of the programmer to
re-SET the global interrupt enable, using the INTE instruction.
2.8Timer Registers
The C614 contains two identical timers, TIMER1 and TIMER2. Each includes
a period register and a count-down register. The period register (PRD1 or
PRD2) defines the initial value for the counter, and the count-down register
(TIM1 or TIM2) does the counting. When the count-down register decrements
to the value 0x0000, then the value currently stored in the period register is
loaded to the count-down register. The count-down register then resumes
counting again from that value.
For each TIMER, there is an interrupt-trigger event associated with the
TIMER’s underflow condition (the point of reaching 0x0000 and then re-setting
again). When enabled, the interrupt INT1 is triggered by the underflow of
TIMER1, and the interrupt INT2 is triggered by the underflow of TIMER2. INT1
and INT2 are the second and third-highest priority interrupts in the C614. Refer
to Section 2.7,
Section 2.6.3,
Interrupt Logic
Interrupt Vectors
, for a summary of the interrupt logic, and to
, for a listing of the interrupt vectors.
Both the period and the count-down registers are readable and writeable as
port-addressed registers:
2-26
PRD1 register
address 0x3A
TIM1 register
address 0x3B
Timer Registers
(16-bit wide location)
15141312111009080706050403020100
†
†
PPPPPPPPPPPPPPPP
TIMER1 Period
TTTTTTTTTTTTTTTT
TIMER1 Count-Down Triggers INT1 on underflow
PRD2 register
address 0x3E
TIM2 register
address 0x3F
†
TIMER1 may be associated with the comparator function, if the comparator enable bit is set. Refer to Section 3.3,
for details.
PPPPPPPPPPPPPPPP
TIMER2 Period
TTTTTTTTTTTTTTTT
TIMER2 Count-Down Triggers INT2 on underflow
P : period register (initial counter value)
T : count-down register (counts from the value in P)
0x0000 : default state of both registers after RESET LOW
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 TIM
register has finished decrementing to 0x0000. The new value in the PRD
register is then loaded to the TIM register, and counting resumes from the new
value.
Note: Writing to the TIM Register
Writing to the TIM register causes the same value to be written to the PRD
register. In this case, the TIM register is immediately updated, and counting
continues immediately from the new value.
Comparator
,
Each TIMER decrements its count-down register at a fixed clock rate. The rate
is selectable between two existing clock sources: the reference oscillator or
1/2 Master Clock. The rate of the master clock (MC) is programmable. It is
determined by the value loaded to the PLL multiplier (Section 2.9.3,
Speed Control Register
). The source to the TIMER is therefore one-half the
Clock
frequency of the programmed master clock (1/2 MC). If, instead, the reference
oscillator is selected as the source to the TIMER, then the source is either a
resistor-trimmed oscillator (RTO) or a crystal oscillator (CRO). Both reference
oscillators are designed to run at a nominal 32 kHz. Refer to Section 2.9,
Clock Control
, for more information regarding the oscillator configuration and
clock programmability.
MSP50C614 Architecture
2-27
Timer Registers
Selection between the timer-source options is made using two control bits in
the interrupt/general control register (IntGenCtrl). The IntGenCtrl is a 16-bit
port-addressed register at 0x38. Clearing bit 8 selects 1/2 MC as the source
for TIMER1. Setting bit 8 selects the reference oscillator as the source for TIMER1. Similarly , clearing bit 9 of the IntGenCtrl selects 1/2 MC as the source for
TIMER2. Setting bit 9 selects the reference oscillator as the source for TIMER2. The default value after a RESET LOW is zero: select 1/2 MC as the
source.
Each of the TIMERs counts from the value stored in its period register to
0x0000. These maximum and minimum counts each receive a full clock cycle
from the TIMER source. This means that the true period of the TIMER, from
one underflow event to the next, is the value stored in the period register plus
one:
Time duration btwn. underflows = (value in PRD + 1) ÷ (frequency of T imer
Source)
TIMER1 and TIMER2 must be enabled for use. This is done at the IntGenCtrl
register. Bit 10 of the IntGenCtrl is the enable bit for TIMER1, and bit 11 is the
enable bit for TIMER2. Setting the enable bit enables the TIMER, i.e., starts
count-down running. Clearing the enable bit disables the TIMER, i.e., stops
the count-down. The default setting after a RESET LOW is zero: both TIMERs
disabled. Refer to Section 3.4,
Interrupt/General Control Register
, for sum-
mary information regarding the IntGenCtrl.
2-28
The TIMER enable bits may be used to start and stop the TIMERs repeatedly
in software. Switching the enable bit from 1 to 0 stops the TIMER, but the
current value in the count-down register is retained. When the enable bit is
subsequently switched from 0 to 1, count-down then resumes from the held
value. The following procedure outlines one (of many) possible ways to start
the TIMERs. TIMER2 is given as an example:
1) Select the TIMER2 clock source: 1/2 MC or RTO/CRO (bit 9 of the IntGenCtrl, address 0x38).
2) Clear the TIMER2 enable (bit 11 in the IntGenCtrl).
3) Load the count-down register (TIM2) with the desired period value aheadof-time. This prepares TIM2 for counting, and also loads the period register (PRD2) with its value.
4) Be sure the TIMER2 interrupt (INT2) has been enabled for service (set bit
2 of IntGenCtrl).
5) Flip the TIMER2 enable bit from 0 to 1, at the precise time you want counting to begin.
2.9Clock Control
2.9.1Oscillator Options
The C614 has two oscillator options available. Either option may be enabled
using the appropriate control bits in the clock speed control register
(ClkSpdCtrl). The ClkSpdCtrl is described in Section 2.9.3,
trol Register
The first oscillator option, called the resistor-trimmed oscillator (RTO), is useful
in low-cost applications where accuracy is less critical. This option utilizes a
single external resistor to reference and stabilize the frequency of an internal
oscillator. The oscillator is designed to run nominally at 32 kHz. It has a low V
coefficient and a low temperature coefficient (refer to Appendix C). The
reference resistor is mounted externally across pins OSCIN and OSC
RTO oscillator is insensitive to variations in the lead capacitance at these pins.
The required value of the reference resistor is 470 kΩ (1%).
The second oscillator option, CRO for crystal referenced, is a real time clock
utilizing a 32.768 kHz crystal. The crystal is mounted externally across pins
OSC
and OSC
IN
Clock Control
Clock Speed Con-
.
DD
. The
OUT
.
OUT
2.9.2PLL Performance
A software controlled PLL multiplies the reference frequency (generated from
either RTO or CRO) by integer multiples. This higher frequency drives the
master clock which, in turn, drives the CPU clock. The master clock (MC)
drives the circuitry in the periphery sections of the C614. The CPU Clock drives
the core processor; its rate determines the overall processor speed. The multiplier in the PLL circuit, therefore, allows the master clock and the CPU clock
to be adjusted between their minimum and maximum values.
For either oscillator option, the reference frequency (32.768 kHz) is multiplied
by four before it is accessed by the PLL circuit. The base frequency for the PLL,
therefore, is 131.07 kHz, and the multiplier operates in increments of this base
frequency. The minimum multiplication of the base frequency is 1, and the
maximum multiplication is 256. The resulting master clock frequency, therefore, can be varied from a minimum of 131.07 kHz to a maximum of 33.554
MHz, in 131.07 kHz steps.
From the master clock to the CPU clock, there is a divide-by-two in frequency .
The CPU clock, therefore, can be set to run between 65.536 kHz and the maximum achievable (see Appendix C), in 65.536 kHz steps.
MSP50C614 Architecture
2-29
Clock Control
The maximum required CPU clock frequency for the C614 is 8 MHz over the
entire VDD range. This rate applies to the speed of the core processor. Higher
CPU clock frequencies may be achieved, but these are not qualified over the
complete range of supply voltages in the guaranteed specification.
Figure 2–9. PLL Performance
Oscillator Reference
32 kHz
Resistor
Trimmed
RTOCRO
Selection Made in ClkSpdCtrl
Phase-Locked-Loop circuit
Multiplier Adjusted in ClkSpdCtrl
or
x4
PLL
x 1 ... x 256
crystal
referenced
Timer Source Option
Selected in IntGenCtrl
1
0
1
0
÷2
CPU Clock
(F
MAX
MC
÷2
= 8 MHz)
Master Clock : Runs Periphery
131.07 kHz ... 33.554 MHz
Core-Processor Speed
65.536 kHz ... F
TIMER2
MAX
TIMER2
2.9.3Clock 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 two
control bits located at bits 8 and 9. Setting bit 8 configures the C614 for the RTO
reference option and simultaneously starts that oscillator. Setting bit 9
configures the C614 for the CRO reference option and simultaneously pulses
the crystal, which starts that oscillator.
2-30
Clock Control
Note: ClkSpdCtrl Bits 8 and 9
When bit 8 is set in the ClkSpdCtrl register, the crystal oscillator bit (bit 9) becomes the least significant bit of the 6-bit resistor trim value. Thus, bits 15–1 1
and 9 make up the 6-bit resistor trim value. For example, if the ClkSpdCtrl
register is 00010X11XXXXXXXX (X means don’t care, bold numbers are re-
sistor trim bits), then the resistor trim value is equal to five.
The default value of the ClkSpdCtrl is 0x0000, which means that neither option
is enabled by default. Immediately after a RESET LOW-to-HIGH, and
regardless of whether a resistor or a crystal is installed across OSCIN/
OSC
, the C614 does not have a reference oscillator running. In the
OUT
absence of a reference, however, the PLL still oscillates; it bottoms-out at a
minimum frequency . The master clock, in turn, runs at a very slow frequency
(less than 100 kHz) in the absence of a reference oscillator. Under this
condition, program execution is supported at a slow rate until one of the two
references (RTO or CRO) is enabled in software. (Refer to Chapter 8,
MSP50C614 Electrical Specifications
, for a more precise characterization of
the master clock rate under these conditions.)
Once a reference oscillator has been enabled, the speed of the master clock
(MC) can be set and adjusted, as desired. Bits 7 through 0 in the ClkSpdCtrl
constitute the PLL multiplier (PLLM). The value written to the PLLM controls
the effective scaling of the MC, relative to the 131.07 kHz base frequency. A
0 value in PLLM yields the minimum multiplication of 1, and a 255 value in
PLLM yields the maximum multiplication of 256. The resulting MC frequency ,
therefore, is controlled as follows:
MCMaster clock frequency kHz = (PLLM register value + 1) × 131.07 kHz
CPUClock frequency kHz = (PLLM register value + 1) × 65.536 kHz
The configuration of bits in the clock speed control register appears below:
T5T4 T3T2T1 I C or T0 RMMMMMMMM
T : RTO oscillator-Trim adjust R : enable Resistor-trimmed oscillator
I : Idle State clock Control M : PLLM multiplier bits for MC
C : enable Crystal oscillator
(or T0 if R is set
0x0000 : default state after RESET LOW
MSP50C614 Architecture
2-31
Clock Control
Bit 10 in the ClkSpdCtrl is idle state clock control. The level of deep-sleep
generated by the IDLE instruction is partially controlled by this bit. When this
bit is cleared (default setting), the CPU Clock is stopped during the sleep, but
the MC remains running. When the idle state clock control bit is set, both the
CPU clock and the MC are stopped during sleep. Refer to section 2.12 for more
information regarding the C614’s reduced-power modes.
Note: Reference Oscillator Stopped by Programmed Disable
If the reference oscillator is stopped by a programmed disable, then, on reenable, the oscillator requires some time to restart and resume its correct frequency. This time imposes a delay on the core processor resuming fullspeed operation. The time-delay required for the CRO to start is GREA TER
than the time-delay required for the RTO to start.
2.9.4RTO Oscillator Trim Adjustment
Bits 15 through 11 and bit 9 (6 bits total) in the ClkSpdCtrl effect a software
control for the RTO oscillator frequency. The purpose of this control is to trim
the RTO to its rated (32 kHz) specification. The correct trim value varies from
device to device. The user must program bits 15 through 1 1 and 9, in order to
achieve the 32-kHz specification within the rated tolerances. Texas
Instruments provides the trim value to the programmer of the P614 part with
a sticker on the body of the chip. For the C614 part, the correct trim value is
located at I/O location 0x2Fh.
RTRIM Register (Read Only) (Applies to MSP50C614 Device Only)
I/O Address 0x2Fh(17-bit wide location)
1615141312111009080706050403020100
RRRRRRRRRRRT5T4T3T2T1T0
T: RTO oscillator-trim storage (device specific)
R: reserved for Texas Instruments use
ClkSpdCtrl Value Copied (Shaded)
1514131211109876543210
T5T4 T3T2T1IT01M7 M6 M5 M4 M3 M2 M1 M0
When selecting and enabling the RTO oscillator ,therefore, the bits at positions
05 through 01 should be read from I/O location 0x2F (MSP50C614 device
only), then copied to the ClkSpdCtrl trim adjust (bits 15 through 11 of control
register 0x3D), and bit 0 of 0x2F I/O port should be copied to bit 9 of ClkSpdCtrl
register. The bit ordering is the same; bit 04 of I/O 0x2F copies to bit 15 of
register 0x3D. Likewise, bit 00 of I/O 0x2F copies to bit 11 of register 0x3D.
2-32
Execution Timing
However, the general specification of the adjustment can be useful in certain
circumstances. For example, the adjustment can be used to obtain a programmatic increase or decrease in the speed of the RTO reference. The default value for the adjustment, after RESET low, is all zeros. The zero value generates
the slowest programmable rate for the RTO reference. The maximum value,
0x3F , generates the fastest programmable rate for the RTO reference. The full
range from 0x00 to 0x3F , ef fects an approximate +62% change (based on the
RTO resistor value specification). The change is nonlinear and nonlinear it
changes from one device to another.
On the P614 part, the above method does not cause in the correct trim value
to be loaded in ClkSpdCtrl. MSP50P614 is an EPROM device. Any
preprogrammed value is erased when the chip goes through a UV erase
procedure. The RTO trim value must, therefore, be computed separately for
each chip. RTO trim values differ from one chip to another, is identical for the
same chip.
Note: Register Trim Value
A resistor trim value is only needed when the resistor trimmed oscillator
(RTO) is used. The MSP50P614 device must determine the trim value separately and use this value in the ClkSpdCtrl register bits 15–1 1 and 9, but C614
device needs to copy bit 0 of I/O location 0x2F to bit 9 of the ClkSpdCtrl register and bits 5 through 1 to bits 15 through 11 of ClkSpdCtrl register.
This software-controlled trim for the RTO is not a replacement for the external
reference-resistor mounted at pins OSCIN and OSC
adjustment has no effect on the rate of the CRO reference oscillator.
2.10 Execution Timing
For executing program code, the C614’s core processor has a three-level
pipeline. The pipeline consists of instruction fetch, instruction decode, and
instruction execution. A single instruction cycle is limited to one program Fetch
plus one data memory read or write. The master clock consists of two phases
with non-overlap protection. A fully static implementation eliminates precharge time on busses or in memory blocks. This design also results in a very
low power dissipation. Figure 2–9 illustrates the basic timing relationship
between the master clock and the execution pipeline.
. Also, note that this
OUT
MSP50C614 Architecture
2-33
Reduced Power Modes
Figure 2–10. Instruction Execution and Timing
CLOCK
FETCH
DECODE
EXEC
DATA ADD
PC ADD
N
N–1
N–2
N
N+1N+2
NN+1
N–1N
N–1
N+1N+2
2.11 Reduced Power Modes
The power consumption of the C614 is greatest when the DAC circuitry is
called into operation, i.e., when the synthesizer speaks. There are, however,
a number of reduced power modes (sleep states) on the C614 which may be
engaged during quiet intervals.
The performance and flexibility of the reduced power modes make the C614
ideal for battery powered operation. Refer to Chapter 8,
Electrical Specifications
including the acceptable power-supply ranges.
NN+1
N+3
N+2
N+1
N+3
N+4
N+3
N+2
N+2
N+4
N+3
N+5N+6
N+4N+5
N+3N+4
N+4N+5
N+5N+6
N+7
N+5
N+7
MSP50C614
, for a full description of the electrical characteristics,
2-34
The reduced power state on the C614 is achieved by a call to the IDLE
instruction. The idle state is released by some interrupt event. Different modes
(or levels) of reduced-power are brought about by controlling a number of
different core and periphery components on the device. These components
are independently enabled/disabled before engaging the IDLE instruction.
The number of subsystems left running during sleep directly impacts the
overall power consumption during that state. The various subsystems that
determine (or are affected by) the depth of sleep include the:
-
Processor core, which is driven by the CPU clock
-
PLL clock circuitry
-
PLL reference oscillator
-
C614 periphery, which is driven by the master clock
-
TIMER1 and TIMER2
-
PDM pulsing
Reduced Power Modes
The deepest sleep achievable on the C614, for example, is a mode where all
of the previously listed subsytems are stopped. In this state, the device draws
less than 10 µA of current and obtains the greatest power savings. It may be
awakened from this state using an external interrupt (input port).
A number of control parameters determine which of the internal components
are left running after the IDLE instruction. In most cases, the states of these
controls may be mixed in any combination. There are three combinations,
however, which are primarily useful. The three modes (light, mid, and deep
sleep) are executed through the independent control of two bits: 1) the idle
state clock control, and 2) the reference oscillator enable. The other pertinent
controls simply enhance the performance of the modes dictated by these two.
Table 2–3 gives a listing of all of the controls which should be maintained by
the programmer before engaging the IDLE instruction. In some cases, it will
be impossible to wake from sleep unless certain controls are set appropriately
before going to sleep. (In those cases, only the hardware RESET low-to-high
will bring the device back into its normal operating state.)
The top row in Table 2–3 lists the first of the two primary controls, namely, the
idle state clock control. The idle state clock control determines the status of the
master clock (MC) during sleep. Setting the idle state control causes the CPU
clock, the PLL clock circuitry, and the MC to stop after the next IDLE
instruction. Clearing the idle state control causes only the CPU clock to stop
after IDLE. The PLL clock circuitry governs the MC and determines its rate.
Whenever the PLL circuitry is suspended, therefore, the MC stops. The idle
state clock control is accessed at bit 10 in the ClkSpdCtrl register. (Refer to
Section 2.9.3,
Clock Speed Control Register
, for more information.)
The reference oscillator enable is the other control which selects between the
three reduced power modes listed in T able 2–3. This control may be one of two
bits, depending on which oscillator reference is implemented in circuitry . Refer
to Section 2.9.3,
Clock Speed Control Register
. When using the
resistor-trimmed oscillator (RTO), the reference oscillator enable appears as
bit 8 in the ClkSpdCtrl register. When using the crystal-referenced oscillator
(CRO), the reference oscillator enable appears as bit 9 in the ClkSpdCtrl
register. If both bits 8 and 9 are clear, then no reference oscillator is enabled.
If either of bits 8 or 9 are set, then the reference oscillator enable is considered
set. This enables the PLL circuitry to regulate to the reference frequency, 32
kHz (assuming the idle state clock control is clear). Whichever state the
reference oscillator is in before idle, it remains in that state (running or stopped)
after idle. If the reference oscillator is left running during sleep, however, it
comes at a cost to power consumption. (This may be a necessary cost if, in
your application, elapsed time needs to be monitored during sleep.)
MSP50C614 Architecture
2-35
Reduced Power Modes
The power consumed during sleep when the RTO oscillator is left running is
greater
than the power consumed during sleep when the CRO oscillator is left
running.
If the idle state clock control is clear, then the PLL circuitry , active during sleep,
will attempt to regulate the MC to whatever frequency is programmed in the
PLL multiplier (see Section 2.9.3,
Clock Speed Control Register
). The MC continues to run at this frequency , even during sleep, provided that the reference
oscillator is enabled.
If the idle state clock control is set, then neither the MC, CPU clock, nor the
TIMER clocks run during sleep, unless the TIMER source is linked to the
reference oscillator (Section 2.8, Time Registers). These relationships are
shown explicitly, as a function of the reduced power mode, in Table 2–4.
Because the DAC circuitry is the single most source of power consumed on
the C614, it is important to disable the DAC entirely before engaging any IDLE
instruction. This is accomplished at the DAC control register, address 0x34.
Refer to Section 3.2.2,
DAC Control and Data Registers
.
The ARM bit is another important control to consider before engaging the
reduced power mode. It is recommended that the ARM bit be cleared
whenever the idle state clock control is clear, and set whenever the idle state
clock control is set Table 2–3. The set ARM bit causes an asynchronous
response to all programmable interrupts when in the sleep state. (The cleared
ARM bit yields the standard synchronous response at all times.) Affected
interrupts include those tied to TIMER1 and TIMER2, as well as those tied to
the inputs at Ports F, D
, D3, D4, and D5. The advantage to having the ARM
2
bit set is that the device may be awakened by one of these interrupts, even
when the PLL clock circuitry is stopped in sleep (by virtue of the idle state
control). The disadvantage of the asynchronous response, however, is that it
can render irregularities in the timing of response to these same inputs.
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 event
that can wake the C614 after an IDLE instruction is a hardware RESET lowto-high. When at sleep, the device will not respond to the input ports, nor to
the internal timers.
Reduced Power Modes
Table 2–3. Programmable Bits Needed to Control Reduced Power Modes
→ deeper sleep … relatively less power →
Control Bit
Idle state clock control
bit 10
ClkSpdCtrl register (0x3D)
Enable reference oscillator
bit 09 : CRO or
bit 08 : RTOClkSpdCtrl register (0x3D)
ARM
bit 14
IntGenCtrl register (0x38)
Enable PDM pulsing
bit 02
DAC Control register (0x34)
IDLE instruction
(executes the mode)
PLL multiplier
bits 07 through 00
ClkSpdCtrl register (0x3D)
Label for
Control Bit
A011
B110
C011
DShould be cleared before any IDLE instruction.
ESame instruction is used to engage any of the modes.
FProgrammed value is 0 … 255 .
LIGHTMIDDEEP
MSP50C614 Architecture
2-37
Reduced Power Modes
Table 2–4. Status of Circuitry When in Reduced Power Modes (Refer to Table 2–3)
→ deeper sleep … relatively less power →
Component
CPU clock
(processor core)
PLL clock circuitryA, Erunningstoppedstopped
Master clock (MC) status
(C614 periphery)
MC rateB, F131 kHz … 34 MHz——
Synchrony of external interruptsC, ESynchronousAsynchronousAsynchronous
PDM pulsingDstoppedstoppedstopped
TIMER1 or TIMER2 status
• Assuming TIMER is enabled
1) TIMER source = 1/2 MC
2) TIMER source = RTO or CRO
Determined
by Controls
Estoppedstoppedstopped
A, Erunningstoppedstopped
A, B, E
LIGHTMIDDEEP
1) running
2) running
1) stopped
2) running
1) stopped
2) stopped
If the reference oscillator is stopped by a programmed disable or by an IDLE
instruction, then, on re-enable or wake-up, the oscillator requires some time
to restart and resume its correct frequency . This time imposes a delay on the
core processor resuming full-speed operation. The time-delay required for the
CRO to start is
greater
than the time-delay required for the RTO to start.
2-38
There are a number of ways to wake the C614 from the IDLE-induced sleep
state. The various options are summarized, as a function of the reduced power
mode, in T able 2–5. Naturally , the RESET event (happens after the RESET pin
has gone low-to-high) causes an immediate escape from sleep; whereby , the
program counter assumes the location stored in the RESET interrupt vector.
The RESET escape from sleep is always enabled, regardless of the depth of
sleep or the state of programmable controls.
The more functional methods available for waking the device are: 1) the
Internal TIMER interrupt, and 2) the external input-port interrupt. For either of
these options to work, the respective bit in the interrupt mask register (address
0x38) must be set to enable the associated interrupt service. If the appropriate
IMR bit is not set before the IDLE instruction, then the interrupt-trigger event
will not be capable of waking the device from sleep. Note also the state of the
idle state clock control bit and the ARM bit, if you expect to wake-up using
either type of interrupt (internal or external). In most cases, the state of these
bits should coincide Table 2–3.
Reduced Power Modes
The interrupt-trigger event associated with each of the two internal TIMERs is
the underflow condition of the TIMER. In order for a TIMER underflow to occur
during sleep, the TIMER must be left running before going to sleep. In certain
cases, however, the act of going to sleep can bring a TIMER to stop, thereby
preventing a TIMER-induced wake-up. The bottom row of T able 2–4 illustrates
the various conditions under which the TIMER will continue to run after the
IDLE instruction. Not that the reduced power mode DEEP leaves both TIMERs
stopped after IDLE. This mode cannot, therefore, be used for a timed wake-up
sequence.
Table 2–5. How to Wake-Up from Reduced Power Modes (Refer to Table 2–3 and
Table 2–4)
→ deeper sleep … relatively less power →
C
C
D
Determined
by Controls
A, B, C
C
D
Event
Timer interrupts
TIMER1 and TIMER2
• Assuming respective IMR bit is set
• Assuming ARM bit is set as in
External interrupts
Port F and D
• Assuming respective IMR bit is set
• Assuming ARM bit is set as in
RESETnone
DAC Timer
• Assuming PDM bit is clear as in
2,3,4,5
(if input)
The external interrupt is the other programmable option for waking the C614
from sleep. The associated interrupt-trigger event is, in some cases, a risingedge at the input port; in some cases it is a falling-edge. Refer to Section 3.1.5,
Internal and External Interrupts
also the comparator driven interrupts described in Section 3.3,
The input ports which are supported by external interrupt include the entire F
Port, and, when programmed as inputs, Ports D2, D3, D4, and D5. Refer to Section 3.1,
I/O
, for a description of the various I/O configurations.
LIGHTMIDDEEP
If TIMER is running,
then Underflow wakes device.
Rising-Edge, or Falling-Edge,
as appropriate, wakes device.
RESET LOW-to-HIGH always wakes device.
No wake-up from DAC Timer.
No wake-up
from TIMER.
, for a full description of these events. Consider
Comparator
.
Under normal operation the DAC timer, when IMR enabled, triggers an
interrupt on underflow. Before any IDLE instruction, however, the entire DAC
circuitry should be disabled. This ensures the effectiveness of the reduced
power mode and prevents any wake-up from the DAC timer.
MSP50C614 Architecture
2-39
Reduced Power Modes
In order to wake the device using a programmable interrupt, the interrupt mask
register must have the respective bit set to enable interrupt service (see Section 2.7,
Interrupt Logic
). In some cases, the ARM bit must also be set, in order
for the interrupts to be visible during sleep Table 2–3.
After the C614 wakes from sleep, the program counter assumes a specific
location, resuming normal operation of the device. Normally, the destination
of the program on wake-up is the interrupt service routine associated with the
interrupt which initiated the wake-up. The start of the interrupt service routine
is defined by the program location stored in the respective interrupt vector (see
Section 2.6.3,
Interrupt Vectors
). This wake-up response requires that the
global interrupt enable is set before going to sleep (use the INTE instruction).
If the global interrupt enable is CLEAR before going to sleep, then the
programmed interrupt can still wake the device, provided that the respective
IMR and ARM bits are set as in Table 2–5 Instead of waking to the interrupt
service routine, however, the program counter assumes the location
immediately following the IDLE instruction which initiated the sleep. This type
of wake-up response may be useful for putting the C614 into a hold sleep;
whereby, any number of programmable interrupts can wake the device, yet
they all return the program to the very same location. In order to accomplish
this, each of the necessary interrupts should be enabled in the IMR. The global
interrupt enable, however, is cleared using the INTD instruction. T able 2–6 lists
the various possible destinations of the program counter on wake-up, provided
that the wake-up is bound to occur under the given conditions.
Table 2–6. Destination of Program Counter on Wake-Up Under Various Conditions
State of Interrupt Controls
before IDLE Instruction
• Global interrupt enable is SET
• Respective IMR bit is SET
• Global interrupt enable is CLEAR
• Respective IMR bit is SET
• Global interrupt enable is SET
• Respective IMR bit is CLEAR
2-40
Assuming Wake-Up can occur…
Destination of Program Counter after Wake-Up
Program counter goes to the location stored in the interrupt vector
associated with the waking Interrupt.
Program counter goes to the next instruction immediately following
the IDLE which initiated sleep.
Wake-up cannot occur from the programmed Interrupt under these
conditions.
If RESET low-to-high occurs, then program goes to the location
stored in the RESET interrupt vector.
Chapter 3
Peripheral Functions
This chapter describes in detail the MSP50C614 peripheral function, i.e., I/O
control ports, general purpose I/O ports, interrupt control registers, comparator and digital-to-analog (DAC) control mechanisms.
The C614 has 64 input-output pins. Forty of these are software configurable as
either inputs or outputs. Eight are dedicated inputs, and the remaining sixteen
are dedicated outputs.
3.1.1General-Purpose I/O Ports
The forty configurable input/output pins are organized in 5 ports, A,B,C,D, and
E. Each port is one byte wide. The pins within these ports can be individually
programmed as input or output, in any combination. The selection is made by
clearing or setting the appropriate bit in the associated control register (Control
A, B, C, D, or E). Clearing the bit in the control register renders the pin as a
high-impedance input. Setting the control bit renders the pin as a totem-poleoutput.
When configured as an input, the data presented to the input pin can be read
by referring to the appropriate bit in the associated data register (Data A, B,
C, D, or E). This is done using the IN instruction, with the address of the data
register as an argument.
When configured as an output, the data driven by the output pin can be
controlled by setting or clearing the appropriate bit in the associated data
register. This is done using the OUT instruction, with the address of the data
register as an argument.
3-2
Port APort BPort CPort DPort E
Control register address
Possible control values0 = High-Z INPUT1 = TOTEM-POLE OUTPUT
V alue after RESET low0 = High-Z INPUT
Data register address0x00h0x08h0x10h0x18h0x20h
Possible input data valuesLow = 0 High = 1 (don’t care on write)
Possible output data values0 = Low 1 = High
†
Each of these I/O ports is only 8 bits wide. The reason for the 4-byte address spacing is so that
instructions
these registers.
with limited addressability (such as memory transfers) can still access
0x04h†0x0Ch0x14h0x1Ch0x24h
Note: Reading the Data Register
Whether configured as input or as output, reading the data register reads the
actual state of the pin.
The programmable I/O are initialized to a known state by cycling the RESET
pin low-to-high. The state of the control registers during and after RESET low
I/O
is 0x00 (all inputs). The state of the data registers after RESET low is unknown
(input state provided by external hardware).
The 8-bit width is the true size of the mapped location. This is independent of
the address spacing, which is greater than 8-bits. When writing to any of the
locations in the I/O address map, therefore, the bit-masking need only extend
across 8 bits. Within a 16-bit accumulator, the desired bits should be
right-justified. When reading from these locations to a 16-bit accumulator, the
IN instruction automatically clears the extra bits in excess of 8. The desired bits
in the result will be right-justified within the accumulator.
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 registeraddress 0x00. . . . . A7 A6 A5 A4 A3 A2 A1 A0
A port control registeraddress 0x04. . . C C C C C C C C
B port data registeraddress 0x08. . . . . B7 B6 B5 B4 B3 B2 B1 B0
B port control registeraddress 0x0C. . . C C C C C C C C
C port data registeraddress 0x10. . . . . C7 C6 C5 C4 C3 C2 C1 C0
C port control registeraddress 0x14. . . C C C C C C C C
D port data registeraddress 0x18. . . . . D7 D6 D5 D4 D3 D2 D1 D0
D port control register
E port data registeraddress 0x20. . . . . E7 E6 E5 E4 E3 E2 E1 E0
E port control registeraddress 0x24. . . C C C C C C C C
A7, B7, C7, D7, E7 : data register
†
Ports D4 and D5 may be dedicated to the Comparator function, if the Comparator Enable bit is
set. If so, then bits 4 and 5 of the D port Control register
3.3,
Comparator
†
address 0x1C. . C C C C C C C C
C : control register (0 = IN, 1 = OUT)
0x00 : state of control register after RESET low
must
, for details.
be CLEAR. Please refer to Section
Port D0 is connected to the branch condition COND1. Port D1 is connected to
the branch condition COND2, assuming the comparator is disabled. Please
refer to Section 3.1.4,
Branch on D Port
, (and to Section 3.3,
Comparator
) for
more information. External interrupts can be caused by transitions on ports D2,
D3, D4, and D5. The interrupts associated with the D port are supported
whether those pins are programmed as inputs or as outputs.
Peripheral Functions
3-3
I/O
3.1.2Dedicated Input Port F
Port F is an 8-bit wide input-only port. The data presented to the input pin can
be read by referring to the appropriate bit in the F port data register, address
0x28. This is done using the IN instruction, with the 0x28 address as an
argument. The state of the F port data registers after RESET low is unknown
(input state provided by external hardware)
Each of the pins at port F has a programmable pull-up resistor. The resistance
of these pullups is at least 100 kΩ. All eight pullup resistors can be enabled by
setting the enable pullup (EP) in the interrupt/general control register (IntGenCtrl). The address of the IntGenCtrl is 0x38, and the location of the EP bit
is 12. Clearing the EP bit disables the eight pullups, and setting the EP bit enables the eight pullups. After RESET low, the default setting for the EP bit is
0 (F-port pullups disabled).
Input Port F
Data register address
Possible input data valuesLow = 0 High = 1
Possible output data valuesN/A
V alue after RESET lowPullup resistors DISABLED
0x28h
When reading from the 8-bit F-port data register to a 16-bit accumulator, the
IN instruction automatically clears the extra bits in excess of 8. The desired bits
in the result will be right-justified within the accumulator.
The following table shows the bit locations of the port F address mapping:
F port Input Data register
address 0x28h
READ only
(8-bit wide location)
07
06 05 04 03 02 01 00
F7 F6 F5 F4 F3 F2 F1 F0
The external interrupt INT5 is triggered by a falling-edge event on any of the
eight port-F input pins (see Section 3.1.5,
Internal and External Interrupts
Specifically , INT5 is triggered if all eight port-F pins are held high, and then one
or more of these pins is taken low. Port F, therefore, is especially useful as a
key-scan interface.
).
3-4
3.1.3Dedicated Output Port G
Port G is a 16-bit wide output-only port. The output drivers have a T otem-Pole
configuration. The data driven by the output pin can be controlled by setting
or clearing the appropriate bit in the G port Data register, address 0x2C. This
is done using the OUT instruction, with the 0x2C address as an argument. After RESET low, the default settings for the G port outputs are 0 (logical low).
I/O
Totem-Pole Output Port G
The following table shows the bit locations of the port G address mapping:
Instructions exist to branch conditionally depending upon the state of ports D
and D1. These conditionals are COND1 and COND2, respectively . The conditionals are supported whether the D
and D1 ports are configured as inputs or
0
as outputs. The following table lists the four possible logical states for D0 and
D1, along with the software instructions affected by them.
D0 = 1COND1 = TRUE. . .CIN1
CNIN1
JNIN1
D0 = 0COND1 = FALSE. . .CIN1
CNIN1
JNIN1
† D1 = 1COND2 = TRUE. . .CIN2
CNIN2
JNIN2
† D1 = 0COND2 = FALSE. . .CIN2
CNIN2
JNIN2
†
COND2 may be associated instead with the comparator function, if the comparator Enable bit
is set. Please refer to Section 3.3,
Comparator
has its conditional call taken.
has its conditional call ignored.
JIN1
has its conditional jump taken.
has its conditional jump ignored.
has its conditional call ignored.
has its conditional call taken.
JIN1
has its conditional jump ignored.
has its conditional jump taken.
has its conditional call taken.
has its conditional call ignored.
JIN2
has its conditional jump taken.
has its conditional jump ignored.
has its conditional call ignored.
has its conditional call taken.
JIN2
has its conditional jump ignored.
has its conditional jump taken.
, for details.
0
3.1.5Internal and External Interrupts
INT3, INT4, INT6, and INT7 are external interrupts which may be triggered by
events on the PD2, PD3, PD4, and PD5 pins. These interrupts are supported
whether the D-port pins are programmed as inputs or outputs. (When
programmed as an output, the pin effectively triggers a software interrupt.)
INT5 is an external interrupt triggered by a falling-edge event on any of the
F-port inputs. It is triggered if all eight port-F pins are held high, and then one
or more of these pins is taken low.
Only the transition from 0xFFh (all high) to (one or more pins) low will trigger
the INT5 event. If any F-port pin is continuously held low and another is toggled
high-to-low, no interrupt is detected at the toggling pin. After all F-port pins
have been brought high again, then it is possible for a new INT5 trigger to
occur.
INT0 is an internal interrupt (highest priority) which is triggered by an underflow
condition on the DAC Timer (see Section 3.2.2,
3-6
DAC Control and Data
I/O
Registers
). INT1 and INT2 are high-priority , internal interrupts triggered by the
underflow conditions on TIMER1 and TIMER2, respectively. Please refer to
Section 2.8,
Timer Registers
, for a full description of the TIMER controls and
their underflow conditions.
When properly enabled, any of these interrupts may be used to wake the de-
vice up from a reduced-power state. In a deep-sleep state, they can also be
used to wake the device when used in conjunction with the ARM bit. Please
refer to Section 2.11,
Reduced Power Modes
, for information regarding the
C614’s reduced power modes.
A summary of the interrupts is given in Table 3–1.
Table 3–1. Interrupts
InterruptVectorSourceTrigger EventPriorityComment
INT00x7FF0DAC TimerTimer underflowHighestUsed to synch. speech data
INT10x7FF1TIMER1T imer underflow2
INT20x7FF2TIMER2T imer underflow3
INT30x7FF3PD
INT40x7FF4PD
INT50x7FF5All port FAny falling edge6
2
3
Rising edge4
Falling edge5
nd
rd
th
Port D2 goes high
th
Port D3 goes low
th
Any F port pin goes from all-high to low
†
INT6
INT7
†
INT6 and INT7 may be associated instead with the Comparator function, if the Comparator Enable bit has been set.
0x7FF6PD
†
0x7FF7PD
4
5
Rising edge7
Falling edgeLowestPort D5 goes low
th
Port D4 goes high
Note: Interrupts in Reduced Power Mode
An interrupt may be lost if its event occurs during power-up or wake-up from
a reduced power mode. Also, note that interrupts are generated as a divided
signal from the master clock. The frequency of the various timer interrupts
will therefore vary, depending upon the operating master clock frequency.
Peripheral Functions
3-7
Digital-to-Analog Converter (DAC)
3.2Digital-to-Analog Converter (DAC)
The C614 incorporates a two-pin pulse-density-modulated DAC which is
capable of driving a 32 Ω loudspeaker directly. To drive loud speakers other
than 32 Ω, an external impedance-matching circuit is required.
3.2.1Pulse-Density Modulation Rate
The rate of the master clock (MC) determines the pulse-density-modulation
(PDM) rate, and this governs the output sampling-rate and the achievable
DAC resolution. In particular, the sampling rate is determined by dividing the
PDM rate by the required resolution:
Output sampling rate = PDM Rate ÷ 2
PDM Rate#DAC resolution bits
Set in ClkSpdCtrl registerSet in DAC control register
Address 0x3DAddress 0x34
For example, a 9 bit PDM DAC at 8 kHz sampling rate requires a PDM rate of
4.096 MHz.
(# DAC resolution bits)
There are four sampling rates which may be used effectively within the
constraints of the C614 and the various software vocoders provided by T exas
Instruments. These are: 7.2 kHz, 8 kHz, 10 kHz, and 11.025 kHz. Other
sampling rates, however, may also be possible.
From the MC to the PDM clock, there is an
This option is controlled by the PDM clock divider in the interrupt/general
control register. This means that the PDM rate can be set to run between
131.07 kHz and 33.554 MHz in 131.07 kHz steps (the same as the MC). Or,
the PDM rate can be set to run between 65.536 kHz and the maximum
achievable CPU frequency (see Chapter 8,
Specifications
of these two ranges apply . Within these ranges, it is the PLLM which sets the
rate: ClkSpdCtrl, 0x3D. Refer to Section 3.2.3,
information regarding the PDM clock divider and the available combinations
of CPU clock rates vs sampling rates. (Section 2.9.3,
Register
) in 65.536 kHz steps. The PDM clock divider determines which
, has more details regarding the PLLM.)
3.2.2DAC Control and Data Registers
The resolution of the PDM-DAC is selected using the control bits in the DAC
control register (address 0x34). The available options are 8, 9, or 10 bits of resolution. Bits 0 and 1 in the DAC control register control this option:
optional
divide-by-two in frequency .
MSP50C614 Electrical
PDM Clock Divider
, for more
Clock Speed Control
3-8
Digital-to-Analog Converter (DAC)
DAC Control register
Address 0x34(4-bit wide location)
02 01 00
03
Set DAC resolution to 8 bits:
Set DAC resolution to 9 bits:
Set DAC resolution to 10 bits:
DM : Drive Mode selection (0 = C3x style : 1 = C5x style)
E : pulse-density-modulation Enable (overall DAC enable)
0x0 : default state of register after RESET low
DM E 0 0
DM E 0 1
DM E 1 0
Bit 2 in the DAC control register is used to enable/disable the pulse-density
modulation. This bit must be set in order to enable the overall functionality of
the DAC. After RESET is held low, the default state of bit 2 is clear . In this state,
the output at the DAC pins is guaranteed to be zero (no PDM pulsing). During
DAC activity, the PDM enable bit may also be toggled at any time to achieve
the zero state. In other words, toggling the PDM enable bit from high-to-low-tohigh brings the DAC output to the known state of zero.
Note: PDM Enable Bit
By default, the PDM enable bit is cleared: DAC function is off.
Data values are output to the DAC by writing to the DAC data register, address
0x30. The highest-priority interrupt, INT0, is generated at the sampling rate
governed by the ClkSpdCtrl and the DAC control register. The program in
software is responsible for writing a correctly-scaled DAC value to the DAC
data register, in response to each INT0 interrupt. The register at 0x30 is 16-bits
wide. The data is written in sign-magnitude format. Bit 15 of the register is the
sign bit. Bits 14 and 13 are the overflow bits. Bits 12 through 3 are the
data-value bits: The MSB is bit 12, and the LSB is bit 5, 4, or 3, depending on
the resolution.
DAC Data register
Address 0x30(16-bit wide location)
Write Only15141312111009080706050403020100
10 bit DAC resolution:
9 bit DAC resolution:
8 bit DAC resolution:
S : Sign bitM : Most-significant data valueD ; Data (magnitude)
O : Overflow bitsL : Least-significant data valueX : ignored bits
SOOMDDDDDDDDLXX X
SOOMDDDDDDDL XXXX
SOOMDDDDDDLXXXXX
The overflow bits function in different ways, depending on the drive mode
selected. The two DAC drive modes are informally named
Peripheral Functions
C3x style
and
C5x
3-9
Digital-to-Analog Converter (DAC)
style
. Their selection is made at bit 3 of the DAC control register (0x34). The
C3x style
bit 3. The default value of the selection is zero which yields the
The overflow bits appear in the DAC data register (14 and 13) to the left of the
MSB data bit (12). In the
buffer to handle overflow in the value field (bits 12…3). Any magnitude written
to the value field which is greater than 1023 (up to the limit 4095) lands a 1 in
the overflow. The overflow state (when a 1 appears in either bit 13 or 14) yields
the maximum PDM saturation and delivers the maximum possible current
drive to the loudspeaker. The overflow bits thus help to ensure that the audible
artifacts of
3.2.3PDM Clock Divider
The pulse-density-modulation rate is determined by the master clock. The
PDM rate may be set equal to the rate of the MC, or it may be set at one-half
the rate of the MC. This option is controlled by the PDM clock divider (PDMCD)
in the interrupt/general control register (IntGenCtrl). The PDMCD is located at
bit 13 in IntGenCtrl (address 0x38).
is selected by clearing bit 3, and the
wrap-around
C3x style
do not occur.
mode, the overflow bits serve as a 2-bit
C5x style
is selected by setting
C3x style
.
Clearing the PDMCD bit results in a PDM rate equal to 1/2 MC (i.e., the CPU
Clock rate). Setting the PDMCD bit results in a PDM rate equal to the MC. After
RESET is held low, the default setting for the PDMCD bit is zero (PDM
rate = 1/2 MC).
Figure 3–1. PDM Clock Divider
Master Clock : 131.07 kHz ... 33.554 MHz
(rate adjusted in ClkSpdCtrl)
Core-Processor Speed
(8 MHz is max assured : see Chapter 9)
MC
÷2
CPU Clock
65.536 kHz ... F
MAX
PDMCD
PDM Clock Divider
Bit 13 in IntGenCtrl
0
1
÷2
x1
(frequency)
Pulse-Density-Modulation Rate
PDM Rate
Governs DAC Capacity
65.536 kHz ... F
131.07 ... 33.554 MHz
MAX
or
3-10
Digital-to-Analog Converter (DAC)
For a given sampling rate and DAC resolution, the CPU clock rate may be
increased, if necessary, through the use of over-sampling. In the previous
example, an original sampling rate of 8 kHz and a PDM rate of 4 MHz was
used. A 2-times over-sampling, therefore, would require the PDM rate to be
8 MHz. This can be accomplished in two ways:
PDM rate = 8 MHz : Set the master clock to 8 MHz also (ClkSpdCtrl).
Set the PDMCD bit to 1: 1x master clock (IntGenCtrl).
CPU clock rate will be 4 MHz.
PDM rate = 8 MHz : Set the master clock to 16 MHz.
Set the PDMCD bit to 0: 1/2 master clock.
CPU clock rate will be 8 MHz.
In the case of over-sampling, the same number of instructions are achievable
between each INT0 interrupt. Not every INT0, however, requires an
independently computed synthesis value, hence, the advantage in increased
instruction capacity. A 2-times over-sampling means that every 2nd INT0
requires a computed update from the synthesis algorithm. The other INT0 may
be satisfied with an interpolating filter computation, then a return to the main
program.
As stated previously , the maximum ensured CPU clock frequency for the C614
operates over the entire V
range. This rate applies to the speed of the core
DD
processor. Operating the processor higher than the listed specification is not
recommended by Texas Instruments.
The following tables illustrate a number of possible combinations with respect
to sampling rate, PDM rate, DAC resolution, master clock rate, and CPU clock
rate. The first table applies to the 8 kHz sampling rate and N-times-8 kHz
over-sampling. The second applies to the 10 kHz sampling rate and
N-times-10 kHz over-sampling.
Note:
The value programmed to the PLLM register is not exactly the multiplicative
factor between the 32-kHz reference and the master clock. Refer to
Section 2.9.3,
Clock Speed Control Register
, for more information on the
relationship between the PLLM and the resulting MC rate.
The column in these tables output sampling rate reports the true audio
sampling rate achievable by the C614, using the 32.768-kHz CRO. The values
reported are not always exact multiples of the 8-kHz and 10-kHz options;
however, they are the closest obtainable (using the PLLM multiplier) under the
given set of constraints.
The C614 provides a simple comparator that is enabled by a control register
option. The inputs of the comparator are shared with pins PD
and PD5. PD
4
is the noninverting input to the comparator, and PD4 is the inverting input.
When the comparator is enabled, the conditional operation COND2 (normally
associated with PD1) becomes associated with the comparator result. In addition, the interrupts associated with PD4 and PD5 (namely , INT6 and INT7), become interrupts based on a
transition
in the comparator result. Finally, the
start/stop function of TIMER1 may be controlled, indirectly, by a comparator
transition. When enabled, therefore, the comparator controls the following four
events:
5
(1) Steady-State Comparator TRUEV
CIN2
CNIN2
has its conditional call taken.
has its conditional call ignored.
(2) Steady-State Comparator FALSEV
CIN2
CNIN2
has its conditional call ignored.
has its conditional call taken.
(3) Comparator transition FALSE-to-TRUEV
PD5
PD5
> V
< V
PD4
PD4
JIN2
JNIN2
JIN2
JNIN2
rises above V
PD5
COND2 = TRUE . . .
has its conditional jump taken.
has its conditional jump ignored.
COND2 = FALSE . . .
has its conditional jump ignored.
has its conditional jump taken.
. . .
PD4
INT6 trigger event
IF:[(INT6 Flag is SET) OR (INT7 Flag is CLEAR)] AND (TIMER1 Enable is CLEAR)
THEN: TIMER1 stops counting
(4) Comparator transition TRUE-to-FALSEV
falls below V
PD5
PD4
. . .
INT7 trigger event
IF:[(INT6 Flag is CLEAR) AND (INT7 Flag is SET)] OR (TIMER1 Enable is SET)]
THEN: TIMER1 starts counting
With regards to the transition events, the rising-edge in the comparator is a
trigger for INT6. This happens independently of any activity associated with
TIMER1. TIMER1, on the other hand, comes to a stop anytime the following
conditional is true:
IF:[(INT6 Flag is SET) OR (INT7 Flag is CLEAR)] AND (TIMER1 Enable is CLEAR)]
THEN: TIMER1 stops counting
INT6 flag refers to bit 6 within the interrupt flag register (IFR, peripheral port
0x39). This bit is automatically SET anytime that an INT6 event occurs. The
3-14
Comparator
bit is automatically CLEARed again if an INT6 event occurs at the same time
that the associated mask bit is SET (IntGenCtrl, address 0x38, bit 6). The latter
indicates that the program vectoring associated with INT6 is enabled. (The flag
bit is SET when the INT event occurs. Only if the mask bit is set, does the
interrupt service occur: vectoring takes place and the flag bit is once again
cleared. Refer to Section 2.7,
Interrupt Logic
, for more details)
The INT6 Flag may also be SET or CLEARed deliberately, at any time, in
software. 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 automatically
SET anytime that an INT7 event occurs. The bit is automatically CLEARed
again if an INT7 event occurs at the same time that the associated mask bit
is SET (IntGenCtrl, address 0x38, bit 7). The latter indicates that the service
for INT7 is enabled.
The INT7 Flag may also be SET or CLEARed at any time, in software. Use the
OUT instruction with the associated I/O port address (IFR, address 0x39).
The TIMER1 enable bit is set or cleared in software: bit 10 of the IntGenCtrl.
falling
Similarly, the
-edge event in the comparator is a trigger for INT7. This
happens independently of any activity associated with TIMER1. TIMER1
starts
counting anytime the following conditional is true:
IF:[(INT6 Flag is CLEAR) AND (INT7 Flag is SET)] OR (TIMER1 Enable is SET)]
THEN: TIMER1 starts counting
Figure 3–2. Relationship Between Comparator/Interrupt Activity and the TIMER1 Control
INT-Trigger
Event
Associated With the Interrupt-Trigger Event
0 1 2 3 4 5INT6INT7
INT Service
Branch
INT Flag bits (IFR)
Interrupt Flag Register (0x39)
Comparator ENABLE
Bit 15, IntGenCtrl (0x38)
port-addressed
write instruction
TIMER1 ENABLE
Bit 10, IntGenCtrl (0x38)
TIMER1 Control
0 = TIM1 stopped
1 = TIM1 running
Peripheral Functions
3-15
Comparator
The comparator, along with all of its associated functions, is enabled by setting
bit 15 of the interrupt/general control register (IntGenCtrl, address 0x38). The
default value of the register is zero: comparator disabled.
Note: IntGenCtrl Register Bit 15
At the time that bit 15 in the IntGenCtrl is set, PD
comparator inputs. At any time during which bit 15 is set, PD
and PD5 become the
4
and PD5 MUST
4
be set to INPUT (I/O Port D Control, address 0x1C, bits 4 and 5 CLEARed).
Failure to do so may result in a bus contention.
The function of pins PD4 and PD5, and the behavior of events COND2, INT6,
INT7, and TIMER1 are very different, depending on whether the comparator
has been enabled or disabled. A summary of the various states appears in the
following table:
Comparator ENABLED
PD4 functions as comparator negative input
PD
functions as comparator positive input
5
SET bit 15 in the IntGenCtrl, address 0x38 . . .
(port D Control, 0x1C, bit 4 MUST be 0)
(port D Control, 0x1C, bit 5 MUST be 0)
COND2 maps to the state of the comparator(PD5 relative to PD4)
INT6 is triggered by a rising edge at PD
INT7 is triggered by a falling edge at PD
TIMER1 may be started by a falling edge at PD
TIMER1 will be stopped by a rising edge at PD
5
5
5
5
(relative to PD4)
(assuming TIMER1 Enable is 0)
Comparator DISABLEDCLEAR bit 15 in the IntGenCtrl, address 0x38 . . .
PD4 functions as a general I/O pin
PD5 functions as a general I/O pin
COND2 maps to the state of the I/O pin PD
INT6 is triggered by a rising edge at PD
INT7 is triggered by a falling edge at PD
4
5
1
(port D Control 0x1C, bit 4 = 0 or 1)
(port D Control 0x1C, bit 5 = 0 or 1)
(0 or 1 logical)
(0 to 1 logical)
(1 to 0 logical)
TIMER1 is started/stopped in software by setting/clearing TIMER1 enable (IntGenCtrl)
3-16
3.4Interrupt/General Control Register
The interrupt/general control (IntGenCtrl) is a 16-bit wide port-mapped register
located at address 0x38. The primary component in the IntGenCtrl is the 8-bit
interrupt mask register (IMR). The service branch enable status for each of the
eight interrupts is registered in the IMR. A SET bit in the IMR enables that
interrupt to assume the service branch (at the time that the associated trigger
event occurs). A CLEAR bit disables the service branch for that interrupt. The
IMR is located at bits 0 through 7 in the IntGenCtrl. Bit 0 is associated with
INT0, which is the highest priority interrupt. Bit 7 is associated with INT7. Refer
to Section 2.7,
interrupt-system logic and initialization sequence.
CE : Comparator enable
AR : ARM bit
PD : Pulse-density clock: PDMCD
EP : Enable pullup resistors on port F
E2 : Enable TIMER2 (1 value starts timer)
E1 : Enable TIMER 1 (1 value starts timer)
S2 : Clock source for TIMER2 (0 chooses 1/2 MC)
S1 : Clock source for TIMER1 (0 chooses 1/2 MC)
The remaining bits in the IntGenCtrl have various control functions which are
not directly related to the interrupt system. Four of these are related to the timer
functions. Bits 8 and 9 are used to select the clock sources which govern the
rates of TIMER1 and TIMER2. Clearing bit 8 chooses 1/2 MC as the source
for TIMER1 (i.e., the TIMER runs at one-half the frequency of the Master
Clock). Setting bit 8 chooses the oscillator reference (RTO or CRO) as the
source for TIMER1. (The same applies for bit 9 and TIMER2.) Bits 10 and 1 1
in the IntGenCtrl are used to enable TIMER1 and TIMER2, respectively.
Setting bit 10
starts
TIMER1, and clearing bit 10
applies for bit 11 and TIMER2).
low
priority
Interrupt mask register
D5 : port D5 falling-edge
D4 : port D4 rising-edge
D3 : port D
D2 : port D
PF : any port F falling-edge
T2 : TIMER2 underflow
T1 : TIMER1 underflow
DA : DAC timer underflow
(1 value enables interrupt service)
falling-edge
3
rising-edge
2
stops
TIMER1. (The same
high
priority
Peripheral Functions
3-17
Interrupt/General Control Register
The upper four bits in the IntGenCtrl have independent functions. Bit 12 is the
enable bit for the pull-up resistors on input port F. Setting this bit engages all
8 F-port pins with at least 100-kΩ pull-ups (see Section 3.1.2,
Port F
Bit 13 is the PDMCD bit for the pulse-density modulation clock. Clearing this
bit yields a PDM clock rate equal to one-half the frequency of the master clock
(i.e., the CPU clock rate). Setting bit 13 yields a PDM rate equal to the rate of
the master clock (see Section 3.2.3,
Bit 14 is the ARM bit. The set ARM bit causes an asynchronous response to
the internal and external interrupts during the sleep state. If the master clock
has been suspended during sleep, then the ARM bit must be set (before the
IDLE instruction), in order to allow a programmable interrupt to wake the C614.
Refer to Section 2.11,
Finally , the top-most bit in the IntGenCtrl is the comparator enable bit. Setting
bit 15 enables the comparator and all of its associated functions. Some of the
C614’s conditions, interrupts, and timers behave differently, depending on
whether the comparator is enabled or disabled by this bit. Refer to Section 3.3,
Comparator
)
, for a full description.
PDM Clock Divider
Reduced Power Modes
Dedicated Input
)
, for more information.
3-18
3.5Hardware Initialization States
The RESET pin is configured at all times as an external interrupt. It provides
for a hardware initialization of the C614. When the RESET pin is held low, the
device assumes a deep sleep state and various control registers are
initialized. After the RESET pin is taken high once again, the Program Counter
is loaded with the value stored in the RESET Interrupt Vector.
Note: Internal Power Reset Function
There is no power-on reset function internal to the C614. After the initial power-up or after an interruption in power, the RESET pin must be cycled low-tohigh. The application circuitry must therefore provide a mechanism for accomplishing this during a power-up transition or after a power fluctuation.
Hardware Initialization States
The application circuits shown in Section 6.1,
Application Circuits
, illustrate
one implementation of a reset-on-power-up circuit. The circuit consists of an
RC network (100 kΩ, 1 µF). When powering V
from 0 V to 4.5 V, the circuit
DD
provides some delay on the RESET pin’s low-to-high transition. This delay
helps to ensure that the C614 initialization occurs
after
the power supply has
had time to stabilize between VDD MIN and VDD MAX. VDD MIN and VDD MAX
are the minimum and maximum supply voltages as rated for the device. The
every
circuit shown, however, may not shield the RESET pin from
kind of rapid
fluctuation in the power supply . At any time that the power supply falls below
VDD MIN, even momentarily , then the RESET pin must be held low and then
high once again, either by the user of the device or by some other external circuitry . Refer to Chapter 8,
terization of the values V
MSP50C614 Electrical Specifications
MIN, VDD MAX, VIL, and VOL. (VIL and VOL are the
DD
, for a charac-
low-level and high-level input voltages, respectively , which dictate the precise
levels of transition for RESET.)
When the RESET pin is held low, the C614 is considered reset and has the
following internal states:
RESET low . . .
-
I/O ports are be placed in a high impedance Input condition: Ports A, B,
C, D, and E.
-
All outputs on Port G is are set to low (0x0000).
-
Device is placed in a deep sleep state (refer to reduced power mode IV
in Table 2–7).
-
PLL circuitry, master clock, CPU clock, and TIMERs are stopped.
-
Current draw from the VDD is less than 10 µA in this condition.
-
Interrupt flag register (IFR at address 0x39) is
-
Internal RAM is
not
automatically cleared.
not
automatically cleared.
Peripheral Functions
3-19
Hardware Initialization States
When RESET is brought back high again, many of the programmable controls
and registers are left in their default states:
RESET high, just after low . . .
-
-
-
-
-
-
-
-
-
-
-
Note: Internal RAM State after Reset
The RESET low will not change the state of the internal RAM, assuming there
is no interruption in power. This applies also to the interrupt flag register . The
same applies to the states of the accumulators in the computational unit.
No reference oscillator is enabled. PLL runs at its minimum achievable
rate.
Master clock runs at a very slow frequency (less than 100 kHz).
PLL multiplier is set to 0x00 (renders slowest speed for MC, once
reference is enabled).
RTO oscillator trim bits are set to zero (renders slowest speed for RTO,
once enabled).
Interrupt mask register is 0x00. Global interrupt enable is clear. All
Interrupts are disabled.
I/O Ports A through E and output Port G have the same state as in RESET
low.
All pull-up resistors on input Port F are disabled.
DAC circuitry is disabled (no PDM pulsing).
Both TIMER1 and TIMER2 are disabled. Count-down and period registers
are 0x0000.
The status register is
partially
initialized, as specified in Table 3–1.
Idle state clock control and ARM bit are both set to zero.
3-20
When in this state, the processor runs, albeit slowly . It executes the following
initialization routine, then resumes execution of the program:
1) ROM block protection word is read from address 0x7FFE.
2) ROM block protection word is loaded to an internal register.
3) RESET interrupt vector is read from address 0x7FFF.
4) Program counter is loaded with the value read from (3); execution resumes there.
Hardware Initialization States
Note: Stack Pointer Initialization
The software stack pointer (R7) must be initialized by the programmer, so
that it points to some legitimate address in data memory (RAM). This must
be done prior to any CALL or CCC instruction. If this is not done, then the first
push/pop operation performed on the STACK will render the Program Counter to an unknown state.
Table 3–2. State of the Status Register (17 bit) after RESET Low-to-High
(Bits 5 through 16 are left uninitialized)
BitBit NameInitialized ValueDescription
0XM0Extended sign mode disabled
1UM0Unsigned multiplier mode disabled (allows signed multiplier mode)
2OM0Overflow mode disabled (allows ALU normal mode)
3FM0
4IM0Global interrupt enable bit
5(reserved)Reserved for future use
6XZFTransfer equal-to-zero status bit
7XSFTransfer sign status bit
8RCFAuxiliary register carry-out status bit
9RZFAuxiliary register equal-to-zero status bit
10OF
11SF
12ZFAccumulator equal-to-zero status bit (16 bits)
13CFAccumulator carry-out status bit (16th ALU bit)
14TF1Test flag 1
15TF2Test flag 2
16TAGMemory tag
Same state as
before RESET
Shift mode for fractional multiplication disabled (allows unsigned
fractional/integer arithmetic)
Accumulator overflow status bit
Accumulator sign status bit (extended 17th bit)
Peripheral Functions
3-21
3-22
Chapter 4
Assembly Language Instructions
This chapter describes in detail about MSP50P614/MSP50C614 assembly
language. Instruction classes, addressing modes, instruction encoding and
explanation of each instruction is described.
In this chapter each MSP50P614/MSP50C614 class of instructions is
explained in detail with examples and restrictions. Most instructions can
individually address bits, bytes, words or strings of words or bytes. Usable
program memory is 30K by 17-bit wide and the entire 17-bits are used for
instruction set encoding. The execution of programs can only be executed
from internal program memory . Usable program memory starts from location
800h. The data memory is 640 by 17-bits of static RAM, 16 bits of which are
an arithmetic value. The 17th bit is used for flags or tags.
4.2System Registers
A functional description of each system register is described below.
4.2.1Multiplier Register (MR)
The multiplier uses this 16-bit register to multiply with the multiplicand. MOV
instructions are used to load the MR register. The multiplicand is usually the
operand of the multiply instructions. All multiply, multiply-accumulate
instructions, and filter instructions (FIR, FIRK, COR and CORK) use the MR
register (see Section 4.11 for detail).
4.2.2Shift Value Register (SV)
The shift value register is 4-bits wide. For barrel shift instructions, the multiplier
operand decodes a 4 bit value in the shift value register (SV) to a 16 bit value.
For example, a value of 7H in the SV register is decoded to a multiplier operand
of 0000000010000000 binary . In effect, this causes a left shift of 7 bits to in the
final 32 bit product. In other words, a nonzero value, say
SV register means padding k number of zeros to the right of the final result.
4.2.3Data Pointer Register (DP)
The data pointer register (DP) is a 16-bit register that is used to point to a
program memory location for various look up table instructions. DP is not
directly loaded by the user, It is loaded during the execution of lookup
instructions overwriting the previous content of the DP register. Lookup
instructions are described in detail in section 4.9. The DP register autoincrements the next logical program memory location after the execution of a
lookup instruction. In addition to lookup instructions, the filter instructions FIRK
and CORK (see Section 4.11 for detail) use the DP pointer to look up filter
coefficients. It may be required to context save and restore the DP in interrupt
service routines.
4.2.4Program Counter (PC)
The program counter (PC) holds the program memory location to be used for
the next instruction’s execution. It increments (by 1 for single word instructions
k
(0 ≤ k ≤ 15), in the
4-2
or by 2 for double word instructions) each execution cycle and points to the
next program memory location to fetch. During a maskable interrupt, the next
PC address is stored in the TOS register and is reloaded from TOS after the
interrupt encounters an IRET instruction. Call and jump instructions also store
the next instruction address by adding PC+2 and then storing the result in the
TOS register . Upon encountering a RET instruction, the TOS value is reloaded
to the PC. Call instructions may not precede RET instructions. Similarly , a RET
instruction may not immediately follow another RET instruction. In these
conditions, pipeline operations breaks down and the PC never recovers its return address from the TOS register . The processor stalls, and the only solution
is to reset the device. On the other hand, RET can be safely replaced by IRET
eliminating processor stalls in all conditions. However, IRET takes one more
cycle than RET.
4.2.5Top of Stack, (TOS)
The top of stack (TOS) register holds the value of the stack pointed by the stack
register (R7). The MSP50P614/MSP50C614 hardware uses TOS register for
very efficient returns from CALL instructions. Figure 4-1 shows the operation
of the TOS register . When call instructions are executed, the old TOS register
value is pushed into the stack by pre-incrementing R7. The current PC value
is incremented by 2 to compute the final return address and is then stored in
the TOS register . Thus, the TOS register holds the next PC value pointing to
the next instruction. When the subroutine reaches the RET instruction, the
program counter (PC) is loaded with the TOS register . Next, the TOS is loaded
with the value pointed to by R7. Finally , the stack register (R7) is decremented.
System Registers
Figure 4–1. Top of Stack (TOS) Register Operation
Program counter (PC)
+2
Top of stack register (TOS)
Read before
incrementing R7
Data memory stack area
The MSP50P614/MSP50C614 development tools use the TOS register for
parameter passing. The TOS register must be used with caution inside user
programs. If the TOS register and stack register (R7) are not restored to their
previous values after using the TOS register in an application, the program can
hang the processor or cause the program to behave in an unpredictable way .
Increment R7 then
store TOS value
Stack register (R7)
Preincrement
during write (+2)
Postdecrement
during read (+2)
Assembly Language Instructions
4-3
System Registers
It is recommended to avoid using the TOS register altogether in applications
and leave its operation to development tools only.
4.2.6Product High Register (PH)
This register holds the upper 16 bits of the 32 bit result of a multiplication,
multiply-accumulate, or shift operation. The lower 16 bits of the result are
stored in the PL register. The PH register can be loaded directly by MOV
instructions. Special move accumulate instructions MOVAPH, MOVAPHS,
MOVSPH, MOVSPHS also use the PH register .
4.2.7Product Low Register (PL)
This register holds the lower 16 bits of the 32 bit result of a multiplication,
multiply-accumulate, or shift operation. The upper 16 bits of the result are
stored in the PH register. There are no instructions that load or save the PL
register directly , but multiply-accumulate instructions allow the contents of the
PL register to be added, subtracted or transferred to the accumulator.
4.2.8Accumulators (AC0–AC31)
There are 32 accumulators on the MSP50P614/MSP50C614. Each is 16 bits
wide. The first sixteen accumulators, AC0–AC15, have offset accumulators,
AC16–AC31, and vice versa. At any one time, four accumulators can be
selected through accumulator pointer registers, AP0–AP3 (see section 4.2.9).
Some instructions can specify offset accumulators which are the
accumulators pointed to by AP
to 31). The offset accumulators are indicated by an offset bit (A~) in some
instructions. When this bit is 0, A
then A
n~
points to the offset (for some instructions this scheme changes). The
selected accumulator pointer register should contain the index to the
corresponding accumulator. For example, if AP0 has a value of 25, then it is
pointing to accumulator AC25. If the offset bit is 1, A0~, then it is pointing to
accumulator AC9 (25–16=9). Because, accumulators can only be addressed
through accumulator pointers, special symbols are used in MSP50P614/
MSP50C614 instructions. Accumulators are indicated by the symbol A
where n ranges from 0 to 3. The symbol indicates that the accumulator pointed
n
to by AP
accumulator ACk. Similarly, An~ points to the offset accumulator pointed by
APn. For example, if AP3 = 22, then A3 is accumulator AC22 and A3~ is
accumulator AC6.
is the referring accumulator. If APn has a value of k, it is pointing to
n
+16 or APn –16 (whichever is in the range 0
n
points to the accumulator directly . If it is 1,
n
,
4-4
During accumulator read operations, both An and offset An~ are fetched.
Depending on the instruction, either or both registers may be used. In addition,
some write operations allow either register to be selected.
The accumulator block can also be used in string operations. The selected
n
accumulator (A
or An~) is the least significant word (LSW) of the string and
is restored at the end of the operation. String instructions are described in
detail in section 4.8.
4.2.9Accumulator Pointers (AP0–AP3)
The accumulator pointer (AP) registers are 5 bit registers which point to one
of the 32 available accumulators. The APs contain the index of accumulators.
Many instructions allow preincrement or predecrement accumulator pointers.
Such instructions have a suffix of ++A for preincrement or ––A for
predecrement. Accumulator pointers can be stored or loaded from memory
using various addressing modes. Limited arithmetic operations can be
performed on accumulator pointers.
BitBits 16 – 543210
System Registers
AP0–AP3Not usedPoints to A
4.2.10 Indirect Register (R0–R7)
Indirect registers, R0–R7, are 16-bit registers that are used in various
addressing modes or as general-purpose registers. R0, R1, R2 and R3 can
be usedsolely as general-purpose registers. These registers can also be used
as indirect registers with relative addressing.
The R4 or LOOP register is used with instructions BEGLOOP and ENDLOOP
to define a hardware controlled loop. If R4 is loaded with a value,
32767), the BEGLOOP and ENDLOOP block will be executed
loop stops when R4 becomes negative.
The R5 or INDEX register is used with indirect addressing and relative addressing modes of certain instructions.
The R6 or P AGE register is used with page relative addressing and relative flag
addressing.
The R7 or ST ACK register holds the pointer to the stack. It can be used as a
general-purpose register as long as no CALL/RET instructions are used
before restoring it with its old value. However, this register can only be used
as a general-purpose register when maskable interrupts are disabled. The old
n
n = val (b0–b4)
n
(0 ≤ n ≤
n+2
times. The
Assembly Language Instructions
4-5
System Registers
value of the STACK register should be stored before use and restored after
use. This register must point to the beginning of the stack in the RESET
initialization routine before any CALL instruction or maskable interrupts can be
used. CALL instructions increment R7 by 2., RET instructions decrement R7
by 2. The stack in MSP50P614/MSP50C614 is positively incremented.
4.2.11 String Register (STR)
The string register (STR) holds the length of the string used by all string instructions. MOV instructions are used to load this register to define the length of a
string. The value in this register is not altered after the execution of a string
instruction. A value of zero in this register defines a string length of 2. Thus,
a numerical value, n
maximum string length is 32. Therefore, 0 ≤ nS ≤ 30 corresponds to actual
string lengths from 2 to 32.
4.2.12 Status Register (STAT)
The status register (STAT) provides the storage of various single bit mode
conditions and condition bits. As shown in Table 4–1, mode bits reside in the
first 5 LSBs of the status register and can be independently set or reset with
specific instructions. See section 4.6 for detail about these computational
modes. Condition bits and flags are used for conditional branches, calls, and
flag instructions. Flags and status condition bits are stored in the upper 10 bits
of the 17 bit status register. MOV instructions provide the means for context
saves and restores of the status register. The STAT should be initialized to
0000h after the processor resets.
, in the STR register, defines a string length of ns+2. The
s
4-6
The XSF and XZF flags are related to data flow to or from the internal data bus.
If the destination of the transfer is an accumulator, then the SF, ZF , CF and OF
x
flags are affected. If the destination of the transfer is R
, the RCF and RZF
flags are affected. If the destination of the transfer is through the internal
databus, the XSF and XZF flags are affected. The SF flag is the sign flag and
it is equal to the most significant bit of an accumulator when an accumulator
instruction is executed. ZF is the zero flag and is set when the instruction
causes the accumulator value to become zero. CF is the carry flag and is set
when the instruction causes a carry. A carry is generated by addition,
subtraction, multiplication, multiply-accumulate, compare, shifting and some
MOV instructions (that have accumulation features). CF is reset if no carry
occurs after execution of an instruction. OF is set when a computation causes
overflow in the result. It is reset if no overflow occurs during an accumulator
based instruction. Overflow saturation mode is set by the OM bit as explained
in section 4.6.
System Registers
Table 4–1. Status Register (STAT)
BitNameFunction
0XMSign extended mode bit. This bit is one, if sign extension mode is enabled. See
3FMFractional multiplication shift mode. This bit is set if fractional mode is enabled. See
MSP50P614/MSP50C614 Computational Modes, Section 4.6.
4IMMaskable interrupt enable mode. If this bit is zero, all maskable interrupts are disabled.
5Reserved Reserved for future use.
6XZFTransfer(x) equal to zero status (flag) bit. In transfer instructions, this bit is set if the operation
cause the destination result to become zero (excluding accumulator and Rx registers).
7XSFTransfer(x) sign status (flag) bit. In transfer instructions, the sign bit of the value is copied to
this bit if the destination is not accumulator or R
x
registers.
8RCFIndirect register carry out status (flag) bit. This bit is set if an addition to the value of Rx register
caused a carry.
9RZFIndirect register equal to zero status (flag) bit. This bit is set if the Rx register content used by
the instruction is zero.
10OFAccumulator overflow status (flag) bit. This bit is set if an overflow occurs during computation
in ALU.
11SFAccumulator sign status (flag) bit (extended 17th bit). This bit is set if the 16th bit (the sign bit)
of the destination accumulator is 1.
12ZFAccumulator equal to zero status (flag) bit (16 bits). This bit is set to 1 if the result of previous
instruction cause the destination accumulator to become zero.
13CFAccumulator carry out status (flag) bit ( 16th ALU bit).
14TF1Test Flag 1. T est flags are related with Class 8 instructions discussed later.
15TF2Test Flag 2. T est flags are related with Class 8 instructions discussed later.
16TAGMemory tag. Holds the 17th bit whenever a memory value is read.
Assembly Language Instructions
4-7
Instruction Syntax and Addressing Modes
4.3Instruction Syntax and Addressing Modes
MSP50P614/MSP50C614 instructions can perform multiple operations per
instruction. Many instructions may have multiple source arguments. They can
premodify register values and can have only one destination. The addressing
mode is part of the source and destination arguments. In the following subsection, a detail of the MSP50P614/MSP50C614 instruction syntax is explained
followed by the subsection which describes addressing modes.
4.3.1MSP50P614/MSP50C614 Instruction Syntax
All MSP50P614/MSP50C614 instructions with multiple arguments have the
following syntax:
name [
dest
] [,
src
] [,
src1
] [,
mod
]
where the symbols are described as follows:
name
destdest
srcsourc
src1sourc
mod
name
of the instruction. Instruction names are shown in bold letters. If the
instruction
name
types. If
tional or not used for some instructions. Destination is also used as both a
source and a destination for some instructions. If a destination is specified,
it must always be the first argument. Destinations can be system registers
or data memory locations referred by addressing modes. This is instruction specific.
be a system register, a data memory location referred by addressing
modes, or a program memory location. This is instruction specific.
tional or not used for some instructions. Source 1 can be a system register,
a data memory location referred by addressing modes, or a program
memory location. This is instruction specific.
pre or post modification of a register. The meaning of
specific.
name
is followed by a B, the arguments are all byte types. If
is followed by an S, all arguments are word string (strings of words)
name
is followed by BS, all arguments are byte string types.
ination of data to be stored after the execution of an instruction. Op-
e of first data. Optional or not used for some instruction. Source can
e of second data. Some instructions use a second data source. Op-
mod
is instruction
4-8
[ ]Square brackets represent optional arguments. Some instructions have
many combinations of source and destination registers and addressing
modes. The combination is instruction class specific.
The possible combinations of sources, destinations and modifications are dependent on the instruction class. Instruction classes are discussed in detail in
section 4.4.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.