DSPRelated.com
Forums

EDMA -> McBSP0 -> Tx Data

Started by silver_sparrow May 12, 2003
Hi all,

I had probs with McBSPs before, and never resolved them.
Frustrated, I will attempt for help again.

I did examine the example code that CCS comes with for McBSP to
McBSP data transfer using a polling method, but would like to
use a EDMA/McBSP interrupt config.

So I am setting up for this, to get the working concept.

The setup:

'int type edmaOutbuff'-> EDMA -> McBSP0 -> Tx Data to pins

Everything for EDMA and McBSP is config in CSL and pre-init.
The code is below, and is quite short.

The prob: There is never an interrupt to trigger 'hwiEdmaIsr'
function. I would expect McBSP0 to trigger ready event to EDMA
then to CPU when finished each data transfer.

Can anyone help me see correctly here?
Thanks!

Chiko

****************************************************************
****************************************************************
****************************************************************

/* Skip header's
Define constants */
#define TCCINTNUM 10
/* Global variables used in interrupt ISRs */
volatile int transmitted = 0;
/*---------------------*/
#pragma DATA_ALIGN(edmaOutbuff,128);
Uint32 edmaOutbuff;
/*---------------------*/

void main() {

int wait=0; //counter used for wait

CSL_init();

MCBSP_enableSrgr(hMcbsp0);//Enable SRGR
for (wait=0; wait<0x10; wait++); /* Wait states after SRG starts */

EDMA_clearPram(0x00000000);

/* Setup & Init. interrupts*/
IRQ_nmiEnable();
IRQ_globalEnable();
IRQ_reset(IRQ_EVT_EDMAINT); //Resets Interrupt 8 @ CPU
//IRQ_EVT_EDMAINT = 8
IRQ_disable(IRQ_EVT_EDMAINT);
EDMA_intDisable(TCCINTNUM); //TCCINTNUM = 10 as set in EDMA config

IRQ_clear(IRQ_EVT_EDMAINT);
EDMA_intClear(TCCINTNUM);

IRQ_enable(IRQ_EVT_EDMAINT);
EDMA_intEnable(TCCINTNUM); edmaOutbuff = 0x00000000; //Data source EDMA will read from

/* edmaCfg1 = edma config handle
hEdmaTbl1 = PaRAM handle
*/
//EDMA_config(hEdmaCha12, &edmaCfg1);This is commented out b/c
done in CSL
//EDMA_config(hEdmaTbl1, &edmaCfg1); This is commented out b/c
done in CSL
//EDMA_link(hEdmaCha12, hEdmaTbl1); This is commented out b/c
done in CSL

EDMA_enableChannel(hEdmaCha12); /* Enable EDMA channel 12
[edmaOutbuff to DXR]*/

MCBSP_enableRcv(hMcbsp0); //Not needed I think
MCBSP_enableXmt(hMcbsp0);
MCBSP_enableFsync(hMcbsp0); //Not needed I think

/* Wait for 1000 events created by EDMA I think*/
*********When I run prog. we are stuck here below***************
while (transmitted < 1000);

/* All done now, close the port open by CSL_Init(). */
MCBSP_close(hMcbsp0);
EDMA_close(hEdmaCha12); /* close TxEDMA channels */
EDMA_freeTable(hEdmaTbl1);

}//End- main /*Hook this HW_INT 8 interrupt function the DSP/BIOS*/
/*Dispatcher used with default values -- is this good?? */
void hwiEdmaIsr(int arg){

if (EDMA_intTest(TCCINTNUM)) {
EDMA_intClear(TCCINTNUM);
edmaOutbuff++; //Data source to be written to EDMA->McBSP0
if(transmitted < 1000){
transmitted++; //Just a counter
}//End- if
}//End- if

}//End- hwiEdmaIsr

*******************************************************************
THE END