DIGI POT 3 Click Board
DIGI POT 3 Click Board
The DIGI POT 3 Click Board™ is a versatile and feature-rich digital potentiometer Click Board™ with 1024 steps and an internal non-volatile memory (EEMEM), which can be used for storing the wiper position, but also for storing various user data. The user EEMEM area has 14 words, each with a 16-bit length.
The DIGI POT 3 Click Board™ can be used with both unipolar and bipolar signals, selectable by onboard SMD jumpers. The wiper position can be increased or decreased linearly or by the logarithmic scale (6db/step) with a single command. A special scratch register allows direct programming of the wiper position. It can be stored in the non-volatile memory and on the power on, it is automatically restored. This means that the device restores its last position after the power on - just like its mechanical counterpart.
Software Support
We provide a library for the DIGI POT 3 Click Board™ on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo application can run on all the main MikroElektronika development boards.
Library Description
The library performs the check procedure for the desired outputs (IN1 - IN4). For more details check the documentation.
Key functions:
uint8_t digipot3_sendCommand( uint8_t commandByte )
- The function executes the desired command.uint8_t digipot3_storeEEMEM( uint8_t location_address, uint16_t transfer_data )
- The function stores 16-bit data to the desired
EEMEM (non-volatile) memory location.uint8_t digipot3_writeDAC( uint16_t valueDAC )
- The function writes a 10-bit value to DAC register and determines the wiper position.void digipot3_readDAC( uint16_t *dataOut )
- The function reads a 10-bit value from DAC register (wiper position).
Example Description
The demo application is composed of three sections:
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes SPI driver and restores the wiper position value from EEMEM (non-volatile) memory to the DAC register, if this value does not already exist in the DAC register.
- Application Task - (code snippet) - Increments the wiper position by 6dB every 2 seconds. When the wiper position reaches the desired value (0x0200), then the wiper position is decremented by 6dB every 2 seconds, until position value reaches the new desired value (0x0002). After that, the new position value will be stored in the EEMEM memory, if that value does not already exist in the EEMEM memory.
void applicationTask() { while (digitalValue < 0x0200) { digipot3_sendCommand( _DIGIPOT3_INCREMENT_RDAC_6DB_COMM ); digipot3_readDAC( &digitalValue ); WordToStr( digitalValue, text ); mikrobus_logWrite( "DAC value is: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); Delay_ms( 2000 ); } while (digitalValue > 0x0002) { digipot3_sendCommand( _DIGIPOT3_DECREMENT_RDAC_6DB_COMM ); digipot3_readDAC( &digitalValue ); WordToStr( digitalValue, text ); mikrobus_logWrite( "DAC value is: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); Delay_ms( 2000 ); } if (eememValue != digitalValue) { digipot3_sendCommand( _DIGIPOT3_STORE_RDAC_TO_EEMEM_COMM ); eememValue = digitalValue; } }
The full application code, and ready to use projects can be found on our Libstock page.
mikroE Libraries used in the example:
- Conversions
- SPI
- UART
Additional Notes and Information
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The DIGI POT 3 Click Board™ is supported by 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.
DIGI POT 3 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.