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.

RM57 SPI loopback analog mode

Other Parts Discussed in Thread: HALCOGEN

Hello.

I'm trying to test spi loop back in analog mode. I send an 1 byte data(any value), it returns 0 always. It works well in digital mode, I can receive an exact data what I send. I need some helps. This is my test code as below. I'm using CCS 6.0 and HALCoGen 4.0.1.

 

spiInit();
spiEnableLoopback(spiREG2, AnaLog_Lbk);
r = SPI_send(0xFF);


unsigned char SPI_send(unsigned char outb)
{
   while((spiREG2->FLG & 0x0200) == 0);
   spiREG2->DAT1 = outb | 0x100D0000;

   while((spiREG2->FLG & 0x0100) == 0);
   return((unsigned char)spiREG2->BUF);
}

  • Hello,

    Analog loop-back requires the TX signal to get all the way to the terminal (pin/ball) and then it gets looped back as the RX signal. This requires configuration of the output multiplexing controls to allow the related SPI2 signals to be output on the assigned terminals. It appears that this configuration is missing in your code.

    Please configure the muxes to output SPI2 signals and then try the above code.

    Regards, Sunil

  • Hello Sunil.

    Thank you for your reply. I don't know what configuration is more required except these 3, 'Enable SPI2 driver' on HALCoGen, 'spiinit()', 'enable loopback()'. I've used SPI on RM48 before, so I configured it similar way in RM57.

     Is it need a pinmux configuration? There is only MIBSPI item, is it needed even I use the normal SPI?

    Best Regards.

     

  • Hello Wonjae,

    There is a difference between the SPI2/MibSPI2 terminal assignments from RM48x to RM57x.

    RM48x:

    RM57x:

    As shown in the terminal function tables above, the SPI2 terminals are dedicated functions on the assigned balls in case of RM48x. These balls are shared between N2HET2 and MibSPI2 functions in case of RM57x.

    Therefore for RM57x you do need to additionally configure the output multiplexing to select MibSPI2 functions to be output on the assigned terminals. You can find the mux configuration control information in table 3-27.

    Regards, Sunil

  • Hello Sunil.

    I missed it. It is cleared, I can get an exact data.

    Thank you.