How does it work?
LED Driver 18 Click is based on the TLC5947, a 24-channel 12-bit PWM LED driver from Texas Instruments. Each channel supports many LEDs in series connected to the LED terminal, and has an individually-adjustable 4096-step PWM grayscale brightness control accessible through a serial interface port. It has a programmable current value of all 24 channels achievable through the AD5171, an I2C-configurable digital potentiometer, with a maximum of 30mA of LED current per channel. The TLC5947 also features a built-in thermal shutdown function that turns OFF all output drivers during an over-temperature condition. All channels automatically restart when the temperature returns to normal conditions.
LED Driver 18 Click communicates with MCU through a register-selectable standard SPI interface that enables a high clock speed of up to 30MHz for optimum performance. In addition to the interface signals, the TLC5947 uses another signal from the mikroBUS™ socket. The enable signal routed on the EN pin of the mikroBUS™ socket provides the ability to turn OFF all constant-current outputs. When the EN pin is in a high logic state, all channels (0-23) are forced OFF, the grayscale PWM timing controller initializes, and the grayscale counter resets to 0. When the EN pin is in a low logic state is low, the grayscale PWM timing controller controls all LED channels.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
LED Drivers
Applications
Can be used for color mixing and backlight application for amusement products, LED status signalization, home automation projects, and more
On-board modules
TLC5947 – PWM LED driver from Texas Instruments
Key Features
24 LED channels, programmable current value, PWM grayscale control, thermal shutdown protection, low power consumption, high efficiency and performance, and more
Interface
I2C,SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on LED Driver 18 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
J1-J3 | 0-23 | Populated | LED Driver Channel Terminals |
LED Driver 18 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Output Current | – | – | 30 | mA |
Resolution | – | 12 | – | bit |
Software Support
We provide a library for the LED Driver 18 Click as well as a demo application (example), developed using Mikroe compilers. The demo can run on all the main Mikroe development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for LED Driver 18 Click driver.
Key functions
-
leddriver18_set_output_pwm
LED Driver 18 set output channel PWM value function. -
leddriver18_write_config
LED Driver 18 write config function. -
leddriver18_set_cc_output
LED Driver 18 set constant current output function.
Example Description
This library contains API for LED Driver 18 Click driver. The library initializes and defines the I2C bus drivers to write and read data for setting constant current output, as well as the default configuration for a PWM output value of the OUT channels.
void application_task ( void )
{
float pwm_val;
for ( int8_t n_cnt = 0; n_cnt <= 100; n_cnt += 10 )
{
for ( uint8_t out_cnt = 0; out_cnt < LEDDRIVER18_MAX_OUTPUT_NUM; out_cnt++ )
{
leddriver18_set_output_pwm( out_cnt, n_cnt );
}
pwm_val = leddriver18_get_output_pwm( 0 );
log_printf( &logger, " PWM value: %.2f rn", pwm_val );
leddriver18_write_config( &leddriver18 );
Delay_ms( 200 );
}
for ( int8_t n_cnt = 100; n_cnt >= 10; n_cnt -= 10 )
{
for ( uint8_t out_cnt = 0; out_cnt < LEDDRIVER18_MAX_OUTPUT_NUM; out_cnt++ )
{
leddriver18_set_output_pwm( out_cnt, n_cnt );
}
pwm_val = leddriver18_get_output_pwm( 0 );
log_printf( &logger, " PWM value: %.2f rn", pwm_val );
leddriver18_write_config( &leddriver18 );
Delay_ms( 200 );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.LEDDriver18
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all Mikroe compilers.
mikroSDK
This Click board™ is supported with mikroSDK – Mikroe Software Development Kit, which needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.