DMAInitialize();
DMADest = &(EPwm1Regs.CMPA.half.CMPA);
DMASource = &sinrom1[0];
DMAWrapStep = (int16)((&EPwm2Regs.CMPA.half.CMPA) – (&EPwm1Regs.CMPA.half.CMPA));
DMACH1AddrConfig(DMADest,DMASource);
DMACH1BurstConfig(0,0,0); //Will set up to use 32-bit datasize, pointers are based on 16-bit words
DMACH1TransferConfig(600,1,0); //so need to increment by 2 to grab the correct location
DMACH1WrapConfig(300,0,300,DMAWrapStep);
DMACH1ModeConfig(DMA_EPWM1A,PERINT_ENABLE,ONESHOT_DISABLE,CONT_ENABLE,SYNC_DISABLE,SYNC_SRC,OVRFLOW_DISABLE,SIXTEEN_BIT,CHINT_END,CHINT_ENABLE);
StartDMACH1();
程序是为了写一个SPWM。想用DMA往EPWM上面发送数据。目前在CCS上看到SRC_ADDR 和DEST_ADDR 的变化都如我所愿。但是真正发送到EPwm1Regs.CMPA.half.CMPA寄存器里的都是0.?我的正弦表没有问题。还请高人指点一二。
熬了一个通宵了,在这儿先谢过大家了。
Danny Liu:
SysCtrlRegs.EPWMCFG.bit.CONFIG = 1;
这句话也加过了。