OFF
MIKROE-1898
30 g
Status:
PWM Click is a compact add-on board that controls 16 PWM outputs through a single I2C interface. This board features the PCA9685, a fully programmable 16-channels PWM controller from NXP Semiconductors. Each output channel has its 12-bit resolution (4096 steps) fixed frequency individual PWM controller that operates at a programmable frequency from a typical of 24Hz to 1526Hz with a duty cycle that is adjustable from 0% to 100%. All channels are set to the same PWM frequency. This Click board™ controls multiple PWM outputs (up to 112 PWM outputs thanks to additional connections) through a single I2C interface suitable for anything from a simple LED strip to a complex robot with many moving parts.
PWM Click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
This product is no longer in stock
Availability date:
PWM Click is based on the PCA9685, a fully programmable 16-channels PWM controller from NXP Semiconductors. Each output channel has its 12-bit resolution (4096 steps) fixed frequency individual PWM controller that operates at a programmable frequency from a typical of 24Hz to 1526Hz with a duty cycle that is adjustable from 0% to 100%. All channels are set to the same PWM frequency. Although it is targeted toward driving LEDs, this Click board™ can also be used for other purposes, such as motor and industrial control, robotics, and similar applications that can benefit from having a compact 16-channel PWM driver.
Each output channel can be turned OFF or ON, with no PWM control, or set at its individual PWM controller value, which minimizes current surges. The ON and OFF time delay is independently programmable for each of the 16 channels. The output channels are programmed to be either open-drain with a 25mA current sink or totem poles with a 25mA sink and 10mA source capability at 5V.
PWM Click communicates with an MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting Fast Mode Plus up to 1MHz. It also has a 7-bit slave address with the first four MSBs fixed to 1000. The slave address pins, A0, A1, and A2, are programmed by the user and determine the value of the three LSBs of the slave address. The value of these address pins can be set by positioning onboard SMD jumpers labeled as I2C ADR to an appropriate position marked as 0 or 1.
It also possesses an additional enable signal, routed on the RST pin of the mikroBUS™ socket labeled EN, allowing asynchronous control of the output channels. It can also be used to set all the outputs to a defined I2C-programmable logic state or to externally ‘pulse width modulate’ the outputs, which is useful when multiple devices need to be dimmed or blinked together using software control. In addition, this Click board™ has two unpopulated headers through which up to seven additional PWM Click boards™ can be connected together. With the help of I2C ADR jumpers, it is possible to specify a different I2C address for each board, allowing a total of 112 PWM outputs on a single I2C line.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the PWR 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.
Type
PWM
Applications
Can be used for driving LEDs, motor and industrial control, robotics, and similar applications
On-board modules
PCA9685 - 16-channels PWM controller from NXP Semiconductors
Key Features
Fully programmable, high resolution, adjustable duty cycle, Fast Mode Plus I2C interface, additional PWM board connections for up to 112 PWMs, output configurable as open-drain or totem pole, low power consumption, and more
Interface
I2C,PWM
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
This table shows how the pinout on PWM Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
JP1 | PWR SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2-JP4 | I2C ADR | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
CN1-CN2 | CH | Populated | PWM Channel Headers |
CN3-CN4 | - | Unpopulated | Additional PWM board Connection Headers |
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | - | 5 | V |
Output Frequency | 24 | - | 1526 | Hz |
Resolution | - | 12 | - | bit |
Data Rate | - | - | 1 | Mbps |
We provide a library for the PWM 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 PWM Click driver.
Key functions
Device configuration function.
Set channel raw function.
Set all channels raw function.
Example Description
This is an example that shows some of the functions that PWM click has.
void application_task ( void )
{
uint8_t chann_id;
pwm_set_all_raw( &pwm, PWM_MAX_RESOLUTION / 2 );
log_printf( &logger, "All Channels set to 50%% duty cycle rn" );
log_printf( &logger, "--------------------------rn" );
Delay_ms( 10000 );
for ( chann_id = 0; chann_id < 8; chann_id++ )
{
pwm_set_channel_raw( &pwm, chann_id, 0, PWM_MAX_RESOLUTION / 4 );
}
log_printf( &logger, "Channels 0-7 set to 25%% duty cycle rn" );
log_printf( &logger, "--------------------------rn" );
Delay_ms( 10000 );
for ( chann_id = 0; chann_id < 8; chann_id++ )
{
pwm_set_channel_raw( &pwm, chann_id, 0, ( PWM_MAX_RESOLUTION / 4 ) * 3 );
}
log_printf( &logger, "Channels 0-7 set to 75%% duty cycle rn" );
log_printf( &logger, "--------------------------rn" );
Delay_ms( 10000 );
pwm_all_chann_state( &pwm, 0 );
log_printf( &logger, "All Channels disabled rn " );
log_printf( &logger, "--------------------------rn" );
Delay_ms( 5000 );
}
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:
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.
This Click board™ is supported with mikroSDK - Mikroe 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.
NOTE: Please be advised that any peripheral devices or accessories shown connected to the Click board™ are not included in the package. Check their availability in our shop or in the YMAN section below.