MPC5746 DSPI Extended Frame with continuous peripherial chip selection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5746 DSPI Extended Frame with continuous peripherial chip selection

761 Views
yong_zheng
Contributor I

Hello,DSPI module of MPC5746C supports extended frame, and i can receive and send multiple extended frames through DSPI.

But when i used the continuos selection format, it failed,the PCS port is not inactived after the last frame.

when i use the normal spi mode by setting xspi 0 with continuous selection format,i  can send multiple frames with the right wave of PCS,PCS port is active at the beginning of the first frame, and inactive at the end of the last frame.

I have noticed the datasheet,When transmitting multiple frames in this mode, the user software must ensure that
the last frame has the PUSHR[CONT] bit deasserted in Master mode.and I have done it.

In the 1338 page,the reference mentioned ,When Extended SPI Mode (MCR[XSPI]) is enabled, every CMD FIFO entry can have multiple TX FIFO entries attached to it. Thus a single CMD FIFO entry can be used to transmit multiple TX FIFO entries.

I have tried to deassert the PUSHER[CONT],but it falied. I want to know whether the extended frame support continuous selection format,and if it supports the feature ,then what should i do to inactivate the PCS port at the end of last frame? 

The figure3 displays extended frame tramission with continuous selection.

Labels (1)
0 Kudos
3 Replies

580 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I found out that this sequence works as expected (I used extended format 32bit):

    //write 16bit command with CONT bit set
    *(uint16_t*)(&DSPI_3.PUSHR.PUSHR.R)  = 0x8001;
    //write 16bit data
    *(uint16_t*)(((uint32_t)&DSPI_3.PUSHR.PUSHR.R)+2)  = 0x1111;
    //write 16bit data
    *(uint16_t*)(((uint32_t)&DSPI_3.PUSHR.PUSHR.R)+2)  = 0x2222;
    while(DSPI_3.SR.B.CMDTCF == 0);    //wait for command completion
    DSPI_3.SR.R = 0x00800000;    //and clear the flag

    //write 16bit command with CONT bit set
    *(uint16_t*)(&DSPI_3.PUSHR.PUSHR.R)  = 0x8001;
    //write 16bit data
    *(uint16_t*)(((uint32_t)&DSPI_3.PUSHR.PUSHR.R)+2)  = 0x3333;
    //write 16bit data
    *(uint16_t*)(((uint32_t)&DSPI_3.PUSHR.PUSHR.R)+2)  = 0x4444;
    while(DSPI_3.SR.B.CMDTCF == 0);    //wait for command completion
    DSPI_3.SR.R = 0x00800000;    //and clear the flag

    //write 16bit command with CONT bit cleared
    *(uint16_t*)(&DSPI_3.PUSHR.PUSHR.R)  = 0x0001;
    //write 16bit data
    *(uint16_t*)(((uint32_t)&DSPI_3.PUSHR.PUSHR.R)+2)  = 0x5555;
    //write 16bit data
    *(uint16_t*)(((uint32_t)&DSPI_3.PUSHR.PUSHR.R)+2)  = 0x6666;
    while(DSPI_3.SR.B.CMDTCF == 0);    //wait for command completion
    DSPI_3.SR.R = 0x00800000;    //and clear the flag

This code transmits three 32bit words and the chip select is deasserted at the end of transmission as expected.

Hope this helps.

Regards,

Lukas

580 Views
yong_zheng
Contributor I

Thanks for your reply, I have tried the sequence you mentioned,  and it worked perfectly !

0 Kudos

580 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can see the same behavior on my side. Let me check if some special sequence is needed or if it is a bug.

Regards,

Lukas

0 Kudos