Whether in scientific instrumentation, telecommunications, or audio equipment, our DAC solution empowers users to generate precise analog outputs from digital inputs, serving as a universal translator between digital and analog domains
A
A
Hardware Overview
How does it work?
DAC 14 Click is based on the DAC53202, a 10-bit dual-channel buffered digital-to-analog converter from Texas Instruments. The DAC channels are independently configurable as voltage or current output, achieved through the population of resistors R6 and R7. By default, these resistors are populated, and the Click board™ works in voltage-output mode providing output voltage in a range from 0V to 5V; they need to be removed to use current-output mode. Both the voltage- and current-output modes support multiple programmable output ranges. In addition to the internal voltage reference of 1.21V, the DAC53202 can also have an external reference using mikroBUS™ power rails as a reference voltage. The DAC53202 supports Hi-Z Power-Down mode putting its output in Hi-Z state during Power-OFF conditions, maintaining low leakage current at the
output channels with up to 1.25V of forced voltage. Besides, it also supports an independent comparator mode for each channel. The comparator mode allows programmable hysteresis, latching comparator, window comparator, and fault-dump to the nonvolatile memory (NVM). These features enable the DAC53202 to surpass a conventional DAC's limitations, resulting in processor-less operation. These features make the DAC53202 an excellent choice for voltage margining and scaling applications, DC set-point for biasing and calibration, and waveform generation (predefined sine, cosine, triangular, and sawtooth). DAC 14 Click allows using I2C and SPI interfaces with a maximum frequency of 1MHz for I2C and 50MHz for SPI communication. The selection can be made by positioning SMD jumpers marked as
COMM SEL to an appropriate position. Note that all the jumpers must be on the same side, or the Click board™ may become unresponsive. It also allows the choice of the four least significant bits of its I2C address by positioning the SMD jumper ADDR SEL to an appropriate position providing the user with a selection of four addresses. The DAC53202 also possesses an additional general-purpose GP pin, routed to the INT pin of the mikroBUS™ socket, configured as multiple interrupt functions. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, 3.3V and 5V capable MCUs can use the communication properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Features overview
Development board
Clicker 4 for STM32F3 is a compact development board designed as a complete solution, you can use it to quickly build your own gadgets with unique functionalities. Featuring a STM32F302VCT6, four mikroBUS™ sockets for Click boards™ connectivity, power managment, and more, it represents a perfect solution for the rapid development of many different types of applications. At its core, there is a STM32F302VCT6 MCU, a powerful microcontroller by STMicroelectronics, based on the high-
performance Arm® Cortex®-M4 32-bit processor core operating at up to 168 MHz frequency. It provides sufficient processing power for the most demanding tasks, allowing Clicker 4 to adapt to any specific application requirements. Besides two 1x20 pin headers, four improved mikroBUS™ sockets represent the most distinctive connectivity feature, allowing access to a huge base of Click boards™, growing on a daily basis. Each section of Clicker 4 is clearly marked, offering an intuitive and clean interface. This makes working with the development
board much simpler and thus, faster. The usability of Clicker 4 doesn’t end with its ability to accelerate the prototyping and application development stages: it is designed as a complete solution which can be implemented directly into any project, with no additional hardware modifications required. Four mounting holes [4.2mm/0.165”] at all four corners allow simple installation by using mounting screws. For most applications, a nice stylish casing is all that is needed to turn the Clicker 4 development board into a fully functional, custom design.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M4
MCU Memory (KB)
256
Silicon Vendor
STMicroelectronics
Pin count
100
RAM (Bytes)
40960
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
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for DAC 14 Click driver.
Key functions:
dac14_set_dac_data
- This function sets the raw DAC data for the selected DAC channeldac14_start_function_gen
- This function starts the function generator for the selected DAC channeldac14_config_function_gen
- This function configures the function generator for the selected DAC channel
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 main.c
* @brief DAC 14 Click example
*
* # Description
* This example demonstrates the use of DAC 14 Click board by changing the voltage level
* on the OUT0 as well as the waveform signals from a function generator on the OUT1.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the Click default configuration.
*
* ## Application Task
* Changes the voltage level on the OUT0 as well as the waveform signals from a function
* generator on the OUT1 every 3 seconds. The state of both outputs will be displayed
* on the USB UART.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "dac14.h"
static dac14_t dac14;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
dac14_cfg_t dac14_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.
dac14_cfg_setup( &dac14_cfg );
DAC14_MAP_MIKROBUS( dac14_cfg, MIKROBUS_1 );
err_t init_flag = dac14_init( &dac14, &dac14_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( DAC14_ERROR == dac14_default_cfg ( &dac14 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
static uint16_t dac = 0;
static uint8_t waveform = DAC14_WAVEFORM_TRIANGULAR;
if ( DAC14_OK == dac14_set_dac_data ( &dac14, DAC14_SEL_DAC_0, dac ) )
{
log_printf( &logger, "\r\n OUT0: %u -> %.2f V\r\n",
dac, ( float ) dac * DAC14_VDD_3V3 / DAC14_DAC_DATA_MAX );
dac += 100;
if ( dac > DAC14_DAC_DATA_MAX )
{
dac = DAC14_DAC_DATA_MIN;
}
}
err_t error_flag = dac14_stop_function_gen ( &dac14, DAC14_SEL_DAC_1 );
error_flag |= dac14_config_function_gen ( &dac14, DAC14_SEL_DAC_1, waveform,
DAC14_CODE_STEP_32_LSB, DAC14_SLEW_RATE_4_US );
error_flag |= dac14_start_function_gen ( &dac14, DAC14_SEL_DAC_1 );
if ( DAC14_OK == error_flag )
{
log_printf( &logger, " OUT1: " );
switch ( waveform )
{
case DAC14_WAVEFORM_TRIANGULAR:
{
log_printf( &logger, "triangular wave at about 4kHz\r\n" );
waveform = DAC14_WAVEFORM_SAWTOOTH;
break;
}
case DAC14_WAVEFORM_SAWTOOTH:
{
log_printf( &logger, "sawtooth wave at about 7.8kHz\r\n" );
waveform = DAC14_WAVEFORM_INV_SAWTOOTH;
break;
}
case DAC14_WAVEFORM_INV_SAWTOOTH:
{
log_printf( &logger, "inverse sawtooth wave at about 7.8kHz\r\n" );
waveform = DAC14_WAVEFORM_SINE;
break;
}
case DAC14_WAVEFORM_SINE:
{
log_printf( &logger, "sine wave at about 10.7kHz\r\n" );
waveform = DAC14_WAVEFORM_DISABLE;
break;
}
case DAC14_WAVEFORM_DISABLE:
{
log_printf( &logger, "function generator disabled\r\n" );
waveform = DAC14_WAVEFORM_TRIANGULAR;
break;
}
default:
{
log_printf( &logger, "unknown state\r\n" );
break;
}
}
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:DAC