手机版

CCS 教程 培训资料

时间:2025-04-22   来源:未知    
字号:

CCS 教程 培训资料

DSP C5000Chapter 3 Addressing Modes

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

ObjectivesPresent the main addressing modes and allocation of sections Present the main addressing modes of the C54 family Present the main addressing modes of the C55 family Explain how to use these addressing modes Do exercises to practice using the different addressing modesESIEE, Slide 2 Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

OutlineGeneralities on addressing modes C54x

C55x

ESIEE, Slide 3

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Addressing Modes: What are the Problems?Specify operands per instruction:A single instruction can access several operands at a time thanks to the many internal data busses, But how do we specify many addresses using a small number of bits?

Repeated processing on an array of data:Many DSP operations are repeated on an array of data stored at contiguous addresses in data memory. There are cases where it is useful to be able to modify the addresses as part of the instruction (increment or decrement).ESIEE, Slide 4 Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Main Addressing Modes of C5000 FamilyImmediate addressing Absolute addressing Direct addressing Indirect addressing by registerSupport for circular indirect addressingDefinition

Access to Memory Mapped Registers MMRs

ESIEE, Slide 5

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Allocating Sections

ESIEE, Slide 6

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

ExampleSystem Diagram Algorithm y= x1+ x0+ x2DROM init[3] EPROM (code) RAM x[3] C5000 CPU RAM y

ProcedureAllocate sections (code, constants, vars) Setup addressing modes Add the values (x1+ x0+ x2) Store the result (y) How do we allocate the proper sections?ESIEE, Slide 7 Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Writing relocatable codeThe programmer should not have to give the exact addresses:where to read the code in program memory, where to read the data in data memory.

The assembler allows to use symbolic addresses. The assembler and the linker work with COFF files:COFF= Common Object File Format. In COFF files, specialized sections are used for code, variables or constants. The programmer specifies in a command file for the linker where the different sections should be allocated in the memory of the system.ESIEE, Slide 8 Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Definition of SectionsDifferent sections for code, vars, constants. The sections can be initialized or not.An initialized section is filled with code or constant values. An uninitialized section reserves memory space for a variable.

The sections can have default names or names given by the programmer.

ESIEE, Slide 9

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Definition and names of SectionsThe programmer uses special directives to identify the sections.Initialized sections code Variables Code or c

onstants Unitialized sections, reserve space for data

Named sections, name given by user Unnamed sections, default nameESIEE, Slide 10

.sect

.usect

.text

.data

.bss

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Example of sections.sect”init" tbl .int 1,2,3 x y .usect"vars",3 .usect"result",1 .sect“code”Initialized named section: Initialization of constants. Definition of address tbl Uninitialized named section: x[3], y[1], Definition of address x and y. Initialized named section: code

System Diagram How are these sections placed into the memory areas shown?DROM tbl[3] EPROM codeESIEE, Slide 11

RAM x[3] 54x CPU RAM y

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

C54x Addressing Modes

ESIEE, Slide 12

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Format of Data and Instructions, Internal Busses of the C54x FamilyIn the C54x DSP, the data and program memories are organized in 16-bit words. Data busses have a 16-bit width. Data and instructions are generally of size N=16 bits. Some instructions may take several 16-bit words. Some data operands may be double precision and occupy 2 words. Internal busses: 2 data read, 1 data writeESIEE, Slide 13 Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Terms from the User’s GuideTerm Smem Xmem Ymem lk dmad pmad src dst PA What it means 16-bit single data memory 16-bit dual data memory operand used in dual-operand instructions and some single-operand instructions. Read through D bus. 16-bit dual data-memory operand used in dual-operand instructions. Read through C bus. 16-bit long 16-bit immediate data memory address (0 - 65,535) 16-bit immediate program memory address (0 - 65,535) This includes extended program memory devices Source accumulator (A or B) Destination accumulator (A or B) 16-bit port (I/O) immediate address (0 - 65,535)

ESIEE, Slide 14

Copyright 2003 Texas Instruments. All rights reserved.

CCS 教程 培训资料

Immediate Addressing Mode#Instruction contains the value of the operand. Value is preceded by#. ADD#4,A Example:Add the value 4 to the content of accumulator A.

Useful for initializations. Long (16 bits) or short values:For long values: instruction uses 2 words.

ESIEE, Slide 15

Copyright 2003 T …… 此处隐藏:5786字,全部文档内容请下载后查看。喜欢就下载吧 ……

CCS 教程 培训资料.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
    ×
    二维码
    × 游客快捷下载通道(下载后可以自由复制和排版)
    VIP包月下载
    特价:29 元/月 原价:99元
    低至 0.3 元/份 每月下载150
    全站内容免费自由复制
    VIP包月下载
    特价:29 元/月 原价:99元
    低至 0.3 元/份 每月下载150
    全站内容免费自由复制
    注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
    × 常见问题(客服时间:周一到周五 9:30-18:00)