Motorola SC140 user manual Motorola

Page 1

MOTOROLA

Semiconductor Products Sector Application Note

Order Number: AN2009/D Rev. 1, 9/2001

Introduction to the StarCore SC140 Tools: An Approach in Nine Exercises

Emmanuel Roy and David Crawford

This document presents a quick, comprehensive hands-on introduction to the StarCore SC140 DSP core using programming examples and exercises. The goal is to help the software developer start writing high-level language applications in C. Included are software-related tips on how to get the most from the StarCore hardware architecture.

We recommend that you complete the exercises in sequential order. The exercises require the use of the SC140 C tools (including compiler, assembler, linker, and simulator) to generate executable files from C and assembly language source files and to verify the code performance. The tools are invoked from a command prompt (DOS or UNIX). If you desire, you can use an Integrated Development Environment (IDE). Be sure to consult the appropriate IDE manuals. This document provides step-by-step instructions to walk you through the exercises included in the file SC140_exercises.zip. You can download this zip file from the MSC8101 or MSC8102 product page at the following Web address:

http://www.mot.com/SPS

Solutions to the exercises are provided at the end of this application note.

Recommended Reading

SC140 Core Reference Manual, MNSC140CORE/D

SC100 C/C++ Compiler User’s Manual, MSC100CCUM/D

StarCore140 Family DSP Core Instruction Set, STCR140ISRM/D

Multisample Programming Technique, STCR140MLTAN/D

 

Contents

 

1

Preliminaries

2

2

File I/O Exercise

4

3

Integer and Fractional

 

 

Arithmetic Exercise

5

3.1

Hardware Support on StarCore

5

3.2

Compiler Support on StarCore

6

4

Local Versus Global

 

 

Optimization Exercise

9

5

Memory Alignment Exercise 12

6

Split Summation Exercise ....

16

7

Multi-Sample Exercise

18

8

Control Code: The True Bit

 

 

Exercise

21

9

Calling an Assembly Routine

 

 

From C Exercise

23

10

The Challenge

26

11

Solutions to Exercises

27

Introduction to the SC140 Tools

© Motorola, Inc. 2000

Image 1
Contents Motorola Typical development process is represented in Figure Compiler Hands On File I/O ExerciseGood To Know Interpretation of 16-bit Integer and Fractional Data Values Integer and Fractional Arithmetic ExerciseInteger Arithmetic Compiler Support on StarCoreFractional Arithmetic Good To Know Local Optimization Local Versus Global Optimization ExerciseCompiler Support on StarCore StarCore C Compiler Global Optimization Local OptimizationMemory Alignment Exercise AA BB CC DD First Code Section Second Code Section Split Summation Exercise Code Generated Assembly Code = ∑ a i x n For 0 ≤ n L Multi-Sample ExerciseIntermediate Version Compromise Between Memory and Speed Further Speed Optimization Control Code The True Bit Exercise Save Ex7.c as Ex71.c Calling an Assembly Routine From C Exercise Current Following output should be displayed Challenge Introduction to the SC140 Tools Solutions to ExercisesAligned ExerciseExpected Motorola INC Intermediate version Compromise between Memory and Speed Compiler Support on StarCore Further Optimizing the Speed Compiler Support on StarCore Compiler Support on StarCore Motorola INC Zoffset equ Moffset equ Exercise Compiler Support on StarCore Compiler Support on StarCore AN2009/D