DIGI POT 5 click
PID: MIKROE-2863
Weight: 26 g
DIGI POT 5 click is a digitally controlled quad potentiometer, with the resistance of 10KΩ. It
has an 8bit wiper step resolution, which allows the wiper to take 257 different discrete positions
(across 256 internal resistors). The digital wiper position can be controlled via the SPI interface.
DIGI POT 5 click features a durable EEPROM non-volatile (NV) memory for storing the wiper
position. The content of the wiper register memory located in the NV memory is copied to the
actual wiper registers after the power-on or reset state, so the device acts similar to its
mechanical counterpart, recalling its last used wiper position after being powered on. The device
also features the WiperLock™ technology, which effectively locks the wiper position in place.
DIGI POT 5 click has a multitude of practical uses in electronic circuits. The most popular uses
include precision calibration of set point thresholds, sensor trimming, LCD contrast adjustment,
audio attenuation, an adjustable gain for amplifiers and offset trimming. DIGI POT 5 click can
be used to replace the common mechanical trim pot, in a wide range of different applications
where the operating voltage stays within the limits.
How does the click work?
DIGI POT 5 click features the MCP4361, an 8bit quad digital potentiometer from Microchip.
This is a very versatile quad digital potentiometer, controlled via the SPI interface. The device
has four integrated digital potentiometer sections, which consist of a string of resistors - serially
connected, with digitally controlled analog switches, used to connect the wiper terminal position.
The wiper position value of 0x000h corresponds to the lower end of the resistors ladder, while
0x100h corresponds to the upper end of the resistors ladder. These values can be written in the
volatile wiper registers, one address for each of the four wipers.
Each of the four wipers can be controlled in several ways. Writing data directly to the volatile
wiper register will result in moving the wiper to the specified location. Wiper value can also be
incremented or decremented, by writing data to the incrementing or decrementing registers,
providing that the wiper is not locked and that the wiper register value is not 0x000h (prevents
further decrease) or above 0x100h (prevents further increase). If the wiper register is set to a
value greater than 0x100h, both increasing and decreasing commands will be disregarded. The
incrementing and decrementing registers allow for less overhead if the wiper position has to be
increased or decreased, making it easy to interface with the rotary encoder applications, for
example.
The MCP4361 also features the WiperLock™ function, which prevents further changes of the
wiper position, effectively locking the wiper in place. To enable this functionality, the CS pin
needs to be pulled beyond the predefined voltage level threshold (8.5V to 12.5V). When this
happens, the device will enter into the high voltage communication mode (HV mode), and the
WiperLock™ functions can be accessed. The click board has a dedicated high voltage input pad
(VIHH), which can be used to drive the CS pin with the appropriate voltage level when the HV
mode is required.
The resistor ladder network can be completely disabled by writing to the terminal control
registers. This allows to effectively disconnect the potentiometer terminals from a circuit,
reducing the power consumption of both the MCP4361 and the electrical circuit the IC is used in.
The terminal control registers can also be used to switch each of the wiper terminal and the two
resistor terminals, separately. There is also a STATUS register, used for storing various status
related information, such as the WiperLock™ status, EEPROM write protect status and so on.
The EEPROM memory is used to hold the wiper data, even after the power down. There are
several (five) general purpose 9bit addresses and 4 NV wiper register addresses that are copied to
the wiper register addresses after the restart or power-up, allowing the device to resume the
wiper position from a previous, stored state. By default, the data registers are zeroed out, while
the NV wiper registers hold the middle scale position for the wiper.
DIGI POT 5 click has one 2x10 pin standard, 2.54mm pitch header used to connect the four
potentiometer terminals. There are three SMD jumpers onboard:
The SMD jumper labeled as WP is used to set the WP pin state of the MCP4361. The WP pin is
used as the hardware EEPROM write protection, along with a software WP bit of the STATUS
register (writable in HV mode only). Both the hardware WP pin and the software WP bit has to
be set to disabled mode, in order to write to EEPROM.
The SMD jumper labeled as PWR SEL is used to select the power supply voltage - 3.3V or 5V.
This also affects the logic voltage levels, used for the SPI communication.
The SMD jumper labeled as CS SEL is used to select the CS pin voltage level. If the HV mode is
required, this jumper should be moved to the VIHH position, so that the externally connected
8.5V to 12.5V power source can be used to pull up the CS pin. If HV mode is not required, this
SMD jumper should stay at the default position (CS). Note that while in the HV mode, the CS
pin is used the same way as with the regular SPI communication, with a difference in logical
levels - the HV mode logical HIGH is at least 8.5V.
Specifications
Type
Digital potentiometer
Applications
DIGI POT 5 can be used for precise calibration of set point thresholds, sensor trimming,
LCD contrast adjustment, audio attenuation, an adjustable gain for amplifiers and offset
trimming
On-board
modules
MCP4361 8-Bit quad digital POT with non-volatile Memory and SPI interface
Key Features
Digitally controlled quad potentiometer with 257 discrete wiper positions, SPI
communication protocol, WiperLock™ feature, and user programmable EEPROM
memory
Interface
GPIO,SPI
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DIGI POT 5 click corresponds to the pinout on the
mikroBUS™ socket (the latter shown in the two middle columns).
Notes
Pin
Pin
Notes
NC
1 AN
PWM
16
NC
Reset
RST
2 RST
INT
15
NC
SPI CS
CS
3 CS
RX
14
NC
SPI Clock
SCK
4 SCK
TX
13
NC
SPI Data Out
SDO
5 MISO
SCL
12
NC
SPI Data In
SDI
6 MOSI
SDA
11
NC
Power Supply
+3.3V
7 3.3V
5V
10
+5V
Power Supply
Ground
GND
8 GND
GND
9
GND
Ground
DIGI POT 5 click electrical specifications
Onboard settings and indicators
Label Name Default
LD1
PWR
JP1 PWR SEL
Left
Description
Power LED indicator
Power supply voltage selection: left position 3V3, right position 5V
JP2
WP
Left
Write protect selection: left position DISABLED, right position ENABLED
JP3
CS SEL
Left
CS mode selection: left position CS (SPI), right position VIHH (HV)
Note: When the high voltage mode (HV) is selected, the VIHH pad is used to drive the CS pin
with the HIGH logic level ranging from 8.5V to 12.5V.
Software support
We provide a library for DIGI POT 5 click on our LibStock page, as well as a demo application
(example), developed using MikroElektronika compilers and mikroSDK. The provided click
library is mikroSDK standard compliant. The demo application can run on all the main
MikroElektronika development boards.
Library description
The library contains functions that perform basic SPI commands on click board registers.
Key functions:
uint8_t digipot5_writeReg(uint8_t regAddress, uint16_t writeData);- Function
writes to the click board registers
uint8_t digipot5_readReg(uint8_t regAddress, uint16_t * pReadData);- Reads from
the click board registers
uint8_t digipot5_setResistance(uint8_t regAddress, uint16_t value);- Sets the
resistance of the selected wiper
Example description
•
•
•
System Initialization - Initializes pins, SPI peripheral and logger
Application Initialization - Initializes the click driver
Application Task (code snippet) - Demonstrates the use of various functions by setting different
wipers to several different positions
mikrobus_logWrite("Setting wiper 0 to zero scale value.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER0_VOLATILE, _DIGIPOT5_ZEROSCALE);
mikrobus_logWrite("Setting wiper 1 to 3k Ohm.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER1_VOLATILE, _DIGIPOT5_3KOHM);
mikrobus_logWrite("Setting wiper 2 to 5k Ohm.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER2_VOLATILE,
_DIGIPOT5_HALFSCALE_5K);
mikrobus_logWrite("Setting wiper 3 to full scale (10k Ohm).", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER3_VOLATILE,
_DIGIPOT5_FULLSCALE_10K);
delay_ms(2000);
mikrobus_logWrite("Decrementing wiper 3 by 5 steps.", _LOG_LINE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
delay_ms(2000);
mikrobus_logWrite("Decrementing wiper 3 by another 5 steps.", _LOG_LINE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE);
delay_ms(2000);
mikrobus_logWrite("Setting wiper 0 to full scale value.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER0_VOLATILE,
_DIGIPOT5_FULLSCALE_10K);
mikrobus_logWrite("Setting wiper 1 to 8k Ohm.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER1_VOLATILE, _DIGIPOT5_8KOHM);
mikrobus_logWrite("Setting wiper 2 to 4k Ohm.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER2_VOLATILE, 0x68);
mikrobus_logWrite("Setting wiper 3 to zero scale value.", _LOG_LINE);
digipot5_setResistance(_DIGIPOT5_WIPER3_VOLATILE, _DIGIPOT5_ZEROSCALE);
The full application code, and ready to use projects can be found on our LibStock page.
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
This click board is supported with 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.
For more information about mikroSDK, visit the official page.
Downloads
mikroBUS™ standard specifications
LibStock: mikroSDK
DIGI POT 5 click: 2D and 3D files
MCP4361 datasheet
DIGI POT 5 click schematic
LibStock: DIGI POT 5 click library
https://www.mikroe.com/digipot-5-click 1-15-18