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

📄 sim2808.gel

📁 DSP学习板上的例子程序包括 AD转换 CAN总线 SPI SCI
💻 GEL
字号:
/********************************************************************/
/* sim2808.gel                                                      */
/* Version 3.30                                                     */
/*                                                                  */
/* This GEL file is to be used with the TMS320F2808 DSP.            */
/* Changes may be required to support specific hardware designs.    */
/*                                                                  */
/* Code Composer Studio supports six reserved GEL functions that    */
/* automatically get executed if they are defined. They are:        */
/*                                                                  */
/* StartUp()              - Executed whenever CCS is invoked        */
/* OnReset()              - Executed after Debug->Reset CPU         */
/* OnRestart()            - Executed after Debug->Restart           */
/* OnPreFileLoaded()      - Executed before File->Load Program      */
/* OnFileLoaded()         - Executed after File->Load Program       */
/* OnTargetConnect()      - Executed after Debug->Connect           */
/*                                                                  */
/********************************************************************/

StartUp()
{
}

OnReset(int nErrorCode)
{
}

OnRestart(int nErrorCode)
{
/* CCS will call OnRestart() when you do a Debug->Restart and   */
/* after you load a new file.  Between running interrupt based  */
/* programs, this function will clear interrupts and help keep  */
/* the processor from going off into invalid memory.            */
     IER = 0;
     IFR = 0;
}

OnPreFileLoaded()
{
}

OnFileLoaded(int nErrorCode, int bSymbolsOnly)
{
}

OnTargetConnect()
{
    F2808_Memory_Map();            /* Initialize the CCS memory map */

/* Check to see if CCS has been started-up with the DSP already */
/* running in real-time mode.  The user can add whatever        */
/* custom initialization stuff they want to each case.          */
 
    if (GEL_IsInRealtimeMode())     /* Do real-time mode target initialization */
    {
        // Note: This case never executes with the simulator
    }
    else                            /* Do stop-mode target initialization */
    {
        // Note: This case always executes with the simulator
    }
}


/********************************************************************/
/*                        F2808 Memory Map                          */
/*                                                                  */
/*   Note: M0M1MAP and VMAP signals tied high on '2808 core         */
/*                                                                  */
/*   0x000000 - 0x0003ff   M0 SARAM                (Prog and Data)  */
/*   0x000400 - 0x0007ff   M1 SARAM                (Prog and Data)  */
/*   0x000800 - 0x000fff   Peripheral Frame0 (PF0) (Data only)      */
/*   0x006000 - 0x006fff   Peripheral Frame1 (PF1) (Data only)      */
/*   0x007000 - 0x007fff   Peripheral Frame2 (PF2) (Data only)      */
/*   0x008000 - 0x008fff   L0 SARAM                (Prog and Data)  */
/*   0x009000 - 0x009fff   L1 SARAM                (Prog and Data)  */
/*   0x00a000 - 0x00bfff   H0 SARAM Mirror         (Prog and Data)  */
/*   0x3d7800 - 0x3d7fff   OTP                     (Prog and Data)  */
/*   0x3e8000 - 0x3f7fff   FLASH                   (Prog and Data)  */
/*   0x3f8000 - 0x3f8fff   L0 SARAM Mirror         (Prog and Data)  */
/*   0x3f9000 - 0x3f9fff   L1 SARAM Mirror         (Prog and Data)  */
/*   0x3fa000 - 0x3fbfff   H0 SARAM                (Prog and Data)  */
/*   0x3ff000 - 0x3fffff   BOOT ROM                (Prog and Data)  */
/********************************************************************/
menuitem "Initialize Memory Map";

hotmenu F2808_Memory_Map()
{
    /* Initialize M0M1MAP and VMAP input signals high               */
    M0M1MAP_IN = 1;       /* Maps M0 and M1 to same Prog/Data addr  */
    VMAP_IN = 1;          /* Vectors fetched from 0x3fffc0-0x3fffff */

    GEL_MapReset();
    GEL_MapOn();

    /* The OTP, FLASH/ROM, and BOOT ROM memory maps are defined as  */
    /* writeable by GEL_MapAdd so that the debugger can load code   */
    /* into them. The simulator configuration file defines these    */
    /* memory blocks as flash or ROM which prevents the application */
    /* from writing to them.                                        */

    /* Program memory maps */
    GEL_MapAdd(0x0,0,0x400,1,1);                 /* M0 SARAM        */
    GEL_MapAdd(0x400,0,0x400,1,1);               /* M1 SARAM        */
    GEL_MapAdd(0x8000,0,0x1000,1,1);             /* L0 SARAM        */
    GEL_MapAdd(0x9000,0,0x1000,1,1);             /* L1 SARAM        */
    GEL_MapAdd(0xa000,0,0x2000,1,1);             /* H0 SARAM Mirror */
    GEL_MapAdd(0x3d7800,0,0x400,1,0);            /* OTP             */
    GEL_MapAdd(0x3e8000,0,0x10000,1,0);          /* FLASH           */
    GEL_MapAdd(0x3f8000,0,0x1000,1,1);           /* L0 SARAM Mirror */
    GEL_MapAdd(0x3f9000,0,0x1000,1,1);           /* L1 SARAM Mirror */
    GEL_MapAdd(0x3fa000,0,0x2000,1,1);           /* H0 SARAM        */
    GEL_MapAdd(0x3ff000,0,0x1000,1,0);           /* BOOT ROM        */


    /* Data memory maps */
    GEL_MapAdd(0x0,1,0x400,1,1);                 /* M0 SARAM        */
    GEL_MapAdd(0x400,1,0x400,1,1);               /* M1 SARAM        */
    GEL_MapAdd(0x800,1,0x800,1,1);               /* PF0             */
    GEL_MapAdd(0x6000,1,0x1000,1,1);             /* PF1             */
    GEL_MapAddStr(0x7000,1,0x1000,"R|W|AS2",0);  /* PF2             */
    GEL_MapAdd(0x8000,1,0x1000,1,1);             /* L0 SARAM        */
    GEL_MapAdd(0x9000,1,0x1000,1,1);             /* L1 SARAM        */
    GEL_MapAdd(0xa000,1,0x2000,1,1);             /* H0 SARAM Mirror */
    GEL_MapAdd(0x3d7800,1,0x800,1,0);            /* OTP             */
    GEL_MapAdd(0x3e8000,1,0x10000,1,0);          /* FLASH           */
    GEL_MapAdd(0x3f8000,1,0x1000,1,1);           /* L0 SARAM Mirror */
    GEL_MapAdd(0x3f9000,1,0x1000,1,1);           /* L1 SARAM Mirror */
    GEL_MapAdd(0x3fa000,1,0x2000,1,1);           /* H0 SARAM        */
    GEL_MapAdd(0x3ff000,1,0x1000,1,0);           /* BOOT ROM        */
}


/********************************************************************/
menuitem "Addressing Modes";

hotmenu C28x_Mode()
{
    AMODE = 0;
    OBJMODE = 1;
}

hotmenu C24x_Mode()
{
    AMODE = 1;
    OBJMODE = 1;
}

hotmenu C27x_Mode()
{
    AMODE = 0;
    OBJMODE = 0;
}

/********************************************************************/
/*** End of file ***/

⌨️ 快捷键说明

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