How does it work?
DIGI POT Click is based on the MCP4161, an 8-bit single SPI digital POT with non-volatile memory from Microchip. The MCP4161 has a resistance of 10kΩ and low wiper resistance, with a typical 75Ω. It can be used as a three-terminal potentiometer or a two-terminal rheostat while floating either of the terminals (A or B). DIGI POT Click has four screw terminals: PA and PB as analog terminals A and B of the MCP4161, a PW as a wiper terminal of the digital potentiometer, and one for ground. The PA and PB terminals do not have polarity restrictions; PA can be a higher voltage than PB and vice-versa. The position of the wiper (PB) terminal is controlled by the value in the 8-bit wiper resistance register.
There are two functional modes of this Click board™. When all three terminals are used, the MCP4161 generates a voltage divider, where the voltage divider at wiper-to-PA and wiper-to-PB is proportional to the input voltage at PA to PB. It operates in rheostat mode as a variable resistor when only two terminals are used.
DIGI POT Click communicates with the host MCU using the 3-Wire SPI serial interface as a write-only. The SCK timing frequency maximum is 10MHz. It features a WiperLock™ Technology for automatically recalling saved wiper settings from EEPROM. In addition to the SMD MCP4161, this Click board™ features 6 PTHs for the DIP variant of this chip.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the PWR SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Digital potentiometer
Applications
Can be used for the development of mechanical rheostat replacements, in voltage to current conversions, for gain and offset adjustment, sensor timing, calibration, and many more applications
On-board modules
MCP4161 – digital potentiometer from Microchip
Key Features
257 wiper positions, 10kΩ end-to-end resistance, no polarity restrictions, voltage divider mode, rheostat mode, 8-bit resolution, SPI interface, low power consumption, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DIGI POT Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | PWR SEL | Lower | Power/Logic Level Voltage Selection 3V3/5V: Lower position 3V3, Upper position 5V |
DIGI POT Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
End-to-end Resistance | – | – | 10 | kΩ |
Resolution | – | – | 8 | bit |
Wiper Steps | – | – | 257 | steps |
Software Support
We provide a library for the DIGI POT Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for DIGI POT Click driver.
Key functions
-
digipot_set_wiper_positions
The function sets 8-bit wiper positions data. -
digipot_convert_output
The function convert 10-bit ADC value to volatage reference.
Example Description
The demo application changes the resistance using DIGIPOT Click.
void application_task ( void ) {
for ( uint16_t n_cnt = 127; n_cnt < 255; n_cnt += 10 ) {
wiper_pos = ( uint8_t ) n_cnt;
digipot_set_wiper_positions( &digipot, wiper_pos );
Delay_ms( 5000 );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.DigiPot
Additional notes and informations
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.