TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139071 times)
  2. FAT32 Library (71595 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27876 times)
  9. PID Library (26859 times)
  10. microSD click (26129 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 9 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: DAC

Downloaded: 184 times

Not followed.

License: MIT license  

DAC 9 Click is a compact add-on board that contains a fully-featured, highly accurate digital-to-analog converter. This board features the DAC80501, a 16-bit voltage-output digital-to-analog converter with precision internal reference from Texas Instruments. It supports both I2C and SPI serial interface and offers a linearity of < 1 LSB. It also includes a 2.5V internal reference, giving full-scale output voltage ranges of 1.25V, 2.5V, or 5V, incorporate a Power-On Reset function, consume a low current of 1mA, and include a Power-Down feature that reduces current consumption to typically 15μA at 5V.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DAC 9 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DAC 9 Click" changes.

Do you want to report abuse regarding "DAC 9 Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


DAC 9 Click

DAC 9 Click is a compact add-on board that contains a fully-featured, highly accurate digital-to-analog converter. This board features the DAC80501, a 16-bit voltage-output digital-to-analog converter with precision internal reference from Texas Instruments. It supports both I2C and SPI serial interface and offers a linearity of < 1 LSB. It also includes a 2.5V internal reference, giving full-scale output voltage ranges of 1.25V, 2.5V, or 5V, incorporate a Power-On Reset function, consume a low current of 1mA, and include a Power-Down feature that reduces current consumption to typically 15μA at 5V.

dac9_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Aug 2021.
  • Type : I2C/SPI type

Software Support

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

Standard key functions :

  • dac9_cfg_setup Config Object Initialization function.

    void dac9_cfg_setup ( dac9_cfg_t *cfg );
  • dac9_init Initialization function.

    err_t dac9_init ( dac9_t *ctx, dac9_cfg_t *cfg );

Example key functions :

  • dac9_set_config Set config function.

    err_t dac9_set_config ( dac9_t *ctx, uint16_t en_ref_pwdwn, uint16_t en_dac_pwdwn );
  • dac9_set_gain Set gain function.

    err_t dac9_set_gain ( dac9_t *ctx, uint16_t en_ref_div, uint16_t en_buff_gain );
  • dac9_set_vout Set Vout function.

    err_t dac9_set_vout ( dac9_t *ctx, uint16_t vout_mv );

Example Description

This is an example that demonstrates the use of the DAC 9 Click board.

The demo application is composed of two sections :

Application Init

Initalizes SPI or I2C driver and applies default settings.


void application_init ( void ) {
    log_cfg_t log_cfg;  /**< Logger config object. */
    dac9_cfg_t dac9_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.
    dac9_cfg_setup( &dac9_cfg );
    DAC9_MAP_MIKROBUS( dac9_cfg, MIKROBUS_1 );
    err_t init_flag  = dac9_init( &dac9, &dac9_cfg );
    if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_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, "     Soft reset      \r\n" );
    dac9_soft_reset( &dac9 );
    Delay_ms ( 200 );

    log_printf( &logger, "---------------------\r\n" );
    log_printf( &logger, "  Vref divided by 2  \r\n" );
    log_printf( &logger, "  Set DAC gain of 2  \r\n" );
    dac9_set_gain( &dac9, DAC9_GAIN_REF_DIV_2, DAC9_GAIN_BUFF_GAIN_2 );
    Delay_ms ( 100 );

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

Application Task

Demonstrates use of DAC 9 Click board by changeing output values every two seconds.


void application_task ( void ) {
    uint16_t n_cnt;
    for ( n_cnt = 0; n_cnt <= res; n_cnt += 500 ) {
        log_printf( &logger, "Output Voltage : %d mV\r\n", ( uint16_t ) n_cnt );
        dac9_set_vout( &dac9, n_cnt );
        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.DAC9

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

PRESS Click

0

PRESS Click is a compact add-on board that contains a board-mount pressure sensor. This board features the ILPS28QSW, an absolute digital output barometer from STMicroelectronics. It is a dual full-scale sensor with a measuring range of 260 up to 4060hPa. In addition, it comes with a Qvar detection ability, which is an electric charge variation detection and is available on two pins.

[Learn More]

Buck 15 Click

0

Buck 15 Click is a compact add-on board for precision voltage regulation across various applications. This board features the TPS62903, a synchronous step-down DC/DC converter from Texas Instruments. It is known for its adaptability, rapid transient response, and high output voltage accuracy of ±1.5% across all operating temperatures. Featuring the innovative DCS-control topology, it supports a wide input voltage range of 3V to 17V, an adjustable output voltage from 0.4V to 5V, and currents up to 3A. This Click board™ can be used in a variety of automotive applications, such as the ADAS, body electronics and lighting, infotainment and cluster, hybrid, electric, and powertrain systems, any application with a 12V input voltage or a 1-4 cell lithium battery pack, and more.

[Learn More]

AlphaNum G 2 Click

0

AlphaNum G 2 Click is a compact add-on board that represents an easy solution for adding numeric or hexadecimal displays to your application. This board features the LTP-3862, a dual-digit 16-segment alphanumeric green display from Lite-ON. It is a 0.3” (7.62mm) display with black face and white segments. The LED segments use common anodes, and besides segments, the decimal point (DP) dot is also available.

[Learn More]