pwm2 2.0.0.0
|
PWM 2 click offers 48 independently controlled PWM channels, available over the onboard headers, perfectly suited for driving LEDs. Each channel has a 12-bit PWM register associated to it, with the addition of the 6-bit correction register, also known as the dot correction register
We provide a library for the Pwm2 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Pwm2 Click driver.
- Initialization function.void pwm2_cfg_setup ( pwm2_cfg_t *cfg );
PWM2_RETVAL pwm2_init ( pwm2_t *ctx, pwm2_cfg_t *cfg );
- Start PWM module.uint8_t pwm2_set_channel ( pwm2_t *ctx, uint8_t n_channel, uint16_t width, uint8_t correction );
void pwm2_pwm_start ( pwm2_t *ctx );
static void send_output_enable_frame ( pwm2_t *ctx );
This application send the PWM signal in one or more outputs.
The demo application is composed of two sections :
Configures the click board and sets all PWM channels on the click board to 50% duty cycle with the phase shift enabled.
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.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.