How does it work?
Rotary R 2 Click is based on the TLC5925, a low-power 16-channel constant-current LED sink driver from Texas Instruments that, combined with a high-quality rotary encoder from ALPS, the EC12D1564402, allows you to add a precision input knob to your design. The EC12D1564402 incremental rotary encoder is surrounded by a ring of 16 red LEDs where a single rotation is divided into 15 discrete steps (in contrast to a potentiometer, a rotary encoder can be spun around continuously). The driver can control each LED individually, allowing various lighting effects to be programmed. The encoder outputs A and B signals (out of phase to each other) on the two mikroBUS™ lines, alongside the knob push-button feature, which outputs through the interrupt line.
The EC12D1564402 is a 15-pulse incremental rotary encoder with a push button. This encoder has unique mechanical specifications (debouncing time for its internal switches goes down to 2ms), and it can withstand a huge number of switching cycles, up to 30.000. The supporting debouncing circuitry allows contacts to settle before the output is triggered fully.
Rotary R 2 Click uses a standard 4-wire SPI serial interface of the TLC5925 LED driver to communicate with the host MCU supporting clock frequency of up to 30MHz. Rotating the encoder, it outputs A and B signals (out of phase to each other) on the two mikroBUS™ lines, ENA and ENB pins of the mikroBUS™ socket, alongside the push-button contact, which outputs through the SW pin (interrupt line) of the mikroBUS™ socket. Two SN74LVC1T45 single-bit bus transceivers from Texas Instruments are used for logic-level translation.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this 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
Rotary encoder
Applications
Can be used for the development of various interesting visual effects for any application, such as flexible position, value indicator, and more
On-board modules
TLC5925 – low-power 16-channel constant-current LED sink driver from Texas Instruments
Key Features
High quality, SPI interface, a ring of 16 red LEDs controlled individually, various lighting effects, knob feature, low power consumption, flexibility, efficiency, precision, and more
Interface
GPIO,SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Rotary R 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 |
1-16 | 1-16 | – | Rotary Red LED Indicators |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Rotary R 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Software Support
We provide a library for the Rotary R 2 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 way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Rotary R 2 Click driver.
Key functions
-
rotaryr2_set_led_pos
This function turns on the LED for the selected LED position. -
rotaryr2_set_led_data
This function, using SPI serial interface, writes a desired 16-bit data. -
rotaryr2_get_state_switch
This function return rotary encoder switch signal, states of the SW(INT).
Example Description
This library contains the API for the Rotary R 2 Click driver to control LEDs states and a rotary encoder position readings.
void application_task ( void )
{
if ( ROTARYR2_OK == rotaryr2_set_led_data( &rotaryr2, led_data ) )
{
rotaryr2_switch_detection( );
rotaryr2_encoder_mechanism( );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.RotaryR2
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.