Beginner
10 min

Convert digital signals into precise analog voltage outputs using the DAC7558 and EasyMx PRO v7 for Tiva MCU card with TM4C123GH6PMI

12-bit octal-channel voltage-output digital-to-analog (DAC)

DAC 17 Click with EasyMx PRO v7 for Tiva

Published May 23, 2024

Click board™

DAC 17 Click

Dev.Board

EasyMx PRO v7 for Tiva

Compiler

NECTO Studio

MCU

EasyMx PRO v7 for Tiva MCU card with TM4C123GH6PMI

Precise voltage output control for applications like digital gain adjustment, programmable voltage sources, and industrial process control.

A

A

Hardware Overview

How does it work?

DAC 17 Click is based on the DAC7558, a 12-bit, octal-channel voltage output DAC from Texas Instruments, known for its exceptional linearity and monotonicity. Its proprietary architecture mitigates undesired transients, such as code-to-code glitches and channel-to-channel crosstalk. Operating within a voltage range of 2.7V to 5.5V, the DAC7558 offers versatility. The board provides the flexibility of powering the IC internally or externally by setting the VCC SEL jumper to either the VIO or VEXT position. The VIO option enables internal powering of the Click board™, providing a choice between 3.3V or 5V. On the other hand, the VEXT option allows users to externally supply power in the range of 2.7 to 5.5V (applied to VEXT pins), offering flexibility in power supply according to specific system requirements. Featuring output amplifiers capable of driving a 2Ω, 200pF load rail-to-rail with a rapid settling time of 5µs, the

DAC7558 ensures precise and efficient performance. Users can configure the output range of DAC channels (from CHA to CHH) by connecting an external voltage reference to one of the REFx terminals in a range from 0V to a value of the main IC supply, VCC. Additionally, the board offers a selection between internal and external voltage reference sources. This selection is made via the VREF SEL jumpers, allowing users to choose between internal or external voltage reference options. The DAC7558 offers versatility in operation, with the ability to update outputs simultaneously or sequentially. Its integrated Power-on-Reset circuit guarantees that DAC outputs power up to zero volts during initialization. Furthermore, a Power-Down feature, controllable via the PD pin of the mikroBUS™ socket, reduces the device's current consumption to under 2µA, enhancing efficiency and prolonging battery life.

Communication with the host MCU is achieved through the 4-wire SPI serial interface, supporting clock rates of up to 50MHz. This interface is compatible with SPI, QSPI, Microwire™, and DSP standards, ensuring easy integration into various systems. The DAC7558 also uses an active-low reset feature via the RST pin on the mikroBUS™ socket. When the RST pin is set to a LOW logic state, all DAC channels are reset to zero scale. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VIO SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.

DAC 17 Click hardware overview image

Features overview

Development board

EasyMx PRO v7 for TIVA is the seventh generation of ARM development boards specially designed for the needs of rapid development of embedded applications. It supports a wide range of 32-bit ARM microcontrollers from Texas Instruments and a broad set of unique functions, such as a powerful onboard mikroProg programmer and In-Circuit debugger over USB-B. 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. With two different connectors for each port, EasyMx PRO v7 for TIVA allows you to connect accessory boards, sensors, and custom electronics more efficiently than ever. Each part of the EasyMx

PRO v7 for TIVA development board contains the components necessary for the most efficient operation of the same board. An integrated mikroProg, a fast USB 2.0 programmer with mikroICD hardware In-Circuit Debugger, offers many valuable programming/debugging options and seamless integration with the Mikroe software environment. Besides it also includes a clean and regulated power supply block for the development board. It can use a wide range of external power sources, including an external 12V power supply, 7-23V AC or 9-32V DC via DC connector/screw terminals, and a power source via the USB Type-B (USB-B) connector. Communication options such as USB-UART, USB-HOST/DEVICE, CAN, and

Ethernet are also included, including the well-established mikroBUS™ standard, one display option for the TFT board line of products, and a standard TQFP socket for the seventh-generation MCU cards. This socket covers a wide range of 32-bit TIVA-series ARM Cortex-M4 MCUs. EasyMx PRO v7 for TIVA 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.

EasyMx PRO v7 for Tiva horizontal image

Microcontroller Overview

MCU Card / MCU

default

Type

