This version (12 Sep 2022 16:28) was approved by Angu Sewa.The Previously approved version (21 Mar 2021 08:47) is available.Diff

Click here to return to the GPIO Conditioning page

Rotary Encoder


The Rotary Encoder block processes the inputs from a rotary encoder and outputs an “up” and a “down” signal. The algorithm also incorporates a software “de-bouncer” for each of the inputs.


1) Drag the block into the schematic.
2) Connect the inputs to two GPIOs. These would correspond to the 2 out-of-phase output pins of a rotary encoder. In hardware configuration, set the GPIOs to “no debounce.”

The value in the field sets the time constant (in samples) for the debouncer. Adjust this value by trial and error using the rotary encoder in your end system.

Targets Supported

Rotary Encoder Not supported Not supported Sample



Input0ControlGPIO rotary up input control
Input1ControlGPIO rotary down input control


Output0ControlGPIO rotary up output control
Output1ControlGPIO rotary down output control

Configurable Parameters

GUI Parameter NameDefault ValueRangeFunction Description
—————————————- ———————- ————————————- —————————————-
Gain 20 3 to 100 Time constant for debounce
IsLin true true/false Setting this value to true indicates the gain is a decimal value, else the value is entered in dB

DSP Parameters

Parameter NameDescriptionADAU145x/ADAU146x
————————--————————————————————-- ———————————
countmaxTime constant for debounceInteger32

DSP Parameter Computation

if IsLin ==true max= Gain else max = 10^ (Gain/20)

resources/tools-software/sigmastudiov2/modules/gpioconditioning/rotaryencoder.txt · Last modified: 12 May 2021 14:26 by Prasad Kamath