How does it work?
DAC 3 Click is based on the MCP4726, a 12-bit voltage output digital-to-analog converter with EEPROM from Microchip. The MCP4726 uses a resistor ladder architecture with an analog output provided on the VOUT screw terminal. The VOUT can swing from approximately 0V to approximately VCC voltage, in the case of this Click board™, 3.3V, and 5V. The resistor ladder DAC is driven from a software-selectable voltage reference source. The reference voltage can be selected between the VCC and the 4.096V given by the MCP1541 via the REF SEL jumper. The VCC on this jumper is selected by default and depends on the voltage selection over the PWR SEL jumper, with 3.3V set by default.
To communicate with the host MCU, DAC 3 Click uses the I2C interface over the mikroBUS™ socket for standard (100KHz), fast (400KHz), or High-Speed (3.4MHz) mode. The 16-bit data is sent to the DAC through the I2C interface. This interface is also used to store desired Power-on Reset (POR)/Brown-out Reset (BOR) values of the DAC register and device configuration bits. During operation, the internal POR/BOR circuit monitors the power supply voltage (VCC) and ensures the correct device Start-Up sequence at system power-up and power-down events.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the PWR SEL jumper. This way, both 3.3V and 5V capable MCUs can 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 applications such as offset and gain control, VCO tuning, programmable reference, and more
On-board modules
MCP4726 – digital-to-analog converter with EEPROM from Microchip
Key Features
12-bit output voltage resolution, rail-to-rail output, selectable reference voltage, integrated nonvolatile EEPROM, Power-Down mode, low power consumption, I2C interface, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DAC 3 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 |
---|---|---|---|
– | PWR | – | Power LED Indicator |
– | PWR SEL | Right | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
– | REF SEL | Left | Reference Voltage Selection VCC/4.096V: Left position VCC, Right position 4.096V |
DAC 3 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Resolution | – | 12 | – | bit |
Software Support
We provide a library for the DAC 3 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 3 Click driver.
Key functions
-
This function configures the click module.
-
This function sends a command to the click module using SPI communication.
-
This function sets the output voltage on the click module terminal.
Example Description
This example showcases how to initialize, configure and use the DAC 3 click module. The click performs digital to analog conversion and the output voltage can be read on the output termi- nal using a multimeter. An oscilloscope is required to read the analog signal.
void application_task ( void )
{
uint8_t cnt;
uint32_t output_value;
output_value = 500;
dac3_send_command( &dac3, DAC3_RESET );
Delay_100ms( );
dac3_send_command( &dac3, DAC3_WAKE_UP );
Delay_100ms( );
for ( cnt = 1; cnt < 9; cnt ++ )
{
dac3_set_out_voltage( &dac3, output_value * cnt );
log_printf( &logger, " .current DAC value: %drn", output_value * cnt );
log_printf( &logger, " .output voltage: %d mVrn", ( ( output_value * cnt ) * 79 ) / 64 );
log_printf( &logger, "-------------------------------rn" );
Delay_ms( 5000 );
}
log_printf( &logger, "###############################rn" );
Delay_1sec( );
}
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.DAC3
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, that needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.