digipot2
2.0.0.0
|
< DIGI POT 2 click is a mikroBUS™ add-on board with a single channel digital potentiometer TPL0501 with 256 wiper positions >
We provide a library for the DigiPot2 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 DigiPot2 Click driver.
void digipot2_cfg_setup ( digipot2_cfg_t *cfg );
DIGIPOT2_RETVAL digipot2_init ( digipot2_t *ctx, digipot2_cfg_t *cfg );
void digipot2_write_byte ( digipot2_t *ctx, uint8_t command, uint8_t write_data );
void digipot2_set_wiper_positions ( digipot2_t *ctx, uint8_t wiper_positions );
float digipot2_convert_output ( digipot2_t *ctx, uint16_t value_adc, float v_ref );
This application change the output voltage every 5 seconds.
The demo application is composed of two sections :
Initialization driver enable's - SPI and start write log.
This is a example which demonstrates the use of DIGI POT 2 Click board. Increments the wiper position by 10 position every 5 seconds. Calculate ADC voltage and write log UART. All data logs on usb uart for aproximetly every 5 sec.
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.