在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1559|回复: 0

[原创] 关于28335DMA传输溢出位OVERFLG如何触发的疑问

[复制链接]
发表于 2020-12-8 11:41:48 | 显示全部楼层 |阅读模式
10资产
请问28335中的DMA如何触发OVERFLG位,试了好多种方法都没有触发,也没有检测到该位置1。有没有知道的大神帮忙解决一下,或者提个思路。之前的思路是使用Timer0来触发DMA传送,然后设置burst_size为1023;timer0使用的是最小的周期,匹配的值为1;该触发方式相信已经很快了,我认为可以在传输FLAG置位以后的很短时间内(即burst传输开始前,或FLAG未清零前)再次给DMA传输中断信号,使其产生中断溢出,从而置位OVERFLG,但是没有发生这样的溢出。将DMA配置为溢出中断方式,也没有进入其中断,期间DMA传输照常进行,DMA传输完成中断照常进入。
就很迷,不会触发这个OVERFLG位。



附上源代码:
//###########################################################################
//
// Included Files
//
#include "dsp28x_Project.h"     // Device Headerfile and Examples Include File
//
// Defines
//
#define BUF_SIZE   1024  // Sample buffer size


#pragma DATA_SECTION(DMABuf0,"DMARAML4");
#pragma DATA_SECTION(DMABuf1,"DMARAML5");
#pragma DATA_SECTION(DMABuf2,"DMARAML6");


volatile Uint16 DMABuf0[BUF_SIZE];
volatile Uint16 DMABuf1[BUF_SIZE];
volatile Uint16 DMABuf2[BUF_SIZE];





volatile Uint16 num1=0;
volatile Uint16 num2=0;
//
// Functions Prototypes
//
__interrupt void local_DINTCH1_ISR(void);
__interrupt void local_DINTCH2_ISR(void);
__interrupt void local_DINTCH3_ISR(void);
__interrupt void local_DINTCH4_ISR(void);
__interrupt void local_DINTCH5_ISR(void);
__interrupt void local_DINTCH6_ISR(void);

//
// Main
//
void main(void)
{
    Uint16 i;
   
    //
    // Step 1. Initialize System Control:
    // PLL, WatchDog, enable Peripheral Clocks
    // This example function is found in the DSP2833x_SysCtrl.c file.
    //
    InitSysCtrl();


    //
    // Step 2. Initialize GPIO:
    // This example function is found in the DSP2833x_Gpio.c file and
    // illustrates how to set the GPIO to it's default state.
    //
    // InitGpio();  // Skipped for this example


    //
    // Step 3. Clear all interrupts and initialize PIE vector table:
    // Disable cpu interrupts
    //
    DINT;


    //
    // Initialize the PIE control registers to their default state.
    // The default state is all PIE interrupts disabled and flags
    // are cleared.
    // This function is found in the DSP2833x_PieCtrl.c file.
    //
    InitPieCtrl();


    //
    // Disable CPU interrupts and clear all CPU interrupt flags:
    //
    IER = 0x0000;
    IFR = 0x0000;


    //
    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    // This will populate the entire table, even if the interrupt
    // is not used in this example.  This is useful for debug purposes.
    // The shell ISR routines are found in DSP2833x_DefaultIsr.c.
    // This function is found in DSP2833x_PieVect.c.
    //
    InitPieVectTable();


    //
    // Interrupts that are used in this example are re-mapped to
    // ISR functions found within this file.
    //
    EALLOW; // Allow access to EALLOW protected registers
    PieVectTable.DINTCH1= &local_DINTCH1_ISR;
    EDIS;   // Disable access to EALLOW protected registers


    IER = M_INT7 ;                               //Enable INT7 (7.1 DMA Ch1)
    EnableInterrupts();
    CpuTimer0Regs.TCR.bit.TSS  = 1;               //Stop Timer0 for now




    //
    // Step 5. User specific code, enable interrupts:
    //
   
    //
    // Initialize DMA
    //
    DMAInitialize();


    //
    // Initialize Tables
    //
    for (i=0; i<BUF_SIZE; i++)
    {
        DMABuf0 = 1;
        DMABuf1 = i;
        DMABuf2 = i*10+1;


    }


    //
    // Configure DMA Channel
    //


    ////////CH1///////
    DMACH1AddrConfig(&DMABuf0[0],&DMABuf1[0]);
    DMACH1BurstConfig(1023,1,1);
    DMACH1TransferConfig(31,1,1);
    DMACH1WrapConfig(0XFFFF,0,0XFFFF,0);
    DMACH1ModeConfig(DMA_TINT0,PERINT_ENABLE,ONESHOT_DISABLE,CONT_DISABLE,
                     SYNC_DISABLE,SYNC_SRC,OVEFLOW_ENABLE,SIXTEEN_BIT,
                     CHINT_END,CHINT_ENABLE);


    //
    //Init the timer 0
    // load low value so we can start the DMA quickly
    //




    //CpuTimer0Regs.TIM.all = 1;
    CpuTimer0Regs.PRD.all=1;
    CpuTimer0Regs.TCR.bit.SOFT = 1;      //Allow to free run even if halted
    CpuTimer0Regs.TCR.bit.FREE = 1;
    CpuTimer0Regs.TCR.bit.TIE  = 1;      //Enable the timer0 interrupt signal
    CpuTimer0Regs.TCR.bit.TRB  = 1;
    CpuTimer0Regs.TCR.bit.TSS  = 0;      //restart the timer 0


    // load low value so we can start the DMA quickly
      //


    //EALLOW;
    //DmaRegs.PRIORITYCTRL1.bit.CH1PRIORITY=1;


    StartDMACH1();

    for(;;)
        {
        if(DmaRegs.CH1.CONTROL.bit.OVRFLG==1)
        __asm ("      ESTOP0");
            //num2++;
        };




}


//
// local_DINTCH1_ISR - INT7.1(DMA Channel 1)
//
__interrupt void
local_DINTCH1_ISR(void)
{
    if(DmaRegs.CH1.CONTROL.bit.OVRFLG==1)
    __asm ("      ESTOP0");
    //
    //
    // Next two lines for debug only to halt the processor here
    // Remove after inserting ISR Code


      __asm ("      ESTOP0");
    for(;;);
}


您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-27 00:06 , Processed in 0.014519 second(s), 5 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表