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.

CCS/TMS570LS0432: MibSPI communication setup

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello,

I'm testing the basic functionality of MibSPI, where I connect MISO and MOSI of MibSPI ( creating an external loopback), I do know that there is a function available for loopback, yet I'm connecting it physically to make sure the connection is established and nothing is going wrong anywhere. I send the values through MOSI and try to read it from MISO, but I ain't getting the values.

I have attached the code written and the console results, do guide me on where am I going wrong.

Thank you5430.ti_2.txt

  • Hi,
    You should change:
    mibspiSetData(mibspiREG1,0,trans_data); to mibspiSetData(mibspiREG1,0,&trans_data[0]);
    mibspiGetData(mibspiREG1,0,TG0_RX_DATA); to mibspiGetData(mibspiREG1,0,&TG0_RX_DATA[0]);
    move to the end and change:
    printf("recieved value is: %u\t\n", TG0_RX_DATA); to printf("recieved value is: %u\t\n", TG0_RX_DATA[0]); (this will print only the first member of the array. If you want all members to be printed you will need a loop )

    If this does not help, please send your HALCoGen project (*.hcg and *.dil)

    Best regards,
    Miro
  • 5483.SD_mibspi.rarHello,

    Thank you, this almost solved the problem. But it doesn't seem to print the unsigned int value (I used the %lu datatype specifier in the printf statement, yet it isn't printing right value) ,

    whereas when used for int, it works fine. I have attached the screenshot in both int and unsigned int cases.I have also attached the *.hcg and *.dll file

    Attachments :

  • Hello Miro,

    I looked upon it, The charlen was set to 8 bits and hence I was getting the error. Now I have changed it to 16 bits and it works fine.

    Thank you.
  • Thanks for feedback....

    Best regards,
    Miro
  • H0827.SD_mibspi.rar ello Miro,

    I'm encountering a problem,the data sending is getting shifted by 16 bits or after 8 bits of data, 0 is sent (alternatively) I'm not able to receive the correct values on MISO (external wiring between pin J8-2 and J9-2 is made).I have set charlen to 8 bits, yet the same problem persists.

    Do tell me where is the issue?

    I have attached the code file.

    Thankyou

  • Hello,
    Change trans_data to be uint8 if you want 8 bit data to be send. Do the same for rec_data.
    change mibspiSetData(mibspiREG1,0,&trans_data[1]); to mibspiSetData(mibspiREG1,0,&trans_data[0]);

    Best regards,
    Miro