TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136790 times)
  2. FAT32 Library (69981 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41889 times)
  6. FT800 Library (41184 times)
  7. GSM click (28988 times)
  8. PID Library (26420 times)
  9. mikroSDK (26375 times)
  10. microSD click (25382 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

DIGI POT 7 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: Digital potentiometer

Downloaded: 94 times

Not followed.

License: MIT license  

DIGI POT 7 Click is a compact add-on board used as a digitally controlled potentiometer. This board features the AD5175, a single-channel 1024-position digital rheostat with less than ±1% end-to-end resistor tolerance error and 50-time programmable wiper memory from Analog Devices. This I2C configurable IC is designed to operate as a variable resistor for analog signals, within the voltage range of single-supply operation at 2.7 V to 5.5 V.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DIGI POT 7 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DIGI POT 7 click" changes.

Do you want to report abuse regarding "DIGI POT 7 click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


DIGI POT 7 click

DIGI POT 7 Click is a compact add-on board used as a digitally controlled potentiometer. This board features the AD5175, a single-channel 1024-position digital rheostat with less than ±1% end-to-end resistor tolerance error and 50-time programmable wiper memory from Analog Devices. This I2C configurable IC is designed to operate as a variable resistor for analog signals, within the voltage range of single-supply operation at 2.7 V to 5.5 V.

digipot7_click.png

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Jul 2021.
  • Type : I2C type

Software Support

We provide a library for the DIGIPOT7 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.

Library Description

This library contains API for DIGIPOT7 Click driver.

Standard key functions :

  • digipot7_cfg_setup Config Object Initialization function.

    void digipot7_cfg_setup ( digipot7_cfg_t *cfg );
  • digipot7_init Initialization function.

    err_t digipot7_init ( digipot7_t *ctx, digipot7_cfg_t *cfg );

Example key functions :

  • digipot7_hw_reset Hardware reset function

    void digipot7_hw_reset ( digipot7_t *ctx );
  • digipot7_read_rdac The function read a 10-bit RDAC data

    uint16_t digipot7_read_rdac ( digipot7_t *ctx );
  • digipot7_write_rdac The function writes a 10-bit RDAC data

    void digipot7_write_rdac ( digipot7_t *ctx, uint16_t rdac_data );

Example Description

This is an example that demonstrate the use of the DIGI POT 7 click board.

The demo application is composed of two sections :

Application Init

Initialization enables I2C, perform a hardware reset, enable write and set to normal operating mode, also write log.


void application_init ( void ) {
    log_cfg_t log_cfg;  /**< Logger config object. */
    digipot7_cfg_t digipot7_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    digipot7_cfg_setup( &digipot7_cfg );
    DIGIPOT7_MAP_MIKROBUS( digipot7_cfg, MIKROBUS_1 );
    err_t init_flag = digipot7_init( &digipot7, &digipot7_cfg );
    if ( I2C_MASTER_ERROR == init_flag ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, " Hardware Reset \r\n" );
    digipot7_hw_reset( &digipot7 );
    Delay_ms ( 100 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, " Enable Write \r\n" );
    digipot7_enable_write( &digipot7 );
    Delay_ms ( 100 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, " Set normal operating mode \r\n" );
    digipot7_operating_mode( &digipot7, DIGIPOT7_NORMAL_MODE );
    Delay_ms ( 100 );

    log_printf( &logger, "----------------------------\r\n" );
    log_info( &logger, " Application Task " );
    log_printf( &logger, "----------------------------\r\n" );
}

Application Task

In this example we set different resistance values: 1.024 kOhm, 2.048 kOhm, 4.096 kOhm and 8.192 kOhm. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes approximately for every 5 sec.


void application_task ( void ) {
    log_printf( &logger, " Set Resistance: 1.024 kOhm \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    digipot7_set_resistance( &digipot7, 1024 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, " Set Resistance: 2.048 kOhm \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    digipot7_set_resistance( &digipot7, 2048 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, " Set Resistance: 4.096 kOhm \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    digipot7_set_resistance( &digipot7, 4096 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, " Set Resistance: 8.192 kOhm \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    digipot7_set_resistance( &digipot7, 8192 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

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:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.DIGIPOT7

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.


ALSO FROM THIS AUTHOR

CAN FD 7 click

0

CAN FD 7 Click is a compact add-on board that contains a CAN transceiver that supports both CAN and CAN FD protocols. This board features the TCAN1462, an automotive fault-protected CAN FD transceiver from Texas Instruments. It is a high-speed Controller Area Network (CAN) transceiver that meets the ISO 11898-2:2016 high-speed CAN specification and the CiA 601-4 signal improvement capability (SIC) specification.

[Learn More]

Load Cell 5 click

0

Load Cell 5 Click is a compact add-on board that represents a weigh scale solution. This board features the AD7780, a pin-programmable, low power, 24-bit sigma-delta ΣΔ ADC from Analog Devices. It interfaces directly to the load cell, where the low-level signal from the load cell is amplified by the AD7780’s internal low noise programmable gain amplifier programmed to operate with a gain of 128 or 1. It also has a power-down mode allowing the user to switch off the power to the bridge sensor and power-down the AD7780 when not converting, increasing the product battery life. This Click board™ has many features that make it a perfect solution for safety-critical and weight measurement applications.

[Learn More]

Color 9 click

0

Color 9 Click is a very accurate color sensing Click board which features the APDS-9250, IR and ambient light sensor, from Broadcom. It contains a specially designed matrix of photosensitive elements, which can sense red, green, blue and IR component.

[Learn More]