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: 3.5 TFT LCD INTERFACING PROPLEM WITH tms570ls0432

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello, I am using tms570ls0432 and interfacing with 3.5inch tft lcd from waveshare using spi protocol,

I am not able to send the reg and data from spi protocol,

I am using spi2 and i made a configration as mosi,clk,cs(0) as output and miso as input. and i am using spiTRansmitData() function.

if we are connecting to external slave device how to enable the external pin for reading the data 

if in spitransmitdata insteead of spi->BUF is there any other command for eeprom to write the data,

lcd is showing only white background means backlight,

and how to use chip select function for making cs high and low...

thank you

  • Hello,
    I am assuming you are using HALCoGen.
    In HALCoGen you should set:
    in Driver Enable Tab:
    - Unmark all drivers;
    - Check Enable SPI2 driver;
    In PINMUX Tab:
    - check SPI2 checkbox;
    In SPI2 --> SPI2 Data Formats Tab:
    - set Charlen to needed length in Data Format 0 section;
    In SPI2 --> SPI2 Port Tab:
    - Set SPI2 SOMI as input and Pin Mode as SPI functional;
    - Set SPI2 SIMO as output and Pin Mode as SPI functional;
    - Set SPI2 CLK as output and Pin Mode as SPI functional;
    - Set SPI2 SCS[0] as output and Pin Mode as SPI functional.

    Set unused pins as GIO.

    Wiring:
    Master pin Slave pin
    SIMO-------->SIMO (MOSI or SDI on some devices);
    SOMI<--------SOMI (MISO or SDO on some devices);
    CLK---------->CLK
    CSn--------->CSn

    If you set SCS[0] to be functional (not GIO) SPI module will toggle it when needed. By default it is active low . In Master mode you can change to active high by changing CSNR field of SPIDAT1.

    More information about SPI module you can find in device TRM, Section 21: www.ti.com/.../spnu517c.pdf

    In CCS:
    - call spiInit() before using any function related to SPI module.


    It is not possible to read/write data direct from/to EEPROM using spiTransmitData .

    You can use TI FEE driver to read/write EEPROM. Information how to use FEE driver could be found in ..\Hercules\HALCoGen\version\Docs\ folder.

    I hope this helps.

    Best regards,
    Miro
  • Thanks for the Reply,
    whatever procedure you are mentioned, I already configured it,I want to know about little more description of SpiTransmitData()
    void SPI4W_Write_Byte(uint16 DATA)
    {

    /* spiDAT1_t dataconfig1_t;

    dataconfig1_t.CS_HOLD =FALSE;
    dataconfig1_t.WDEL = TRUE;
    dataconfig1_t.DFSEL = SPI_FMT_0;
    dataconfig1_t.CSNR = 0xFE;
    */

    /* Enable CPU Interrupt through CPSR */
    _enable_IRQ();
    spiInit();
    // spiEnableLoopback(spiREG2,Digital_Lbk);
    if(SpiTxStatus(spiREG2) != 0)
    {
    //spiTransmitData(spiREG2,&dataconfig1_t,8,&DATA);
    while ((spiREG2->FLG & 0x0100) == 0); // Wait until TXINTFLG is set for previous transmission
    spiREG2->DAT1 = DATA | 0x100D0000;
    }
    }
    can this function work properly????
  • Hi,
    spiTransmitData transmits data using polling method. In your code you are using spiTxStatus function where tx_data_status is returned. tx_data_status value is assigned in interrupt handler and Tx interrupt is not enabled by default. If you want to use interrupt method to send data check spiSendData function. You don't have to call spiInit every time data has to be send. Usually spiInit is called only once in main.c .
    Assigning Dh to CSNR field in SPIDATx register makes CS1 active low and you mentioned that CS0 is the one you want to use. If CS0 need to be active low the value assigned to CSNR field must be Eh.
    Also you set CSHOLD bit. This will hols CS active between transmissions.


    Best regards,
    Miro