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 (136874 times)
  2. FAT32 Library (70000 times)
  3. Network Ethernet Library (55999 times)
  4. USB Device Library (46305 times)
  5. Network WiFi Library (41921 times)
  6. FT800 Library (41206 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26396 times)
  10. microSD click (25386 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

DAC 15 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.4

mikroSDK Library: 2.0.0.0

Category: DAC

Downloaded: 25 times

Not followed.

License: MIT license  

DAC 15 Click is a compact add-on board that provides a highly accurate digital-to-analog conversion on two channels. This board features the DAC80502, a dual 16-bit 1-LSB INL voltage-output DAC from Texas Instruments. The DAC operates at a wide power supply range and is a low-power device with as low as 1mA per channel at 5.5V. It also includes a 2.5V, 5-ppm/°C internal reference, giving a full-scale voltage buffered output ranges of 1.25V, 2.5V, and 5.5V.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DAC 15 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DAC 15 click" changes.

Do you want to report abuse regarding "DAC 15 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


DAC 15 click

DAC 15 Click is a compact add-on board that provides a highly accurate digital-to-analog conversion on two channels. This board features the DAC80502, a dual 16-bit 1-LSB INL voltage-output DAC from Texas Instruments. The DAC operates at a wide power supply range and is a low-power device with as low as 1mA per channel at 5.5V. It also includes a 2.5V, 5-ppm/°C internal reference, giving a full-scale voltage buffered output ranges of 1.25V, 2.5V, and 5.5V.

dac15_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Jul 2023.
  • Type : I2C/SPI type

Software Support

We provide a library for the DAC 15 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 DAC 15 Click driver.

Standard key functions :

  • dac15_cfg_setup Config Object Initialization function.

    void dac15_cfg_setup ( dac15_cfg_t *cfg );
  • dac15_init Initialization function.

    err_t dac15_init ( dac15_t *ctx, dac15_cfg_t *cfg );
  • dac15_default_cfg Click Default Configuration function.

    err_t dac15_default_cfg ( dac15_t *ctx );

Example key functions :

  • dac15_set_dac_data DAC 15 set DAC data function.

    err_t dac15_set_dac_data ( dac15_t *ctx, uint8_t dac_sel, uint16_t dac_data );
  • dac15_get_dac_data DAC 15 get DAC data function.

    err_t dac15_get_dac_data ( dac15_t *ctx, uint8_t dac_sel, uint16_t *dac_data );

Example Description

This example demonstrates the use of DAC 15 Click board™ by changing the output voltage level on the VOUTA and VOUTB.

The demo application is composed of two sections :

Application Init

Initialization of I2C or SPI module and log UART. After driver initialization, the app executes a default configuration.

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    dac15_cfg_t dac15_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.
    dac15_cfg_setup( &dac15_cfg );
    DAC15_MAP_MIKROBUS( dac15_cfg, MIKROBUS_1 );
    err_t init_flag = dac15_init( &dac15, &dac15_cfg );
    if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( DAC15_ERROR == dac15_default_cfg ( &dac15 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

The demo application changes the output voltage level on the VOUTA and VOUTB. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{   
    static uint16_t dac_data = 0;
    for ( uint16_t n_cnt = 0; n_cnt < 60000; n_cnt += 5000 )
    {
        dac_data = n_cnt;
        if ( DAC15_OK == dac15_set_dac_data( &dac15, DAC15_SET_DAC_A, dac_data ) )
        {
            log_printf( &logger, "VOUTA: %u -> %.2f V\r\n", 
                        dac_data, 
                        ( float ) dac_data * DAC15_VREF_3V3 / DAC15_MAX_DAC_DATA );
        }

        dac_data = DAC15_DAC_RES_16BIT - n_cnt;
        if ( DAC15_OK == dac15_set_dac_data( &dac15, DAC15_SET_DAC_B, dac_data ) )
        {
            log_printf( &logger, "VOUTB: %u -> %.2f V\r\n", 
                        dac_data, 
                        ( float ) dac_data * DAC15_VREF_3V3 / DAC15_MAX_DAC_DATA );
        }
        log_printf( &logger, " -------------------\r\n" );
        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.DAC15

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

Charger click

0

Charger Click is a compact add-on board providing a standalone battery charger and monitor. This board features Microchip's MCP73831, a miniature single-cell, fully integrated Li-Ion, Li-Polymer charge management controller. The charge voltage of the MCP73831 is set to 4.20V, and a charge current to 250mA with an external resistor. In addition, this Click board™ features the DS2438, a smart battery monitor that monitors the total amount of current going into and out of the battery.

[Learn More]

Flicker click

0

FLICKER click is perfect, simple solution if you need to turn a device on and off at specific time intervals, like blinking LED commercials, alarm system lights, or any other signalling lights. This example shows how by using the button you can start time relay and configure it's duration of on and off period.

[Learn More]

Utility Task Scheduler

11

Contains common utilities that are often implemented repetitively. This library contains a task scheduler. Incredibly handy for those systems doing multiple things. By using the libraries here, you save yourself some time and have the convenience of MikroCs' library management system.

[Learn More]