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.

MibSPI is not working in TMS570LC4357

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Hi TI,

I am using TMS570LC4357 HDK. And Halcogen 04.04.00, and CCS 6.0.1.00040.


I want to use the MibSPI peripheral to transfer data using Multi-Buffer RAM.

I just used the Halcogen Developed code for this purpose and add my code in the main().

But when I probe the pins (MibSPI1_CLK (@F18), MibSPI_SIMO(@F19)), I cannot find either CLK pulses or SIMO data in the scope.

I configured the Baudrate of MibSPI1 Data Format0 as 20MHz (max as per trm).

And other configurations like One Shot Transfer, TRIGGER_ALWAYS and TRIG_SOURCE_DISABLED.

So that My software can do trigger to initiate SPI Tranfer. I did all the configurations needed. But still I cannot find the output.

I cannot predict why it is not working. Please anybody guide me where I am missing.

I have given my project (CCS + Halcogen) for your reference. Please anybody go through it and help me.

8738.MibSPI.zip

Thanks in advance.

Regards,

Karthikeyan.K

  • Hi Karthikeyan,

    Our MibSPI expert will get back to you.

    Regards,
    Sunil

  • Karthikeyan,

    I was able to run your code on my HDK setup and it is working perfectly.

    I can see the MIBSPI1CLK on J9-6 and MIBSPI1SIMO on J9-11

    On which connector are you trying to probe these signals?

  • Hi Jean-Marc,

    Thanks for your fast response.
    I'm using TMS570LC4357 Hercules Development Kit. And I also probe the same pin that you probed.

    Technically Pin F18 @ J9-6 as SPICLK, PinF19 @ J9-11 as SIMO.
    Here I cannot get the waveform. Whenever I typed in serial port, Just a Pulse (Single Pulse alone) comes. After that pulse line remains dead.

    In SPI Transfer Group 1, I am trying to transfer 8 elements. But I am just getting only one pulse alone.

    Did you make any changes (even a single change) in my code to work?

    Regards,
    Karthikeyan.K
  • Hi Jean-Marc,

    Really I don't make any changes to the project file uploaded. But It is not working for me. I am getting just only one positive pulse in SPI1CLK Pin (J9-6), and some two or three noisy pulses in SPI1SIMO Pin (J9-11). If you did any changes, please specify it. Or else can you please upload the working example project for MibSPI to transfer just 8 bytes of data through SPI1SIMO Pin using Multi-Buffer concept.
    It will be really helpful to me.
    Of course I am also monitoring the same pins J9-6, and J9-11 of my TMS570LC4357 Hercules Development Kit.
    Please help me in this.

    Regards,
    Karthikeyan. K
  • Karthikeyan,

    I have not even re-compiled your code. I'm using your out file and I can see the 8 data transfer on the scope.

    Using 20Mhz for the SPI clock is the max limit as master. Maybe in order to debug your problem, try to reduce the clock, let say 2Mhz.
    It will be easier to probe.

    Also you can try, to use the MIBSPI is GIO mode just to see if you can control SIMO and CLK manually.

    To do so, once the MIBSPI is initialize, using the register view, expand MIBSPI1.

    Locate Fun Register and make it 0x0000_0000 (All GIOs)
    Locate Dir Register and make it 0x0000_0200 (CLK as output)
    Locate Set Register and make it 0x0000_0200 (force 1 on CLK) and check on the scope.
    Locate Clr Register and make it 0x0000_0200 (force 0 on CLK) and check on the scope.

    You can repeat this test with SIMO pin. (Use 0x0000_0400 instead of 0x0000_0200)

    Please have a try and let me know the result.

  • Hi Jean-Marc,

    I am really surprising, that my code is working in your HDK but not in mine.
    I did accessing those FUN, DIR, SET, CLR registers in Register View. (Using Debugger window)

    And by modifying them I can make those CLK and SIMO Pins to toggle.
    And also I did the same in the code itself. I code like CLK and SIMO Pins are GPIO and I did SET and CLEAR them whenever I typed in the terminal window. This also working.

    So my SPI1CLK and SPI1SIMO[0] pins are working when GPIO mode. But They are not performing well when configured as SPI Functional.

    Another observation:
    When I Configure TransferGroup0 as Continuous mode (instead of One Shot), I can see the SPI Clock signal and Data as soon as I typed in the Terminal window. But It is Continuous. So It keeps on sending SPI DATA. I doesn't want this behaviour.

    So as OneShot mode only it is not working.

    So What could be the problem?

    Regards,
    Karthikeyan.K
  • Karthikeyan,

    The Oneshot mode will need a new trigger for each group transfer.
    Like I said, it is working on my side without any modification in your code.

    Have you tried to reduce the SPICLK just to make a try?

    If the gio mode for MIBSPI1 is working, I don't see any reason for real MIBSPI transfer to work.

    Something else you can check is the MIBSPI RAM Receive buffer. Before the transmission, all buffers should be 0x0000 for the data field (low 16 bits)
    After the transfer, if there is no connection in the SOMI pin, the MIBSPI should receive all 1s (Because of the default pullup on SIMO.
    This is what I can see when I run your code on my HDK. That means, the MIBSPI is also able to receive.

    Please check that and let me know.

  • Hi Jean-Marc,

    Really very thanks for your support. I found what the problem is.
    Actually I cannot see the SPI Waveform in the Scope and it's because the timing settings in the scope.
    I configured SPI with 20MHz, means that One pulse duration will be 50ns. So to send 8 * 8bits of data, SPI bus will take 3200 ns = 3.2 us.
    So upto this duation only I can have my transaction is the bus.

    But I made my Scope timing as 200ms, and then tried to catch the SPI Waveform. So only I was having a single pulse in the SPIClk and SPISIMO lines since my scope have the less amount of samples.
    Silly mistake.

    But anyhow you helped me a lot.

    Thanks Sir.

    Regards,
    Karthikeyan.K