How does it work?
DIGI POT 2 Click is based on the TPL0501, a 256-taps, single-channel, digital potentiometer with an SPI interface from Texas Instruments. The TPL0501 can be used as a three-terminal potentiometer or a two-terminal rheostat. It has four screw terminals: A High terminal (H), a Low terminal (L), and two Wiper terminals (W), internally connected. The H and L terminals do not have polarity restrictions; H can be a higher voltage than L and vice-versa. The position of the wiper (W) terminal is controlled by the value in the 8-bit wiper resistance register.
There are two functional modes for the DIGI POT 2 Click. When all three terminals are used, the TPL0501 generates a voltage divider, where the voltage divider at wiper-to-H and wiper-to-L is proportional to the input voltage at H to L. It operates in rheostat mode as a variable resistor when only two terminals are used. The variable resistance can be anywhere between the H and L terminals depending on the polarity. The nominal resistance between H and L terminals, in this case, is 10KΩ, and the TPL0501 has 256 tap positions of the wiper.
DIGI POT 2 Click communicates with the host MCU using the 3-Wire SPI serial interface as a write-only. The SCK timing frequency maximum is 25MHz.
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
TPL0501 – digital potentiometer from Texas Instruments
Key Features
256 wiper positions, 100 kilo Ohms end-to-end resistance, no polarity restrictions, voltage divider mode, rheostat mode, ±20% resistance tolerance, 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 2 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 | Left | Power Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
DIGI POT 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
End-to-end Resistance | – | – | 100 | KΩ |
Position Resolution | – | – | 256 | steps |
Software Support
We provide a library for the DIGI POT 2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika 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 2 Click driver.
Key functions
-
digipot2_set_wiper_positions
The function sets 8-bit wiper positions data. -
digipot2_convert_output
The function convert 10-bit ADC value to volatage reference.
Example Description
The demo application changes the resistance using DIGI POT 2 Click.
void application_task ( void ) {
for ( uint16_t n_cnt = 127; n_cnt < 255; n_cnt += 10 ) {
wiper_pos = ( uint8_t ) n_cnt;
digipot2_set_wiper_positions( &digipot2, 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.DigiPot2
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 MikroElektronika compilers.
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.