⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chk2xx_.txt

📁 DSP的例程
💻 TXT
📖 第 1 页 / 共 2 页
字号:

               TMS320C2xx SELFCHECK PROGRAM APPLICATIONS BRIEF

1.0 INTRODUCTION
    In this document, both TMS320C2xx and C2xx refer to any member of the
'2xx DSP family (e.g. C203, C204, C205, C209, C240, F206, F207, F240, ect.).
Also, TMS320C24x refers to the subset of '2xx DSPs belonging to the '24x
family (e.g. C240, F240, ect.).

2.0 PROGRAM FILES

    The following files are included in this archival:

     ALU.ASM      ------  arithmetic operations module
     BASIC.ASM    ------  basic operations module
     BRNCH.ASM    ------  branch instructions module
     CHK2XX.ASM   ------  program control shell
     CHK2XX.TXT   ------  this text file
     CTRL.ASM     ------  control instructions module
     DATA.ASM     ------  data memory operations module
     MAKECHK.BAT  ------  DOS batch file to assemble and link the code
     MEMMAP.H     ------  include file containing constant definitions
     MULT.ASM     ------  multiplier operations module
     OPTIONS.H    ------  include file containing user setable options
     RAM.ASM      ------  RAM check module
     READ.ME      ------  readme text file
     SHFT.ASM     ------  scaling shifter operations module
     USER.C       ------  sample C program that calls the selfcheck program
     USER.CMD     ------  sample linker command file for use with USER.C


2.1 HOW TO CALL THE SELFCHECK PROGRAM
   If calling the selfcheck from C code, use a statement of the form
                          errorcode = chk2xx();

where errorcode has been declared as an unsigned integer.  The C language
function prototype for the selfcheck routine is:
                          extern unsigned chk2xx(void);

If calling the selfcheck from assembly code, use the following instruction:
                          CALL    _chk2xx

The leading underbar in _chk2xx above is not a typo, and must be included.


2.2 ASSEMBLING AND LINKING THE CODE
         dspa chk2xx -v2xx -l -x
         dspa basic  -v2xx -l -x
         dspa data   -v2xx -l -x
         dspa ctrl   -v2xx -l -x
         dspa brnch  -v2xx -l -x
         dspa alu    -v2xx -l -x
         dspa mult   -v2xx -l -x
         dspa ram    -v2xx -l -x
         dspa shft   -v2xx -l -x
         dspcl -c -v2xx user.c
         dsplnk user.cmd -c -l rts2xx.lib -o user.out -m user.map

  You should replace USER.C and USER.CMD with your own custom routines as
necessary.  If you instead wish to call the selfcheck from assembly code,
say the files YOURFILE.ASM and YOURFILE.CMD, also modify the last two lines
of MAKECHK.BAT so that YOURFILE is assembled and linked.  For example:

         dspa chk2xx -v2xx -l -x
         dspa basic  -v2xx -l -x
         dspa data   -v2xx -l -x
         dspa ctrl   -v2xx -l -x
         dspa brnch  -v2xx -l -x
         dspa alu    -v2xx -l -x
         dspa mult   -v2xx -l -x
         dspa ram    -v2xx -l -x
         dspa shft   -v2xx -l -x
         dspa YOURFILE -v2xx -l -x
         dsplnk YOURFILE.CMD -o YOURFILE.OUT -m YOURFILE.MAP


2.3 HOW TO ALLOCATE MEMORY FOR THE LINKER
1) Link and run all code from external RAM (or ROM), and do not exercise the
external RAM test option on the used portion.

2) TMS320C209 users can run the program from its on-chip SARAM block.  Do
not exercise the option to test this block.  

3) Users of TMS320C2xx devices that contain sufficient on-chip SARAM can run
the program from this block (similar to the TMS320C209).

4) If running the selfcheck as auxiliary support for some other primary
application program, one option is to run the selfcheck using one of the
above three linker methods before bootloading the code and initializing the
data for your primary application.  This will require you to modify your
bootloader.

3.0 PRESERVED REGISTERS
    Since the selfcheck is C-callable, the C environment (e.g. AR0, AR1,
AR6, and AR7) must be saved upon entering the program and restored prior to
returning to the calling routine.  Certain other CPU core registers are also
actively preserved as follows:

    ST0: All bits preserved except ARP and INTM.  Upon return, ARP = 1 (the
         standard TMS320C2xx C language convention), and INTM = 1 (all
         maskable interrupts disabled).

    ST1: All bits preserved except ARB.  At return, ARB = 2.

    IMR: All bits preserved.

3.1 HOW THE PROGRAM IS STRUCTURED
    The selfcheck program is written as a series of modules that test
