Experience the synergy of precision and transformation with our DAC solution
A
A
Hardware Overview
How does it work?
DAC 8 Click is based on the DAC8554, a 16-bit QUAD channel, ultra-low glitch, voltage-output digital to analog converter from Texas Instruments. It offers good linearity, exceptionally low glitch, and high precision output amplifier, allowing rail-to-rail output swing over a wide supply voltage range. This component additionally has a Power-On reset function, which ensures that DAC outputs power-up at zero-scale and remains there until a proper write operation occurs. Also, it provides a power-down feature that reduces the current consumption to 175nA per channel. An external voltage reference is made user-programmable to achieve a fully flexible range of the DAC8554. For this purpose, the Click board™ uses another DAC, DAC60501, a 12-bit DAC from Texas Instruments, whose output is brought to the
VREF pin of the DAC8554. That way, the reference voltage of the DAC8554 can be set at any value between 0V and 5V, providing high precision and low power consumption as well. That makes the DAC 8 Click a fully customizable solution, well suited for applications where the maximum precision from the output 16-bit DAC is needed. DAC60501 uses the I2C serial interface to communicate with the MCU and operates at a clock rate of up to 100kHz. The DAC 6 Click communicates with MCU using the 3-Wire SPI serial interface compatible with standard SPI, QSPI™, and MICROWIRE™ and operates at clock rates up to 50 MHz. Additional functionality, such as software simultaneous update capability, is implemented and routed at the PWM pin of the mikroBUS™, which allows when new data enter
the device, all DAC outputs can be updated simultaneously and synchronously with the clock. It also possesses enable function routed at the CS pin of the mikroBUS™ that is used to connect the SPI interface to the serial port. This Click Board™ is designed to be operated with both 3.3V and 5V logic levels. The onboard SMD jumper labeled VCC SEL allows voltage selection for interfacing with 3.3V and 5V MCUs. More information about the DAC8554’s functionality, electrical specifications, and typical performance can be found in the attached datasheet. However, the Click board™ comes equipped with a library that contains easy-to-use functions and a usage example that can be used as a reference for the development.
Features overview
Development board
UNI-DS v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different STM32, Kinetis, TIVA, CEC, MSP, PIC, dsPIC, PIC32, and AVR MCUs regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over WiFi. 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. Thanks to innovative manufacturing technology, UNI-DS v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the UNI-DS v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector. Communication options such as USB-UART, USB
HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. UNI-DS v8 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.
Microcontroller Overview
MCU Card / MCU
Type
8th Generation
Architecture
AVR
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
2048
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for DAC 8 Click driver.
Key functions:
dac8_device_config
- This function set configuration of the DAC8554dac8_load_dac
- This function simultaneously update DAC with the contents of the corresponding data buffersdac8_set_vref
- This function set voltage reference
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief Dac8 Click example
*
* # Description
* This click carries 12-bit buffered Digital-to-Analog Converter. It converts digital value to
* the corresponding voltage level using external voltage reference.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization driver enables - I2C.
* Configure DAC60501: executes call software reset, disable sync and internal reference and
* disable Power-down mode, the set reference voltage is internally divided by a factor of 2,
* amplifier for corresponding DAC has a gain of 2.
* Initialization driver enables - SPI, enable DAC8554, also write log.
*
* ## Application Task
* This is an example that demonstrates the use of the DAC 8 Click board.
* DAC 8 board changeing output values:
* Channel A ~ 2500 mV, Channel B ~ 1250 mV,
* Channel C ~ 625 mV, Channel D ~ 312 mV.
* All data logs write on USB uart changes every 5 sec.
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "dac8.h"
// ------------------------------------------------------------------ VARIABLES
static dac8_t dac8;
static log_t logger;
dac8_cfg_data_t cfg_dac;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
dac8_cfg_t cfg;
/**
* 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.
dac8_cfg_setup( &cfg );
DAC8_MAP_MIKROBUS( cfg, MIKROBUS_1 );
dac8_init( &dac8, &cfg, DAC8_MASTER_I2C );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " I2C driver init. \r\n" );
Delay_ms( 100 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " DAC60501 \r\n" );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Soft reset \r\n" );
dac8_soft_reset( &dac8 );
Delay_ms( 100 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Disable sync. mode \r\n" );
dac8_enable_sync( &dac8, DAC8_SYNC_DISABLE );
Delay_ms( 100 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Set config.: \r\n" );
log_printf( &logger, " Enable: \r\n" );
log_printf( &logger, " Internal reference \r\n" );
log_printf( &logger, " Disable: \r\n" );
log_printf( &logger, " Power-down mode \r\n" );
dac8_set_config( &dac8, DAC8_CONFIG_REF_PWDWN_ENABLE, DAC8_CONFIG_DAC_PWDWN_DISABLE );
Delay_ms( 100 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Vref divided by 2 \r\n" );
log_printf( &logger, " Set DAC gain of 2 \r\n" );
dac8_set_gain( &dac8, DAC8_GAIN_REF_DIV_2, DAC8_GAIN_BUFF_GAIN_1 );
Delay_ms( 100 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Set Vref ~ 2500 mV \r\n" );
dac8_set_vref( &dac8, 2500 );
Delay_ms( 1000 );
dac8_init( &dac8, &cfg, DAC8_MASTER_SPI );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " SPI driver init. \r\n" );
Delay_ms( 1000 );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " DAC8554 \r\n" );
log_printf( &logger, "---------------------\r\n" );
log_printf( &logger, " Enable DAC8554 \r\n" );
dac8_device_enable( &dac8, DAC8_DAC8554_ENABLE );
Delay_ms( 100 );
}
void application_task ( void )
{
log_printf( &logger, "---------------------\r\n" );
cfg_dac.addr = DAC8_ADDR_DEFAULT;
cfg_dac.ctrl_upd_an_out = DAC8_CTRL_UPD_AN_OUT_SINGLE_CH_STORE;
cfg_dac.dac_sel = DAC8_DAC_SEL_CH_A;
cfg_dac.pwr_mode = DAC8_PWR_MODE_POWER_UP;
cfg_dac.dac_val = 0xFFFF;
log_printf( &logger, " Channel A ~ 2500 mV \r\n" );
dac8_device_config( &dac8, cfg_dac );
dac8_load_dac( &dac8 );
Delay_ms( 5000 );
log_printf( &logger, "---------------------\r\n" );
cfg_dac.addr = DAC8_ADDR_DEFAULT;
cfg_dac.ctrl_upd_an_out = DAC8_CTRL_UPD_AN_OUT_SINGLE_CH_STORE;
cfg_dac.dac_sel = DAC8_DAC_SEL_CH_B;
cfg_dac.pwr_mode = DAC8_PWR_MODE_POWER_UP;
cfg_dac.dac_val = 0x7FFF;
log_printf( &logger, " Channel B ~ 1250 mV \r\n" );
dac8_device_config( &dac8, cfg_dac );
dac8_load_dac( &dac8 );
Delay_ms( 5000 );
log_printf( &logger, "---------------------\r\n" );
cfg_dac.addr = DAC8_ADDR_DEFAULT;
cfg_dac.ctrl_upd_an_out = DAC8_CTRL_UPD_AN_OUT_SINGLE_CH_STORE;
cfg_dac.dac_sel = DAC8_DAC_SEL_CH_C;
cfg_dac.pwr_mode = DAC8_PWR_MODE_POWER_UP;
cfg_dac.dac_val = 0x3FFF;
log_printf( &logger, " Channel C ~ 625 mV \r\n" );
dac8_device_config( &dac8, cfg_dac );
dac8_load_dac( &dac8 );
Delay_ms( 5000 );
log_printf( &logger, "---------------------\r\n" );
cfg_dac.addr = DAC8_ADDR_DEFAULT;
cfg_dac.ctrl_upd_an_out = DAC8_CTRL_UPD_AN_OUT_SINGLE_CH_STORE;
cfg_dac.dac_sel = DAC8_DAC_SEL_CH_D;
cfg_dac.pwr_mode = DAC8_PWR_MODE_POWER_UP;
cfg_dac.dac_val = 0x1FFF;
log_printf( &logger, " Channel D ~ 312 mV\r\n" );
dac8_device_config( &dac8, cfg_dac );
dac8_load_dac( &dac8 );
Delay_ms( 5000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END