This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI slave with DMAX

Other Parts Discussed in Thread: SPRC223

Hi,

      I want to use SPI0 as slave and it has to use DMAX for data transfer.To test this i connected SPI1 with SPI0 on EVM-C6727 board.I configured SPI1 as master

and SPI0 as slave.I observed SPI0 is able to receive data whatever i send through SPI1 with out dmax.

     Then i introdused DMAX to transfer SPIOBUF register contents to one internal buffer(dmaxDest).

I configured DMAX with lopriority EVENT-13 and parameter entry -0 .But internal buffer(dmaxDest) is not updating ,only SPIOBUF contents are changing when i try to

send 16-bit word from SPI1.

I do not know what was missing in DMAX configuration.I am sharing the code  

 

 

 

 

 

/* Variable to check the Transfer Complete Interrupt generated */

 

 

 

 

 

 


Uint32 dmaxTcValue = TC_PASS;

/* Interrupt handle */
CSL_IntcHandle hIntc;
CSL_IntcEventEnableState eventStat;
CSL_IntcDispatcherContext intcDispatcherContext;

/* DMAX */
CSL_DmaxObj dmaxEvent;
CSL_DmaxHandle hDmax;
CSL_DmaxHwSetup hwSetupDmax;
CSL_DmaxGPTransferEventSetup gpxfrEventSetup;
CSL_DmaxGPXFRParameterSetup gpxfrParameterSetup;

/* Data buffers */
Uint32 dmaxDest;
/* status variable */
CSL_Status status=CSL_SOK;

void main(void)
{

CSL_intcSetVectorPtr (ISTP_VECTOR_VALUE);
/* Initialize DMAX CSL module */
status = CSL_dmaxInit (NULL);

if (status != CSL_SOK) {
return status;
}

/*Relocating Interrupt Vector Table */
CSL_intcSetVectorPtr (ISTP_VECTOR_VALUE);

/* Low Priority Event1 */
//dmaxEvent.eventUid = CSL_DMAX_LOPRIORITY_EVENT1_UID;
dmaxEvent.eventUid = CSL_DMAX_LOPRIORITY_SPI0RX_UID;

/* Low Priority Parameter entry0 */
dmaxEvent.paramUid = CSL_DMAX_LOPRIORITY_PARAMETERENTRY0_UID;

/* DMAX Handle by calling CSL_dmaxOpen Call */
hDmax = CSL_dmaxOpen (&dmaxEvent, CSL_DMAX, NULL, &status);

if (status != CSL_SOK || (hDmax == (CSL_DmaxHandle) CSL_DMAX_BADHANDLE)) {
status = CSL_ESYS_BADHANDLE;
return status;
}

hDmax->regs->DELPR = 0x2000;
hDmax->regs->LoPriorityEventTable.EVENT13 = 0x302A0A2;
hDmax->regs->LoMaxParam->WORD0 = (unsigned int)&dmaxDest;
hDmax->regs->LoMaxParam->WORD1 = (unsigned int)&dmaxDest;
hDmax->regs->LoMaxParam->WORD2 = SPIBUFSIZE;
hDmax->regs->LoMaxParam->WORD3 = SPIBUFSIZE;
hDmax->regs->LoMaxParam->WORD4 = (unsigned int)&dmaxDest;
hDmax->regs->LoMaxParam->WORD5 = (unsigned int)&dmaxDest;
hDmax->regs->LoMaxParam->WORD6 = (unsigned int)&dmaxDest;
hDmax->regs->LoMaxParam->WORD7 = (unsigned int)&dmaxDest;

hDmax->regs->DEPR = 0x2000;
hDmax->regs->DEER = 0x2000;

}

please help me regarding this

Thanks & Regards,

Ajay Reddy.