Dr. BuB Bulletin Board —891-DSP3 (8 data bits, no parity, 1 stop)
We welcome your comments and suggestions. They help us provide you with better product documentation. Please send your suggestions/corrections to the Fax number or Email
address above or mail this completed form to:
Motorola Inc.
6501 Wm. Cannon Drive West
Austin, Texas 78735-8598
Attn: DSP Applications/Documentation
Mail Drop: OE314
nc...
I
cale Semiconductor,
Frees
1. Did you find errors in the manual? Please give page number and a description of
each error.
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
DSP56002 User’s Manual Trouble Report
2. Did you find the manual clear and easy to use? Please comment on specific
sections that you feel need improvement.
nc...
I
cale Semiconductor,
Frees
3. What sections of this manual do you consider most important/least important?
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Freescale Semiconductor, Inc.
Order this document by
DSP56002UMAD/AD
SEMICONDUCTOR
TECHNICAL DATA
DSP56002
Addendum to
24-bit Digital Signal Processor
User’s Manual
This document, containing changes, additional features, further explanations, and clarifications, is
a supplement to the original document:
DSP56002UM/ADRev. 1User’s ManualDSP56002
24-bit Digital Signal Processor
Change the following:
nc...
I
Page 1-4, Section 1.2 - Insert after first group of bullets “PLL based clocking with wide input frequency range, wide range frequency multiplication (1 to 4096) and power saving clock divider
(2i, i=0,...,15) to reduce clock noise”
Page 1-4, Section 1.2 - Replace “24 General Purpose I/O Pins” with “25 General Purpose I/O pins”
Page 1-6 - Replace with the following Figure 1-2.
cale Semiconductor,
Frees
Page 2-14, Section 2.5 - Insert “Reset disables the TIO pin and causes it to be three-stated.”
Page 3-11, Section 3.4.3, third sentence - Replace “Mode 0” with “Mode 2”.
Page 5-19, Figure 5-11 - Replace “X:FFE” in two places with “X:$FFE8” on top and “X:FFE9” on
bottom.
Page 6-28, Program listing - Move: “MOVE (R0)+ ;and increment the packing pointer”
to after the JCS instruction.
Replace “RTI”
with“RTI X:”
Replace “FLAGMOVEA,(R3)+”
with“FLAGMOVEA,X:(R3)+”
Page 6-68, Section 6.3.9, third sentence - Replace “Bits CD11–CD0, SCP, and STIR in the SCCR work
together to determine the time base.” with “Bits CD11–CD0 and SCP in the SCCR and the STIR bit
in the SCR work together to determine the time base.”
Page 6-127, Section 6.4.7.2, second paragraph - Replace “MC15500” with “MC145500”.
Page 6-130, Figure 6-72 - Replace “MC1550x” with “MC14550x”.
Page 6-155, Figure 6-88 - Replace “MC15500” with “MC145500”.
Page B-11, Figure B-4 - Add programming description for IPR bits 16 and 17 (see Figure B-4
below).
Page B-25, Figure B-32 - Change CRB bits 2-4 description (see Figure B-32 below).
Page B-27, Figure B-34 - Change arrows pointing to Timer Enable bits 1 and 0 as shown in
Figure B-34 below.
MOTOROLA INC., 1995
For More Information On This Product,
Go to: www.freescale.com
2
Freescale Semiconductor, Inc.
nc...
I
cale Semiconductor,
24-bit
56000 DSP
Core
Internal
Data
Bus
Switch
OnCETM Port
Clock
PLL
Gen.
Counter
47
1
24-bit
Timer /
Event
Interrupt
Control
IRQ
Sync.
Serial
(SSI)
or I/O
Address
Generation
Program Control Unit
3
6
Unit
Program
Decode
Controller
Serial
Comm.
(SCI)
or I/O
Generator
3
Interface
Program
Address
Host
(HI)
or I/O
15
PAB
XAB
YAB
GDB
PDB
XDB
YDB
Program
Memory
512 × 24 RAM
64 × 24 ROM
(boot)(A-law / µ-law)(sine)
Data ALU
24 × 24 + 56 → 56-bit MAC
Two 56-bit Accumulators
Figure 1-2 DSP56002 Block Diagram
X Data
Memory
256 × 24 RAM
256 × 24 ROM
16-bit Bus
24-bit Bus
Y Data
Memory
256 × 24 RAM
256 × 24 ROM
External
Address
Bus
Switch
External
Data
Bus
Switch
Bus
Control
Address
16
Data
24
Control
10
Frees
DSP56002 User’s Manual Addendum
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Freescale Semiconductor, Inc.
nc...
I
cale Semiconductor,
Frees
MOTOROLA
For More Information On This Product,
DSP56002 User’s Manual Addendum
Go to: www.freescale.com
3
4
Freescale Semiconductor, Inc.
nc...
I
10Yes1
11Yes2
IRQA Mode
IRQB Mode
0
*
0
*
0
10Yes1
11Yes2
Host IPL
*
*
0
= Reserved, Program as zero
*
cale Semiconductor,
Frees
IAL2 TriggerIAL1 IAL0 Enabled IPL
0Level00No—
00No—
01Yes0
10Yes1
11Yes2
HPL1 HPL0 Enabled IPL
SSL1SSL0
1Neg. Edge01Yes0
IBL2 TriggerIBL1 IBL0 Enabled IPL
0Level00No—
1Neg. Edge01Yes0
SCL0HPL1 HPL0IBL2 IBL1 IBL0 IAL2 IAL1 IAL0
1514131211109876543210
SCL1
TIL0
TIL1
0
*
0
*
0
*
*
0
Figure B-4 Interrupt Priority Register (IPR)
$0
0
*
0
*
23 22 21 20 19 181617
SSI IPL
SSL1 SSL0 Enabled IPL
00No—
01Yes0
10Yes1
SCI IPL
11Yes2
SCL1 SCL0 Enabled IPL
00No—
01Yes0
10Yes1
11Yes2
TIMER IPL
00No—
TIL1 TIL0Enabled IPL
01Yes0
10Yes1
CENTRAL PROCESSOR
DSP56002 User’s Manual Addendum
For More Information On This Product,
Go to: www.freescale.com
11Yes2
Register (IPR)
Interrupt Priority
X:$FFFF Read/Write
Reset = $000000
MOTOROLA
Freescale Semiconductor, Inc.
nc...
I
cale Semiconductor,
Frees
MOTOROLA
For More Information On This Product,
DSP56002 User’s Manual Addendum
Go to: www.freescale.com
5
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
SSI
Serial Control Direction Bits
0 = Input1 = Output
Clock Source Direction
0 = External Clock1 = Internal Clock
Shift Direction
0 = MSB First 1 = LSB First
Frame Sync Length 0
0 = Rx and Tx Same Length 1 = Rx and Tx Different Length
Frame Sync Length 1
0 = Rx is Word Length 1 = Rx is Bit Length
Sync/Async Control
0 = Asynchronous 1 = Synchronous
Gated Clock Control
0 = Continuous Clock 1 = Gated Clock
SSI Mode Select
0 = Normal1 = Network
Transmit Enable
0 = Disable1 = Enable
Receive Enable
0 = Disable1 = Enable
Transmit Interrupt Enable
0 = Disable1 = Enable
Receive Interrupt Enable
0 = Disable1 = Enable
SSI
Control Register B (CRB)
X:$FFED Read/Write
Reset = $000000
23
*
0
•••
1514131211109876543210
RIE TIE RE TE MOD GCK SYN FSL1 FSL0SHFDSCKDSCD2SCD1SCD0 OF1 OF0
6
Output Flag x
If SYN = 1 and SCD1=1
OFx SCx Pin
= Reserved, Program as zero
*
Figure B-32 SSI Control Register B (CRB)
DSP56002 User’s Manual Addendum
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Freescale Semiconductor, Inc.
TIMER
Timer Control Bits 3-5 (TC0 - TC2)
TC2TC1TC0TIOClockMode
0 0 0GPIO InternalTimer
001OutputInternalTimer Pulse
010OutputInternalTimer Toggle
011XXUndefined
100InputInternalInput Width
101InputInternalInput Period
110InputExternalStandard Time Counter
111InputExternalEvent Counter
Sheet 1 of 1
Timer Enable Bit 0
0 = Timer Disabled
1 = Timer Enabled
Timer Interrupt Enable Bit 1
0 = Interrupts Disabled
1 = Interrupts Enabled
nc...
I
cale Semiconductor,
Frees
Data Input Bit 9
0 = Zero read on TIO pin
1 = One read on TIO pin
Data Output Bit 10
0 =Zero written to TIO pin
1 = One written to TIO pin
Timer Control and
Status Register (TCSR)
X:$FFDE (Read/Write)
Reset = $000200
Figure B-34 Timer Control and Status Register (TCSR)
GPIO Bit 6
0 = TIO is Timer IO
1 = TIO is GPIO if TC2-TC0 are clear
Timer Status Bit 7
0 = TCSR read, or timer interrupt
serviced
1 = Counter decremented to 0
Direction Bit 8
0 = TIO pin is input
1 = TIO pin is output
23
*
0
•••
1514131211109876543210
*0*0*0*0*
Inverter Bit 2
0 = 0- to-1 transitions on TIO
input decrement the counter
1 = 1-to-0 transitions on TIO
input decrement the counter
Timer pulse inverted before
it goes to TIO output
0
= Reserved, Program as zero
*
or
TETIEINVTC0TC1TC2GPIOTSDIRDIDO
MOTOROLA
For More Information On This Product,
DSP56002 User’s Manual Addendum
Go to: www.freescale.com
7
Freescale Semiconductor, Inc.
nc...
I
OnCE is a trademark of Motorola, Inc.
All product and brand names appearing herein are trademarks or registered trademarks of their respective holders.
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability
arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters can and do vary in different applications. All operating parameters, including “Typical”, must be validated for each customer application by customer's technical experts. Motorola does not
cale Semiconductor,
convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized
for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain
life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death
may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall
indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims,
Frees
costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or
death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the
design or manufacture of the part.
Motorola and
Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
Literature Distribution Centers:
USA: Motorola Literature Distribution; P.O. Box 20912; Phoenix, Arizona 85036.
EUROPE: Motorola Ltd.; European Literature Centre; 88 Tanners Drive, Blakelands, Milton Keynes, MK14 5BP, United Kingdom.
JAPAN: Nippon Motorola Ltd.; 4-32-1, Nishi-Gotanda, Shinagawa-ku, Tokyo 141 Japan.
ASIA-PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbor Center, No. 2 Dai King Street, Tai Po Industrial
b are registered trademarks of Motorola, Inc.
Estate, Tai Po, N.T., Hong Kong.
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
SEMICONDUCTOR USER’S MANUAL ADDENDUM
Freescale Semiconductor, Inc.
Order this document by:
DSP56002UMAD2/D
DSP56002
24-BIT DIGITAL SIGNAL PROCESSOR FAMILY
This document, containing changes, additional features, further explanations, and
clarifications, is a second addendum to the original document listed below:
Document Name:
Order Number:
Revision:
Change the following:
Page 5-43 - In the first paragraph after item l0, delete “The code shown in Figure 5-25 is an
excerpt from the Host I/O Port Technical Bulletin (in-house document).” Change the next
nc...
I
cale Semiconductor,
sentence so that it begins “The MAIN PROGRAM in Figure 5-25 initializes...”
Page 7-4 - Change “In Timer Modes 4 and 5” to read “In Timer Modes 4, 5 and 6” in the first
line of the last paragraph.
Page 7-6 - In the second paragraph of section 7.4.4, change “...is given in Chapter 3” to “...is
given in Section 7.5.”
Page 7-20 - In the fifth line of code, change the operand from “#$CF,MR” to #$FC,MR” for
the ANDI instruction.
Page 7-21 - In the eleventh line of code in section 7.8.4, change the operand from “#$CF,MR”
to #$FC,MR” for the ANDI instruction.
Page 7-22 - In the ninth line of code on the page, “#$CF,MR” to #$FC,MR” for the ANDI
instruction.
Page B-3 - In Figure B-1, the Timer Count Register should be shown as 24 bits long instead of
16 bits long.
OnCE, Motorola, and are registered trademarks of Motorola, Inc.
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no
warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does
Motorola assume any liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or incidental damages. “Typical”
parameters can and do vary in different applications. All operating parameters, including “Typical”, must be
validated for each customer application by customer’s technical experts. Motorola does not convey any license
under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use
as components in systems intended for surgical implant into the body, or other applications intended to support or
sustain life, or for any other application in which the failure of the Motorola product could create a situation where
personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries,
cale Semiconductor,
affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney
fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or
unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of
the part.
Frees
How to reach us:
USA/Europe :
Motorola Literature Distribution
P.O. Box 20912
Phoenix, Arizona 85036
1 (800) 441-2447
Hong Kong :
Motorola Semiconductors H.K. Ltd.
8B Tai Ping Industrial Park
51 Ting Kok Road
Tai Po, N.T., Hong Kong
852-2662928
Japan :
Nippon Motorola Ltd.
Tatsumi-SPD-JLDC
Toshikatsu Otsuki
6F Seibu-Butsuryu-Center
3-14-2 Tatsumi Koto-Ku
Tokyo 135, Japan
03-3521-8315
This manual describes the DSP56002 24-bit digital signal processor, its memory and operating modes, and its peripheral modules. It is intended to be used with the DSP56K
Central Processing Unit Manual (DSP56KFAMUM/AD), which describes the central processing unit, programming models, and includes details of the instruction set. The
DSP56002 Technical Data Sheet (DSP56002/D) provides timing, pinout, and packaging
descriptions (see Figure 1-1).
This section presents the DSP56002 features.
nc...
I
24-bit
DSP56002
INTRODUCTION
Products
cale Semiconductor,
Frees
DSP56000
Family Manual
# DSP56KFAMUM/AD
DSP56002
User’s Manual
# DSP56002UM/AD
DSP56002
Technical Data
# DSP56002/D
Central Processor and
Instruction Manual
• central processor
• instruction set
Device Manual
• peripherals
• memories
Specification
• electrical
• mechanical
Figure 1-1 DSP56002 Technical Literature
MOTOROLA INTRODUCTION TO THE DSP560021 - 3
For More Information On This Product,
Go to: www.freescale.com
1.2FEATURES
DSP56K Central Processing Unit (CPU) Features
•20 Million Instructions per Second (MIPS) at 40 MHz
•Single-Cycle 24 x 24 Bit Parallel Multiply-Accumulator
•Highly Parallel Instruction Set with Unique DSP Addressing Modes
•Zero Overhead Nested DO Loops
•Fast Auto-Return Interrupts
•Fully Static Logic, Operation Frequency Down to DC
•Very Low-power CMOS Design
•STOP and WAIT Low-power Standby Modes
Freescale Semiconductor, Inc.
FEATURES
nc...
I
cale Semiconductor,
Frees
DSP56002 Features
•512 x 24 Program RAM
•Two 256 x 24 Data RAM
•Two 256 x 24 Data ROM (Sine and Cosine Tables)
•Full Speed Memory Expansion Port with 16-bit Address and 24-bit Data Buses
•Byte-wide Host Interface with DMA Support
•Synchronous Serial Interface Port
•Serial Communication Interface (Asynchronous) Port
•24 General Purpose I/O Pins
•24-bit Timer/Event Counter
*
•On-chip Emulator (OnCE ) for Unobtrusive, Full Speed Debugging
•Optional Program Security Feature Disables Unauthorized Program ROM and
OnCE Access
•PLL Based Clocking with Wide Input Frequency Range, Wide Range Frequency
Multiplication (1 to 4096) and Power Saving Clock Divider (2
i
, i=0,...,15) to
Reduce Clock Noise
1.3DSP56K CENTRAL PROCESSING UNIT OVERVIEW
The DSP56K series of 24-bit modular processors is built on a common central processing
unit (CPU). In the expansion area around the CPU, the chip can support various configurations of memory and peripheral modules which may change between series members.
* The first version of the DSP56002 (mask number D41G) did not have the timer/event counter. Later versions of the DSP56002 which have
different mask numbers do have the timer/event counter. This mask number can be found below the part number on each chip.
1 - 4INTRODUCTION TO THE DSP56002MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
The central components are:
•Data Buses
•Address Buses
•Data Arithmetic Logic Unit (data ALU)
•Address Generation Unit (AGU)
•Program Control Unit (PCU)
•Memory Expansion (Port A)
Figure 1-2 shows a block diagram of the DSP56002, including the CPU and the expansion
area for memory and peripherals. The DSP56000 Family Manual (DSP56KFAMUM/AD)
presents the details of each of the above CPU components.
MANUAL ORGANIZATION
nc...
I
cale Semiconductor,
Frees
1.4MANUAL ORGANIZATION
This manual includes the following sections:
SECTION 2 — PIN DESCRIPTIONS presents the DSP56002 pinout.
SECTION 3 — MEMORY MODULES AND OPERATING MODES presents the details of
the DSP56002 memory maps and explains the various operating modes that affect the
processor’s program and data memories.
SECTION 4 — PORT A describes the external memory port, its registers, and control
signals.
SECTION 5 — PORT B describes the port B parallel I/O and the host interface, their registers, and their controls.
SECTION 6 — PORT C describes the port C parallel I/O, the Synchronous Serial Interface, the Synchronous Communication Interface, their registers, and their controls.
SECTION 7 — DSP56002 TIMER AND EVENT COUNTER describes the timer/counter
and its registers and controls.
APPENDIX A — BOOTSTRAP PROGRAM
APPENDIX B — PROGRAMMING SHEETS
TROUBLE REPORT — This trouble report is a form that allows the reader to notify the
factory of any errors or discrepancies discovered in this manual.
This section introduces pins associated with the DSP56002. It divides the pins into their
functional groups and explains the role each pin plays in the operation of the chip. It acts
as a reference for following chapters which explain the chip’s peripherals in detail.
2.2SIGNAL DESCRIPTIONS
The DSP56002 is available in a 132-pin grid array package or surface mount (Plastic Quad
Flat Pack, or PQFP). The input and output signals are organized into the functional groups
indicated in Section Figure 2-1. The signals are discussed in the paragraphs that follow.
nc...
I
cale Semiconductor,
Frees
Functional Group
Number
of Pins
Port A Data Bus24
Port A Address19
Port A Bus Control7
Port B Host Interface15
Port C Synchronous Comm. Interface3
Port C Synchronous Serial Interface6
Interrupt and Mode Control4
PLL and Clock7
On-chip Emulation (OnCE)4
Power (VCC)16
Ground (GND)24
Timer 1
Reserved2
Total (for the PGA package)132
D0-D23
DGND(6)
DVCC(3)
A0-A15
X/Y
AGND(5)
AVCC(3)
BN
RD
WR
BR
BG
WT
CGND
CVCC
MODC/NMI
MODB/IRQB
MODA/IRQA
RESET
EXTAL
XTAL
QGND(4)
QVCC(4)
RESERVED (2)
DSP56002
Port A
Data
Port A
PS
DS
BS
TIOTimer
Address
Port A
Control
Interrupt/
Mode
Control
132 pins
Port B
HOST
Port C
SCI
Port C
SSI
OnCE
PLL
H0-H7
HA0-HA2
HR/W
HEN
HREQ
HACK
HGND(4)
HVCC(2)
RXD
TXD
SCLK
SVCC
SGND(2)
SC0-SC2
SCK
SRD
STD
DSCK/OS1
DSI/OS0
DSO
DR
PVCC
PGND
PCAP
CKP
PLOCK
PINIT
CLVCC
CLGND
CKOUT
Figure 2-1 DSP56002 Signals
2.2.1Port A Address and Data Bus
The Port A address and data bus signals control the access to external memory. They are
three-stated during reset unless noted otherwise, and may require pull-up resistors to minimize power consumption and to prevent erroneous operation.
Note:All unused inputs should have pull-up resistors for two reasons: 1) floating inputs
draw excessive power, and 2) a floating input can cause erroneous operation. For
MOTOROLA DSP56002 PIN DESCRIPTIONS2 - 3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
SIGNAL DESCRIPTIONS
example, during reset, all signals are three-stated. Without pull-up resistors, the BR
and WT signals may become active, causing two or more memory chips to try to
simultaneously drive the external bus, which can damage the memory chips. A pullup resistor in the 50K-ohm range should be sufficient. Also, for future enhancements, all reserved pins (see Section Figure 2-1) should be left unconnected.
2.2.1.1Address (A0–A15)
These three-state output pins specify the address for external program and data memory
accesses. To minimize power dissipation, A0–A15 do not change state when external
memory spaces are not being accessed.
nc...
I
cale Semiconductor,
Frees
2.2.1.2Data Bus (D0–D23)
These pins provide the bidirectional data bus for external program and data memory accesses. D0–D23 are in the high-impedance state when the bus grant signal is asserted.
2.2.2Port A Bus Control
The Port A bus control signals are discussed in the following paragraphs. The bus control
signals provide a means to connect additional bus masters (which may be additional
DSPs, microprocessors, direct memory access (DMA) controllers, etc.) through port A to
the DSP56002. They are three-stated during reset and may require pull-up resistors to
prevent erroneous operation.
2.2.2.1Program Memory Select (PS
)
This three-state output is asserted only when external program memory is referenced
(see Table 2-1).
Table 2-1 Program and Data Memory Select Encoding
PSDSX/YExternal Memory Reference
111No Activity
101X Data Memory on Data Bus
100Y Data Memory on Data Bus
011Program Memory on Data Bus (Not Exception)
010External Exception Fetch: Vector or Vector +1
00XReserved
110Reserved
2 - 4DSP56002 PIN DESCRIPTIONSMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
(Development Mode Only)
2.2.2.2Data Memory Select (DS)
This three-state output is asserted only when external data memory is referenced (see Table 2-1).
2.2.2.3X/Y Select (X/Y)
This three-state output selects which external data memory space (X or Y) is referenced
by DS
(see Table 2-1).
Freescale Semiconductor, Inc.
SIGNAL DESCRIPTIONS
nc...
I
cale Semiconductor,
Frees
2.2.2.4Read Enable (RD
This three-state output is asserted to read external memory on the data bus (D0–D23).
2.2.2.5Write Enable (WR)
This three-state output is asserted to write external memory on the data bus (D0–D23).
2.2.2.6Bus Needed (BN)
The BN
port (Port A). During instruction cycles where the external bus is not required, BN
serted.
has granted the bus (by asserting BG
external accesses are required. If an external access is required and the chip is not the
bus master, it will stop processing and remain in wait states until bus ownership is returned. If the BN
processing has stopped and the DSP is waiting to acquire bus ownership. An external arbiter may use this pin to help decide when to return bus ownership to the DSP.
Note: The BN
During hardware reset, BN is deasserted.
2.2.2.7Bus Request (BR
When the bus request input (BR
to an external device such as a processor or DMA controller. The external device will become the new master of the external address and data buses while the DSP continues
internal operations using internal memory spaces. When BR
DSP56002 will again assume bus mastership.
output pin is asserted whenever the chip requires the external memory expansion
If an external device has requested the bus by asserting the BR
pin is asserted when the chip is not the bus master, this indicates that
pin cannot be used as an early indication of imminent external bus access
because it is valid later than the other bus control signal BS
)
is deas-
input and the DSP
), the DSP will continue processing as long as no
.
)
) is asserted, the DSP56002 will always relinquish the bus
is deasserted, the
When BR
D23, and the bus control pins (PS
impedance state, after the execution of the current instruction has been completed.
Note: To prevent erroneous operation, the BR
MOTOROLA DSP56002 PIN DESCRIPTIONS2 - 5
is asserted, the DSP56002 will always release Port A, including A0–A15, D0–
, DS, X/Y, RD, WR, and BS) by placing them in the high-
pin should be pulled up when it is not in use.
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
2.2.2.8Bus Grant (BG)
When this output is asserted, it signals to the external device that it has been granted the external bus (i.e. Port A has been three-stated).This output is deasserted during hardware reset.
SIGNAL DESCRIPTIONS
nc...
I
cale Semiconductor,
Frees
2.2.2.9Bus Strobe (BS
The BS
of the state of the external bus access by the DSP56002. It may also be used with the bus
wait input, WT
necting asynchronous devices to the DSP, allowing devices with differing timing
requirements to reside in the same memory space, allowing a bus arbiter to provide a fast
multiprocessor bus access, and providing an alternative to the WAIT and STOP instructions to halt the DSP at a known program location and have a fast restart. This output is
deasserted during hardware reset.
2.2.2.10Bus Wait (WT
For as long as it is asserted by an external device, this input allows that device to force
the DSP56002 to generate wait states. If WT
will be inserted into the current cycle (see the DSP56002 Technical Data Sheet
(DSP56002/D) for timing details.
2.2.3Interrupt and Mode Control
The interrupt and mode control pins select the chip’s operating mode as it comes out of
hardware reset, and they receive interrupt requests from external sources.
2.2.3.1Mode Select A/External Interrupt Request A (MODA/IRQA
This input pin has three functions. It works with the MODB and MODC pins to select the
chip’s operating mode, it receives an interrupt request from an external source, and it
turns on the internal clock generator, causing the chip to recover from the stop processing
state. Reset causes this input to act as MODA.
During reset, this pin should be forced to the desired state, because as the chip comes
out of reset, it reads the states of MODA, MODB, and MODC and writes the information
to the Operating Mode Register to set the chip’s operating mode. (Operating Modes are
discussed in SECTION 3 MEMORY MODULES AND OPERATING MODES .) After the
chip has left the reset state, the MODA pin automatically changes to external interrupt
request IRQA
output is asserted when the DSP accesses Port A. It acts as an early indication
, to generate wait states, a feature which provides capabilities such as con-
.
)
)
is asserted when BS is asserted, wait states
)/STOP Recovery
IRQA receives external interrupt requests. It can be programmed to be level sensitive or
negative edge triggered. When the signal is edge triggered, triggering occurs at a voltage
level and is not directly related to the fall time of the interrupt signal. However, as the fall
2 - 6DSP56002 PIN DESCRIPTIONSMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
time of the interrupt signal increases, the probability that noise on IRQA will generate multiple interrupts also increases.
2.2.3.2Mode Select B/External Interrupt Request B (MODB/IRQB)
This input pin works with the MODA and MODC pins to select the chip’s operating mode,
and it receives an interrupt request from an external source. Reset causes this input to act
as MODB.
During reset, this pin should be forced to the desired state, because as the chip comes
out of reset, it reads the states of the mode pins and writes the information to the Operating Mode Register, which sets the chip’s operating mode. After the chip has left the reset
state, the MODB pin automatically changes to external interrupt request IRQB
SIGNAL DESCRIPTIONS
.
nc...
I
cale Semiconductor,
Frees
IRQB receives external interrupt requests. It can be programmed to be level sensitive or
negative edge triggered. When the signal is edge triggered, triggering occurs at a voltage
level and is not directly related to the fall time of the interrupt signal. However, as the fall
time of the interrupt signal increases, the probability that noise on IRQB
tiple interrupts also increases.
This input pin works with the MODA and MODB pins to select the chip’s operating mode,
and it receives an interrupt request from an external source. Reset causes this input to act
as MODC.
During reset, this pin should be forced to the desired state, because as the chip comes out
of reset, it reads the states of the mode pins and writes the information to the Operating
Mode Register, which sets the chip’s operating mode. After the chip has left the reset state,
the MODC pin automatically changes to a nonmaskable interrupt request (NMI
The negative-edge triggered NMI receives nonmaskable interrupt requests. Triggering
occurs at a voltage level and is not directly related to the fall time of the interrupt signal.
However, as the fall time of the interrupt signal increases, the probability that noise on NMI
will generate multiple interrupts also increases.
will generate mul-
) input.
2.2.3.4Reset (RESET
This Schmitt trigger input pin is used to reset the DSP56002. When RESET
the DSP56002 is initialized and placed in the reset state. When RESET
the chip writes the mode pin (MODA, MODB, MODC) information to the operating mode
MOTOROLA DSP56002 PIN DESCRIPTIONS2 - 7
)
is asserted,
is deasserted,
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
register, setting the chip’s operating mode. The chip also samples the PINIT pin and
writes its information into the PEN bit of the PLL Control Register, and it samples the CKP
pin to determine the polarity of the CKOUT signal. When the chip comes out of the reset
state, deassertion occurs at a voltage level and is not directly related to the rise time of
the RESET
resets increases with increasing rise time of the RESET
2.2.4Power and Clock
The power and clock signals are presented in the following paragraphs.
2.2.4.1Power (Vcc), Ground (GND)
There are six sets of power and ground pins: a set of eight (four power, four ground) for
internal logic; a set of eight (three power, five ground) for the address bus output buffer;
a set of nine (three power, six ground) for the data bus output buffer; a set of eleven (four
power, seven ground) for ports B and C and for the OnCE; a set of one power and one
ground for the PLL; and a set of one power and one ground for the CKOUT pin. Refer to
the pin assignments in the Layout Practices section of the DSP56002 Technical Data
Sheet (DSP56002/D).
2.2.4.2External Clock/Crystal Input (EXTAL)
The EXTAL input interfaces the internal crystal oscillator input to an external crystal or an
external clock.
2.2.4.3Crystal Output (XTAL)
This output connects the internal crystal oscillator output to an external crystal. If an external clock is used, XTAL should not be connected. It may be disabled through software
control using the XTLD bit in the PLL control register.
2.2.5Host Interface
The following paragraphs discuss the host interface signals, which provide a convenient
connection to another processor through Port B on the DSP56002.
signal. However, the probability that noise on RESET will generate multiple
SIGNAL DESCRIPTIONS
signal.
2.2.5.1Host Data Bus (H0–H7)
This bidirectional data bus transfers data between the host processor and the DSP56002.
It acts as an input unless HEN
puts and allowing the host processor to read DSP56002 data. It is high impedance when
HEN
is deasserted. H0–H7 can be programmed as general-purpose I/O pins (PB0–PB7)
2 - 8DSP56002 PIN DESCRIPTIONSMOTOROLA
is asserted and HR/W is high, making H0–H7 become out-
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
when the host interface is not being used. These pins are configured as GPIO input pins
during hardware reset.
2.2.5.2Host Address (HA0–HA2)
These inputs provide the address selection for each host interface register. HA0–HA2 can
be programmed as general-purpose I/O pins (PB8–PB10) when the host interface is not
being used. These pins are configured as GPIO input pins during hardware reset.
SIGNAL DESCRIPTIONS
nc...
I
cale Semiconductor,
Frees
2.2.5.3Host Read/Write (HR/W
This input selects the direction of data transfer for each host processor access. If HR/W
is high and HEN is asserted, H0-H7 are outputs and DSP data is transferred to the host
processor. If HR/W
ferred to the DSP. HR/W
general-purpose I/O pin (PB11) when the host interface is not being used, and is configured as a GPIO input pin during hardware reset.
2.2.5.4Host Enable (HEN
This input enables a data transfer on the host data bus. When HEN
is high, H0–H7 become outputs and the host processor may read DSP56002 data. When
HEN
is asserted and HR/W is low, H0–H7 become inputs. When HEN is deasserted, host
data is latched inside the DSP. Normally, a chip select signal derived from host address
decoding and an enable clock are used to generate HEN
general-purpose I/O pin (PB12) when the host interface is not being used, and is configured as a GPIO input pin during hardware reset.
2.2.5.5Host Request (HREQ
This open-drain output signal is used by the host interface to request service from the
host processor, DMA controller, or a simple external controller. HREQ
grammed as a general-purpose I/O (not open-drain) pin (PB13) when the host
interface is not being used.
is low and HEN is asserted, H0-H7 are inputs and host data is trans-
is stable when HEN is asserted. It can be programmed as a
)
)
is asserted and HR/W
. HEN can be programmed as a
)
can be pro-
2.2.5.6Host Acknowledge (HACK
This input has two functions. It provides a host acknowledge handshake signal for DMA
transfers and it receives a host interrupt acknowledge compatible with MC68000 Family
processors. When the port is defined as the host interface and neither of the HACK pin’s
two functions are being used, the user may program this input as a general-purpose I/O pin.
For more details about the programming options for this pin, see Section 5.3.4.6 Host Ac-
knowledge (HACK
Note: HACK should always be pulled high when it is not in use.
MOTOROLA DSP56002 PIN DESCRIPTIONS2 - 9
) . This pin is configured as a GPIO input pin during hardware reset.
For More Information On This Product,
Go to: www.freescale.com
)
Freescale Semiconductor, Inc.
2.2.6Serial Communication Interface (SCI)
The following signals relate to the SCI. They are introduced briefly here and described in
more detail in SECTION 6 - PORT C .
2.2.6.1Receive Data (RXD)
This input receives byte-oriented data and transfers the data to the SCI receive shift register. Input data is sampled on the positive or the negative edge of the receive clock,
depending on how the SCI control register is programmed. RXD can be programmed as
a general-purpose I/O pin (PC0) when it is not being used as an SCI pin, and it is configured as a GPIO input pin during hardware reset.
SIGNAL DESCRIPTIONS
nc...
I
cale Semiconductor,
Frees
2.2.6.2Transmit Data (TXD)
This output transmits serial data from the SCI transmit shift register. Data changes on the
negative edge of the transmit clock. This output is stable on the positive or the negative
edge of the transmit clock, depending on how the SCI control register is programmed.
TXD can be programmed as a general-purpose I/O pin (PC1) when the SCI TXD function
is not being used, and it is configured as a GPIO input pin during hardware reset.
2.2.6.3SCI Serial Clock (SCLK)
This bidirectional pin provides an input or output clock from which the transmit and/or receive baud rate is derived in the asynchronous mode, and from which data is transferred
in the synchronous mode. SCLK can be programmed as a general-purpose I/O pin (PC2)
when the SCI SCLK function is not being used, and it is configured as a GPIO input pin
during hardware reset.
2.2.7Synchronous Serial Interface (SSI)
The SSI signals are presented in the following paragraphs.The SSI operating mode affects the definition and function of SSI control pins SC0, SC1, and SC2. They are
introduced briefly here and are described in more detail in SECTION 6 - PORT C .
2.2.7.1Serial Clock Zero (SC0)
This bidirectional pin’s function is determined by whether the SCLK is in synchronous or
asynchronous mode. In synchronous mode, this pin is used for serial flag I/O. In asynchronous mode, this pin receives clock I/O. SC0 can be programmed as a general-purpose
I/O pin (PC3) when the SSI SC0 function is not being used, and it is configured as a GPIO
input pin during hardware reset.
2 - 10DSP56002 PIN DESCRIPTIONSMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
2.2.7.2Serial Control One (SC1)
The SSI uses this bidirectional pin to control flag or frame synchronization. This pin’s function is determined by whether the SCLK is in synchronous or asynchronous mode.In
asynchronous mode, this pin is frame sync I/O. For synchronous mode with continuous
clock, this pin is serial flag SC1 and operates like the SC0. SC0 and SC1 are independent
serial I/O flags but may be used together for multiple serial device selection. SC1 can be
programmed as a general-purpose I/O pin (PC4) when the SSI SC1 function is not being
used, and it is configured as a GPIO input pin during hardware reset.
2.2.7.3Serial Control Two (SC2)
The SSI uses this bidirectional pin to control frame synchronization only. As with SC0 and
nc...
I
SC1, its function is defined by the SSI operating mode. SC2 can be programmed as a
general-purpose I/O pin (PC5) when the SSI SC2 function is not being used, and it is configured as a GPIO input pin during hardware reset.
ON-CHIP EMULATION (OnCE) PINS
cale Semiconductor,
Frees
2.2.7.4SSI Serial Clock (SCK)
This bidirectional pin provides the serial bit rate clock for the SSI when only one clock is
being used. SCK can be programmed as a general-purpose I/O pin (PC6) when it is not
needed as an SSI pin, and it is configured as a GPIO input pin during hardware reset.
2.2.7.5SSI Receive Data (SRD)
This input pin receives serial data into the SSI receive shift register. SRD can be programmed as a general-purpose I/O pin (PC7) when it is not needed as an SSI pin, and it
is configured as a GPIO input pin during hardware reset.
2.2.7.6SSI Transmit Data (STD)
This output pin transmits serial data from the SSI transmit shift register. STD can be programmed as a general-purpose I/O pin (PC8) when it is not needed as an SSI pin, and it
is configured as a GPIO input pin during hardware reset.
2.3ON-CHIP EMULATION (OnCE) PINS
The following paragraphs describe the OnCE pins associated with the OnCE controller
and its serial interface.
2.3.1Debug Serial Input/Chip Status 0 (DSI/OS0)
Serial data or commands are provided to the OnCE controller through the DSI/OS0 pin
when it is an input. The data received on the DSI pin will be recognized only when the
DSP56K has entered the debug mode of operation. Data is latched on the falling edge of
MOTOROLA DSP56002 PIN DESCRIPTIONS2 - 11
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
the DSCK serial clock. Data is always shifted into the OnCE serial port most significant bit
(MSB) first. When the DSI/OS0 pin is an output, it works in conjunction with the OS1 pin
to provide chip status information (see Section 10 ON CHIP EMULATION (OnCE) in the
DSP56000 Family Manual ). The DSI/OS0 pin is an output when the processor is not in
debug mode. When switching from output to input, the pin is three-stated. During hardware reset, this pin is defined as an output and it is driven low.
Note: To avoid possible glitches, an external pull-down resistor should be attached to this pin.
2.3.2Debug Serial Clock/Chip Status 1 (DSCK/OS1)
The DSCK/OS1 pin supplies the serial clock to the OnCE when it is an input. The serial
clock provides pulses required to shift data into and out of the OnCE serial port. (Data is
nc...
I
clocked into the OnCE on the falling edge and is clocked out of the OnCE serial port on
the rising edge.) The debug serial clock frequency must be no greater than 1/8 of the processor clock frequency.
ON-CHIP EMULATION (OnCE) PINS
cale Semiconductor,
Frees
The pin is three-stated when it is changing from input to output. When it is an output, it works
with the OS0 pin to provide information about the chip status (see SECTION 10 ON CHIP
EMULATION (OnCE) in the DSP56000 Family Manual ). It is an output when the chip is not
in debug mode. During hardware reset, this pin is defined as an output and is driven low.
Note: To avoid possible glitches, an external pull-down resistor should be attached to this pin.
2.3.3Debug Serial Output (DSO)
The DSP reads serial data from the OnCE through the DSO output pin, as specified by
the last command received from the external command controller. Data is always shifted
out the OnCE serial port most significant bit (MSB) first. Data is clocked out of the OnCE
serial port on the rising edge of DSCK.
The DSO pin also provides acknowledge pulses to the external command controller.
When the chip enters the debug mode, the DSO pin will be pulsed low to indicate (acknowledge) that the OnCE is waiting for commands. After receiving a read command,
the DSO pin will be pulsed low to indicate that the requested data is available and the
OnCE serial port is ready to receive clocks in order to deliver the data. After receiving
a write command, the DSO pin will be pulsed low to indicate that the OnCE serial port
is ready to receive the data to be written; after the data is written, another acknowledge pulse will be provided.
During hardware reset and when the processor is idle, the DSO pin is held high.
2 - 12DSP56002 PIN DESCRIPTIONSMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
2.3.4Debug Request Input (DR)
The debug request input (DR
the external command controller. When DR
current instruction being executed, save the instruction pipeline information, enter the debug mode, and wait for commands to be entered from the DSI line. While in debug mode,
the DR
receiving an acknowledge. It may be necessary to reset the OnCE controller in cases
where synchronization between the OnCE controller and external circuitry is lost. Asserting DR
acknowledge pulse in the DSP is produced, sends the DSP into the debug mode. After
receiving the acknowledge, DR
nc...
I
mand. For more information, see Section 10.6 METHODS OF ENTERING THE DEBUG
MODE in the DSP56000 Family Manual (DSP56KFAMUM/AD).
pin lets the user reset the OnCE controller by asserting it and deasserting it after
when the DSP is in the WAIT or the STOP state, and keeping it asserted until an
PLL PINS
) allows the user to enter the debug mode of operation from
is asserted, it causes the DSP to finish the
must be deasserted before sending the first OnCE com-
cale Semiconductor,
Frees
2.4PLL PINS
The following pins are dedicated to the PLL operation:
•
Analog PLL Circuit Power (PVCC) — The Vcc input is dedicated to the analog
PLL circuits. The voltage should be well regulated and the pin should be provided with an extremely low impedance path to the Vcc power rail. PVcc should
be bypassed to PGND by a 0.1
chip package.
•Analog PLL Circuit Ground (PGND) — This GND input is dedicated to the an-
alog PLL circuits. The pin should be provided with an extremely low impedance
path to ground. PVcc should be bypassed to PGND by a 0.1
ed as close as possible to the chip package.
•CKOUT Power (CLVCC) — This input acts as VCC for the CKOUT output. The
voltage should be well regulated and the pin should be provided with an extremely low impedance path to the VCC power rail. CLVCC should be bypassed to CLGND by a 0.1
package.
•CKOUT Ground (CLGND) — This input acts as GND for the CKOUT output.
The pin should be provided with an extremely low impedance path to ground.
CLVCC should be bypassed to CLGND by a 0.1
as possible to the chip package.
•PLL Filter Capacitor (PCAP) — This input is used to connect an external capacitor needed for the PLL filter. One terminal of the capacitor is connected to
PCAP while the other terminal is connected to PVCC. The capacitor value is
specified in the DSP56002 Technical Data Sheet (DSP56002/D).
µF capacitor located as close as possible to the
µF capacitor located as close as possible to the chip
µF capacitor locat-
µF capacitor located as close
MOTOROLA DSP56002 PIN DESCRIPTIONS2 - 13
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
•Output Clock (CKOUT) — This output pin provides a 50% duty cycle output
clock synchronized to the internal processor clock when the PLL is enabled and
locked. When the PLL is disabled, the output clock at CKOUT is derived from,
and has the same frequency and duty cycle as, EXTAL.
Note: If the PLL is enabled and the multiplication factor is less than or equal to
4, then CKOUT is synchronized to EXTAL. (For information on the
DSP56002’s PLL multiplication factor, see Section Section 3.6 PLLMULTIPLICATION FACTOR.
•CKOUT Polarity Control (CKP) — This input pin defines the polarity of the CK-
OUT clock output. Strapping CKP through a resistor to GND will make the CKOUT polarity the same as the EXTAL polarity. Strapping CKP through a resistor
to Vcc will make the CKOUT polarity the inverse of the EXTAL polarity. The CKOUT clock polarity is internally latched at the end of the hardware reset, so that
any changes of the CKP pin logic state after deassertion of hardware reset will
not affect the CKOUT clock polarity.
•PLL Initialization Input (PINIT) — During the assertion of hardware reset, the
value at the PINIT input pin is written into the PEN bit of the PLL control register.
The PEN bit enables the PLL by causing it to derive the internal clocks from the
PLL VCO output. When the bit is clear, the PLL is disabled and the chip’s internal clocks are derived from the clock connected to the EXTAL pin. After hardware reset is deasserted, the PINIT pin is ignored.
•Phase and Frequency Locked (PLOCK) — The PLOCK output originates
from the Phase Detector. The chip asserts PLOCK when the PLL is enabled
and has locked on the proper phase and frequency of EXTAL. The PLOCK output is deasserted by the chip if the PLL is enabled and has not locked on the
proper phase and frequency. PLOCK is asserted if the PLL is disabled. PLOCK
is a reliable indicator of the PLL lock state only after the chip has exited the
hardware reset state. During hardware reset, the PLOCK state is determined
by PINIT and by the PLL lock condition.
TIMER/EVENT COUNTER MODULE PIN
2.5TIMER/EVENT COUNTER MODULE PIN
The bidirectional TIO pin is the pin that provides an interface to the timer/event counter module. When the TIO is used as an input, the module functions as an external event counter,
or it measures external pulse width/signal period. When the TIO is used as an output, the
module functions as a timer and the signal on the TIO pin is the timer pulse. When the timer
module is not using the TIO pin, the TIO can act as a general purpose I/O pin.
The memory of the DSP56002 can be partitioned in several ways to provide high-speed
parallel operation and additional off-chip memory expansion. Program and data memory
are separate, and the data memory is, in turn, divided into two separate memory spaces,
X and Y. Both the program and data memories can be expanded off-chip. There are also
two on-chip data read-only memories (ROMs) that can overlay a portion of the X and Y
data memories, and a bootstrap ROM that can overlay part of the program random-access memory (RAM). The data memories are divided into two independent spaces to work
with the two address arithmetic logic units (ALUs) to feed two operands simultaneously to
the data ALU.
The DSP operating modes determine the memory maps for program and data memories
nc...
I
and the start-up procedure when the DSP leaves the reset state. This section describes
the DSP56002 Operating Mode Register (OMR), its operating modes and their associated
memory maps, and discusses how to set and reset operating modes.
cale Semiconductor,
Frees
This section also includes details of the interrupt vectors and priorities and describes the
effect of a hardware reset on the PLL multiplication factor.
3.2DSP56002 DATA AND PROGRAM MEMORY
The DSP56002 has 512 words of program RAM, 64 words of bootstrap ROM, 256 words
of RAM and 256 words of ROM for each of the X and Y internal data memories. The memory maps are shown in Section Figure 3-1 DSP56002 Memory Maps.
3.2.1Program Memory
The DSP56002 has 512 words of program RAM and 64 words of factory-programmed
bootstrap ROM.
The bootstrap ROM is programmed to perform the bootstrap operation from the memory
expansion port (port A), from the host interface, or from the SCI. It provides a convenient,
low cost method of loading the program RAM with a user program after power-on reset.
The bootstrap ROM activity is controlled by the MA, MB, and MC bits in the OMR (see 3.3
DSP56002 OPERATING MODE REGISTER (OMR) for a complete explanation of the
OMR and the DSP56002’s operating modes and memory maps).
Addresses are received from the program control logic (usually the program counter) over
the PAB. Program memory may be written using the program memory (MOVEM) instructions. The interrupt vectors are located in the bottom 128 locations ($0000-$007F) of
program memory. Program memory may be expanded to 64K off-chip.
MOTOROLA MEMORY MODULES AND OPERATING MODES3 - 3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
DSP56002 OPERATING MODE REGISTER (OMR)
3.2.2X Data Memory
The on-chip X data RAM is a 24-bit-wide, static internal memory occupying the lowest 256
locations (0–255) in X memory space. The on-chip X data ROM occupies locations 256–
511 in the X data memory space and is controlled by the DE bit in the OMR. (See the explanation of the DE bit in Section 3.3.2 Data ROM Enable (Bit 2) . Also, see Figure 3-
1.)The on-chip peripheral registers occupy the top 64 locations of the X data memory
($FFC0–$FFFF). The 16-bit addresses are received from the XAB, and 24-bit data transfers to the data ALU occur on the XDB. The X memory may be expanded to 64K off-chip.
3.2.3Y Data Memory
The on-chip Y data RAM is a 24-bit-wide internal static memory occupying the lowest 256
nc...
I
locations (0–255) in the Y memory space. The on-chip Y data ROM occupies locations
256–511 in Y data memory space and is controlled by the DE and YD bits in the OMR.
(See the explanations of the DE and YD bits in Sections Section 3.3.2 Data ROM En-
able (Bit 2) and Section 3.3.3 Internal Y Memory Disable Bit (Bit 3) , respectively. Also,
see Figure 3-1.) The 16-bit addresses are received from the YAB, and 24-bit data transfers to the data ALU occur on the YDB. Y memory may be expanded to 64K off-chip.
cale Semiconductor,
Frees
Note: The off-chip peripheral registers should be mapped into the top 64 locations ($FFC0–
$FFFF) to take advantage of the move peripheral data (MOVEP) instruction.
3.3DSP56002 OPERATING MODE REGISTER (OMR)
Operating modes determine the memory maps for program and data memories, and the
start-up procedure when the DSP leaves the reset state. The processor samples the MODA, MODB, and MODC pins as it leaves the reset state, establishes the initial operating
mode, and writes the operating mode information to the Operating Mode Register. When
the processor leaves the reset state, the MODA and MODB pins become general-purpose
interrupt pins, IRQA
maskable interrupt pin NMI
The OMR is a 24-bit register (only six bits are defined) that controls the current operating
mode of the processor. It is located in the DSP56002’s Program Control Unit (described
in Section 5 of the DSP56000 Family Manual ). The OMR bits are only affected by processor reset and by the ANDI, ORI, MOVEC, BSET, BCLR, and BCHG instructions, which
directly reference the OMR. The OMR format for the DSP56002 is shown in Figure 3-2
OMR Format.
and IRQB, respectively, and the MODC pin becomes the non-
OPERATING MODE DETERMINES
PROGRAM MEMORY AND RESET
STARTING ADDRESS
MODE 2
MC=0 MB=1 MA=0
$FFFF
$E000
$01FF
$003F
RESET
EXTERNAL
INTERNAL
RAM
INTERRUPTS
$0
INTERNAL P: RAM
EXTERNAL RESET
$FFFF
$01FF
$003F
PERIPHERAL MAP
$FFFF
INTERRUPT PRIORITY
BUS CONTROL
SCI INTERFACE
SSI INTERFACE
HOST INTERFACE
P ARALLEL I/0 INTERF A CE
TIMER
$FFDE
$FFC0
MODE 3
MC=0 MB=1 MA=1
EXTERNAL
INTERRUPTS
RESET
$0
NO INTERNAL P: RAM
EXTERNAL RESET
ON-CHIP
RESERVED
Figure 3-1 DSP56002 Memory Maps
$FFFF
X DATA
MEMORY
SPACE
$0
DE and YD BITS IN THE OMR DETERMINE
THE X AND Y DATA MEMORY MAPS
DE = 1
YD = 0
$FFFF
ON-CHIP
PERIPHERALS
$FFC0
$FFBF
EXTERNAL
X DATA
MEMORY
$01FF
INTERNAL
X ROM -
+A-LAW/LIN
$017F
INTERNAL
X ROM -
+MU-LAW/LIN
$00FF
INTERNAL
X RAM
$0
DATA ROMS ENABLED
$FFFF
ON-CHIP
PERIPHERALS
$FFC0
$FFBF
EXTERNAL
X DATA
MEMORY
$01FF
INTERNAL
X ROM -
+A-LAW/LIN
$017F
INTERNAL
X ROM -
+MU-LAW/LIN
$00FF
INTERNAL
X RAM
$0
NOTE: Addresses $FFC0–$FFFF in X data memory
are NOT available externally
PERIPHERALS
EXTERNAL
INTERNAL
SINE-WAVE
INTERNAL
DE = 1
YD = 1
PERIPHERALS
EXTERNAL
EXTERNAL
Y DATA
MEMORY
Y ROM
FULL
Y RAM
EXTERNAL
Y DATA
MEMORY
$FFFF
$0
$FFFF
$FFC0
$00FF
$FFFF
$FFC0
$00FF
Y DATA
MEMORY
SPACE
ON-CHIP
PERIPHERALS
EXTERNAL
X DATA
MEMORY
INTERNAL
X RAM
$0
DATA ROMS DISABLED
ON-CHIP
PERIPHERALS
INTERNAL
X RAM
$0
DE = 0
YD = 0
DE = 0
YD = 1
PERIPHERALS
EXTERNAL
PERIPHERALS
EXTERNAL
Y DATA
MEMORY
INTERNAL
Y RAM
EXTERNAL
EXTERNAL
Y DATA
MEMORY
MOTOROLA MEMORY MODULES AND OPERATING MODES3 - 5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
DSP56002 OPERATING MODE REGISTER (OMR)
23876543210
*
SDMC YD DE MB MA
*
*
OPERATING MODES A, B
DATA ROM ENABLE
INTERNAL Y MEMORY DISABLE
OPERATING MODE C
RESERVED
STOP DELAY
RESERVED
RESERVED
Figure 3-2 OMR Format
nc...
I
3.3.1Chip Operating Mode (Bits 0 and 1)
The chip operating mode bits, MB and MA, together with MC, define the program memory maps and the operating mode of the DSP56002. On processor reset, MB and MA are
loaded from the external mode select pins, MODB and MODA, respectively. After the
DSP leaves the reset state, MB and MA can be changed under software control.
cale Semiconductor,
Frees
3.3.2Data ROM Enable (Bit 2)
The DE bit enables the two, on-chip, 256X24 data ROMs located between addresses
$0100–$01FF in the X and Y memory spaces. When DE is cleared, the $0100–$01FF
address space is part of the external X and Y data spaces, and the on-chip data ROMs
are disabled. Hardware reset clears the DE bit.
3.3.3Internal Y Memory Disable Bit (Bit 3)
Bit 3 is defined as Internal Y Memory Disable (YD). When set, all Y Data Memory addresses are considered to be external, disabling access to internal Y Data Memory. When
cleared, internal Y Data Memory may be accessed according to the state of the DE control
bit. The content of the internal Y Data Memory is not affected by the state of the YD bit.
The YD bit is cleared during hardware reset.
Figure 3-1 DSP56002 Memory Maps shows a graphic representation of the DE and YD
bit effects on the X and Y data memory maps. Table 3-1 also compares the DE and YD
effects on the memory maps.
3 - 6MEMORY MODULES AND OPERATING MODESMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
DEYDData Memory
00Internal ROMs Disabled and their addresses are part of
01Internal X Data ROM is Disabled and is part of External
nc...
I
DSP56002 OPERATING MODES
Table 3-1 Memory Mode Bits
External Memory
Memory. Internal Y Data RAM and ROM are Disabled and
are part of External Memory
cale Semiconductor,
Frees
3.3.4Chip Operating Mode (Bit 4)
The MC bit, together with bits MA and MB, define the program memory map and the operating
mode of the chip. Upon reset, the processor loads this bit from the MODC external mode select pin. After the DSP leaves the reset state, MC can be changed under software control.
3.3.5Reserved (Bit 5)
This bit is reserved for future expansion and will be read as zero during read operations.
3.3.6Stop Delay (Bit 6)
The SD bit determines the length of the clock stabilization delay that occurs when the
processor leaves the stop processing state. If the stop delay bit is zero when the chip
leaves the stop state, a 64K clock cycle delay is selected before continuing the stop
instruction cycle. However, if the stop delay bit is one, the delay before continuing the
instruction cycle is long enough to allow a clock stabilization period for the internal clock
to begin oscillating and to stabilize. (See the DSP56002 Technical Data Sheet
(DSP56002/D) for the actual timing values.) When a stable external clock is used, the
shorter delay allows faster start-up of the DSP.
3.3.7Reserved OMR Bits (Bits 7–23)
These bits are reserved for future expansion and will be read as zero during read operations.
3.4DSP56002 OPERATING MODES
The user can set the chip operating mode through hardware by pulling high the MODC,
MODB, and MODA pins appropriately, and then assert the RESET pin. When the DSP
leaves the reset state, it samples the mode pins and writes to the OMR to set the initial
operating mode.
MOTOROLA MEMORY MODULES AND OPERATING MODES3 - 7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
DSP56002 OPERATING MODES
Chip operating modes can also be changed using software to write the operating mode
bits (MC, MB, MA) in the OMR. Changing operating modes does not reset the DSP.
Note: The user should disable interrupts immediately before changing the OMR to pre-
vent an interrupt from going to the wrong memory location. Also, one no-operation
(NOP) instruction should be included after changing the OMR to allow for remapping to occur.
Table 3-2 DSP56002 Operating Mode Summary
nc...
I
cale Semiconductor,
Frees
Operating
Mode
0000Single-Chip Mode - P: RAM enabled, reset @ $0000
1001Bootstrap from EPROM, exit in Mode 0
2010Normal Expanded Mode - P: RAM enabled, reset @ $E000
3011Development Mode - P: RAM disabled, reset @ $0000
4100Reserved for Bootstrap
5101Bootstrap from Host, exit in Mode 0
6110Bootstrap from SCI (external clock), exit in Mode 0
7111Reserved for Bootstrap
MCMBM
A
Description
3.4.1Single Chip Mode (Mode 0)
In the single-chip mode, all internal program and data RAM memories are enabled (see
Figure 3-1). A hardware reset causes the DSP to jump to internal program memory location $0000 and resume execution. The memory maps for mode 0 and mode 2 (see Figure
3-1) are identical. The difference between the two modes is that reset vectors to program
memory location $0000 in mode 0 and vectors to location $E000 in mode 2.
3.4.2Bootstrap From EPROM (Mode 1)
The bootstrap modes allow the DSP to load a program from an inexpensive byte-wide
ROM into internal program memory during a power-on reset. On power-up, the waitstate generator adds 15 wait states to all external memory accesses so that slow memory can be used. The bootstrap program uses the bytes in three consecutive memory
locations in the external ROM to build a single word in internal program memory.
3 - 8MEMORY MODULES AND OPERATING MODESMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
DSP56002 OPERATING MODES
In the bootstrap mode, the chip enables the bootstrap ROM and executes the bootstrap
program. (The bootstrap program code is shown in Appendix A.) The bootstrap ROM contains the bootstrap firmware program that performs initial loading of the DSP56002
program RAM. Written in DSP56002 assembly language, the program initializes the program RAM by loading from an external byte-wide EPROM starting at location P:$C000.
The EPROM is typically connected to the chip’s address and data bus.The data contents
of the EPROM must be organized as shown in Table 3-3 Organization of EPROM Data
Contents.
+5 V
nc...
I
FROM OPEN
COLLECTOR
BUFFER
MBD301
FROM
RESET
FUNCTION
FROM OPEN
cale Semiconductor,
COLLECTOR
BUFFER
*
MBD301
MBD301
DR
DSP56002
BR
HACK
WT
MODA/IRQA
MODC/NMI
*
RESET
*
MODB/IRQB
2716
PS
A0-A10
D0-D7
Notes: 1. *These diodes must be Schottky diodes.
2. All resistors are 15KΩ unless noted otherwise.
3. When in RESET, IRQA
be deasserted by external peripherals.
CE
11
A0-A10
8
D0-D7
, IRQB and NMI must
Frees
ADDRESS OF EXTERNAL
BYTE-WIDE P MEMORY
P:$C000
P:$C001
P:$C002
•
•
•
P:$C5FD
P:$C5FE
P:$C5FF
CONTENTS LOADED
TO INTERNAL P: RAM AT:
P:$0000 LOW BYTE
P:$0000 MID BYTE
P:$0000 HIGH BYTE
•
•
•
P:$01FF LOW BYTE
P:$01FF MID BYTE
P:$01FF HIGH BYTE
After loading the internal memory, the DSP switches to the single-chip mode (Mode 0) and
begins program execution at on-chip program memory location $0000.
If the user selects Mode 1 through hardware (MODA, MODB, MODC pins), the following
actions occur once the processor comes out of the reset state.
1. The control logic maps the bootstrap ROM into the internal DSP program memory space starting at location $0000.
2. The control logic causes program reads to come from the bootstrap ROM (only
address bits 5–0 are significant) and all writes go to the program RAM (all address bits are significant). This condition allows the bootstrap program to load
the user program from $0000–$01FF.
3. Program execution begins at location $0000 in the bootstrap ROM. The bootstrap ROM program loads program RAM from the external byte-wide EPROM
starting at P:$C000.
4. The bootstrap ROM program ends the bootstrap operation and begins executing
the user program. The processor enters Mode 0 by writing to the OMR. This action is timed to remove the bootstrap ROM from the program memory map and
re-enable read/write access to the program RAM. The change to Mode 0 is
timed to allow the bootstrap program to execute a single-cycle instruction (clear
status register), then a JMP #<00, and begin execution of the user program at
location $0000.
3 - 10MEMORY MODULES AND OPERATING MODESMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
The user can also get into the bootstrap mode (Mode 1) through software by writing zero
to MC and MB, and one to MA in the OMR. This selection initiates a timed operation to
map the bootstrap ROM into the program address space (after a delay to allow execution
of a single-cycle instruction), and then a JMP #<00 to begin the bootstrap process described previously in steps 1 through 4. This technique allows the user to reboot the
system (with a different program, if desired).
The code to enter the bootstrap mode is as follows:
MOVEP#0,X:$FFFF;Disable interrupts.
MOVEC#1,OMR;The bootstrap ROM is mapped
nc...
I
NOP;Allow one cycle delay for the
DSP56002 OPERATING MODES
;into the lowest 64 locations
;in program memory.
;remapping.
cale Semiconductor,
Frees
JMP<$0;Begin bootstrap.
The code disables interrupts before executing the bootstrap code. Otherwise, an interrupt
could cause the DSP to execute the bootstrap code out of sequence because the bootstrap program overlays the interrupt vectors.
3.4.3Normal Expanded Mode (Mode 2)
In this mode, the internal program RAM is enabled and the hardware reset vectors to location $E000. (The memory maps for Mode 0 and Mode 2 are identical. The difference
for Mode 0 is that, after reset, the instruction at location $E000 is executed instead of the
instruction at $0000 — see Figure 3-1 and Table 3-2).
3.4.4Development Mode (Mode 3)
In this mode, the internal program RAM is disabled and the hardware reset vectors to location $0000. All references to program memory space are directed to external program
memory. The reset vector points to location $0000. The memory map for this mode is
shown in Figure 3-1 and Table 3-2.
3.4.5Reserved (Mode 4)
This mode is reserved for future definition. If selected, it defaults to Mode 5.
3.4.6Bootstrap From Host (Mode 5)
In this mode, the Bootstrap ROM is enabled and the bootstrap program is executed. This is
similar to Mode 1 except that the bootstrap program loads internal P: RAM from the Host Port.
MOTOROLA MEMORY MODULES AND OPERATING MODES3 - 11
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Freescale Semiconductor, Inc.
DSP56002 INTERRUPT PRIORITY REGISTER
Note: The difference between Modes 1 and 5 in the DSP56002 and Mode 1 in the
DSP56001 may be considered software incompatibility. A DSP56001 program that
reloads the internal P: RAM from the Host Port by setting MB-MA = 01 (assuming
external pull-up resistor on bit 23 of P:$C000) will not work correctly in the
DSP56002. In the DSP56002, the program would trigger a bootstrap from the external EPROM. The solution is to modify the DSP56001 program to set MC-MA = 101.
3.4.7Bootstrap From SCI (Mode 6)
In this mode, the Bootstrap ROM is enabled and the bootstrap program is executed. The
internal and/or external program RAM is loaded from the SCI serial interface. The number
of program words to load and the starting address must be specified. The SCI bootstrap
code expects to receive 3 bytes specifying the number of program words, 3 bytes specifying the address from which to start loading the program words, and then 3 bytes for each
program word to be loaded. The number of words, the starting address and the program
words are received least significant byte first, followed by the mid-, and then by the most
significant byte. After receiving the program words, program execution starts at the address where the first instruction was loaded. The SCI is programmed to work in
asynchronous mode with 8 data bits, 1 stop bit, and no parity. The clock source is external
and the clock frequency must be 16x the baud rate. After each byte is received, it is echoed back through the SCI transmitter.
3.4.8Reserved (Mode 7)
This mode is reserved for future definition. If selected, the processor defaults to Mode 6.
3.5DSP56002 INTERRUPT PRIORITY REGISTER
Section 7 of the DSP56000 Family Manual describes interrupt (exception) processing in
detail. It discusses interrupt sources, interrupt types, and interrupt priority levels (IPL).
Interrupt priority levels for each on-chip peripheral device and for each external interrupt
source can be programmed under software control by writing to the interrupt priority register. Level 3 interrupts are nonmaskable, and interrupts of levels 0-2 are maskable.
The DSP56002 Interrupt Priority Register (IPR) configuration is shown in Section Figure 3-4 DSP56002 Interrupt Priority Register (IPR). The starting addresses of interrupt
vectors in the DSP56002 are defined as shown in Section Table 3-4 Interrupt Vectors,
while the relative priorities of exceptions within the same IPL are defined as shown in
Section Table 3-5 Exception Priorities Within an IPL).
Section 9 of the DSP56000 Family Manual discusses the details of the PLL. The multiplication factor determines the frequency at which the Voltage Controlled Oscillator (VCO)
will oscillate. The user sets the multiplication factor by writing to the MF0-MF11 bits in the
PLL control register.
The DSP56002 PLL multiplication factor is set to 1 during hardware reset, which means
that the Multiplication Factor Bits MF0-MF11 in the PLL Control Register (PCTL) are set
to $000.
Port A provides a versatile interface to external memory, allowing economical connection
with fast memories/devices, slow memories/devices, and multiple bus master systems.
Port A has two power-reduction features. It can access internal memory spaces, toggling
only the external memory signals that need to change, thereby eliminating unneeded
switching current. Also, if conditions allow the processor to operate at a lower memory
speed, wait states can be added to the external memory access to significantly reduce
power while the processor accesses those memories.
4.2PORT A INTERFACE
The DSP56002 processor can access one or more of its memory sources (X data mem-
nc...
I
ory, Y data memory, and program memory) while it executes an instruction. The memory
sources may be either internal or external to the DSP. Three address buses (XAB, YAB,
and PAB) and four data buses (XDB, YDB, PDB, and GDB) are available for internal
memory accesses during one instruction cycle. Port A’s one address bus and one data
bus are available for external memory accesses.
INTRODUCTION
cale Semiconductor,
Frees
If all memory sources are internal to the DSP, one or more of the three memory sources
may be accessed in one instruction cycle (i.e., program memory access or program memory access plus an X, Y, XY, or L memory reference). However, when one or more of the
memories are external to the chip, memory references may require additional instruction
cycles because only one external memory access can occur per instruction cycle.
If an instruction cycle requires more than one external access, the processor will make
the accesses in the following priority: X memory, Y memory, and program memory. It
takes one instruction cycle for each external memory access – i.e., one access can be
executed in one instruction cycle, two accesses take two instruction cycles, etc. Since the
external data bus is only 24 bits wide, one XY or long external access will take two instruction cycles. The 16-bit address bus can sustain a rate of one memory access per
instruction cycle (using no-wait-state memory which is discussed in 4.4 PORT A WAIT
STATES).
Figure 4-1 shows the port A signals divided into their three functional groups: address bus
signals (A0-A15), data bus signals (D0-D15), and bus control. The bus control signals can
be subdivided into three additional groups: read/write control (RD
space selection (including program memory select (PS
X/Y
select) and bus access control (BN, BR, BG, WT, BS).
), data memory select (DS), and
and WR), address
The read/write controls can act as decoded read and write controls, or, as seen in Figure
4-2, Figure 4-3, and Figure 4-4, the write signal can be used as the read/write control, and
the read signal can be used as an output enable (or data enable) control for the memory.
MOTOROLA PORT A4 - 3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
16 - BIT INTERNAL
ADDRESS BUSES
X ADDRESS (XA)
Y ADDRESS (YA)
PROGRAM ADDRESS (PA)
24 - BIT INTERNAL
nc...
I
DATA BUSES
PORT A INTERFACE
EXTERNAL
ADDRESS BUS
SWITCH
16
EXTERNAL
ADDRESS BUS
A0 - A15
cale Semiconductor,
Frees
X DATA (XD)
Y DATA (YD)
PROGRAM DATA (PD)
GLOBAL DATA (GD)
EXTERNAL
DATA BUS
SWITCH
EXTERNAL
BUS CONTROL
LOGIC
24
EXTERNAL
DATA BUS
D0 - D23
BUS CONTROL SIGNALS
RD –- READ ENABLE
– WRITE ENABLE
WR
– PROGRAM MEMORY SELECT
PS
– DATA MEMORY SELECT
DS
– X MEMORY/Y MEMORY SELECT
X/Y
BN
–- BUS NEEDED
– BUS REQUEST
BR
– BUS GRANT
BG
– BUS WAIT
WT
– BUS STROBE
BS
Figure 4-1 Port A Signals
Decoding in such a way simplifies connection to high-speed random-access memories
4 - 4PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PORT A INTERFACE
nc...
I
cale Semiconductor,
Frees
V
CC
+5 V
ADDRESS BUS
DSP56002
CONTROL
V
GROUND
A0 - A15
DATA BUS
D0 - D23
BUS
SS
RD
WR
PS
DS
X/Y
BN
BR
BG
WT
BS
16
24
ADDRESS
DATA
OE
R/W
CS
PROGRAM MEMORY
24 BIT x N WORDS
Figure 4-2 External Program Space
(RAMs). The program memory select, data memory select, and X/Y select can be considered additional address signals, which extend the directly addressable memory from 64K
words to 192K words total.
Since external logic delay is large relative to RAM timing margins, timing becomes more
difficult as faster DSPs are introduced. The separate read and write strobes used by the
DSP56002 are mutually exclusive, with a guard time between them to avoid an instance
where two data buffers are enabled simultaneously. Other methods using external logic
gates to generate the RAM control inputs require either faster RAM chips or external
data buffers to avoid data bus buffer conflicts.
Figure 4-2 shows an example of external program memory. A typical implementation of
this circuit would use three-byte-wide static memories and would not require any additional logic. The PS
signal is used as the program-memory chip-select signal to enable
the program memory at the appropriate time.
Figure 4-3 shows a similar circuit using the DS
MOTOROLA PORT A4 - 5
For More Information On This Product,
Go to: www.freescale.com
signal to enable two data memories and
Freescale Semiconductor, Inc.
PORT A INTERFACE
nc...
I
cale Semiconductor,
Frees
V
CC
+5 V
ADDRESS BUS
DSP56002
V
GROUND
A0 - A15
DATA BUS
D0 - D23
BUS
CONTROL
SS
RD
WR
PS
DS
X/Y
BN
BR
BG
WT
BS
16
24
DATA DATA ADDRESS ADDRESS
X DATA
MEMORY
24 BITS x N WORDS
OER/WCSCEOER/WCSCE
Y DATA
MEMORY
24 BITS x N WORDS
Figure 4-3 External X and Y Data Space
using the X/Y
signal to select between them. The three external memory spaces (program, X data, and Y data) do not have to reside in separate physical memories; a single
memory can be employed by using the PS
, DS, and X/Y signals as additional address
lines to segment the memory into three spaces (see Figure 4-4). Table 4-1 shows how
the PS
, DS, and X/Y signals are decoded.
If the DSP is in the development mode, an exception fetch to any interrupt vector location
will cause the X/Y
signal to go low when PS is asserted. This procedure is useful for
debugging and for allowing external circuitry to track interrupt servicing.
4 - 6PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PORT A INTERFACE
Table 4-1 Program and Data Memory Select Encoding
PSDSX/YExternal Memory Reference
111No Activity
101X Data Memory on Data Bus
100Y Data Memory on Data Bus
011Program Memory on Data Bus (Not an Exception)
010External Exception Fetch: Vector or Vector +1
(Development Mode Only)
00XReserved
nc...
I
cale Semiconductor,
Frees
110Reserved
Figure 4-5 shows a system that uses internal program memory loaded from an external
V
CC
+5 V
ADDRESS BUS
DSP56002
GROUND
A0 - A15
DATA BUS
D0 - D23
BUS
CONTROL
V
SS
RD
WR
PS
DS
X/Y
BN
BR
BG
WT
BS
16
24
A11
U3
U4
A13
A14
A15
U1
U2
A0-A10
CE
OE
R/W
CS
A12
A11
EXTERNAL
PROGRAM
X AND Y MEMORY
$3FFF
4K
PROGRAM
MEMORY
$3000
$2FFF
2K
X DATA
MEMORY
$2800
$27FF
2K
Y DATA
MEMORY
$2000
24 BITS
Figure 4-4 Memory Segmentation
MOTOROLA PORT A4 - 7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
nc...
I
10
PORT A INTERFACE
D0-D23
2018-55 (3)
A0-A9 A10 CS WE OE
D0-D7
24
8
, IRQB and NMI must
be deasserted by external peripherals.
2. All resistors are 15KΩ unless noted otherwise.
3. When in RESET, IRQA
Notes: 1. *These diodes must be Schottky diodes.
cale Semiconductor,
Frees
+5 V
DS
RD
WR
DSP56002
BR
DR
HACK
WT
11
PS
X/Y
A0-A10
MODA/IRQA
MODC/NMI
*
MBD301
*
MBD301
2716
CEA0-A10
RESET
*
MBD301
D0-D23
MODB/IRQB
Figure 4-5 Port A Bootstrap ROM with X and Y RAM
FROM OPEN
COLLECTOR
BUFFER
FUNCTION
FROM OPEN
COLLECTOR
BUFFER
FROM
RESET
ROM during power-up and splits the data memory space of a single memory bank into X:
4 - 8PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PORT A TIMING
and Y: memory spaces. Although external program memory must be 24 bits, external data
memory does not. Of course, this is application specific. Many systems use 16 or fewer bits
for A/D and D/A conversion and, therefore, they may only need to store 16, 12, or even eight
bits of data. The 24/56 bits of internal precision is usually sufficient for intermediate results.
This is a cost saving feature which can reduce the number of external memory chips.
4.3PORT A TIMING
The external bus timing is defined by the operation of the address bus, data bus, and bus
control pins. The transfer of data over the external data bus is synchronous with the clock.
The timing A, B, and C relative to the edges of an external clock (see Figure 4-6 and Figure 4-7) are provided in the DSP56002 Advance Information Data Sheet (DSP56002/D) .
nc...
I
This timing is essential for designing synchronous multiprocessor systems. Figure 4-6
shows the port A timing with no wait states (wait-state control is discussed in Section 4.4).
One instruction cycle equals two clock cycles or four clock phases. The clock phases,
which are numbered T0 – T3, are used for timing on the DSP. Figure 4-7 shows the same
timing with two wait states added to the external X: memory access.
cale Semiconductor,
Frees
Four TW clock phases have been added because one wait state adds two T phases and
ONE INSTRUCTION CYCLE
ONE CLOCK CYCLE
INTERNAL CLOCK PHASES
ADDRESS PS, DS, X/Y
RD
READ
CYCLE
DATA IN
WRITE
CYCLE
WR
DATA OUT
T0T1T2T3T0T1T2T3T0T1
A
B
C
Figure 4-6 Port A Bus Operation with No Wait States
MOTOROLA PORT A4 - 9
For More Information On This Product,
Go to: www.freescale.com
ONE CLOCK CYCLE
INTERNAL CLOCK PHASES
ADDRESS PS, DS, X/Y
Freescale Semiconductor, Inc.
T0T1T2TWTWTWTWT3T0T1
A
PORT A TIMING
ONE INSTRUCTION CYCLE
TWO WAIT ST A TES
nc...
I
cale Semiconductor,
Frees
B
C
DATA LATCHED HERE
READ
CYCLE
WRITE
CYCLE
RD
DATA IN
WR
DATA OUT
Figure 4-7 Port A Bus Operation with Two Wait States
is equivalent to repeating the T2 and T2 clock phases. The write signal is also delayed
from the T1 to the T2 state when one or more wait states are added to ease interfacing to
the port. Each external memory access requires the following procedure:
1. The external memory address is defined by the address bus (A0–A15) and the
memory reference selects (PS
, DS, and X/Y). These signals change in the first
phase (T0) of the bus cycle. Since the memory reference select signals have
the same timing as the address bus, they may be used as additional address
lines. The address and memory reference signals are also used to generate
chip-select signals for the appropriate memory chips. These chip-select signals change the memory chips from low-power standby mode to active mode
and begin the read access time. This mode change allows slower memories to
be used since the chip-select signals can be address based rather than read
or write enable based. Read and write enable do not become active until after
the address is valid. See the timing diagrams in the DSP56002 Advance Information Data Sheet (DSP56002/D ) for detailed timing information.
2. When the address and memory reference signals are stable, the data transfer
4 - 10PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
is enabled by read enable (RD) or write enable (WR). RD or WR is asserted to
“qualify” the address and memory reference signals as stable and to perform
the read or write data transfer. RD
of the bus cycle (if there are no wait states). Read enable is typically connected to the output enable (OE
output buffers of the chip-selected memory. Write enable is connected to the
write enable (WE
that strobes data into the selected memory. For a read operation, RD
asserted and WR
memory read operation is performed. The DSP data bus becomes an input,
and the memory data bus becomes an output. For a write operation, WR
nc...
I
asserted and RD
the memory chip outputs remain in the high-impedance state even before write
strobe is asserted. This state assures that the DSP and the chip-selected
memory chips are not enabled onto the bus at the same time. The DSP data
bus becomes an output, and the memory data bus becomes an input.
PORT A TIMING
and WR are asserted in the second phase
) of the memory chips and simply controls the
) or write strobe (WS) of the memory chips and is the pulse
is
remains deasserted. Since write enable remains negated, a
is
remains deasserted. Since read enable remains deasserted,
cale Semiconductor,
Frees
3. Wait states are inserted into the bus cycle by a wait-state counter or by asserting WT
value loaded into the wait-state counter is zero, no wait states are inserted into
the bus cycle, and RD
W ≠ 0 is loaded into the wait state counter, W wait states are inserted into the
bus cycle. When wait states are inserted into an external write cycle, WR
delayed from T1 to T2. The timing for the case of two wait states (W=2) is
shown in Figure 4-7.
4. When RD
latched in the destination device – i.e., when RD
latches the data internally; when WR
latches the data on the positive-going edge. The address signals remain stable until the first phase of the next external bus cycle to minimize power dissipation. The memory reference signals (PS
high) during periods of no bus activity, and the data signals are three-stated.
For read-modify-write instructions such as BSET, the address and memory
reference signals remain active for the complete composite (i.e., two I
instruction cycle.
. The wait-state counter is loaded from the bus control register. If the
and WR are asserted as shown in Figure 4-6. If a value
is
or WR are deasserted at the start of T3 in a bus cycle, the data is
is deasserted, the DSP
is deasserted, the external memory
, DS, and X/Y) are deasserted (held
cyc
)
MOTOROLA PORT A4 - 11
For More Information On This Product,
Go to: www.freescale.com
X:$FFFE
Freescale Semiconductor, Inc.
EXTERNAL
X MEMORY
1512 118 7430
0100100010101101
PORT A TIMING
PORT A BUS CONTROL REGISTER (BCR)
EXTERNAL
Y MEMORY
EXTERNAL
P MEMORY
EXTERNAL
I/0 MEMORY
D/A
CONVERTER
CSWRDCSRDD
350 ns
(13 WAIT STATES)
nc...
I
A0 - A15
D0 - D23
MEMORY
INTERNAL
(0 WAIT STATES)
cale Semiconductor,
40 MHz
DSP56002
A15
A15
6242 - 15
6242 - 15
6242 - 152764 - 25
8K x 24
X RAM
150 ns
(4 WAIT STATES)
CS CS WE OECSOECEOE
2764 - 25
2764 - 25
8K x 24
Y ROM
250 ns
(8 WAIT STATES)
27256 - 30
27256 - 30
(10 WAIT STATES)
CONVERTER
27256 - 30
32K x 24
P ROM
300 ns
A/D
Frees
X/Y
DS
WR
RD
PS
Figure 4-8 Mixed-Speed Expanded System
4 - 12PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PORT A WAIT STATES
Figure 4-8 shows an example of mixing different memory speeds and memory-mapped
peripherals in different address spaces. The internal memory uses no wait states, X: memory
uses two wait states, Y: memory uses four wait states, P: memory uses five wait states, and
the analog converters use 14 wait states. Controlling five different devices at five different
speeds requires only one additional logic package. Half the gates in that package are used
to map the analog converters to the top 64 memory locations in Y: memory.
4.4PORT A WAIT STATES
The DSP56002 features two methods to allow the user to accommodate slow memory
by changing the port A bus timing. The first method uses the bus control register (BCR),
which allows a fixed number of wait states to be inserted in a given memory access to all
locations in each of the four memory spaces: X, Y, P, and I/O. The second method uses
nc...
I
the bus strobe (BS
) and bus wait (WT) facility, which allows an external device to insert
an arbitrary number of wait states when accessing either a single location or multiple
locations of external memory or I/O space. Wait states are executed until the external
device releases the DSP to finish the external memory cycle.
cale Semiconductor,
Frees
Table 4-2 Wait State Control
BCR
Contents
0Deasserted0
0Asserted2 (minimum)
> 0DeassertedEquals value in BCR
> 0AssertedMinimum equals 2 or value in BCR.
WT
Number of Wait States Generated
Maximum is determined by BCR or WT
whichever is larger.
,
4.5BUS CONTROL REGISTER (BCR)
The BCR determines the expansion bus timing by controlling the timing of the bus interface signals, RD
and WR, and the data output lines. It is a memory mapped register
located at X:$FFFE. Each of the memory spaces in Figure 4-9 (X data, Y data, program
data, and I/O) has its own 4-bit BCR, which can be programmed for inserting up to 15
wait states (each wait state adds one-half instruction cycle to each memory access – i.e.,
50 ns for a 20-Mhz clock). In this way, external bus timing can be tailored to match the
speed requirements of the different memory spaces. On processor reset, the BCR is
preset to all ones (15 wait states). This allows slow memory to be used for boot strap-
ping. The BCR needs to be set appropriately for the memory being used or the processor
will insert 15 wait states between each memory fetch and cause the DSP to run slow.
MOTOROLA PORT A4 - 13
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
15121187430
BUS CONTROL REGISTER (BCR)
nc...
I
cale Semiconductor,
Frees
X:$FFFE
$FFFF
$200
0
* Zero to 15 wait states can be inserted into each external memory access.
EXTERNAL
X MEMORY
EXTERNAL
PROGRAM
MEMORY
INTERNAL
PROGRAM
PROGRAM
MEMORY SPACE
*
RAM
EXTERNAL
Y MEMORY
$FFFF
$FFFE
$FFC0
$200
$100
0
*
BUS CONTROL REGISTER
ON-CHIP PERIPHERALS
EXTERNAL
X DATA
MEMORY
INTERNAL
X ROM
INTERNAL
X RAM
X DATA
MEMORY
SPACE
EXTERNAL
P MEMORY
*
$FFFF
$FFC0
$200
$100
EXTERNAL
I/0 MEMORY
EXTERNAL
PERIPHERALS
EXTERNAL
Y DATA
MEMORY
INTERNAL
Y ROM
INTERNAL
0
Y RAM
Y DATA
MEMORY
SPACE
*
Figure 4-9 Bus Control Register
Figure 4-9 illustrates which of the four BCR subregisters affect which external memory
space. All the internal peripheral devices are memory mapped, and their control registers
reside between X:$FFC0 and X:$FFFF.
To load the BCR the way it is shown in Figure 4-8, execute a “MOVEP #$48AD,
X:$FFFE” instruction. Or, change the individual bits in one of the four subregisters by
using the BSET and BCLR instructions which are detailed in the DSP56000 Family Manual , SECTION 6 and APPENDIX A .
Figure 4-8 shows an example of mixing different memory speeds and memory-mapped
peripherals in different address spaces. The internal memory uses no wait states, X: memory uses two wait states, Y: memory uses four wait states, P: memory uses five wait states,
and the analog converters use 14 wait states. Controlling five different devices at five different speeds requires only one additional logic package. Half the gates in that package
are used to map the analog converters to the top 64 memory locations in Y: memory.
4 - 14PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BUS STROBE AND WAIT PINS
OPERATING MODE REGISTER
765 43210
EM SD000DE MB MA
SET EM = 1
nc...
I
cale Semiconductor,
Frees
V
+5 V
DSP56000/DSP56001
ADDRESS BUS
BUS
CONTROL
CC
GROUND
A0 - A15
DATA BUS
D0 - D23
V
SS
T0T1T2TWTWTWTWT3T0
16
A0 - A15, D0 - D23, PS, DS, X/Y
24
WT IS
SAMPLED
RD
WR
PS
DS
X/Y
WT
BS
WT IS
SAMPLED
WT IS
SAMPLED
T3
Figure 4-10 Bus Strobe/Wait Sequence
Adding wait states to external memory accesses can substantially reduce power requirements. Consult the DSP56002 Technical Data Sheet (DSP56002/D) for specific power
consumption requirements.
4.6BUS STROBE AND WAIT PINS
The ability to insert wait states using BS
and WT provides a means to connect asynchronous devices to the DSP, allows devices with differing timing requirements to reside in the
same memory space, allows a bus arbiter to provide a fast multiprocessor bus access, and
provides another means of halting the DSP at a known program location with a fast restart.
The timing of the BS
and WT pins is illustrated in Figure 4-10. Every external access, BS
is asserted concurrently with the address lines in T0. BS can be used by external wait-
MOTOROLA PORT A4 - 15
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
state logic to establish the start of an external access. BS is deasserted in T3 of each
external bus cycle, signaling that the current bus cycle will complete. Since the WT
is internally synchronized, it can be asserted asynchronously with respect to the system
clock. The WT
BS
is deasserted will give indeterminate results. However, for the number of inserted wait
states to be deterministic, WT
negative-going edge of EXTAL. The setup and hold times are provided in the DSP56002
Advance Information Data Sheet (DSP56002/D) . The timing of WR
BCR and is independent of WT
using the WT
the minimum number of wait states that are inserted. Table 4-2 summarizes the effect of
nc...
I
the BCR and WT
4.7BUS ARBITRATION AND SHARED MEMORY
The DSP56002 has five pins that control port A. They are bus needed (BN), bus request
(BR
), bus grant (BG), bus strobe (BS) and bus wait (WT) and they are described in SEC-
TION 2 DSP56002 PIN DESCRIPTIONS.
signal should only be asserted while BS is asserted. Asserting WT while
pin is two. The BCR is still operative when using BS and WT and defines
pin on the number of wait states generated.
signal
timing must satisfy setup and hold timing with respect to the
is controlled by the
. The minimum number of wait states that can be inserted
cale Semiconductor,
Frees
The bus control signals provide the means to connect additional bus masters (which may be
additional DSPs, microprocessors, direct memory access (DMA) controllers, etc.) to the port
A bus. They work together to arbitrate and determine what device gets access to the bus.
If an external device has requested the external bus by asserting the BR
DSP has granted the bus by asserting BG
requires no external bus accesses itself. If the DSP does require an external access but
is not the bus master, it will stop processing and remain in wait states until it regains bus
ownership. The BN
help “arbitrate”, or decide when to return bus ownership to the chip.
Four examples of bus arbitration will be described later in this section: 1) bus arbitration
using only BR
external control, 3) bus arbitration using BR
signaling using semaphores.
The BR
while the DSP continues internal operations using internal memory spaces. This allows a
bus controller to arbitrate a multiple bus-master system. (A bus master can issue
addresses on the bus; a bus slave can respond to addresses on the bus. A single device
can be both a master and a slave, but can only be one or the other at any given time.)
input allows an external device to request and be given control of the external bus
pin will have been asserted, and an external device may use BN to
and BG with internal control, 2) bus arbitration using BN, BR, and BG with
, the DSP will continue to process as long as it
, BG and WT, BS with no overhead, and 4)
input, and the
4 - 16PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
BR
BG
DSP56002
BUS MASTER
A0 - A15, D0 - D23, PS,
, X/Y, RD, WR
DS
Figure 4-11 Bus Request/Bus Grant Sequence
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
A DIFFERENT
BUS MASTER
DSP56002
BUS MASTER
nc...
I
cale Semiconductor,
Frees
Before BR is asserted, all port A signals are driven. When BR is asserted (see Figure 4-11), the
DSP will assert BG
after the current external access cycle completes and will simultaneously
three-state (high-impedance) the port A signals (see the DSP56002 Technical Data Sheet
(DSP56002/D) for exact timing of BR
and BG). The bus is then available to whatever external
device has bus mastership. The external device will return bus mastership to the DSP by deasserting BR
without wait states), BG
and RD
. After the DSP completes the current cycle (an internally executed instruction with or
will be deasserted. When BG is deasserted, the A0-A15, PS, DS, X/Y,
, WR lines will be driven. However, the data lines will remain in three-state. All signals
are now ready for a normal external access.
During the wait state (see Section 7 in the DSP56000 Family Manual), the BR
and BG
circuits remain active. However, the port is inactive - the control signals are deasserted,
the data signals are inputs, and the address signals remain as the last address read or
written. When BR
shows the status of BR
is asserted, all signals are three-stated (high impedance). Table 4-3
and BG during the wait state.
Table 4-3 BR and BG During WAIT
Signal
MOTOROLA PORT A4 - 17
Before BR
Asserted
For More Information On This Product,
While BG
Asserted
Go to: www.freescale.com
After BR
Deasserted
After Return to
Normal State
(BG Deasserted)
After First
External Access
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
4.7.1Bus Arbitration Using Only BR and BG With Internal Control
Perhaps the simplest example of a shared memory system using a DSP56002 is shown
in Figure 4-12. The bus arbitration is performed within the DSP#2 by using software.
DSP#2 controls all bus operations by using I/O pin OUT2 to three-state its own port A
and by never accessing port A without first calling the subroutine that arbitrates the bus.
When the DSP#2 needs to use external memory, it uses I/O pin OUT1 to request bus
access and I/O pin IN1 to read bus grant. DSP#1 does not need any extra code for bus
arbitration since the BR
protocol for bus arbitration is as follows:
and BG hardware handles its bus arbitration automatically. The
nc...
I
cale Semiconductor,
Frees
At reset: DSP#2 sets OUT2=0 (BR
access to the bus and suspends DSP#2 bus access.
When DSP#2 wants control of the memory, the following steps are performed (see Figure 4-13):
1. DSP# 2 sets OUT1=0 (BR
2. DSP# 2 waits for IN1=0 (BG#1=0 and DSP#1 off the bus).
3. DSP#2 sets OUT2=1 (BR#2=1 to let DSP#2 control the bus).
4. DSP#2 accesses the bus for block transfers, etc. at full speed.
5. To release the bus, DSP#2 sets OUT2=0 (BR#2=0) after the last external
access.
6. DSP#2 then sets OUT1=1 (BR
7. DSP#1 then acknowledges mastership by deasserting BG#1.
4.7.2Bus Arbitration Using BN
Figure 4-14 can be implemented with external bus arbitration logic, which will save processing capacity on the DSPs and can make bus access much faster at a cost of additional hardware. The bus arbitration logic takes control of the external bus by deasserting
an enable signal (E1, E2, and E3) to all DSPs, which will then acknowledge by granting
the bus (BG
WAIT state with BN
the bus to DSP#1 by asserting E1 (E2 for DSP#2; E3 for DSP#3) to let the DSP know
that it can have the bus. DSP#1 will then deassert BG
trol of the bus. When the DSP no longer needs to make an external access it will deassert BN
=0). When a DSP (DSP#1 in Figure 4-14) needs the bus, it will enter the
asserted. If DSP#1 has highest priority, the arbitration logic grants
and the arbiter deasserts E1, after which the DSP deasserts BG.
#2=0) and OUT1=1 (BR#1=1), which gives DSP#1
#1=0).
#1=1) to return control of the bus to DSP#1.
, BR, and BG With External Control
to tell the arbiter it has taken con-
4 - 18PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
BR
OUT2
BR
BG
CONTROL
A0 - A15
D0 - D23
nc...
I
DSP56002 #1
CAD
MEMORY
BANK
Figure 4-12 Bus Arbitration Using Only BR and BG with Internal Control
cale Semiconductor,
OUT1
OUT1
IN1
CONTROL
A0 - A15
D0 - D23
DSP56002 #2
BUS ARBITER
Frees
IN1
OUT2
1234567
DATA
TRANSFERRED
HERE
Figure 4-13 Two DSPs with External Bus Arbitration Timing
MOTOROLA PORT A4 - 19
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
SYSTEM MEMORY
32K x 24 X DATA RAM
32K x 24 Y DATA RAM
32K x 24 PROGRAM RAM
ADDRESSDATACONTROL
ADDRESS
DATA
CONTROL
nc...
I
ADCADCADC
DSP56002 #1DSP56002 #2DSP56002 #3
BG BR BN
A1 E1 BR1
BUS ARBITRATION LOGIC WITH PRIORITY ENCODER
BG BR BN
A2 E2 BR2
BG BR BN
A3 E3 BR3
cale Semiconductor,
Figure 4-14 Bus Arbitration Using BN, BR, and BG with External Control
16
24
5
Frees
4.7.3Bus Arbitration Using BR and BG, and WT and BS With No Overhead
By using the circuit shown in Figure 4-15, two DSPs can share memory with hardware
arbitration that requires no software on the part of the DSPs. The protocol for bus arbitration in Figure 4-15 is as follows:
At RESET assume DSP#1 is not making external accesses so that BR
Hence, BG
of DSP#2 is deasserted, which three-states the buffers, giving DSP#2 control
#2 is deasserted.
of the memory.
4 - 20PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
MEMORY
DAC
nc...
I
cale Semiconductor,
Frees
DSP #1
D0 - D23
A0 - A15
RD, WR,
DS, PS, X/Y
BSWT
THREE-STATE
BUFFER
DIR
ENABLE
DSP #2
D0 - 23
A0 - A15
, WR,
RD
DS
, PS, X/Y
BGBR
Figure 4-15 Bus Arbitration Using BR and BG,
and WT
and BS with No Overhead
When DSP#1 wants control of the memory the following steps are performed (see Figure 4-16):
1. DSP#1 makes an external access, thereby asserting BS, which asserts WT
(causing DSP#1 to execute wait states in the current cycle) and asserts
DSP#2 BR
(requesting that DSP#2 release the bus).
2. When DSP#2 finishes its present bus cycle, it three-states its bus drivers and
asserts BG
signals on the memory bus. Asserting BG
. Asserting BG enables the three-state buffers, placing the DSP#1
also deasserts WT, which allows
DSP#1 to finish its bus cycle.
3. When DSP#1’s memory cycle is complete, it releases BS
BR
. DSP#2 then deasserts BG, three-stating the buffers and allowing DSP#2
, which deasserts
to access the memory bus.
MOTOROLA PORT A4 - 21
For More Information On This Product,
Go to: www.freescale.com
BS
WT
BR
BG
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
123
DATA TRANSFERRED
BETWEEN DSP#1
AND MEMORY HERE
nc...
I
cale Semiconductor,
Frees
Figure 4-16 Two DSPs with External Bus Arbitration Timing
4.7.4Signaling Using Semaphores
Figure 4-17 shows a more sophisticated shared memory system that uses external arbitration with both local external memory and shared memory. The four semaphores are
bits in one of the words in each shared memory bank used by software to arbitrate memory use. Semaphores are commonly used to indicate that the contents of the semaphore’s memory blocks are being used by one processor and are not available for use by
another processor. Typically, if the semaphore is cleared, the block is not allocated to a
processor; if the semaphore is set, the block is allocated to a processor.
Without semaphores, one processor may try to use data while it is being changed by
another processor, which may cause errors. This problem can occur in a shared memory
system when separate test and set instructions are used to “lock” a data block for use by
a single processor.
The correct procedure is to test the semaphore and then set the semaphore if it was
clear to lock and gain exclusive use of the data block. The problem occurs when the second processor acquires the bus and tests the semaphore after the first processor tests
the semaphore but before the first processor can lock the data block. The incorrectsequence is:
1. the first processor tests the semaphore and sees that the block is available
2. the second processor then tests the bit and also sees that the block is available
3. both processors then set the bit to lock the data
4. both proceed to use the data on the assumption that the data cannot be
changed by another processor
4 - 22PORT AMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BUS ARBITRATION AND SHARED MEMORY
DSP56002
LOCAL
MEMORY
nc...
I
SEMAPHORE 3
1
BANK 3
SEMAPHORE 2
0
BANK 2
SEMAPHORE 1
0
BANK 1
SEMAPHORE 0
1
BANK 0
PROCESSOR
LOCAL
MEMORY
cale Semiconductor,
Frees
DSP56002PROCESSOR
ADDRESS
DATA AND
CONTROL
BUSES
BUS
BUFFER
ARBITRATION
LOGIC
BUS
BUFFER
ADDRESS
DATA AND
CONTROL
BUSES
OR DMA
Figure 4-17 Signaling Using Semaphores
The DSP56K processor series has a group of instructions designed to prevent this problem. They perform an indivisible read-modify-write operation and do not release the bus
between the read and write (specifically, A0–A15, DS
, PS, and X/Y do not change state).
Using a read-modify-write operation allows these instructions to test the semaphore and then to set, clear, or change the semaphore without the possibility of
another processor testing the semaphore before it is changed. The instructions are
bit test and change (BCHG), bit test and clear (BCLR), and bit test and set (BSET).
(They are discussed in detail in the DSP56000 Family Manual.) The proper way to set
the semaphore to gain exclusive access to a memory block is to use BSET to test the
semaphore and to set it to one. After the bit is set, the result of the test operation will
reveal if the semaphore was clear before it was set by BSET and if the memory block is
available. If the bit was already set and the block is in use by another processor, the DSP
must wait to access the memory block.
Port B is a dual-purpose I/O port. It performs as 15 general-purpose I/O (GPIO) pins,
each configurable as output or input, to be used for device control. Or, it can perform as
an 8-bit bidirectional host interface (HI) (see Figure 5-1), where it provides a convenient
connection to another processor. This section describes both configurations, including
examples of how to configure and use the port.
nc...
I
cale Semiconductor,
Frees
EXTERNAL ADDRESS
SWITCH
EXTERNAL DATA
SWITCH
BUS
CONTROL
HOST/DMA
PARALLEL
INTERFACE
SCI
INTERFACE
SSI
INTERFACE
PORT
A
I/0
(47)
PORT
B
I/0
(15)
PORT
C
I/0
(9)
16
24
DEFAULT
FUNCTION
A0 - A15
D0 - D23
PS
DS
X/Y
RD
WR
BN
BR
BG
WT
BS
PB0 - PB7
PB8
PB9
PB10
PB11
PB12
PB13
PB14
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
PC8
88
ALTERNATE
FUNCTION
—
—
—
—
—
—
—
—
—
—
—
—
H0 - H7
HA0
HA1
HA2
HR/W
HEN
HREQ
HACK or PB14
RXD
TXD
SCLK
SC0
SC1
SC2
SCK
SRD
STD
Figure 5-1 Port B Interface
MOTOROLA PORT B5 - 3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL PURPOSE I/O CONFIGURATION
5.2GENERAL PURPOSE I/O CONFIGURATION
When it is configured as general-purpose I/O, Port B acts as three memory-mapped registers (see Figure 5-2) that control 15 I/O pins (see Figure 5-3). They are the Port B control
register (PBC), Port B data direction register (PBDDR), and Port B data register (PBD).
The software and hardware resets clear the PBC and PBDDR, which configures Port B
as general-purpose I/O, with all 15 pins as inputs. (External circuitry connected to these
pins may need pullups until the pins are configured for operation.)
To select between general purpose I/O and the HI, set PBC bits 0 and 1 as shown in Figure 5-2. Use the PBDDR to determine whether the corresponding bit in the PBD shall be
an input pin (bit is set to zero) or an output pin (bit is set to one).
nc...
I
cale Semiconductor,
Frees
If a pin is configured as a GPIO input (as shown in Figure 5-4) and the processor reads
the PBD, the processor sees the logic level on the pin. If the processor writes to the PBD,
the data is latched there, but does not appear on the pin because the buffer is in the highimpedance state.
If a pin is configured as a GPIO output and the processor reads the PBD, the processor
sees the contents of the PBD rather the logic level on the pin, which allows the PBD to be
used as a general purpose 15-bit register. If the processor writes to the PBD, the data is
latched there and appears on the pin during the following instruction cycle (see Section
5.2.2 Port B General Purpose I/O Timing ).
If a pin is configured as a host pin, the Port B GPIO registers can be used to help in
debugging the HI. If the PBDDR bit for a given pin is cleared (configured as an input), the
PBD will show the logic level on the pin, regardless of whether the HI function is using the
pin as an input or an output.
If the PBDDR is set (configured as an output) for a given pin that is configured as a host
cale Semiconductor,
pin, when the processor reads the PBD, it sees the contents of the PBD rather than the
logic level on the pin - another case which allows the PBD to act as a general purpose
register.
Frees
Note: The external host processor should be carefully synchronized to the DSP56002 to
assure that the DSP and the external host will properly read status bits transmitted
between them. There is more discussion of such port usage considerations in sections Section 5.3.2.7 Host Port Usage Considerations – DSP Side and Section
5.3.6.5 Host Port Usage Considerations – Host Side .
5.2.1Programming General Purpose I/O
Port B is a memory-mapped peripheral as are all of the DSP56002 peripherals (see
Figure 5-5). The standard MOVE instruction transfers data between Port B and a register; as a result, MOVE takes two instructions to perform a memory-to-memory data
MOTOROLA PORT B5 - 5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL PURPOSE I/O CONFIGURATION
nc...
I
cale Semiconductor,
Frees
PORT
REGISTERS
PERIPHERAL
LOGIC
Port Control
Register Bit
00Port Input Pin
PORT B DATA (PBD)
REGISTER BIT
DATA DIRECTION
REGISTER (PBDDR) BIT
PORT B CONTROL
REGISTER (PBC) BIT
PORT INPUT DATA BIT
HI OUTPUT DATA BIT
HI DATA DIRECTION BIT
HI INPUT DATA BIT
Data Direction
Register Bit
Pin Function
PIN
(GPIO
POSITION)
(INPUT
POSITION)
Figure 5-4 Port B I/O Pin Control Logic
transfer and uses a temporary holding register. The MOVEP instruction is specifically
designed for I/O data transfer as shown in Figure 5-6. Although the MOVEP instruction may take twice as long to execute as a MOVE instruction, only one MOVEP is
required for a memory-to-memory data transfer, and MOVEP does not use a temporary register. Using the MOVEP instruction allows a fast interrupt to move data to/from
a peripheral to memory and execute one other instruction or move the data to an absolute address. MOVEP is the only memory-to-memory move instruction; however, one
of the operands must be in the top 64 locations of either X: or Y: memory.
The bit-oriented instructions that use I/O short addressing (BCHG, BCLR, BSET, BTST,
JCLR, JSCLR, JSET, and JSSET) can also be used to address individual bits for faster
I/O processing. The digital signal processor (DSP) does not have a hardware data strobe
to strobe data out of the GPIO port. If a strobe is needed, it can be implemented using
software to toggle one of the GPIO pins.
INTERRUPT PRIORITY REGISTER (IPR)
PORT A — BUS CONTROL REGISTER (BCR)
PLL CONTROL REGISTER
OnCE GDB REGISTER
RESERVED
RESERVED
RESERVED
RESERVED
RESERVED
SCI HI - REC/XMIT DATA REGISTER (SRX/STX)
SCI MID - REC/XMIT DATA REGISTER (SRX/STX)
SCI LOW - REC/XMIT DATA REGISTER (SRX/STX)
SCI TRANSMIT DATA ADDRESS REGISTER (STXA)
SCI CONTROL REGISTER (SCCR)
SCI INTERFACE STATUS REGISTER (SSR)
SCI INTERFACE CONTROL REGISTER (SCR)
SSI RECIEVE/TRANSMIT DATA REGISTER (RX/TX)
SSI STATUS/TIME SLOT REGISTER (SSISR/TSR)
SSI CONTROL REGISTER B (CRB)
SSI CONTROL REGISTER A (CRA)
HOST RECEIVE/TRANSMIT REGISTER (HRX/HTX)
RESERVED
HOST STATUS REGISTER (HSR)
HOST CONTROL REGISTER (HCR)
RESERVED
RESERVED
PORT C — DATA REGISTER (PCD)
PORT B — DATA REGISTER (PBD)
PORT C — DATA DIRECTION REGISTER (PCDDR)
PORT B — DATA DIRECTION REGISTER (PBDDR)
PORT C — CONTROL REGISTER (PCC)
MOVE#$0,X:$FFE0;Select Port B to be general-purpose I/O
MOVE#$7F00,X:$FFE2;Select pins PB0–PB7 to be inputs
•;and pins PB8–PB14 to be outputs
•
MOVEP#data_out,X:$FFE4;Put bits 8–14 of “data_out” on pins
;PB8–PB14 bits 0–7 are ignored
MOVEPX:$FFE4,#data_in;Put PB0–PB7 in bits 0–7 of “data_in”
Figure 5-6 Instructions to Write/Read Parallel Data with Port B
nc...
I
cale Semiconductor,
Frees
Figure 5-7 details the process of programming Port B as GPIO. Normally, it is not good
programming practice to activate a peripheral before programming it. However, reset activates the Port B general-purpose I/O as all inputs; the alternative is to configure Port B as
an HI, which may not be desirable. In this case, it is probably better to insure that Port B
is initially configured for general-purpose I/O, and then configure the data direction and
data registers. It may be better in some situations to program the data direction or the data
registers first to prevent two devices from driving one signal. The order of steps 1, 2, and
3 in Figure 5-7 is optional and can be changed as needed.
5.2.2Port B General Purpose I/O Timing
General purpose data written to Port B is synchronized to the central processing unit
(CPU) but delayed by one instruction cycle. For example, the instruction
MOVE DATA15,X:PORTBDATA24,Y:EXTERN
1. writes 15 bits of data to the Port B register, but the output pins do not change
until the following instruction cycle
2. writes 24 bits of data to the external Y memory, which appears on Port A during T2 and T3 of the current instruction
As a result, if it is desirable to synchronize Port A and Port B outputs, two instructions must
be used:
MOVE DATA15,X:PORTB
NOPDATA24,Y:EXTERN
The NOP can be replaced by any instruction that allows parallel moves. Inserting one or
more “MOVE DATA15,X:PORTB DATA24,Y:EXTERN” instructions between the first and
5 - 8PORT BMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
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.