TMS320c6457.
I use EDMA3 for sending of the data in EMIF. Upon termination of data transmission EDMA (after interruption reception) I finish one number the processor in EMIF. It turns out that EDMA gives interruption earlier, than has really transferred all data, and last number from the processor registers before several numbers from EDMA.
Pseudo-code.
void DataPut ()
{
EDMA3CHANPARAM [8].opt = 0x80400004 | (18 <<12);
EDMA3CHANPARAM [8].src = (unsigned int) data;
EDMA3CHANPARAM [8].dst = (unsigned int) (CE4DATA);
EDMA3CHANPARAM [8].acnt = 8;
EDMA3CHANPARAM [8].bcnt = 4096;
EDMA3CHANPARAM [8].ccnt = 1;
EDMA3CHANPARAM [8].bcntrld = 0;
EDMA3CHANPARAM [8].srcbidx = 8;
EDMA3CHANPARAM [8].dstbidx = 0;
EDMA3CHANPARAM [8].srccidx = 0;
EDMA3CHANPARAM [8].dstcidx = 0;
EDMA3CHANPARAM [8].link = 0xffff;
*EESR |= (1 << 18);
*ESR |= 1 << 18;
Semaphore_pend (Sem, BIOS_WAIT_FOREVER);
*CE4DATA = x;
}
void IntEDMA3 ()
{
Semaphore_post (Sem);
}
In the buffer we will assume numbers lie
0 1 2 3 4 5 6 7
x = 8;
In emif it can appear
0 1 2 3 4 5 8 6 7
I.e. the processor has time to push through number earlier than has finished EDMA.
How to be convinced, what EDMA has really transferred all data instead of has put them in turn on processing?
---------------------------
Узнай первым о новых переводчиках
PROMT 9.0 на http://www.promt.ru