SLVUCZ6 November   2024 TLC69627-Q1 , TLC69628-Q1 , TLC69629-Q1 , TLC69637-Q1 , TLC69638-Q1 , TLC69639-Q1

 

  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 Basic System Setup
    4. 3.4 Advanced System Setup
    5. 3.5 Diagnostics
    6. 3.6 Demo

Basic 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 selection for the used LED driver IC is made.

#include "TLC69628.h"

The code supports the below products:

  • TLC6962[7|8]
  • TLC6963[7|8]

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 SPI_FREQ_IN_HZ CLK_I frequency.
RUN_MODE Selection between different code run modes. Supported options are ANIMATION and SIMPLE_TEST.
TOTAL_SCAN_LINES Number of scan lines. For TLC6962x/TLC6963x-Q1 family this is always 1.
BUS_NUM Number of daisy chain buses.
CASCADED_UNITS_BUS1 Device count in daisy chain bus 1.
CASCADED_UNITS_BUS2 Device count in daisy chain bus 2.
SCAN_FET_CTRL_NUM Number of SCAN FET controllers in one daisy chain. For TLC6962x/TLC6963x-Q1 family this is always 0.
system_info.c FRAME_RATE Interval of VSYNC commands.
Within the file system_info.c the frame rate is specified. The frame period is specified in Hz (frames per second).
uint32_t FRAME_RATE = 60;      // 60Hz frames-per-second

The minimum supported frame rate is 1Hz.

File system_info.h includes several system definitions.

// Desired CLK_I frequency 
// 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        3000000

Macro SPI_FREQ_IN_HZ defines at what data rate the SPI is running, such that, the clock frequency of pin CLK_I. This frequency 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

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

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

#define TOTAL_SCAN_LINES       1
#define CASCADED_UNITS_BUS1    2

Macro TOTAL_SCAN_LINES defines the number of scan lines used in the system. For TLC6962x/TLC6963x-Q1 family this is always 1.

Macro CASCADED_UNITS_BUS1 defines the number of cascaded devices in the system and directly impacts the field CHIP_NUM is register DEVSET. For the TLC69628Q1EVM there are two devices cascaded.