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.

AM263P4: MCSPI Transfer

Part Number: AM263P4
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello,

I am currently working with AM263P4 on custom board.

I am using two SPI peripheral to drive PMIC and TLE9104SH. PMIC spi transfer is working correctly but I can not send data for TLE9104SH.

You can see my Sysconfig below. I have seven TLE9104 modules. Therefore, I will not use CS pin. I am driving CS pin from GPIO pins.


After this initialization, I used some examples from launchpad. You can see my code below. When I look MOSI pin(D0) with oscilloscope, I did not catch any signal. I did not find the error for a while so what am I doing wrong?



Best Regards,
BK

  • I tried sending data with 4 pin mode but I did not use SPI0_CS0 pin for chip select. I set/reset chip select from GPIO pins. I can send data but I can not set TLE9104. I guess that there are problems which is TLE9104 is broken or chip select signal is not working as I expected. I will keep working on this.

  • Hi Basri,

    I've added the software expert to this thread to review your code.

    In the scope shots you have attached, I assume the purple trace is the SPI0_CLK. What are the yellow traces in each image?

    Regards,

    Brennan

  • Hi Brennan,

    I miss clicked "This resolved my issue" but I could not fix this yet.

    Yes, you are right. Purple traces are SPI0_CLK and yellow traces are SPI0_D0 (MOSI pin for sensor).

    I checked datasheet of TLE9104 and it use 16 bit SPI interface and If you want to send more than 16 bit data, you have to send them separately while controling CS pin of chip. Therefore, I send 0x8780 and after that 0x0700 to read global status register but recieve buffer values are meaningles. Return values from chip are not belong to global status register (0x07).

    In brief, I can send spi data from AM263P4. If I can not set sensor as expected, it is my problem... I just want to know that is there a trick to control chip select pin from GPIO peripherals instead of SPI0_CS? 



    Best Regards,
    BK

  • Hi Kaya,

    You can use GPIO instead of SPI0_CS.  Please refer mcspi_loopback example and check spiTransaction parameter.