Re:Facing issue on implementing the eDMA with DSPI peripheral in MPC5675KRM microcontroller

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Re:Facing issue on implementing the eDMA with DSPI peripheral in MPC5675KRM microcontroller

跳至解决方案
1,390 次查看
sachin_waghmare
Contributor II

Hi,
I'm Sachin Waghmare,

I am using the MPC5675KRM microcontroller. We are facing issue on implementing the eDMA with DSPI peripheral to transmit data over DSPI channel, I did't getting any clock pulse as well as data.

To transmit data through eDMA with DSPI peripheral the following sequence has been followed.

Kindly suggest if any thing is missed out in this sequence.


void initDSPI_A(void)
{
DSPI_1.MCR.R = 0x80010001; /* Configure DSPI_A as master */
DSPI_1.RSER.R = 0x03030000; /* DMA enable */
DSPI_1.CTAR[0].R = 0x780A7727; /* Configure CTAR0, Baud rate 17.6kHz */

DSPI_1.MCR.B.HALT = 0x0; /* Exit HALT mode: go from STOPPED to RUNNING state*/

/* Pad Config */
SIU.PCR[7].R = 0x0604; /* 7 sout, obe=1 */
SIU.PCR[8].R = 0x0504; /* 8 sin, ibe=1 */
SIU.PCR[6].R = 0x0604; /* 6 sck */
SIU.PCR[5].R = 0x0704; /* 5 cs0/ss */
}

 

 

void eDMA_TCD_DSPI_Master_Transmit_init(void)
{
/*** source settings ***/
EDMA_0.TCD[2].SADDR = (vuint32_t) &DSPI_Master_Transmit_Data; // source address - command_word
EDMA_0.TCD[2].SSIZE = 2; // 32-bit
EDMA_0.TCD[2].SOFF = 4; // addr increment after transfer in bytes
EDMA_0.TCD[2].SLAST = 0; // after major loop, do not change
EDMA_0.TCD[2].SMOD = 0; // source modulo feature not used

/*** destination settings ***/
EDMA_0.TCD[2].DADDR = (vuint32_t) &DSPI_1.PUSHR.R; // dest. address - command PUSH register
EDMA_0.TCD[2].DSIZE = 2; // 32-bit
EDMA_0.TCD[2].DOFF = 0; // no addr increment after transfer
EDMA_0.TCD[2].DLAST_SGA = 0; // after major loop, do not change addr
EDMA_0.TCD[2].DMOD = 0; // destination modulo feature not used

/*** counts ***/
EDMA_0.TCD[2].NBYTES = 4; // 4 bytes per minor loop
EDMA_0.TCD[2].BITER = 8; // major iteration count - lenght of message
EDMA_0.TCD[2].CITER = 8; // major iteration count - lenght of message

/*** linking ***/
EDMA_0.TCD[2].CITERE_LINK = 0; // disabled
EDMA_0.TCD[2].BITERE_LINK = 0; // disabled
EDMA_0.TCD[2].MAJORE_LINK = 0; // disabled
EDMA_0.TCD[2].MAJORLINKCH = 0; // disabled

/*** others ***/
EDMA_0.TCD[2].D_REQ = 1; // do not disable channel when major loop is done
EDMA_0.TCD[2].INT_HALF = 0; // interrupt is not used
EDMA_0.TCD[2].INT_MAJ = 0; // interrupt is not used
EDMA_0.TCD[2].E_SG = 0; // disable scatter/gather operation
EDMA_0.TCD[2].BWC = 0; // default bandwidth control- no stalls
EDMA_0.TCD[2].START = 0;
EDMA_0.TCD[2].DONE = 0;
EDMA_0.TCD[2].ACTIVE = 0; // initialize status flags

EDMA_0.DMASERQ.R = 2; // enable the channel
}

0 项奖励
回复
1 解答
1,369 次查看
sachin_waghmare
Contributor II

with the above mentioned code including the DMAMUX configuration.  I am getting the Destination write error though  EDMA_0.DMAES.R;

this register to solve that error the following things has been implemented in code,

PBRIDGE_0.MPROT0_7.B.MPROT2_MTW = 1;
PBRIDGE_0.MPROT0_7.B.MPROT2_MTR = 1;
PBRIDGE_0.PACR16_23.B.PACR17_SP = 0;
PBRIDGE_0.OPACR0_7.B.OPACR5_SP = 0;
PBRIDGE_0.OPACR16_23.B.OPACR23_SP = 0;

with this configuration, that error has been resolve, but still not getting the clock signal on the DSPI peripheral channel.

Kindly suggest the missed out things.

Thanks

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,370 次查看
sachin_waghmare
Contributor II

with the above mentioned code including the DMAMUX configuration.  I am getting the Destination write error though  EDMA_0.DMAES.R;

this register to solve that error the following things has been implemented in code,

PBRIDGE_0.MPROT0_7.B.MPROT2_MTW = 1;
PBRIDGE_0.MPROT0_7.B.MPROT2_MTR = 1;
PBRIDGE_0.PACR16_23.B.PACR17_SP = 0;
PBRIDGE_0.OPACR0_7.B.OPACR5_SP = 0;
PBRIDGE_0.OPACR16_23.B.OPACR23_SP = 0;

with this configuration, that error has been resolve, but still not getting the clock signal on the DSPI peripheral channel.

Kindly suggest the missed out things.

Thanks

0 项奖励
回复
1,370 次查看
sachin_waghmare
Contributor II

Hi, I have been enabled the DMAMUX as follow,

DMAMUX_0.CHCONFIG[0].R = 0x00;
DMAMUX_0.CHCONFIG[0].R = 0x83;

to transmit data.

0 项奖励
回复
1,383 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, your sample code omitted DMAMUX initialization, that is necessary. It is needed to enable channels and assign channel to DMA source request.

 

0 项奖励
回复