//Step 5. User specific code
DMAInitialize(); //DMA初始化
for (i=0; i<BUF_SIZE; i++) //缓冲清零。注:用DMABuf1[40]={0}定义不能初始化为0
{
DMABuf1[i] = 0;
}
// Configure DMA Channel
pDMADest = &DMABuf1[0]; //Point DMA destination to the beginning of the array
pDMASource = &AdcMirror.ADCRESULT0; //Point DMA source to ADC result register base
DMACH1AddrConfig(pDMADest,pDMASource);
DMACH1BurstConfig(3,1,10); //burst传输
DMACH1TransferConfig(9,1,0); //transfer传输
DMACH1WrapConfig(1,0,0,1); //wrap传输
DMACH1ModeConfig(DMA_SEQ1INT,PERINT_ENABLE,ONESHOT_DISABLE,CONT_DISABLE,SYNC_DISABLE,SYNC_SRC,
OVRFLOW_DISABLE,SIXTEEN_BIT,CHINT_END,CHINT_ENABLE);
StartDMACH1();
AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 0x1; // Start SEQ1
for(i=0;i<10;i++)
{
for(j=0;j<1000;j++){}
AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1; //Normally ADC will be tied to ePWM, or timed routine
} //For this example will re-start manually
}
// INT7.1
__interrupt void local_DINTCH1_ISR(void) // DMA Channel 1
{
// To receive more interrupts from this PIE group, acknowledge this interrupt
PieCtrlRegs.PIEACK.all = PIEACK_GROUP7;
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
__asm (" ESTOP0");
for(;;);
}
//Step 5. User specific code
DMAInitialize(); //DMA初始化
for (i=0; i<BUF_SIZE; i++) //缓冲清零。注:用DMABuf1[40]={0}定义不能初始化为0
{
DMABuf1[i] = 0;
}
// Configure DMA Channel
pDMADest = &DMABuf1[0]; //Point DMA destination to the beginning of the array
pDMASource = &AdcMirror.ADCRESULT0; //Point DMA source to ADC result register base
DMACH1AddrConfig(pDMADest,pDMASource);
DMACH1BurstConfig(3,1,10); //burst传输
DMACH1TransferConfig(9,1,0); //transfer传输
DMACH1WrapConfig(1,0,0,1); //wrap传输
DMACH1ModeConfig(DMA_SEQ1INT,PERINT_ENABLE,ONESHOT_DISABLE,CONT_DISABLE,SYNC_DISABLE,SYNC_SRC,
OVRFLOW_DISABLE,SIXTEEN_BIT,CHINT_END,CHINT_ENABLE);
StartDMACH1();
AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 0x1; // Start SEQ1
for(i=0;i<10;i++)
{
for(j=0;j<1000;j++){}
AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1; //Normally ADC will be tied to ePWM, or timed routine
} //For this example will re-start manually
}