Board logo

标题: DSP外扩SRAM的应用测试心得体会(转)(3) [打印本页]

作者: yuyang911220    时间: 2015-10-25 16:32     标题: DSP外扩SRAM的应用测试心得体会(转)(3)

// 利用TMS320F28335的SCIC串口FIFO来发送数据,只要数据包不超过16,
   // 都可以无需等待,直接将所有字节放入FIFO,极大的节约CPU的时间开销
   // 具体实现如下,至于官方的例程,等待当前字节发送完毕再发下一个,
   // 这样太浪费时间,在实际产品中基本上没人用
   if(Flag_CpuTimer0){
         Flag_CpuTimer0 = 0; // 10ms 定时周期
         GpioDataRegs.GPBSET.bit.GPIO50 = 1;   // RS485 DE = 1 RS485切换为发送状态

         for(i = 0; i < 10; ++i){
             ScicRegs.SCITXBUF = bufferA; // 将10个数据放入FIFO,然后自动依次转移到移位寄存器
         }
         asm(" nop");
         asm(" nop");
         asm(" nop");
         asm(" nop");
         asm(" nop");
         asm(" nop");
     }
     // RS485处于发送状态,且SCIC移位寄存器为空
    if((GpioDataRegs.GPBDAT.bit.GPIO50 == 1)&&(ScicRegs.SCICTL2.bit.TXEMPTY == 1)){
          GpioDataRegs.GPBCLEAR.bit.GPIO50 = 1;   // RS485 DE = 0 RS485转为接收状态
    }

2. CAN通信配置
   进行中


三、数据存储器配置说明(I2C)
   扩展了512K byte EEPROM,打开官方的I2C例程(非GPIO模拟的时序),已测试OK。

四、集成功率芯片测试(GPIO)
   主要是对功率器件的测试,进行中

五、看门狗配置说明(已完成)

一般嵌入式系统都需要开启外部或内部看门狗,以防意外的CPU挂起死机

六、TI官方的CMD文件说明(实际应用的文件是在官方的基础上稍作修改)

TI官方提供的CMD文件有三个: 28335_RAM_lnk.cmd、F28335.cmd、DSP2833x_Headers_nonBIOS.cmd

调试程序时,将28335_RAM_lnk.cmd文件加入工程中,程序被加载到SRAM中运行。
实际的产品运行时,需要将程序下载到FLASH中,并从FLASH中启动,这时需要
在工程中加入F28335.cmd文件,同时屏蔽28335_RAM_lnk.cmd文件。

TI官方文件F28335.cmd对内部SRAM的分配如下:

BOOT_RSVD : origin = 0x000000, length = 0x000050 // Part of M0, BOOT rom will use this for stack PAGE 1
RAMM0 : origin = 0x000050, length = 0x0003B0 // on-chip RAM block M0 PAGE 1
RAMM1 : origin = 0x000400, length = 0x000400 // on-chip RAM block M1 PAGE 1

ZONE0 : origin = 0x004000, length = 0x001000 // XINTF zone 0 PAGE 0

RAML0 : origin = 0x008000, length = 0x001000 // on-chip RAM block L0 PAGE 0
RAML1 : origin = 0x009000, length = 0x001000 // on-chip RAM block L1 PAGE 0
RAML2 : origin = 0x00A000, length = 0x001000 // on-chip RAM block L2 PAGE 0
RAML3 : origin = 0x00B000, length = 0x001000 // on-chip RAM block L3 PAGE 0
RAML4 : origin = 0x00C000, length = 0x001000 // on-chip RAM block L1 PAGE 1
RAML5 : origin = 0x00D000, length = 0x001000 // on-chip RAM block L1 PAGE 1
RAML6 : origin = 0x00E000, length = 0x001000 // on-chip RAM block L1 PAGE 1
RAML7 : origin = 0x00F000, length = 0x001000 // on-chip RAM block L1 PAGE 1

Allocate DMA-accessible RAM sections:
DMARAML4 : > RAML4, PAGE = 1
DMARAML5 : > RAML5, PAGE = 1
DMARAML6 : > RAML6, PAGE = 1
DMARAML7 : > RAML7, PAGE = 1

Allocate uninitalized data sections:
.stack : > RAMM1 PAGE = 1
.ebss : > RAML4 PAGE = 1
.esysmem : > RAMM1 PAGE = 1

TI官方文件DSP2833x_Headers_nonBIOS.cmd对特殊功能寄存器的映射(PAGE 1)如下

