SLVSHF3 October 2024 LP5899-Q1
PRODUCTION DATA
For each command except SOFTRESET_CRC there are two versions. The version without CRC at the end of the type name is always executed even when the CRC value is incorrect. The version with CRC at the end of the type name is only executed when the CRC that is received matches the calculated CRC over the command word and data words.
The commands starting with FWD, forward the received data words by the CCSI controller. As long as the data length is larger than 0, the CCSI controller automatically inserts one start bit, the check bits, and one END byte. The SPI data words of one SPI command are therefore considered to be one CCSI command with 1 start bit before the first SPI data word, a check bit after every data word, and one END byte after the last SPI data word.
Commands starting with REG are used to write and read the register of the LP5899-Q1 device. The DATA_RD commands return the data stored on the RXFIFO.
Commands starting with FWD, REG_WR, and SOFTRESET_CRC return the STATUS register and the CRC calculated over the STATUS register. This acknowledgement can be disabled by bit SPI_ACK_DIS in the SPICTRL register. Care has to be taken when executing SOFTRESET_CRC while the acknowledgement is disabled. In this case, TI recommends to wait at least one SPI word before sending the next command.
Whenever the LP5899-Q1 device returns data to the controller on the SDO pin, the controller has to provide sufficient clock pulses on the SCLK pin to shift out the data. TI recommends to keep the SDI pin at logic HIGH while providing the clock pulses to shift out the data.
FWD_WR_CRC (Forward Write CRC command)
Return to the SPI Command Table
The FWD_WR_CRC command is used to transmit data words by the CCSI controller in the device. All the data words received by the SPI peripheral are stored on the TXFIFO. Only when the received CRC matches with the calculated CRC over the command word and data words, the CCSI controller starts to transmit. This means that the TXFFLVL does not impact the start of this transmission. Caution has to be taken by the SPI controller that the data length is less than the size of the TXFIFO. This SPI command supports up to 512 data words and returns the STATUS register and the CRC calculated over the STATUS register. An example of FWD_WR_CRC command forwarding 2 data words is depicted in Figure 7-10.
FWD_WR (Forward Write command)
Return to the SPI Command Table
The FWD_WR command is used to transmit data words by the CCSI controller in the device. All the data words received by the SPI peripheral are stored on the TXFIFO. If one or more of the following conditions is met, the CCSI controller starts transmitting.
FWD_WR_END_CRC (Forward Write CRC with END bytes command)
Return to the SPI Command Table
The FWD_WR_END_CRC command is used to transmit data words by the CCSI controller in the device. All the data words received by the SPI peripheral are stored on the TXFIFO. Only when the received CRC matches with the calculated CRC over the command word and data words, the CCSI controller starts to transmit. This means that the TXFFLVL does not impact the start of this transmission. After all the data words have been transmitted by the CCSI controller, the specified number of extra END bytes are appended. The transmission of data words and the transmission of the extra END bytes are considered as 2 separate CCSI commands. This SPI command supports up to 31 data words and returns the STATUS register and the CRC calculated over the STATUS register. An example of FWD_WR_END_CRC command forwarding 0 data words (and therefore does not insert one END byte) and 3 extra END bytes is depicted in Figure 7-12.
FWD_WR_END (Forward Write with END bytes command)
Return to the SPI Command Table
The FWD_WR_END command is used to transmit data words by the CCSI controller in the device. All the data words received by the SPI peripheral are stored on the TXFIFO. If one or more of the following conditions is met, the CCSI controller starts transmitting.
FWD_RD_END_CRC (Forward Read CRC with END bytes command)
Return to the SPI Command Table
The FWD_RD_END_CRC command is used to transmit data words by the CCSI controller in the device. All the data words received by the SPI peripheral are stored on the TXFIFO. Only when the received CRC matches with the calculated CRC over the command word and data words, the CCSI controller starts to transmit. This means that the TXFFLVL does not impact the start of this transmission. After all the data words have been transmitted by the CCSI controller, the specified number of extra END bytes are appended. The transmission of data words and the transmission of the extra END bytes are considered as 2 separate CCSI commands. All the data words that are received by the CCSI peripheral for this command are stored on the RXFIFO. This SPI command supports up to 32 data words and returns the STATUS register and the CRC calculated over the STATUS register. An example of FWD_RD_END_CRC command forwarding 2 data words and 1 extra END bytes is depicted in Figure 7-14.
FWD_RD_END (Forward Read with END bytes command)
Return to the SPI Command Table
The FWD_RD_END command is used to transmit data words by the CCSI controller in the device. All the data words received by the SPI peripheral are stored on the TXFIFO. If one or more of the following conditions is met, the CCSI controller starts transmitting.
DATA_RD_CRC (Data Read CRC command)
Return to the SPI Command Table
The DATA_RD_CRC command is used to read data words from the RXFIFO. Only when the received CRC matches with the calculated CRC over the command word, the device returns the requested number of data words and the CRC calculated over the data words. When the CRC fails, the SDO is kept at logic HIGH. An example of DATA_RD_CRC command requesting 4 data words is depicted in Figure 7-16.
DATA_RD (Data Read command)
Return to the SPI Command Table
The DATA_RD command is used to read data words from the RXFIFO. Even when the received CRC does not match with the calculated CRC over the command word, the device returns the requested number of data words and the CRC calculated over the data words. When the received CRC does not match the calculated CRC over the command word, the FAULT pin is pulled low (when not masked) and the flag FLAG_SPI_CRC is set. An example of DATA_RD command requesting 3 data words is depicted in Figure 7-17.
REG_WR_CRC (Register Write CRC command)
Return to the SPI Command Table
The REG_WR_CRC command is used to write the internal registers of the LP5899-Q1 device. The command includes a field to indicate the address of the first register to be written. All the data words received by the SPI peripheral are stored in shadow registers. Only when the received CRC matches with the calculated CRC over the command word and data words, the registers are updated. This command returns the STATUS register and the CRC calculated over the STATUS register. An example of REG_WR_CRC command writing 3 registers is depicted in Figure 7-18.
REG_WR (Register Write command)
Return to the SPI Command Table
The REG_WR command is used to write the internal registers of the LP5899-Q1 device. The command includes a field to indicate the address of the first register to be written. All the data words received by the SPI peripheral are directly written in registers. This means that the CRC does not impact the writing of registers. When the received CRC does not match the calculated CRC over the command word, the FAULT pin is pulled low (when not masked) and the flag FLAG_SPI_CRC is set. This command returns the STATUS register and the CRC calculated over the STATUS register. An example of REG_WR_CRC command writing 2 registers is depicted in Figure 7-19.
REG_RD_CRC (Register Read CRC command)
Return to the SPI Command Table
The REG_RD_CRC command is used to read the internal registers of the LP5899-Q1 device. The command includes a field to indicate the address of the first register to be read. Only when the received CRC matches with the calculated CRC over the command word, the device returns the requested number of register words and the CRC calculated over the register words. When the CRC fails, the SDO is kept at logic HIGH. An example of REG_RD_CRC command reading 1 register is depicted in Figure 7-20.
REG_RD (Register Read command)
Return to the SPI Command Table
The REG_RD command is used to read the internal registers of the LP5899-Q1 device. The command includes a field to indicate the address of the first register to be read. Even when the received CRC does not match with the calculated CRC over the command word, the device returns the requested number of register words and the CRC calculated over the register words. When the received CRC does not match the calculated CRC over the command word, the FAULT pin is pulled low (when not masked) and the flag FLAG_SPI_CRC is set. An example of REG_RD command reading 3 registers is depicted in Figure 7-21.
SOFTRESET_CRC (Softreset CRC command)
Return to the SPI Command Table
The SOFTRESET_CRC command is used to reset all internal registers to the default values and synchronize the CCSI controller and peripheral. The command is executed when:
With a reset of all the internal registers, most of the fault flags that were previously set, are cleared. Only FLAG_POR and FLAG_ERR are reset to HIGH. In addition, all data stored on the RXFIFO becomes inaccessible. If there are CCSI commands in the LED daisy chain that have not been received yet by the CCSI peripheral, the CCSI CRC diagnostics cannot be checked anymore because the calculated CRC values have been cleared for the purpose of synchronization between the CCSI controller and CCSI peripheral. TI recommends to transmit the same number of END bytes as the number of LED drivers in the daisy chain after transmitting the SOFTRESET_CRC command. This clears any already transmitted CCSI command and therefore keeps the synchronization. When the device is in FAILSAFE mode, the SOFTRESET_CRC command brings the device to NORMAL mode. An unsuccessful SOFTRESET_CRC command is recorded in the bit FLAG_SRST in the STATUS register. An example of SOFTRESET_CRC command is depicted in Figure 7-22.