How does it work?
DAC 12 Click as its foundation uses the DAC60508, a low-power voltage-output 8-channel 12-bit digital-to-analog converter (DAC) from Texas Instruments. Each output channel in the DAC60508 consists of an R-2R ladder architecture, followed by an output buffer amplifier. It also includes a 2.5V, 5ppm/°C internal reference, eliminating the need for an external precision reference in most applications, and a user interface-selectable gain configuration that provides full-scale output voltages of 1.25V, 2.5V, or 5 V.
This Click board™ communicates with MCU through a flexible serial interface compatible with SPI-type interfaces used on many microcontrollers and DSP controllers, with a maximum frequency of 50 MHz. The input data are written to the individual DAC data registers in straight binary format, where after a Power-On or a reset event, all DAC registers are set to a mid-scale code.
Data written to the DAC data registers are initially stored in the DAC buffer registers. Data transfer from the DAC buffer registers to the active DAC registers can be configured to happen immediately using the asynchronous mode or initiated by an LDAC trigger in synchronous mode. Once the DAC active registers are updated, the DAC outputs change to new values. When the host reads from a DAC data register, the value held in the DAC buffer register is returned (not the value stored in the DAC active register).
This Click board™ can operate with both 3.3V and 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 that contains 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 digital gain and offset adjustment applications, programmable voltage, and current sources, programmable reference, and many more
On-board modules
DAC60508 – octal 12-bit analog voltage-output DAC from Texas Instruments
Key Features
Low power consumption, high performance, integrated 2.5V internal reference, high precision, flexible output configuration, SPI compatible interface, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DAC 12 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 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
DAC 12 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Output Voltage Range | 0 | – | 5 | V |
Resolution | 12 | – | – | bits |
Operating Temperature Range | -40 | +25 | +120 | °C |
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.
Key functions
-
dac12_soft_reset
This function executes the software reset command. -
dac12_set_channel_value
This function sets the raw DAC value to the specific channels output. -
dac12_set_channel_voltage
This function sets the output voltage of the specific channels.
Example Description
This example demonstrates the use of DAC 12 Click board™ by changing the outputs voltage level every 2 seconds.
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 Vrn", output_voltage );
output_voltage += step;
Delay_ms( 2000 );
}
}
}
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.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.