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.

TLC6C5712-Q1: Led driver configuration issue

Part Number: TLC6C5712-Q1

I have my SPI communication working. I can see my Sent and received Data on SPI bus. So, to check the LED driver Configuration I have written below code to write the data in MAP_0 register and read it back.

LedSpiCmdWriteWord(0x6C, 0xCC); /* Send unlock MAP command */

LedSpiCmdReadWriteVerify(0X40, 0X11, 0x80, &spi_error); // code for checking LED Driver

LedSpiCmdWriteWord(0x68, 0xA5); /* Send lock MAP command */

SPI MOSI pin has Data log as ---> 6CCC 4011 8000 0000 68A5

SPI MISO pin has Data log as ---> 2000 2444 0000 8024 0000

So when I wrote 0x11 in Map Register_0 using Address 0x40, while reading Map_0 Register using Address 0x80 I am getting 0x24 as return value.

What might be wrong?

  • Seems there is one bit removed to left, please check if there is any issue regarding the data read configuration.

  • I didn't get that. Could you please elaborate it?
  • Seems there is no issue on your command, i just want to confirm one thing, do you send the latch signal every 16 bits data? For register read command, 16 bits data is shifted into the device first, then send the latch signal, then shift 16 bit dummy bits, during sending the dummy bits, the read data will be shifted out though SDO.
  • Yes, I send Latch signal after every 16 bits data. I send latch signal even during sending the 16 bit dummy bits. Below is the code for Read Register



    /* Ignore the first byte read back. Send the read register and dummy byte */
    (void)SpiTxBytes(SPI_LED, led_read_register, LED_DUMMY_SPI_BYTE, &spi_comm_error); /* Send the read register address */

    if(spi_comm_error == SPI_COMM_ERROR_NO_ERROR)
    {
    /* Send another dummy byte pair to read back the value requested */
    *return_byte = (U8)SpiTxBytes(SPI_LED, LED_DUMMY_SPI_BYTE, LED_DUMMY_SPI_BYTE, &spi_comm_error); /* Pass another word to clock out return word */
    }
  • Below is the code for "SpiTxBytes" function. This same portion of code is used for reading and writing over SPI Bus.



    E_CSIH0_ERROR csih_0_error;
    S16 timeout = CSIH_TX_TIMEOUT;
    BOOLEAN wait = TRUE;
    U16 spi_rx;

    csih_0_error = Csih0CsActiveAsilB(spi_device); /* Setting latch Signal Low */

    if (csih_0_error == CSIH0_NO_ERROR)
    {
    CSIH0TX0H = the_word; /* sending 16 bit data */

    /* wait for transmission completion */
    while (wait != FALSE)
    {
    if ((CSIH0STR0 & CSIH0_COMM_BUSY) != CSIH0_COMM_BUSY)
    {
    wait = FALSE;
    }
    else if (timeout <= (S16)0)
    {
    wait = FALSE;
    csih_0_error = CSIH0_TX_TIMEOUT;
    }
    else
    {
    timeout--;
    }
    }

    csih_0_error = Csih0CsInactiveAsilB(spi_device); /* Setting Latch signal High */
    spi_rx = CSIH0RX0H; /* reading the received Byte */
  • Forgive me i'm not very good at debugging such detailed software, but we have an application note for TLC6C5712 for software configuration. Maybe you can refer to that documents to check if there is any issue on the data read.

    http://www.ti.com/lit/an/slva802/slva802.pdf