DAC 4 Click Board
DAC 4 Click Board
The DAC 4 Click Board™ carries Microchip’s MCP4728 IC, a Quad Digital-to-Analog Converter with nonvolatile (EEPROM) Memory. The digital value is converted to the appropriate voltage level in the range between GND and VCC, which is proportional to the received 12-bit number. MCP4726 also integrates EEPROM for storing DAC register and configuration bit values.
These options give a lot of flexibility which make it a perfect choice for an accurate and simple generation of analogue signals for various purposes, such as PLC/DCS modules, temperature and pressure control, medical and scientific instrumentation, chromatography and other similar applications, where accurate digital to analogue conversion is needed.
Software Support
We provide a library for the DAC 4 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library contains function for getting INT pin state Library contains function for setting PWM pin state Library contains function for getting data via I2C Library contains function for setting data via I2C Library contains functions for executing general call functions (reset, wake up and software update) Library contains functions for executing fast write, multi write, sequential write and single write commands Library contains functions for setting voltage reference, power mode and gain Library contains function for getting channel reports.
Key Functions
uint8_t dac4_general_call_reset( void )
- This function executes general call reset command.uint8_t dac4_single_write( T_dac_channel_setting * channel_X )
- This function executes single write command.uint8_t dac4_data_report( T_dac_channel_setting * channel_buffer )
- This function reads data for all 4 channels, forms a report and stores it into the buffer.
Example Description
The application is composed of three sections :
- System Initialization - Initializes GPIO pins, I2C and LOG modules
- Application Initialization - Initializes I2C driver, executes general call reset and wake up commands and initializes variables to zero
- Application Task - Waits for user input and based on it logs reports or sets output value for specified channel
void applicationTask( ) { dac4_check_input( ); if (message_ok_flag == 1) { dac4_parse_message( ); message_ok_flag = 0; } }
Additional Functions :
- dac4_receive_char() - receives single character from UART terminal and stores it into the buffer
- dac4_check_input() - calls dac4_receive_char() function to fill the buffer and checks if received character is correct
- dac4_log_report() - logs channel reports
- dac4_set_output() - sets output channel values
- dac4_parse_message() - parses message stored into the buffer and calls appropriate functions
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The DAC 4 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.
DAC 4 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.