SNVU844 may   2023

 

  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 Demo

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:
  • LP5891
  • LP5890
  • TLC6984
  • TLC6983

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 ANIMATION Selection between animation and simple test modes
TOTAL_SCAN_LINES Number of scan lines
CASCADED_UNITS_CCSI1 Device count in CCSI bus 1
MONOCHROMATIC Selection between RGB and single color display
system_info.c FRAME_PERIOD Interval of VSYNC commands

Within the file system_info.c the frame period is specified which determines the frame rate. The frame period is specified in microseconds.

const uint16_t FRAME_PERIOD = 40000;      // 40ms = 25 Hz frames-per-second

The maximum supported frame period is 65535 microseconds, i.e. the lowest frame rate is 15.3 Hz.

File system_info.h includes several system definitions.

#define ANIMATION              TRUE
#define MONOCHROMATIC          FALSE

Macro ANIMATION will determine if the animation or simple test mode is executed.

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 will directly impact the field SCAN_NUM in register FC0.

For the LP5890EVM and LP5891EVM 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 LP5890EVM and LP5891EVM there is only 1 device cascaded.

When the user cascades more EVMs with the available connectors, this macro will have to be updated.

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