TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136652 times)
  2. FAT32 Library (69878 times)
  3. Network Ethernet Library (55904 times)
  4. USB Device Library (46245 times)
  5. Network WiFi Library (41880 times)
  6. FT800 Library (41117 times)
  7. GSM click (28968 times)
  8. PID Library (26404 times)
  9. mikroSDK (26333 times)
  10. microSD click (25345 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 click

Rating:

0

Author: MIKROE

Last Updated: 2019-04-25

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: Digital potentiometer

Downloaded: 11332 times

Followed by: 1 user

License: MIT license  

This program demonstrates the usage of single channel Digital Potentiometer (MCP4161) with 8 bit resolution.
Voltage derived from PW pin is read by MCU's ADC. Scaled value is then displayed at PORTD LEDs.
User can increase or decrease resitance by pressing buttons RB2 and RB3.&amp;lt;br/&amp;gt;

No Abuse Reported

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

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

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

  • mikroSDK Library 2.0.0.0
  • Comments (1)
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

DigiPot click

DigiPot click

Front and back view of DigiPot click board designed in mikroBUS form factor. mikroBUS is specially designed pinout standard with SPI, I2C, Analog, UART, Interrupt, PWM, Reset and Power supply pins.

View full image

Library Description

The library covers all the necessary functions to control the DIGI POT Click board. Library performs the communication with the device via SPI driver by writing to registers and reading from the register. The library set 8-bit ( 256 ) wiper positions value, reading the status register and convert to voltage 0V - 3.3V  or  0V - 5.0V.

Key functions:

  • void digipot_writeByte( uint8_t command, uint8_t writeData ) - Generic write 8-bit data function.
  • void digipot_setWiperPositions( uint8_t wiperPositions ) - Set 8-bit wiper positions.

Examples description

The application is composed of three sections:

  • System Initialization - Initializes GPIO, SPI, and LOG structures set the CS pin as an output.
  • Application Initialization -  Initialization driver enables - SPI and start to write log.
  • Application Task - (code snippet) This is an example which demonstrates the use of DIGI POT Click board. Increments the wiper position by 10 positions every 5 seconds. All data logs on USB uart.
void applicationTask() 
{
    for ( cnt = 127; cnt < 255; cnt += 10 )
    {
        digipot_setWiperPositions( cnt );
        Delay_ms( 5000 );
    }
}       

Other mikroE Libraries used in the example:

  • SPI
  • UART​

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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

Accel 10 click

0

Accel 10 Click features an ultra-low power triaxial `femto` accelerometer sensor with embedded intelligence, labeled as the LIS2DW12TR.

[Learn More]

Color 12 click

0

Color 12 Click is a compact add-on board providing an accurate color-sensing solution. This board features the BU27006MUC-Z, a digital color sensor from Rohm Semiconductor with an integrated flicker sensing function. The BU27006MUC-Z can sense Red, Green, Blue (RGB), and Infrared light and efficiently convert them into digital values via the I2C interface. Its remarkable high sensitivity, wide dynamic range, and exceptional IR-cut characteristics enable precise illuminance measurement, typically up to 50klx, and accurate ambient light color temperature determination. Moreover, this sensor can effectively detect flicker noise originating from displays and room lighting, with a typical sensitivity of 10klx.

[Learn More]

ADC 14 click

0

ADC 14 Click is a compact add-on board with a high-performance data converter. This board features the MAX11108A, a low-power serial ADC from Analog Devices. It includes a high-dynamic range sample-and-hold and a high-speed serial interface.

[Learn More]