TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136537 times)
  2. FAT32 Library (69730 times)
  3. Network Ethernet Library (55838 times)
  4. USB Device Library (46170 times)
  5. Network WiFi Library (41798 times)
  6. FT800 Library (40984 times)
  7. GSM click (28921 times)
  8. PID Library (26383 times)
  9. mikroSDK (26276 times)
  10. microSD click (25297 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

DIGI POT 3 click

Rating:

5

Author: MIKROE

Last Updated: 2018-05-16

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Digital potentiometer

Downloaded: 4286 times

Not followed.

License: MIT license  

DIGI POT 3 click is a versatile and feature-rich digital potentiometer click 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.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DIGI POT 3 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DIGI POT 3 click" changes.

Do you want to report abuse regarding "DIGI POT 3 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

DIGI POT 3 click

DIGI POT 3 click

Native view of the DIGI POT 3 click board.

View full image
DIGI POT 3 click

DIGI POT 3 click

Front and back view of the DIGI POT 3 click board.

View full image

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).

Examples 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 wiper position reaches the desired value (0x0200), then the wiper position be 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;
 }
}

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.

ALSO FROM THIS AUTHOR

Brushless 3 click

5

Brushless 3 click carries the DRV10983, a three-phase sensorless motor driver with integrated power MOSFETs. When an external power supply is applied, you can drive a brushless DC motor through the PWM pin, AN pin or I2C interface.

[Learn More]

DC Motor 4 click

0

This library contains API for DcMotor4 Click driver.

[Learn More]

LTE Cat.1-US click

5

LTE Cat.1-US click is a Click board based on Thales Cinterion ELS61 wireless module that delivers highly efficient Cat 1 LTE connectivity for M2M IoT solutions offering seamless fall back to 2G and 3G networks.

[Learn More]