I spent a long time trying to get the ACPY3 API working but never got it going so now I am using the QDMA by directly writing into the QDMA registers. I can get the transfers working just fine except for two related problems. I can only get the 0th bit in IPR to go high when a transfer completes. If I set the TCC of the QDMA transfer to anything other than 0, IPR never changes. I have TCINTEN set high. Also, I am polling off of IPR because I cannot get an interrupt to trigger. Here are the steps that I go through to set up transfers and try to set up triggers... (everything here refers to a header file I created while referencing the data sheet)
testQDMAch->params.SRC = (uint)displayBuff->frame.pFrm.y;
testQDMAch->params.DST = (uint)tempY;
testQDMAch->params.ACNT = (uint)F_WIDTH;
testQDMAch->params.BCNT = (uint)F_HEIGHT;
testQDMAch->params.SRCBIDX = ( int)F_WIDTH;
testQDMAch->params.DSTBIDX = ( int)F_WIDTH;
testQDMAch->params.SRCCIDX = ( int)0;
testQDMAch->params.DSTCIDX = ( int)0;
testQDMAch->params.CCNT = (uint)1;
testQDMAch->params.BCNTRLD = (uint)0;
testQDMAch->params.LINK = (uint)0;
testQDMAch->params.OPT.ITCCH = EDMA_OPT_ITCCH_DIS;
testQDMAch->params.OPT.TCCH = EDMA_OPT_TCCH_DIS;
testQDMAch->params.OPT.ITCINT = EDMA_OPT_ITCINT_DIS;
testQDMAch->params.OPT.TCINT = EDMA_OPT_TCINT_EN;
testQDMAch->params.OPT.TCC = EDMA_OPT_TCC( myTCC /*or whatever TC code I want*/);
testQDMAch->params.OPT.TCCMODE = EDMA_OPT_TCCMODE_NORM;
testQDMAch->params.OPT.FWID = EDMA_OPT_FWID_8b;
testQDMAch->params.OPT.STATIC = EDMA_OPT_STATIC_EN;
testQDMAch->params.OPT.SYNCDIM = EDMA_OPT_SYNCDIM_AB;
testQDMAch->params.OPT.DAM = EDMA_OPT_DAM_INC;
testQDMAch->params.OPT.SAM = EDMA_OPT_SAM_INC;
testQDMAch->trigger = PARAM_SRC;
I have a function that goes through and actually writes all those options into the registers, and a function that enables the QDMA channel and rewrites the trigger word to start the transfer. But the transfer works fine...
I poll for the completion using...
while((IPRL & 0x1<<myTCC) != 0x1<<myTCC){}
ICRL = 0x1<<myTCC;
If myTCC = 0 then everything works fine. However, if myTCC != 0 then I get stuck in the while loop.
Onto interrupts... Here is the code in my TCF to try to get a HWI to fire.
bios.HWI.instance("HWI_INT4").interruptSelectNumber = 24;
bios.HWI.instance("HWI_INT4").fxn = prog.extern("DMA_isr");
bios.HWI.instance("HWI_INT4").useDispatcher = 1;
Here is how I am setting the IER (0x02A01050)...
if(hChannel->params.OPT.TCC > 31)
IESRH = 0x1 << (hChannel->params.OPT.TCC - 32);
else
IESRL = 0x1 << (hChannel->params.OPT.TCC);
And my ISR...
void DMA_isr(){
int i;
uint iprl = IPRL;
uint iprh = IPRH;
for(i = 0; i < 32; i++){
if(iprl & 0x1<<i){
/*big switch statement to act on each particular bit that is set*/
ICRL = 0x1<<i;
}
if(iprh & 0x1<<i){
/*big switch statement to act on each particular bit that is set*/
ICRL = 0x1<<i;
}
}
I put a breakpoint on the first line of my ISR so I know if it goes in there and it never does.
Does anybody see what I might be doing wrong? If I left any details out please let me know I will include those.