different components of the CPU (or different functional groupings of
instructions).  Each of these routines is called by the main control shell,
contained in the file CHK2XX.ASM.  The following is the order in which the
test modules are called:

    BASIC.ASM    ----    basic operations module
    DATA.ASM     ----    data memory operations module
    CTRL.ASM     ----    control instructions module
    BRNCH.ASM    ----    branch instructions module
    ALU.ASM      ----    arithmetic operations module
    MULT.ASM     ----    multiplier operations module
    RAM.ASM      ----    RAM check module
    SHFT.ASM     ----    scaling shifters operations module
;
          TABLE 1: Op-Code Functional Testing by Module

                                   | | | | | | | | | |n|
                                   | | | | | | | | | |o|
                                   | | | | | | | | | |t|
                                   | | | | | | | | | | |
                                   | | | | | | | | |C|t|
                                   |B| | |B| | | | |H|e|
                                   |A|D|C|R| |M| |S|K|s|
                                   |S|A|T|N|A|U|R|H|2|t|
                                   |I|T|R|C|L|L|A|F|X|e|
          Op-Code  /  module name: |C|A|L|H|U|T|M|T|X|d|
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ABS                      | | | | |X| | | | | |
          ADD dma [,shift]         | | | | |X| | |X| | |
          ADD dma,16               | | | | |X| | | | | |
          ADD ind [,shift [,ARn]]  | | |X| |X| | | | | |
          ADD ind,16[,ARn]         | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ADD #k                   | | | | |X| | | | | |
          ADD #lk [,shift]         | | | | |X| | | | | |
          ADDC dma                 | | | | |X| | | | | |
          ADDC ind [,ARn]          | | | | |X| | | | | |
          ADDS dma                 | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          ADDS ind [,ARn]          | | | | |X| | | | | |
          ADDT dma                 | | | | |X| | | | | |
          ADDT ind [,ARn]          | | | | |X| | | | | |
          ADRK #k                  | |X| | | | | | | | |
          AND dma                  | | | | |X| | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          AND ind [,ARn]           | | | | |X| |X| | | |
          AND #lk [,shift]         | | | | |X| | | | | |
          AND #lk,16               | | | | |X| | | | | |
          APAC                     | | | | | |X| |X| | |
          B                        |X| | | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          BACC                     | | | |X| | | | | | |
          BANZ                     | | | |X| | | | | | |
          BCND                     |X| | | | | | | | | |
          BIT dma, bit code        | | |X| | | | | | | |
          BIT ind, bit code [,ARn] | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          BITT dma                 | | |X| | | | | | | |
          BITT ind [,ARn]          | | |X| | | | | | | |
          BLDD #lk, dma            | |X| | | | | | | | |
          BLDD #lk, ind [,ARn]     | |X| | | | | | | | |
          BLDD dma, #lk            | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          BLDD ind, #lk [,ARn]     | |X| | | | | | | | |
          BLPD #pma, dma           | |X| | | | | | | | |
          BLPD #pma, ind [,ARn]    | |X| | | | | | | | |
          CALA                     | | | |X| | | | | | |
          CALL pma [,ind [,ARn]]   | | | | | | | | |X| |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          CC                       | | | |X| | | | | | |
          CLRC OVM                 | | |X| |X| | | | | |
          CLRC SXM                 | | |X| | | | | | | |
          CLRC TC                  | | |X| | | | | | | |
          CLRC C                   | | |X| | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          CLRC CNF                 | |X|X| | | |X| | | |
          CLRC INTM                | | |X| | | | | | | |
          CLRC XF                  | | |X| | | | | | | |
          CMPL                     | | | | |X|X| | | | |
          CMPR 0                   | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          CMPR 1                   | |X| | | | | | | | |
          CMPR 2                   | |X| | | | | | | | |
          CMPR 3                   | |X| | | | | | | | |
          DMOV dma                 | |X| | | | | | | | |
          DMOV ind [,ARn]          | |X| | | | | | | | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          IDLE                     | | | | | | | | | |X|
          IN dma, PA               | | | | | | | | | |X|
          IN ind, PA [,ARn]        | | | | | | | | | |X|
          INTR k                   | | | | | | | | | |X|
          LACC dma [,shift]        |X|X|X| |X| | |X| | |
          -------------------------+-+-+-+-+-+-+-+-+-+-+
          LACC dma,16              | | | | |X| | | | | |
          LACC ind [,shift [,ARn]] | |X| | | | | | | | |
          LACC ind,16[,ARn]        | | |X| | | | | | | |
          LACC #lk [,shift]        |X|X| |X| | |X| | | |

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -