SLVUCZ6B November   2024  – March 2026 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
  7. 4Revision History

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[1|2|3|4|5|6|7|8|9]
  • TLC6963[1|2|3|4|5|6|7|8|9]

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 macros and variables 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 (LED drivers) or SCLK_RX frequency (TLC69698-Q1) when IF_SEL is defined as SPI.
USE_CONN_IC Selection if UPAC device TLC69698-Q1/TLC69697-Q1 is used.
RUN_MODE Selection between different code run modes. Supported options are ANIMATION and SIMPLE_TEST.
IF_SEL Selection of MCU interface used to communicate.
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.
CASCADED_UNITS_BUS3 Device count in daisy chain bus 3. Only supported for UART with UPAC device.
CASCADED_UNITS_BUS4 Device count in daisy chain bus 4. Only supported for UART with UPAC device.
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.
dev_addr Device addresses of connectivity devices used on the UART bus.

Within the file system_info.c the frame rate and UART device addresses of the UPAC devices are specified. The frame period is specified in Hz (frames per second). The minimum supported frame rate is 1Hz.

uint32_t FRAME_RATE = 60;      // 60Hz frames-per-second
const uint16_t dev_addr[BUS_NUM] = {DEVICE_ADDR__0};

Variable dev_addr only needs to be set when USE_CONN_IC is set to _TRUE and IF_SEL is set to UART or UART_CAN. The variable specifies the addresses of the UPAC devices on the UART bus.

File system_info.h includes several system definitions.

// Desired CLK_I or SCLK_RX frequency 
// Supported range is 500kHz to 7.5MHz --> For higher frequencies need to enable SPI high speed mode
// Note: Exact frequency is not always 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 for the LED drivers or pin SCLK_RX of TLC69698-Q1. This frequency is an integer divider from the system frequency of the MCU. Therefore, the actual SPI frequency sometimes differ from the desired specified frequency defined by SPI_FREQ_IN_HZ.

#define USE_CONN_IC              _FALSE
#define RUN_MODE              ANIMATION
#define IF_SEL                      SPI

Macro USE_CONN_IC defines if the UPAC device is used. When LED driver is selected as TLC696[2|3][3|6|9], this is automatically set to _TRUE.

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

Options for macro IF_SEL are SPI, UART, and UART_CAN. For UART and UART_CAN the selection of UPAC device USE_CONN_IC has to be set to _TRUE. The difference between UART and UART_CAN is that UART uses a direct UART connection between MCU and UPAC device while UART_CAN uses the CAN physical layer in between the MCU and UPAC device.

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 and TLC69698Q1EVM there are two devices cascaded while for TLC69622Q1EVM and TLC69625Q1EVM this is only one device.