With 48 channels controlled through one interface, you gain total PWM dominance, giving you the power to manage your devices and applications with precision and efficiency
A
A
Hardware Overview
How does it work?
PWM 2 Click is based on the LT8500, a 48-channel LED PWM generator with 12-bit resolution and 50MHz serial interface from Analog Devices. This IC has 48 independent 12-bit PWM channels, each with 6-bit correction up to 50% of the original duty cycle. The LT8500 IC is clocked by a clock signal at the PWMCK pin. The frequency of the clock signal can go up to 25MHz, generating the PWM output frequency of up to 6.1kHz, which is sufficient for most purposes. The maximum speed of the LT8500 serial interface goes up to 50MHz in theory, but in practice, it will depend on many factors. The clock signal at the PWM pin of the mikroBUS™ is triggering an internal counter register (PWMCK). This register is compared with the content of the PWMRSYNC register, associated with each channel. Whenever the counter value is less than the value written in a specific channel PWMRSYNC register, the PWM output of that channel goes to a HIGH logic level. The frequency of the output PWM signal is therefore determined by the frequency the clock signal at the PWMCK pin. This represents the basic operating principle of the LTC8500 IC. The PWMCK pin is routed to the PWM pin of the mikroBUS™. The device uses an industry-standard SPI interface for the communication. The LDI pin acts as the normal Chip Select, latching the SPI data in, but it has an additional function if held to a HIGH logic level
for more than 50µs. In that case, the IC will be reset, and all outputs will be blanked. Therefore, care should be taken not to hold this pin to a HIGH logic level, for more than 5µs. The LDI pin is routed to the CS pin of the mikroBUS™ and it is labeled as LDI. Besides the usual SPI interface lines, the LT8500 PWM generator IC provides a serial interface clock output signal (SCKO), allowing additional devices to be connected in the parallel 5-wire topology (LDI, SCKI, SDI, SDO, and SCKO). This allows large-scale cascading, without the need for the skew balancing or buffering the signals. These additional pins are available at the standard 2.54 pitch headers on board. These additional pins on the header are described in a table, below. More information about cascading and using the SCKO feature of the IC can be found in the LT8500 datasheet. The device is controlled by sending commands via the SPI interface, embedded in a command frame. There are eight different commands which are used to control the following parameters: PWM outputs update (synchronously or asynchronously to PWM period), the dot correction factor, self-test initialization, phase shifting between banks (groups of 16 channels), enabling/ disabling of the PWM output drivers, and enabling/disabling of the dot correction . A frame consists of a 12-bit data field for each of the 48 PWM channels, followed by an
8-bit command field, which contains one of the eight command codes. The status frame is clocked on the SDO pin, providing the host MCU with the frame information: LED fault status, phase shifting status, correction status, synchronization status, and so on. This information can be used either for troubleshooting or for other purposes by the host MCU application. As already mentioned, additional functionalities of the LT8500 IC are offered via the onboard headers, along with the 48 PWM channel outputs. The outputs are not meant to drive devices with high current, so PWM 2 click is best used as the driver for additional circuitry, whether it is a simple MOSFET LED driver, or a more complex ICs, such as the LT3595A LED driver, for which a special input pin is reserved, allowing open LED conditions to be detected, even on the externally connected LT3595 IC. Onboard headers also offer fixed 5V output from the mikroBUS™ for the auxiliary purposes. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the PWR SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this 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.
Features overview
Development board
Arduino UNO is a versatile microcontroller board built around the ATmega328P chip. It offers extensive connectivity options for various projects, featuring 14 digital input/output pins, six of which are PWM-capable, along with six analog inputs. Its core components include a 16MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button, providing everything necessary to power and program the board. The Uno is ready to go, whether connected to a computer via USB or powered by an AC-to-DC adapter or battery. As the first USB Arduino board, it serves as the benchmark for the Arduino platform, with "Uno" symbolizing its status as the
first in a series. This name choice, meaning "one" in Italian, commemorates the launch of Arduino Software (IDE) 1.0. Initially introduced alongside version 1.0 of the Arduino Software (IDE), the Uno has since become the foundational model for subsequent Arduino releases, embodying the platform's evolution.
Microcontroller Overview
MCU Card / MCU
![default](https://dbp-cdn.mikroe.com/catalog/mcus/resources/ATmega328P.jpeg)
Architecture
AVR
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
28
RAM (Bytes)
2048
You complete me!
Accessories
Click Shield for Arduino UNO has two proprietary mikroBUS™ sockets, allowing all the Click board™ devices to be interfaced with the Arduino UNO board without effort. The Arduino Uno, a microcontroller board based on the ATmega328P, provides an affordable and flexible way for users to try out new concepts and build prototypes with the ATmega328P microcontroller from various combinations of performance, power consumption, and features. The Arduino Uno has 14 digital input/output pins (of which six can be used as PWM outputs), six analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header, and reset button. Most of the ATmega328P microcontroller pins are brought to the IO pins on the left and right edge of the board, which are then connected to two existing mikroBUS™ sockets. This Click Shield also has several switches that perform functions such as selecting the logic levels of analog signals on mikroBUS™ sockets and selecting logic voltage levels of the mikroBUS™ sockets themselves. Besides, the user is offered the possibility of using any Click board™ with the help of existing bidirectional level-shifting voltage translators, regardless of whether the Click board™ operates at a 3.3V or 5V logic voltage level. Once you connect the Arduino UNO board with our Click Shield for Arduino UNO, you can access hundreds of Click boards™, working with 3.3V or 5V logic voltage levels.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic
![PWM 2 Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1ee790a3-f1e3-67c0-bd02-0242ac120009/schematic.webp)
Step by step
Project assembly
Track your results in real time
Application Output
This Click board can be interfaced and monitored in two ways:
Application Output
- Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
UART Terminal
- Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Software Support
Library Description
This library contains API for PWM 2 Click driver.
Key functions:
pwm2_set_channel
- Set channel function.pwm2_pwm_start
- Start PWM module.send_output_enable_frame
- Enable frame.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief Pwm2 Click example
*
* # Description
* This application send the PWM signal in one or more outputs.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Configures the click board and sets all PWM channels on the click board to
* 50% duty cycle with the phase shift enabled.
*
* ## Application Task
* The first 10 PWM channels of PWM2 Click board are switched back and forth
* from 25% duty cycle to 75% duty cycle every 10 seconds.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "pwm2.h"
// ------------------------------------------------------------------ VARIABLES
static pwm2_t pwm2;
void application_init ( void )
{
pwm2_cfg_t cfg;
// Click initialization.
pwm2_cfg_setup( &cfg );
PWM2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
pwm2_init( &pwm2, &cfg );
pwm2_set_duty_cycle( &pwm2, 0.5 );
pwm2_pwm_start( &pwm2 );
pwm2_default_cfg( &pwm2 );
pwm2_toggle_phase_shift( &pwm2 );
//setting all 48 PWM channels of the PWM2 click to 50% duty
for( uint8_t cnt = 1; cnt < 49; cnt++ )
{
pwm2_set_channel( &pwm2, cnt, PWM2_50_PERCENT_DUTY, PWM2_NO_CORRECTION );
}
}
void application_task ( void )
{
for ( uint8_t cnt = 1; cnt < 10; cnt++ )
{
pwm2_set_channel( &pwm2, cnt, PWM2_25_PERCENT_DUTY, PWM2_NO_CORRECTION );
}
Delay_ms( 10000 );
for ( uint8_t cnt = 1; cnt < 10; cnt++ )
{
pwm2_set_channel( &pwm2, cnt, PWM2_75_PERCENT_DUTY, PWM2_NO_CORRECTION );
}
Delay_ms( 10000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END