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.

Changing PINs on SPI starterware

Other Parts Discussed in Thread: AM3358

Hi guys,

I am using a SPI for communication with our sensors. There is one register on sensor, which is known as WHOAMI and when I send there 0x75 | 0x80, I should reacieve a value of 0x68. When I used this configuration "MCSPI_DATA_LINE_COMM_MODE_1" and the connection is SPI_D0 as MOSI and SPI_D1 as MISO, evertything is working properly, but when I try to change these pins (SPI_D1 as MOSI and SPI_D0 as MISO) and change configuration to "MCSPI_DATA_LINE_COMM_MODE_2", my analyzer always shows me that I transmitted and received the correct values, but in my buffers and registers on an AM3358 looks, that the communication is working in loopback, so I have in transmit register and receive register the same values, the transmit ones. How you can see, my code is depended on your example "mcspiFlash". Do you anybody have an idea where do I have an mistake?

And second questiong. I am using the SPI0, but I need to hae SPI0_CS1 instead of SPI0_CS0. I cannot find in which mode I should set up the GPIO.

Can you please help me?

Thank you, Stan

  • Ok Guys, so i resolved the first part of my problem with  "MCSPI_DATA_LINE_COMM_MODE", with MODE3, everything seems to work properly if I am using SPI0_CS0, but I still have a troubles with SPI0_CS1. My mus setting is shown bellow. I assumed that if I just change CONTROL_CONF_SPI0_CS0 for CONTROL_CONF_SPI0_CS1, the SPI communication will use the CS1, but it is not. Can you please give me advice? Thanks

    HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_CS1) =
    (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL |
    CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE);


  • I got it, I have a solution right now....the thing with "MCSPI_DATA_LINE_COMM_MODE" was one part of story and second was the channel. SO if anybody is curious, for SPI0_CLK, SPI0_MOSI(D0), SPI0_MISO(D1) and SPI0_CS1, one of the settings which is actually working is "MCSPI_DATA_LINE_COMM_MODE3" + channel 1. But if I still have somewhere mistake, please, let me know.