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.

LAUNCHXL-F28069M: f2806x\examples\c28\mcbsp_spi_loopback pin connections ?

Part Number: LAUNCHXL-F28069M


Hi,

Looking at the example, the pins as I see, appear to translate thus:

/**
 * 	Pin			GPIO	McBSP	Signal	SPI		equivalent		status
 * -----------------------------------------------------------------------------
 * - Pin#08 - GPIO22 - MCLKX - SPICLK  (master) SCLK
 * - Pin#49 - GPIO23 - MFSX  - SPISTE  (master) CS
 * - Pin#45 - GPIO20 - MDX   - SPISIMO			MOSI
 *
 * - 		  GPIO58 - MCLKR - SPICLK  (slave)	SCLK			unused
 * - Pin#18 - GPIO44 - MFSR  - SPISTE  (slave)	CS				unused
 * - Pin#48 - GPIO21 - MDR   - SPISOMI 			MISO			unused
 *
 * By default for the McBSP examples, the McBSP sample rate generator (SRG)
 * input clock frequency is LSPCLK 80E6/4.
 *
 * \b Watch \b Variables: \n
 * - sdata1 - Sent data word(1)
 * - sdata2 - Sent data word(2)
 * - rdata1 - Received data word(1)
 * - rdata2 - Received data word(2)
 */

I have a few questions:

#01.

I see only the Master pins being used ?

#02.

I dont see any pin connections between the Master and Slave, for the loopback to be complete ?

#03

It appears that there are 2 Master's and 2 Slave's from the 2 data variable pairs: sdata1, sdat2, rdata1, rdata2 ?

But from the example description, there appears to be one Master and one Slave ?

Can somebody please clarify ?

Thanks,

Manu

  • #1
    There is only one set of pins for the SPI mode of McBSP, - MCLKX, MDX, MDR, and MFSX regardless if master or slave mode is used.
    The comments about MCLKR and MFSR as "(slave - not used for this example)" is incorrect. It should just state that these pins are not used in SPI mode of the McBSP. Refer to the TRM http://www.ti.com/lit/spruh18 in the section titled: "SPI Operation Using the Clock Stop Mode" for more information on this.

    #2
    Loopback is done internally with the DLB bit being set. Wiring up the connections are not necessary, but you can still observe the signals on the scope.

    #3
    There are not 2 masters and slaves. that is just data words 1 and 2 being sent and received. check out how those variables are used later in the example and this should be clear.

    Regards,
    Mark
  • Hi Mark,

    Your comments match what's described in the TRM. Was slightly overwhelmed by the MCBSP module, additionally seeing the comments in the example code; thought those comments might be more relevant and added to the confusion.

    As for the comments, there is a ton of them in different examples; some of the comments explaining the self explanatory themselves; many of which cause nothing but confusion. A shorter and concise set of comments would have helped and reduced coding time!

    Just to cite an example, while going through it:
    //
    // Skipped for this example. For this example, only enable the GPIO for
    // McBSP-A
    //InitGpio();
    InitMcbspaGpio();

    There's so much noise in the example code, that one really misses out the actual code too .. Additionally, it gives an overall feeling that the code is quite complex. While the function name itself is self evident, that it is Initializing the Mcbspa gpio. I wonder, what the author would have been thinking, when he wrote those comments.

    Maybe it might be just me, Please excuse me if I seem unnecessarily noisy.

    Actually your comments clarified the issue very much precisely.

    Thanks,
    Manu