7th Generation

Architecture

ARM Cortex-M4

MCU Memory (KB)

10

Silicon Vendor

Texas Instruments

Pin count

64

RAM (Bytes)

100

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Reset / ID SEL
PE0
RST
SPI Select / ID COMM
PB0
CS
SPI Clock
PA2
SCK
SPI Data OUT
PA4
MISO
SPI Data IN
PA5
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Power-Down
PD0
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

Schematic

DAC 17 Click Schematic schematic

Step by step

Project assembly

EasyPIC Fusion v7 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the EasyMx PRO v7 for Tiva as your development board.

EasyPIC Fusion v7 front image hardware assembly
GNSS2 Click front image hardware assembly
EasyPIC FUSION v7 ETH MCUcard with PIC32MZ2048EFH144 front image hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
EMxPRO-STM32-TIVA/EPIC Fusion v7 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
EasyPIC PRO v7a MCU Selection Necto Step hardware assembly
EasyPIC PRO v7a Display Selection Necto Step 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

After pressing the "FLASH" button on the left-side panel, it is necessary to open the UART terminal to display the achieved results. By clicking on the Tools icon in the right-hand panel, multiple different functions are displayed, among which is the UART Terminal. Click on the offered "UART Terminal" icon.

UART Application Output Step 1

Once the UART terminal is opened, the window takes on a new form. At the top of the tab are two buttons, one for adjusting the parameters of the UART terminal and the other for connecting the UART terminal. The tab's lower part is reserved for displaying the achieved results. Before connecting, the terminal has a Disconnected status, indicating that the terminal is not yet active. Before connecting, it is necessary to check the set parameters of the UART terminal. Click on the "OPTIONS" button.

UART Application Output Step 2

In the newly opened UART Terminal Options field, we check if the terminal settings are correct, such as the set port and the Baud rate of UART communication. If the data is not displayed properly, it is possible that the Baud rate value is not set correctly and needs to be adjusted to 115200. If all the parameters are set correctly, click on "CONFIGURE".

UART Application Output Step 3

The next step is to click on the "CONNECT" button, after which the terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.

UART Application Output Step 4

Software Support

Library Description

This library contains API for DAC 17Click driver.

Key functions:

  • dac17_send_command - This function is used to send specific command of the DAC 17 click board.

  • dac17_set_dac_output - This function is used to set output level of the sellected channel of the DAC 17 click board.

  • dac17_set_all_dac_output - This function is used to set output level of the DAC 17 click board.

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * @file main.c
 * @brief DAC 17 Click example
 *
 * # Description
 * This example demonstrates the use of DAC 17 Click board 
 * by changing the voltage level on the output channels.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and performs click default configuration.
 *
 * ## Application Task
 * Changes the output channels voltage level starting from full scale ( REF voltage ),  
 * to the mid-scale ( half of the REF voltage ), and then to zero every two seconds.
 *
 * @author Stefan Ilic
 *
 */

#include "board.h"
#include "log.h"
#include "dac17.h"

static dac17_t dac17;
static log_t logger;

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    dac17_cfg_t dac17_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.
    dac17_cfg_setup( &dac17_cfg );
    DAC17_MAP_MIKROBUS( dac17_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == dac17_init( &dac17, &dac17_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( DAC17_ERROR == dac17_default_cfg ( &dac17 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

void application_task ( void )
{
    #define DAC17_OUTPUT_ZERO           0x0000u
    #define DAC17_OUTPUT_MID_SCALE      0x0800u
    #define DAC17_OUTPUT_FULL_SCALE     0x0FFFu

    log_printf( &logger, " Setting all channels to full scale output \r\n" );
    dac17_set_all_dac_output( &dac17, DAC17_OUTPUT_FULL_SCALE );
    Delay_ms( 2000 );

    log_printf( &logger, " Setting all channels outputs to zero \r\n" );
    dac17_set_all_dac_output( &dac17, DAC17_OUTPUT_ZERO );
    Delay_ms( 2000 );

    log_printf( &logger, " Setting all channels outputs to mid scale \r\n" );
    dac17_set_all_dac_output( &dac17, DAC17_OUTPUT_MID_SCALE );
    Delay_ms( 2000 );
}

int main ( void ) 
{
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

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

Additional Support

Resources