TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 codes)
  5. Bugz Bensce (97 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 (140543 times)
  2. FAT32 Library (73035 times)
  3. Network Ethernet Library (58043 times)
  4. USB Device Library (48214 times)
  5. Network WiFi Library (43826 times)
  6. FT800 Library (43295 times)
  7. GSM click (30359 times)
  8. mikroSDK (28987 times)
  9. PID Library (27116 times)
  10. microSD click (26721 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 18 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: DAC

Downloaded: 38 times

Not followed.

License: MIT license  

DAC 18 Click is a compact add-on board for converting general-purpose input to PWM signals. This board features the DAC539G2-Q1, a 10-bit smart DAC from Texas Instruments. The board offers two key output channels: one for digital-to-analog conversion (OUT1) and the other for voltage-to-PWM conversion (OUT0) supporting triangle or sawtooth waveforms. It features an operational mode selection pin for I2C programming or standalone operation, along with nonvolatile memory for storing register settings. DAC 18 Click is ideal for automotive lighting systems and industrial environments requiring reliable signal conversion.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


DAC 18 Click

DAC 18 Click is a compact add-on board for converting general-purpose input to PWM signals. This board features the DAC539G2-Q1, a 10-bit smart DAC from Texas Instruments. The board offers two key output channels: one for digital-to-analog conversion (OUT1) and the other for voltage-to-PWM conversion (OUT0) supporting triangle or sawtooth waveforms. It features an operational mode selection pin for I2C programming or standalone operation, along with nonvolatile memory for storing register settings. DAC 18 Click is ideal for automotive lighting systems and industrial environments requiring reliable signal conversion.

dac18_click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Mar 2024.
  • Type : I2C type

Software Support

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

Standard key functions :

  • dac18_cfg_setup Config Object Initialization function.

    void dac18_cfg_setup ( dac18_cfg_t *cfg );
  • dac18_init Initialization function.

    err_t dac18_init ( dac18_t *ctx, dac18_cfg_t *cfg );
  • dac18_default_cfg Click Default Configuration function.

    err_t dac18_default_cfg ( dac18_t *ctx );

Example key functions :

  • dac18_cfg_pwm_out This function configures PWM output (OUT0) for the function generator by using the I2C serial interface.

    err_t dac18_cfg_pwm_out ( dac18_t *ctx, uint8_t f_sel, uint8_t c_step, uint8_t t_step );
  • dac18_set_mode This function selects between programming and standalone modes by toggling the digital output state of the MOD pin.

    void dac18_set_mode ( dac18_t *ctx, uint8_t mode );
  • dac18_get_gpi_status This function gets GPI status by reading the states of the GP0, GP1 and GP2 pins.

    void dac18_get_gpi_status ( dac18_t *ctx, uint8_t *gpi_status );

Example Description

This example demonstrates the use of the DAC 18 Click board by configuring the waveform signals from a function generator on the OUT0 and voltage level on the OUT1.

The demo application is composed of two sections :

Application Init

Initialization of I2C module and log UART. After driver initialization, the app executes a default configuration (configuration mode).

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    dac18_cfg_t dac18_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.
    dac18_cfg_setup( &dac18_cfg );
    DAC18_MAP_MIKROBUS( dac18_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == dac18_init( &dac18, &dac18_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( DAC18_ERROR == dac18_default_cfg ( &dac18 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
    log_printf( &logger, " Use the GP0, GP1 and GP2 switch to change the outputs\r\n\n" );
}

Application Task

The demo application operated in standalone mode and displayed the voltage level on OUT1. The GP0, GP1, and GP2 switches on the DAC 18 Click board are used to change the output voltage level and waveform signals. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void ) 
{
    dac18_get_gpi_status( &dac18, &gpi_status );
    if ( gpi_status != new_gpi_status )
    {
        new_gpi_status = gpi_status;
        dac18_display_out_status( );
    }
    Delay_ms ( 100 );
}

Note

Set GP0, GP1, and GP2 switches to position "1" for the configuration modes.

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.DAC18

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

ROTARY Y Click

0

Rotary Click carries a 15-pulse incremental rotary encoder with detents, surrounded by a ring of 16 yellow LEDs. It’s a perfect solution for adding a precision input knob to your design. The encoder outputs A and B signals (out of phase to each other); the knob also acts as a push-button which sends an interrupt to the target board MCU. The LED ring is controlled through SPI lines (CS, SCK, MISO, MOSI). Rotary Click can be used with either a 3.3V or 5V power supply.

[Learn More]

Color 18 Click

0

Color 18 Click is a compact add-on board for accurate ambient light detection and flicker monitoring. This board features the TCS3530, a true color ambient light sensor from ams OSRAM. The TCS3530 features true color XYZ sensing, flicker detection up to 7kHz, and eight concurrent sensing channels with independent gain configurations. It also includes a UV/IR blocking filter for precise light measurements and a unique Click Snap feature, allowing the main sensor area to become movable by breaking the PCB for flexible implementation.

[Learn More]

OBD II click

0

OBDII click offers a unique opportunity to tap inside the car diagnostic systems. It features the STN1110 Multiprotocol OBD to UART Interface, developed by the ScanTool technologies.

[Learn More]