digipot3 2.0.0.0
|
DIGI POT 3 click is a versatile and feature-rich digital potentiometer click with 1024 steps and an internal non-volatile memory (EEMEM), which can be used for storing the wiper position, but also for storing various user data.
We provide a library for the DigiPot3 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 DigiPot3 Click driver.
- Initialization function.void digipot3_cfg_setup ( digipot3_cfg_t *cfg );
DIGIPOT3_RETVAL digipot3_init ( digipot3_t *ctx, digipot3_cfg_t *cfg );
void digipot3_default_cfg ( digipot3_t *ctx );
- This function executes the desired command.uint8_t digipot3_store_eemem ( digipot3_t *ctx, uint8_t location_address, uint16_t transfer_data );
uint8_t digipot3_send_command ( digipot3_t *ctx, uint8_t command_byte );
uint8_t digipot3_write_dac ( digipot3_t *ctx, uint16_t value_dac );
This app get value from digital potentiometer and stored to the EEMEM memory.
The demo application is composed of two sections :
Initializes device.
Increments the wiper position by 6dB every 2 seconds. When wiper position reaches the desired value (0x0200), then the wiper position be decremented by 6dB every 2 seconds, until position value reaches the new desired value (0x0002). After that the new position value will be stored to the EEMEM memory, if that value does not already exist in the EEMEM memory.
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.