RX231 to SH7216 transfer data by RSPI



I trying to build SPI communication between the RX231(Master) and Sh7216(Slave).

I'm used the each sample code to try it.

But Sh7216 Slave SPI cannot read data from RX231

If RX231 Sample Code hasn't modified,Sh7214 how to read data from RX231 by SPI channel.


RX231 Sample Code: https://www.renesas.com/zh-tw/software/D6000896.html

SH7216 Sample Code: https://www.renesas.com/zh-tw/software/D3001245.html



  • Hi BenSu,

    Any updates with your issue? Have you already solved it?

    RenesasRulz Forum Moderator
  • In reply to JB:


    No, I'm not solved this question yet.

    I try to do this, but it not effect.

    I think I missed check SSL0 before read data from MOSI.

    But I can't find this status flag or register bit in User's Manual

    void main(void){
    int i, j;

    /* ==== PFC ==== */
    PFC.PACRL1.BIT.PA2MD = 0x5; /* SSL0 */
    PFC.PACRL1.BIT.PA3MD = 0x5; /* MISO */
    PFC.PACRL2.BIT.PA4MD = 0x5; /* MOSI */
    PFC.PACRL2.BIT.PA5MD = 0x5; /* RSPCK */

    /* ==== CPG ==== */
    STB.CR5.BIT._RSPI = 0; /* RSPI active */

    /* ==== RSPI ==== */
    RSPI.SPCR.BYTE = 0x00;
    RSPI.SPPCR.BYTE = 0x30;
    RSPI.SPBR.BYTE = 0x02;

    RSPI.SPDCR.BYTE = 0x00;
    RSPI.SPCKD.BYTE = 0x00;
    RSPI.SSLND.BYTE = 0x00;
    RSPI.SPND.BYTE = 0x00;
    RSPI.SPSCR.BYTE = 0x00;
    RSPI.SPCMD0.WORD = 0x0701;

    RSPI.SSLP.BYTE = 0x00;

    RSPI.SPCR.BYTE = 0x40;

    *read_data++ = (unsigned char) RSPI.SPDR.WORD;

    Best wish

  • In reply to BenSu:


    Have you resolved your issue?

    Mike Clements
    RenedadRulz Moderator
  • In reply to BenSu:

    This thread will be achived due to inactivity.

    Mike Clements
    RenesasRulz Moderator