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.

Useable SPI interface on C6748 LCDK?

Other Parts Discussed in Thread: OMAPL138

Hi there,

I want to use an SPI interface on the C6748 LCDK evaluation board. Unfortunately there is no info about it in SPRT633, and also not on the wiki page http://processors.wiki.ti.com/index.php/L138/C6748_Development_Kit_(LCDK).

The C6748 DSP has two Serial Peripheral Interface Ports (SPI0, SPI1).

Only the finger print sensor is mentioned, which afair was connected through SPI. The block diagram states a connection through SPI1. SPI0 is not listed there.

Even though there are schematics in sprcaf4_LCDK.zip (VER A7E) I could not figure out if SPI0 or SPI1 can be used on this board. Some signals seem to be connected to connector J16. A also could not find connector J16 on the board, and unfortunately the Assy_bot.pdf and Assy_top.pdf cannot be searched for those names.

Finally with help of the BOM entry "CONN FPC/FFC 36POS .5MM VERT ZIF, Molex" I could find it. It is the camera cable connector next to the yellow composite socket which indeed is labeled "J16". Is this correct?

Any guidance is very much appreciated. Thanks!

Best regards,
Matthias


  • Finally with help of the BOM entry "CONN FPC/FFC 36POS .5MM VERT ZIF, Molex" I could find it. It is the camera cable connector next to the yellow composite socket which indeed is labeled "J16". Is this correct?

    Yes. You can take out the SPI1 pins in J16 connector which is for camera.


    You can use SPI0 also but its shared with Ethernet MII pins, so you have to remove & mount some of resistors to use the SPI0 (disabling the ethernet support)
    Connect 0 ohms resistors for R214,R215,R216 and remove R184,R179,and R178.
  • Good morning Titus,

    thank you very much for your answer.
    I think that I will go for the approach using SPI1 then as we might still want to use Ethernet for TCP/IP communications.

    Cheers,
    Matthias
  • Dear Matthias,
    Very good morning to you.
    Superb. Thanks for your update.
  • Hello Titus,

    I have two sort questions regarding the usage of SPI1 in master mode.

    I only want to use the 3-pin configuration, i.e. MISO, MOSI and SCLK.
    The platform code for SPI - SPIPinMuxSetup also sets PINMUX3_SPI0_ENA_ENABLE.
    Can I leave it like this? The ENA pin does not seem to be connected anyway. Or should I replace the code?

    What about the Chip Select signal. If I read the manual correctly I'd say one has to manage the CS signals for the slaves self, i.e. with GPIO signals as the provided CS signals for the C6748 being operated in slave mode. Is SPI1CSPinMuxSetup therefore only applicable in slave mode? I mean I don't really want to select a *Slave* Chip Select(CS) pin then, right?

    Thank you,
    Matthias
  • I only want to use the 3-pin configuration, i.e. MISO, MOSI and SCLK.

    The platform code for SPI - SPIPinMuxSetup also sets PINMUX3_SPI0_ENA_ENABLE.

    Can I leave it like this? The ENA pin does not seem to be connected anyway. Or should I replace the code?

    You can leave it, don't want to change the code.

    /* value to configure SMIO,SOMI,CLK and CS pin as functional pin */

    #define SIMO_SOMI_CLK_CS        0x00000E04

    What about the Chip Select signal. If I read the manual correctly I'd say one has to manage the CS signals for the slaves self, i.e. with GPIO signals as the provided CS signals for the C6748 being operated in slave mode. Is SPI1CSPinMuxSetup therefore only applicable in slave mode? I mean I don't really want to select a *Slave* Chip Select(CS) pin then, right?

    Nope, master is also need CS pin for SPI transfers.

    Master will assert the CS to select the slave device.

    C:\ti\OMAPL138_StarterWare_1_10_04_01\examples\lcdkOMAPL138\spi\spi.c

    static void ResetCommand(void)

    {

    // Issue Reset Command

    tx_data[0] = 0x80;

    tx_data[1] = 0x14;

    tx_data[2] = 0xBA;

    tx_data[3] = 0x07;

    tx_data[4] = 0x00;

    tx_data[5] = 0x00;

    tx_data[6] = 0x00;

    tx_len = 7;

    rx_len = 7;

    SPIDat1Config(SOC_SPI_1_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), 0x4);

       SpiTransfer();

    }

  • Thank you for the clarification, Titus.

    That CS is required, is clear. I just was not sure if the control over CS was done by the SPI controller itself.

    For futher clarification:

        /*
        ** Using the Chip Select(CS) 0 pin of SPI1 to communicate with the Fingerprint Sensor.
        */
        SPI1CSPinMuxSetup(2);

    Is "Chip Select(CS) 0 pin" a typo and "pin 2" meant, i.e. is *slave* chip select pin SPI1_SCSn_2 used then?

    Edit: initial confusion came from SPRS590F, section 6.17:

    "The optional SPIx_SCS (Slave Chip Select) pin is most useful to enable in slave mode when there are other slave devices on the same SPI port. The device will only shift data and drive the SPIx_SOMI pin when SPIx_SCS is held low."

    Cheers


  • /*
    ** Using the Chip Select(CS) 0 pin of SPI1 to communicate with the Fingerprint Sensor.
    */
    SPI1CSPinMuxSetup(2);

    Is "Chip Select(CS) 0 pin" a typo and "pin 2" meant, i.e. is *slave* chip select pin SPI1_SCSn_2 used then?

    Yes, it is TYPO only in the code comment.
  • Hello Titus,
    thank you for elaborating on that. I continued reading in SPRUFM4 ("TMS320C674x/OMAP-L1x Processor Serial Peripheral Interface (SPI) User's Guide") now as this provides a more detailed understanding of the SPI interface. Especailly section "2.8 SPI Operation: 4-Pin with Chip Select Mode" provides information why use of the SPIx_SCSN[n] can be useful!
    Matthias