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; to use current-output mode, they need to be removed. Both the voltage- and current-output modes support multiple programmable output ranges. In addition to the internal voltage reference of 1.21V, the DAC53202 also has the possibility of 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 go beyond 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 both 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’ positions 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 labeled 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, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the 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.
Specifications
Type
DAC
Applications
Can be used for communications equipment, enterprise servers, test and measurement, and general-purpose power-supply modules
On-board modules
DAC53202 – 10-bit dual-channel buffered digital-to-analog converter from Texas Instruments
Key Features
Programmable outputs, flexible configuration, comparator mode for all channels, Hi-Z power-down mode, multifunction GPIO, selectable interface, and more
Interface
I2C,SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DAC 14 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1-JP5 | COMM SEL | Right | Communication Interface Selection SPI/I2C: Left position SPI, Right position I2C |
JP4 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP6 | ADDR SEL | Lower | I2C Address Selection: Left position SDA, Right position SCL, Upper position VCC, Lower position GND |
DAC 14 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Resolution | – | 10 | – | bit |
Output Voltage | 0 | – | 5 | V |
Software Support
We provide a library for the DAC 14 Click as well as a demo application (example), developed using Mikroe compilers. The demo can run on all the main Mikroe development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
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 channel. -
dac14_start_function_gen
This function starts the function generator for the selected DAC channel. -
dac14_config_function_gen
This function configures the function generator for the selected DAC channel.
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.
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, "rn OUT0: %u -> %.2f Vrn",
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 4kHzrn" );
waveform = DAC14_WAVEFORM_SAWTOOTH;
break;
}
case DAC14_WAVEFORM_SAWTOOTH:
{
log_printf( &logger, "sawtooth wave at about 7.8kHzrn" );
waveform = DAC14_WAVEFORM_INV_SAWTOOTH;
break;
}
case DAC14_WAVEFORM_INV_SAWTOOTH:
{
log_printf( &logger, "inverse sawtooth wave at about 7.8kHzrn" );
waveform = DAC14_WAVEFORM_SINE;
break;
}
case DAC14_WAVEFORM_SINE:
{
log_printf( &logger, "sine wave at about 10.7kHzrn" );
waveform = DAC14_WAVEFORM_DISABLE;
break;
}
case DAC14_WAVEFORM_DISABLE:
{
log_printf( &logger, "function generator disabledrn" );
waveform = DAC14_WAVEFORM_TRIANGULAR;
break;
}
default:
{
log_printf( &logger, "unknown statern" );
break;
}
}
}
Delay_ms ( 3000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.DAC14
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 Mikroe compilers.
mikroSDK
This Click board™ is supported with mikroSDK – Mikroe Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.