正常情况下的DMA初始化
DMACTL0 = DMA0TSEL_5; // DAC12IFG trigger DMA0 // critial codes to trigger all
// assign finally set
// DMA0 setup for DAC0
DMA0SA = (unsigned int)&Sin_tab; // Source block address
DMA0DA = (unsigned int)&DAC12_0DAT; // Destination single address
DMA0SZ = 32; // Block size
DMA0CTL |= DMADT_4 + DMASRCINCR_3 + DMAEN + DMAIE; // Rpt, inc src, word-word
正常执行这个后__bis_SR_register(CPUOFF + GIE);进入DMA中断,就是这个
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=DACDMA_VECTOR
__interrupt void DACDMA_ISR (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(DACDMA_VECTOR))) DACDMA_ISR (void)
#else
#error Compiler not supported!
#endif
{
}
分开写DMA初始化后,不正常情况就是卡在__bis_SR_register(CPUOFF + GIE)这里了,进不了中断了