Intermediate
30 min

Fine-tune circuit characteristics easier than ever using MAX5494 and TM4C129EKCPDT

Taming currents in the digital realm

DIGI POT 4 Click with Fusion for Tiva v8

Published Aug 21, 2023

Click board™

DIGI POT 4 Click

Dev Board

Fusion for Tiva v8

Compiler

NECTO Studio

MCU

TM4C129EKCPDT

Redesign your approach to precision control by integrating our digital potentiometers, achieving unparalleled customization and stability

A

A

Hardware Overview

How does it work?

DIGI POT 4 Click is based on the MAX5494, a 10-bit dual, non-volatile, linear taper digital potentiometer from Analog Devices. This IC consists of the control logic and a resistors stream (i.e., 1024 equal resistors serially connected) through which the wiper moves. The end-to-end resistance of the resistors on the used IC is 10KΩ. The wiper movement is done by writing 10-bit data into the wiper registers, resulting in 1024 discrete positions the wiper can take. All three terminals of the digital pot are routed to the IC terminals and the onboard connectors for easy and secure connection to the rest of the circuit.

The MAX5494 contains two such potentiometers routed to the click board™ screw terminals. The voltage drop may occur while switching positions depending on the output impedance to which the wiper is connected. Therefore, it is not recommended to use it as the variable resistor. After the power is on, the content of the EEPROM NV memory will be copied to the volatile RAM, used as the shift register for the wiper position. This volatile memory register directly controls the wiper position. The wiper can be positioned by writing data into this register. The EEPROM NV registers are only written if requested using the

specific write command. This way, the EEPROM lifecycle is prolonged, although it can withstand up to 200000 read/write cycles. All the communication with the control logic of the MAX5494 is done through the SPI, so all the SPI signals are routed to the appropriate mikroBUS™ pins. The CS pin is held high, preventing the SPI communication, so as always - to initialize the SPI communication, the CS pin needs to be pulled LOW by the MCU. Besides two connectors used to connect the potentiometer terminals, the click board™ is equipped with the SMD jumper to choose between the 3.3V or 5V operating voltage.

DIGI POT 4 Click top side image
DIGI POT 4 Click bottom side image

Features overview

Development board

Fusion for TIVA v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different 32-bit ARM® Cortex®-M based MCUs from Texas Instruments, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over a WiFi network. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for TIVA v8 provides a fluid and immersive working experience, allowing access

anywhere and under any circumstances at any time. Each part of the Fusion for TIVA v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.

Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for TIVA v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

Fusion for Tiva v8 horizontal image

Microcontroller Overview

MCU Card / MCU

default

Type

8th Generation

Architecture

ARM Cortex-M4

MCU Memory (KB)

512

Silicon Vendor

Texas Instruments

Pin count

128

RAM (Bytes)

262144

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
NC
NC
RST
SPI Chip Select
PH0
CS
SPI Clock
PQ0
SCK
NC
NC
MISO
SPI Data IN
PQ2
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
NC
NC
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

DIGI POT 4 Click Schematic schematic

Step by step

Project assembly

Fusion for PIC v8 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Fusion for Tiva v8 as your development board.

Fusion for PIC v8 front image hardware assembly
GNSS2 Click front image hardware assembly
SiBRAIN for PIC32MZ1024EFK144 front image hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
v8 SiBRAIN Access MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
NECTO Compiler Selection Step Image hardware assembly
NECTO Output Selection Step Image hardware assembly
Necto image step 6 hardware assembly
Necto image step 7 hardware assembly
Necto image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto PreFlash Image hardware assembly

Track your results in real time

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.

Software Support

Library Description

This library contains API for DIGI POT 4 Click driver.

Key functions:

  • digipot4_write_reg - This function writes data in wiper register and NV register

  • digipot4_copy_reg - This function is used to copy the data from the wipers to the NV memory and from the NV memory it wipers

Open Source

Code example

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.

/*!
 * \file 
 * \brief DigiPot4 Click example
 * 
 * # Description
 * This application is a digitally controlled dual potentiometer.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Driver intialization
 * 
 * ## Application Task  
 * Set the wiper position.
 * 
 * \author MikroE Team
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "digipot4.h"

// ------------------------------------------------------------------ VARIABLES

static digipot4_t digipot4;
static log_t logger;

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    digipot4_cfg_t cfg;

    /** 
     * 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.

    digipot4_cfg_setup( &cfg );
    DIGIPOT4_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    digipot4_init( &digipot4, &cfg );
}

void application_task ( void )
{
    //  Task implementation.

    digipot4_write_reg( &digipot4, DIGIPOT4_WIPER_REG_1, 0 );
    digipot4_write_reg( &digipot4, DIGIPOT4_WIPER_REG_2, 0 );
    Delay_1sec( );
    digipot4_write_reg( &digipot4, DIGIPOT4_WIPER_REG_1, 512 );
    digipot4_write_reg( &digipot4, DIGIPOT4_WIPER_REG_2, 512 );
    Delay_1sec( );
    digipot4_write_reg( &digipot4, DIGIPOT4_WIPER_REG_1, 1023 );
    digipot4_write_reg( &digipot4, DIGIPOT4_WIPER_REG_2, 1023 );
    Delay_1sec( );
}

void main ( void )
{
    application_init( );

    for ( ; ; )
    {
        application_task( );
    }
}


// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.