TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139059 times)
  2. FAT32 Library (71589 times)
  3. Network Ethernet Library (56988 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29774 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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: 4774 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

EXPAND 5 click

5

EXPAND 5 Click features a low-voltage 24-bit I2C and SMBus I/O expander. This 24-bit I/O expander is designed to provide general-purpose remote I/O expansion for most microcontroller families via the I2C serial interface.

[Learn More]

PIR Click

0

PIR Click is a pyroelectric sensor which generates a voltage when exposed to infrared radiation emitted by live bodies. It is equipped with the PL-N823-01, an infrared sensor from KEMET that uses the pyrolectric effect of ceramic by absorbing infrared rays emitted from the human body, while the the white plastic Fresnel lens covering the sensor filters visible light.

[Learn More]

BIG 7-SEG Click

0

BIG 7-SEG Click is what you need if you want to add a seven-segment LED display to your project.

[Learn More]