Qwiic Twist Hookup Guide

Pages
Contributors: Nate
Favorited Favorite 7

Hardware Overview

The RGB encoder is a 24 indent encoder. You’ll feel 24 clicks when turning one 360 degree rotation.

The RGB encoder on the Qwiic Twist

The encoder works best with the Clear Plastic Knob but is compatible with any knob with a 6mm knurled hole. The encoder output is filtered through a series of resistors, capacitors, and error checked in software to be sure the accurate number of ticks is being output.

Qwiic Twist with Clear Knob lit up purple

The encoder has an RGB LED built into it. To get the full light effect we recommend a clear knob but depending on your setup you may also be able to get a ‘backlit’ effect with an opaque knob. The RGB LEDs are pulse-width-modulated and controlled via software (and backed by non-volatile memory) so you can tell the Qwiic Twist to go to any color you want and it will be that color now and even after the Twist is power cycled (it remembers the last color setting).

The encoder has a built-in momentary button. This is useful for selecting menu items and getting general feedback from the user.

Qwiic I2C Pins

Qwiic Twist connected to a BlackBoard

The Qwiic Twist is best used with the Qwiic system. Simply plug a Qwiic Cable into the Twist and start talking to it.

I2C pins on the Qwiic Twist highlighted

Alternatively you can solder to the I2C pins on the board.

RST and INT

The reset pin is an active low input. When pulled low Qwiic Twist will be held in reset.

RST and INT pins on the digital RGB encoder highlighted

The INT pin is active low and is open drain output. The interrupt pin will go low when any of the follow events happen:

  • The user presses the button is pressed or released.
  • The user has turned the knob and no movement has been detected for a certain amount of time. This amount of time is called the turnInterruptTimeout and is 250ms by default. This means that once the user has stopped turning the knob for 250ms the interrupt will fire. This is helpful when the user is doing lots of knob changes. The Qwiic Twist won't fire the interrupt until the user has stopped fidgeting. The turnInterruptTimeout is software configurable from 1ms to 65000ms (65 seconds).

The INT pin is open drain and is pulled up through a 10k resistor but if you want to connect multiple Twists and share the interrupt pins among many Twists then you can optionally cut the jumper to remove the 10k pull up on each Twist board.

Jumpers

The ADR jumper is normally open and controls the I2C address of the device. By default the Qwiic Twist 7-bit unshifted address is 0x3F. If the jumper is closed with solder, the address will become 0x3E.

Address jumper of the Qwiic Twist

The Twist is unique in that it can have any address assigned to it between 0x08 and 0x77. This means over 100 Twists can be connected on a single bus!

Note: If the ADR jumper is closed then Qwiic Twist will resort to address 0x3E regardless of what address may have been configured via software commands. This is a safety mechanism in case the Twist gets set to an unknown address.

The INT jumper is a normally closed jumper; there is a small trace connecting the two pads. This jumper connects the INT pin on the ATtiny84 through a 10k resistor to 3.3V. Cutting the small trace disconnects the 10k resistor from the INT pin on the ATtiny84.

Qwiic INT jumper closed with trace

The INT pin on Qwiic Twist is open drain, meaning the pin will actively go low when an interrupt occurs but will then float when there is no interrupt. This open drain type of setup is handy if you have multiple devices sharing a single interrupt line. For advanced applications (such as many many Twists all sharing the same INT pin) you may want to cut this jumper on each Twist to remove the 10k pull ups. For general use you can leave this jumper unmodified.

The Qwiic Twist has built-in 2.2k pull-up resistors on the SDA and SCL lines. These are needed for normal I2C communication. The I2C jumper has two small traces connecting the pull-ups to 3.3V. For general use you can leave this jumper unmodified. If you have many (over 7) devices on the I2C bus, each with their own pull up resistors, then you may want to cut the I2C jumpers to disconnect the 2.2k resistors on each Qwiic board.