How does it work?
LED Driver 12 Click as its foundation uses the PCA9532, a 16-bit I2C-configurable LED dimmer from NXP Semiconductors. The PCA9532 has two fully programmable PWM controllers used to control up to 16 LED channels, switching each of the LEDs ON and OFF independently. Each LED output, 16 LED drivers presented on two 1×8 male headers, with a maximum output current of 25mA per channel, has a programmable period ranging from 0.6Hz to 152Hz and a programmable duty cycle from 0 to 100%, which means that the LEDs can be set to blink steadily and visibly, or dimmed.
Any bits not used for controlling the LED channels can be used for General Purpose parallel Input/Output (GPIO) expansion, providing a simple solution when additional I/O is needed for some power switches, sensors, push-buttons, alarm monitoring, fans, or other applications.
LED Driver 12 Click communicates with MCU using the standard I2C 2-Wire interface that supports Standard-Mode (100 kHz) and Fast-Mode (400 kHz) operation. The PCA9532 has a 7-bit slave address with the first five MSBs fixed to 1100. The address pins A0, A1, and A2, are programmed by the user and determine the value of the last three LSBs of the slave address, which can be selected by onboard SMD jumpers labeled as ADDR SEL allowing selection of the slave address LSBs.
Alongside the internal Power-On Reset (POR) function, this board also has an active-low reset signal routed on the RST pin of the mikroBUS™ socket used to recover from a bus-fault condition. When this signal is asserted low, the PCA9532 resets its registers alongside with I2C state machine and deselects all channels.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to 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 many more
On-board modules
PCA9532 – 16-bit I2C-configurable LED dimmer from NXP Semiconductors
Key Features
Low power consumption, 16 channels, ON/OFF LED channels control, two selectable fully programmable blink rates, supports hot insertion, drive LEDs to 25mA, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on LED Driver 12 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-JP3 | ADDR SEL | – | I2C Address Selection 1/0: Left position 1, Right position 0 |
JP4 | VCC SEL | – | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
J1-J2 | 0-15 | – | LED Driver Channels |
LED Driver 12 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Maximum Output Current | – | – | 25 | mA |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the LED Driver 12 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for LED Driver 12 Click driver.
Key functions
-
leddriver12_set_led_config
This function sets the specified LED config. -
leddriver12_set_led_port_config
This function sets the specified LED port config. -
leddriver12_set_blink_period_pwm_0
This function sets the blink period of PWM 0 function.
Example Description
This example demonstrates the use of LED Driver 12 Click board™.
void application_task ( void )
{
leddriver12_set_led_port_config ( &leddriver12, LEDDRIVER12_LED0_TO_3, LEDDRIVER12_LED_ON );
leddriver12_set_led_port_config ( &leddriver12, LEDDRIVER12_LED4_TO_7, LEDDRIVER12_LED_ON );
log_printf ( &logger, " LEDs 0-7 turns ON rn" );
Delay_ms( 2000 );
leddriver12_set_led_port_config ( &leddriver12, LEDDRIVER12_LED0_TO_3, LEDDRIVER12_LED_OFF );
leddriver12_set_led_port_config ( &leddriver12, LEDDRIVER12_LED4_TO_7, LEDDRIVER12_LED_OFF );
log_printf ( &logger, " LEDs 0-7 turns OFF rnn" );
Delay_ms( 2000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.LEDDriver12
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 MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.