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/LAUNCHXL2-RM46: MIBSPI1 TO MIBSPI3 TRANSFER ISSUE

Part Number: LAUNCHXL2-RM46
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

I AM NEW TO THIS AND HENCE NEED TO KNOW THE FOLLOWING

1. I AM USING HALCOGEN AND I DID THE FOLLOWING IN IT

CREATED A NEW PROJECT

ONLY ENABLED DRIVERS FOR MIBSPI1 AND MIBSP3

PINMUX >>> SELECTED MIBSPI1 AND MIBSPI3

MIBSPI1TRANSFER GROUP>>>> SELECTED CS_NONE (I AM USING MIBSPI IN 3 PIN MODE)

MIBSPI3GLOBAL>>> UNCHECKED MASTERMODE AND INTERNAL CLOCK (MIBSPI3 IN SLAVE MODE)

MIBSPI3PORT>>> UNCHECKED DIR FOR SIMO; UNCHECKED DIR FOR CLK

2. I AM USING CCS AND HAVE WRITTEN THE FOLLOWING CODE TO TRANSFER DATA IN A AND RECEIVE IT IN B USING MIBSPI3, BUT I AM UNABLE TO RECEIVE THE DATA

#include "mibspi.h"


uint16 a[8]={1,2,4,6,10,12,15,16};
uint16 b[8]={0};


int main(void)
{
/* USER CODE BEGIN (3) */
    mibspiInit();
    mibspiSetData(mibspiREG1, 0, a);
    mibspiTransfer(mibspiREG1, 0);
    mibspiGetData(mibspiREG3, 0, b);

}

KINDLY HELP FOR THE ABOVE, I AM THANKFUL

  • Hello Rohan,

    Did you have a look at the example provide with HalcoGen for Master-Slave transfer. It is located at

    C:\ti\Hercules\HALCoGen\v04.06.00\examples\RM46x\example_spi_Master_Slave.c

    Although it uses different SPIs it should still serve as a good example and should be easily portable to SPI1 and SPI3. Also, since you are not using the buffered feature of the SPI (the Mib part), you can use only the SPI1 and SPI3 tabs and associated SPI drivers to make life easier for you when you port the example to SPI1 and SPI3.
  • Dear Chuck,

    I will be using the multi buffer part in my project but firstly I would like to get this up and running, then I will do the little tweaks later.

    Hence, I would really appreciate if you can help me out with this one.

    Also, With reference to the Hercules Example you mentioned, I tried that before this and also unable to receive data in that too. So kindly let me know.

  • Hello Rohan,

    Can you zip your project or a simplified version with just the MiBSPI portion and post it to this thread so I can have a look at it in more detail and potentially test it on my bench?
  • 2816.mibspicheck.zipHi,

    I am Sending the Zip file for the project here. Kindly let me know if you find something amiss.

  • Kindly Help us finish this.

  • Rohan, did you wire up the two SPI busses?
    I'll try and replicate on a RM46...
  • Hello Rohan,

    Sorry for the delays. I will have a look at this today.
  • Rohan,

    I've had a look at your project. A minor observation was I noticed that MibSPI1 CS0 was not configured as a GIO in the Halcogen setup, This shouldn't have been too critical but you should configure as GIO if not using in functional mode per the instructions.

    The main observation is that your setup in main is not correct. You never initialize the data format registers and I think the calls are not quite right. Please review the example of SPI master-slave implementation provided in the Halcogen example library under help. Although you are using MibSPI, the calls and sequencing should be the same because you are using MibSPI in SPI compatibility mode (without the buffered spi feature). Note that the driver taps in Halcogen for SPI1 and SPI3 do the same using the same module as MibSPI1 and MibSPI3 just in SPI compatibility mode (without buffered SPI).