DEV_EMU : origin = 0x000880, length = 0x000180 // device emulation registers
FLASH_REGS : origin = 0x000A80, length = 0x000060 // FLASH registers
CSM : origin = 0x000AE0, length = 0x000010 // code security module registers
ADC_MIRROR : origin = 0x000B00, length = 0x000010 // ADC Results register mirror
XINTF : origin = 0x000B20, length = 0x000020 // external interface registers

CPU_TIMER0 : origin = 0x000C00, length = 0x000008 // CPU Timer0 registers
CPU_TIMER1 : origin = 0x000C08, length = 0x000008 // CPU Timer0 registers (CPU Timer1 & Timer2 reserved TI use)
CPU_TIMER2 : origin = 0x000C10, length = 0x000008 // CPU Timer0 registers (CPU Timer1 & Timer2 reserved TI use)

PIE_CTRL : origin = 0x000CE0, length = 0x000020 // PIE control registers
PIE_VECT : origin = 0x000D00, length = 0x000100 // PIE Vector Table

DMA : origin = 0x001000, length = 0x000200 // DMA registers

MCBSPA : origin = 0x005000, length = 0x000040 // McBSP-A registers
MCBSPB : origin = 0x005040, length = 0x000040 // McBSP-B registers

ECANA : origin = 0x006000, length = 0x000040 // eCAN-A control and status registers
ECANA_LAM : origin = 0x006040, length = 0x000040 // eCAN-A local acceptance masks
ECANA_MOTS : origin = 0x006080, length = 0x000040 // eCAN-A message object time stamps
ECANA_MOTO : origin = 0x0060C0, length = 0x000040 // eCAN-A object time-out registers
ECANA_MBOX : origin = 0x006100, length = 0x000100 // eCAN-A mailboxes

ECANB : origin = 0x006200, length = 0x000040 // eCAN-B control and status registers
ECANB_LAM : origin = 0x006240, length = 0x000040 // eCAN-B local acceptance masks
ECANB_MOTS : origin = 0x006280, length = 0x000040 // eCAN-B message object time stamps
ECANB_MOTO : origin = 0x0062C0, length = 0x000040 // eCAN-B object time-out registers
ECANB_MBOX : origin = 0x006300, length = 0x000100 // eCAN-B mailboxes

EPWM1 : origin = 0x006800, length = 0x000022 // Enhanced PWM 1 registers
EPWM2 : origin = 0x006840, length = 0x000022 // Enhanced PWM 2 registers
EPWM3 : origin = 0x006880, length = 0x000022 // Enhanced PWM 3 registers
EPWM4 : origin = 0x0068C0, length = 0x000022 // Enhanced PWM 4 registers
EPWM5 : origin = 0x006900, length = 0x000022 // Enhanced PWM 5 registers
EPWM6 : origin = 0x006940, length = 0x000022 // Enhanced PWM 6 registers

ECAP1 : origin = 0x006A00, length = 0x000020 // Enhanced Capture 1 registers
ECAP2 : origin = 0x006A20, length = 0x000020 // Enhanced Capture 2 registers
ECAP3 : origin = 0x006A40, length = 0x000020 // Enhanced Capture 3 registers
ECAP4 : origin = 0x006A60, length = 0x000020 // Enhanced Capture 4 registers
ECAP5 : origin = 0x006A80, length = 0x000020 // Enhanced Capture 5 registers
ECAP6 : origin = 0x006AA0, length = 0x000020 // Enhanced Capture 6 registers

EQEP1 : origin = 0x006B00, length = 0x000040 // Enhanced QEP 1 registers
EQEP2 : origin = 0x006B40, length = 0x000040 // Enhanced QEP 2 registers

GPIOCTRL : origin = 0x006F80, length = 0x000040 // GPIO control registers
GPIODAT : origin = 0x006FC0, length = 0x000020 // GPIO data registers
GPIOINT : origin = 0x006FE0, length = 0x000020 // GPIO interrupt/LPM registers

SYSTEM : origin = 0x007010, length = 0x000020 // System control registers
SPIA : origin = 0x007040, length = 0x000010 // SPI-A registers
SCIA : origin = 0x007050, length = 0x000010 // SCI-A registers
XINTRUPT : origin = 0x007070, length = 0x000010 // external interrupt registers

ADC : origin = 0x007100, length = 0x000020 // ADC registers

SCIB : origin = 0x007750, length = 0x000010 // SCI-B registers

SCIC : origin = 0x007770, length = 0x000010 // SCI-C registers

I2CA : origin = 0x007900, length = 0x000040 // I2C-A registers

CSM_PWL : origin = 0x33FFF8, length = 0x000008 // Part of FLASHA. CSM password locations

PARTID : origin = 0x380090, length = 0x000001 // Part ID register location





欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0