TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136785 times)
  2. FAT32 Library (69980 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41889 times)
  6. FT800 Library (41184 times)
  7. GSM click (28988 times)
  8. PID Library (26420 times)
  9. mikroSDK (26374 times)
  10. microSD click (25382 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: 4320 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

Mikromedia 3 for PIC32MZ Capacitive

0

This project contains demo example for Mikromedia 3 for PIC32MZ Capacitive.

[Learn More]

Load Cell 6 click

0

Load Cell 6 Click is a compact add-on board representing a weigh scale solution. This board features the MAX11270, a high-performance 24-bit delta-sigma ADC that achieves excellent 130dB SNR while dissipating an ultra-low 10mW from Maxim Integrated, now part of Analog Devices. This SPI-configurable ADC sample rates up to 64ksps allow precision DC and AC measurements, with integral non-linearity guaranteed to 4ppm maximum. The MAX11270 offers a 6.5nV/√Hz noise programmable gain amplifier with gain settings between 1x to 128x. Optional buffers are also included to isolate the signal inputs from the switched capacitor sampling network, which allows the MAX11270 to be used with high-impedance sources without compromising the available dynamic range.

[Learn More]

Light click

0

This is a sample program which demonstrates the use of Light Click. Measured light intensity is then presented on the LCD 2 x 16 char bit.

[Learn More]