TOP Contributors

  1. MIKROE (2751 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 (139059 times)
  2. FAT32 Library (71589 times)
  3. Network Ethernet Library (56988 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 (27874 times)
  9. PID Library (26858 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 12 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: DAC

Downloaded: 171 times

Not followed.

License: MIT license  

DAC 12 Click is a compact add-on board that contains a highly accurate digital-to-analog converter. This board features the DAC60508, a general-purpose octal 12-bit analog voltage-output DAC from Texas Instruments. It includes a 2.5V, 5ppm/°C internal reference, eliminating the need for an external precision reference in most applications, and supports the SPI serial interface, which operates at clock rates up to 40MHz. A user interface-selectable gain configuration provides full-scale output voltages of 1.25V, 2.5V, or 5 V. This Click board™ represents an excellent choice for digital gain and offset adjustment applications, programmable voltage, and current sources, programmable reference, and many more.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


DAC 12 Click

DAC 12 Click is a compact add-on board that contains a highly accurate digital-to-analog converter. This board features the DAC60508, a general-purpose octal 12-bit analog voltage-output DAC from Texas Instruments. It includes a 2.5V, 5ppm/°C internal reference, eliminating the need for an external precision reference in most applications, and supports the SPI serial interface, which operates at clock rates up to 40MHz. A user interface-selectable gain configuration provides full-scale output voltages of 1.25V, 2.5V, or 5 V. This Click board™ represents an excellent choice for digital gain and offset adjustment applications, programmable voltage, and current sources, programmable reference, and many more.

dac12_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Feb 2022.
  • Type : SPI type

Software Support

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

Standard key functions :

  • dac12_cfg_setup Config Object Initialization function.

    void dac12_cfg_setup ( dac12_cfg_t *cfg );
  • dac12_init Initialization function.

    err_t dac12_init ( dac12_t *ctx, dac12_cfg_t *cfg );
  • dac12_default_cfg Click Default Configuration function.

    err_t dac12_default_cfg ( dac12_t *ctx );

Example key functions :

  • dac12_soft_reset This function executes the software reset command.

    err_t dac12_soft_reset ( dac12_t *ctx );
  • dac12_set_channel_value This function sets the raw DAC value to the specific channels output.

    err_t dac12_set_channel_value ( dac12_t *ctx, uint8_t channel, uint16_t dac_value );
  • dac12_set_channel_voltage This function sets the output voltage of the specific channels.

    err_t dac12_set_channel_voltage ( dac12_t *ctx, uint8_t channel, float voltage );

Example Description

This example demonstrates the use of DAC 12 Click board by changing the outputs voltage level every 2 seconds.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    dac12_cfg_t dac12_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.
    dac12_cfg_setup( &dac12_cfg );
    DAC12_MAP_MIKROBUS( dac12_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == dac12_init( &dac12, &dac12_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    DAC12_SET_DATA_SAMPLE_EDGE;

    if ( DAC12_ERROR == dac12_default_cfg ( &dac12 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Changes the output voltage of all channels every 2 seconds and logs the voltage value on the USB UART. It will go through the entire voltage range taking into account the number of steps which is defined below.

void application_task ( void )
{
    float step = DAC12_INTERNAL_VREF / NUMBER_OF_STEPS;
    float output_voltage = step;
    for ( uint8_t cnt = 0; cnt < NUMBER_OF_STEPS; cnt++ )
    {
        if ( DAC12_OK == dac12_set_channel_voltage ( &dac12, DAC12_SELECT_CHANNEL_ALL, output_voltage ) )
        {
            log_printf( &logger, " All channels output voltage set to %.3f V\r\n", output_voltage );
            output_voltage += step;
            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.DAC12

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

Color 11 Click

0

Color 11 Click is a compact add-on board that provides an accurate color-sensing solution. This board features the TCS34083M, an ALS/color sensor with selective flicker detection from ams-OSRAM. The sensor features ambient light and color (RGB) sensing and flicker detection, which suppresses cross-coupling from 940nm IR if generated by adjacent circuits. The main benefits of this sensor are invisible ALS and color sensing under any glass type, unique fast ALS integration mode, and more. It features configurable programmable gain and integration time, tailored ALS and color response, ALS/color interrupt with thresholds, and many more.

[Learn More]

Ambient 12 Click

0

Ambient 12 Click is a compact add-on board used to sense the amount of the present ambient light. This board features the BH1620FVC, an analog current-output type ambient light sensor from Rohm Semiconductor.

[Learn More]

Mikromedia+ for Stellaris ARM - RF Communication Example

0

This is demonstration project how Mikromedia+ for Stellaris communicate over RF. Data is send over simple 'led protocol' (1 byte command). Development board for Stellaris with an add-on board nRF Click is used as a receiver device.

[Learn More]