SNVU849A May   2023  – September 2024 LP5890 , LP5891 , LP5891-Q1 , TLC6983 , TLC6984

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Software Setup
  6. 3Sample Code Structure
    1. 3.1 Design Parameters
    2. 3.2 Flow Diagram
    3. 3.3 System Setup
    4. 3.4 Diagnostics
    5. 3.5 Demo
  7. 4Revision History

System Setup

This section describes how the sample code setups different parameters to identify how the system is built. The first part is the actual used LED driver IC. Within the led_driver.h file, the used LED driver IC is selected.

#include "LP5891.h"
The code supports:
  • LP5892
  • LP5891
  • LP5890
  • TLC6984
  • TLC6983

Note that for the "Q1" devices, this is not added and only the base product name is used.

A summary about macros and variables that impact the system setup and their location is listed in Table 3-2.

Table 3-2 Summary of Macro and Variable Names Per File
Filename Macro/Variable name Description
system_info.h SCLK_FREQ_IN_HZ SCLK frequency
USE_CONN_IC Selection if augmented connectivity device LP5899(-Q1)/TLC6989 is used
SPI_FREQ_IN_HZ When augmented connectivity device is used, this is the SPI frequency between MCU and connectivity device
RUN_MODE Selection between different code run mode. Supported options are ANIMATION and SIMPLE_TEST
TOTAL_SCAN_LINES Number of scan lines
CCSI_BUS_NUM Number of CCSI busses
CASCADED_UNITS_CCSI1 Device count in CCSI bus 1
CASCADED_UNITS_CCSI2 Device count in CCSI bus 2
MONOCHROMATIC Selection between RGB and single color display
system_info.c FRAME_RATE Interval of VSYNC commands

Within the file system_info.c the frame rate is specified. The frame rate is specified in Hz (frames per second).

const uint16_t FRAME_RATE = 60;      // 16.67ms = 60 Hz frames-per-second

The minimum supported frame rate is 1Hz.

File system_info.h includes several system definitions.

// When TLC6989 or LP5899 is used this should be set to _TRUE
#define USE_CONN_IC           _TRUE

Macro USE_CONN_IC defines if the LED driver is paired with the augmented connectivity IC. This impacts the MCU's hardware setup which switches automatically between standard SPI when using the connectivity IC or CLB when communicating directly to the LED drivers using CCSI.

// Desired SCLK frequency (in case of TLC698x this SCLK frequency is half of this)
// Note: Exact frequency may not be possible
#define SCLK_FREQ_IN_HZ        10000000

Macro SCLK_FREQ_IN_HZ defines at what data rate the Continuous Clock Serial Interface (CCSI) is running, i.e. the clock frequency of pin SCLK. When the augmented connectivity IC is used, the selected data rate will be the option that is equal or first available option that is higher than the desired data rate. When the augmented connectivity IC is not used, the desired SCLK frequency is an integer divider from the system frequency of the MCU. In both cases, the actual CCSI frequency may differ from the desired specified frequency defined by SCLK_FREQ_IN_HZ.

// Desired SPI frequency - for TLC6989 or LP5899
// Supported range is 500kHz to 7.5MHz --> For higher frequencies need to enable SPI high speed mode
// Note: Exact frequency may not be possible
#define SPI_FREQ_IN_HZ          7500000

Macro SPI_FREQ_IN_HZ is only used when the augmented connectivity IC is used and defines the desired SPI frequency. This is an integer divider from the system frequency of the MCU. Therefore, the actual SPI frequency may differ from the desired specified frequency defined by SPI_FREQ_IN_HZ.

#define RUN_MODE               ANIMATION
#define MONOCHROMATIC          _FALSE

Macro RUN_MODE determines the run mode of the code. The supported run modes are animation and simple test mode.

The EVMs all use RGB LEDs. Therefore, macro MONOCHROMATIC is defined as _FALSE. The sample code does support systems using single color LEDs, e.g. only red LEDs. In those cases, the macro MONOCHROMATIC should be defined as _TRUE. This automatically changes the frame data structure, the animation algorithms, and APIs.

The following code block shows macros which impact the register settings.

#define TOTAL_SCAN_LINES       16
#define CASCADED_UNITS_CCSI1   1

Macro TOTAL_SCAN_LINES defines the number of scan lines used in the system and directly impacts the field SCAN_NUM in register FC0. For the LP5891Q1EVM, LP5891EVM, and LP5890EVM there are 16 scan lines. For the TLC6983EVM and TLC6984EVM there are 32 scan lines.

Macro CASCADED_UNITS_CCSI1 defines the number of cascaded devices in the system and directly impacts the field CHIP_NUM is register FC0. For the LP5891Q1EVM, LP5891EVM, and LP5890EVM there is only 1 device cascaded. When the user cascades more of these EVMs with the available connectors, this macro has to be updated.

For the TLC6983EVM and TLC6984EVM there are two cascaded devices on one EVM.

LP5891Q1EVM LP5891-Q1 Example System Using 2 CCSI
                    Chains Without Augmented Connectivity IC Figure 3-2 Example System Using 2 CCSI Chains Without Augmented Connectivity IC
LP5891Q1EVM LP5891-Q1 Example System Using 2 CCSI
                    Chains With Augmented Connectivity IC Figure 3-3 Example System Using 2 CCSI Chains With Augmented Connectivity IC

The sample code supports up to 2 CCSI daisy chains. To illustrate the support of 2 CCSI daisy chains, examples are depicted in Figure 3-2 and Figure 3-3. The first figure depicts the example without using the augmented connectivity IC and the second image with using the augmented connectivity IC. For both, the number of actual used chains is defined by macro CCSI_BUS_NUM in file system_info.h.

// Total CCSI buses supported
#define CCSI_BUS_NUM           2

Each chain can have a different number of cascaded devices. Therefore, besides macro CASCADED_UNITS_CCSI1, there is also macro CASCADED_UNITS_CCSI2 in file system_info.h. In the examples, CCSI chain 1 has 3 cascaded devices and CCSI chain 2 has 2 cascaded devices.

#define CASCADED_UNITS_CCSI1   3
#define CASCADED_UNITS_CCSI2   2