antopwm2 2.1.0.0
|
AN to PWM 2 Click is a compact add-on board that contains an easy-to-use component that converts the value of the input analog signal to a fixed frequency PWM voltage output, with a duty cycle proportional to the input voltage. This board features the LTC6992CS6, a silicon oscillator with an easy-to-use analog voltage-controlled pulse width modulation (PWM) capability from Analog Devices. It features the PWM signal controlled by analog input in range of -2.5V to 2.5V, frequency range up to 1 MHz, frequency error less than 1.7%, and it has good temperature stability. It has many features that make it well suited for heater control, PWM servo loops, LED dimming, signal isolation, and other duty cycle control applications.
We provide a library for the AN to PWM 2 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.
This library contains API for AN to PWM 2 Click driver.
antopwm2_cfg_setup
Config Object Initialization function. antopwm2_init
Initialization function. antopwm2_set_frequency
This function sets a frequency output in a range from 500kHz to 1MHz by setting the digipot resistance. antopwm2_set_frequency_otp
This function sets a frequency output in a range from 500kHz to 1MHz by setting the digipot resistance in OTP mode. This example demonstrates the use of AN to PWM 2 click board by changing the PWM output frequency from 500kHz to 1MHz in steps of 50kHz.
The demo application is composed of two sections :
Initializes the driver and logger.
Changes the PWM output frequency every 5 seconds in steps of 50kHz going through the full range from 500kHz to 1MHz. The currently set frequency will be displayed on the USB UART.
Applying a voltage of -2.5 to 2.5V on the input will generate the PWM pulse train with a duty cycle linearly proportional to the input voltage.
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:
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.