Built upon years of experience, featuring well-proven touch sensing technologies, the IQS266 is a perfect solution for single-sided capacitive trackpads for various applications. Combined with the low power consumption, a low number of external components required, and a set of advanced options and features, SwipeSwitch click presents an ideal platform for the development of low-power touch sensing applications for wearables, white goods, home appliances, toys, human-machine interface (HMI) applications, etc.
How does it work?
SwipeSwitch click is based on the IQS266, an integrated trackpad controller circuit, featuring ProxSense® and IQ Switch® technologies, from Azoteq. This integrated touch controller features 2 receivers and 3 transmitters, allowing a 2x3 capacitive touch trackpad to be formed. By using a specific trace pattern on the PCB, the Click board™ is able to sense several different swipe gestures, offering several different configuration parameters. By employing well-proven ProxSense® and IQ Switch® technologies, the IQS266 device is able to provide very reliable touch detection in various environmental conditions. It uses the industry-standard I2C communication interface, with the additional RDY pin for the event signaling and communication protocol handshaking routines.
Besides five capacitive touch sensing electrodes, the IQS266 integrates a single proximity channel. This channel can be used to wake up the device from the standby mode when the user approaches the touch panel, ensuring a low overall power consumption that way. CH0 is a dedicated proximity/touch channel and it is treated as a separate channel group in the IQS266 settings. Both proximity and touch thresholds can be defined for this channel.
Automatic Tuning Implementation (ATI) ensures the optimal sensitivity of the sensing channels, by monitoring the sampling values. The developer can set up the ATI targets for two groups of channels (channel 0, and channels 1-6). Once these targets are set, the ATI algorithm will try to match them, ensuring consistent behavior when used in various operating conditions. The ATI functionality can also be disabled/forced by the user, allowing to retune the sensor electrodes on demand. Else, the IQS266 will automatically retune the electrodes every time the counts drift outside a predefined ATI band in an attempt to ensure an optimal sensitivity.
The RDY pin has two functions. It can be used as an interrupt event pin, signaling either an event occurrence (when operated in the Event mode) or a "Data Ready" event. In this case, the RDY pin will be driven to a LOW logic level to signal an event, allowing it to generate an interrupt on the host MCU. However, the host MCU can pull the RDY pin down to initiate a communication window (communication protocol handshaking), requesting data from the device. The RDY pin is routed to the mikroBUS™ INT pin.
The IQS266 can be set to operate in the Streaming mode or in the Event mode. When operated in the Event mode, the RDY pin will indicate a communication window only after the selected event has occurred. There are several different events to choose from: low power, swipe, tap, ATI, trackpad, touch, and proximity event. Each event is signalized by the RDY pin driven to a LOW logic level. More details about the RDY pin driving pattern for each event can be found in the IQS266 datasheet.
The IQS266 is very flexible, allowing many parameters to be tuned according to needs. These parameters include timeout periods for various modes (Zoom mode timeout, Low Power mode timeout, RDY timeout, etc.) thresholds for various events and channels, some special sensing parameters, and so on. The developer can set up these parameters by writing appropriate values to the registers of the IQS266 IC over the I2C interface. For a more detailed description of each register, please refer to the included datasheet. However, the Click board™ is supported by a library of mikroSDK compatible functions that simplify and speed up the development. It also comes with the example application, which demonstrates their use.
Specifications
Type |
Capacitive |
Applications |
SwipeSwitch click presents an ideal platform for the development of low-power touch sensing applications for wearables, white goods, home appliances, toys, human-machine interface (HMI) applications, etc. |
On-board modules |
IQS266, an integrated trackpad controller circuit, featuring ProxSense® and IQ Switch® technologies, from Azoteq. |
Key Features |
Reliable and well-proven capacitive touch and swipe detection technologies, noise filtering, automatic tuning implementation, a lot of programmable parameters and options, single dedicated proximity detection channel for low power consumption, etc. |
Interface |
I2C |
Input Voltage |
3.3V |
Click board size |
L (57.15 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on SwipeSwitch click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes |
Pin |
|
Pin |
Notes |
---|
|
NC |
1 |
AN |
PWM |
16 |
NC |
|
|
NC |
2 |
RST |
INT |
15 |
RDY |
RDY pin (interrupt) |
|
NC |
3 |
CS |
RX |
14 |
NC |
|
|
NC |
4 |
SCK |
TX |
13 |
NC |
|
|
NC |
5 |
MISO |
SCL |
12 |
SCL |
I2C Clock |
|
NC |
6 |
MOSI |
SDA |
11 |
SDA |
I2C Data |
Power Supply |
3.3V |
7 |
3.3V |
5V |
10 |
NC |
|
Ground |
GND |
8 |
GND |
GND |
9 |
GND |
Ground |
Onboard settings and indicators
Label |
Name |
Default |
Description |
---|
LD1 |
PWR |
- |
Power LED Indicator |
Software support
We provide a library for the SwipeSwitch click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
This library contains all the functions required to work with SwipeSwitch click.
Key functions:
void swipeswitch_init()
- Function for initialization chip.
void swipeswitch_goToEventMode()
- Function for go to Event mode.
uint8_t swipeswitch_waitForReady()
- Function for checking RDY pins.
Examples description
The application is composed of the three sections :
- System Initialization - Initialization I2C module and sets INT pin as INPUT.
- Application Initialization - Initialization and configuration of the chip for measurement.
- Application Task - (code snippet) : In the first test mode, it checks whether or not a new event ocurred (TAP or SWIPE). If it did, it writes out data regarding that event via UART. In the second test mode, X and Y coordinates are being read and logged via UART.
Note: After reading data or status registers, there is a certain time which must pass until the device is ready again. The device is ready for a new conversion and reading after the Ready pin is LOW.
void applicationTask()
{
if(displayMode == 0)
{
while(swipeswitch_waitForReady() != 0);
events = swipeswitch_readEvents();
while(swipeswitch_waitForReady() != 0);
gestures = swipeswitch_readGestures();
if((events & (_SWIPESWITCH_EVENT_SWIPE)) != 0 )
{
if((gestures & _SWIPESWITCH_GESTURE_SWIPE_UP) != 0)
{
mikrobus_logWrite("SWIPE UP", _LOG_LINE);
}
if((gestures & _SWIPESWITCH_GESTURE_SWIPE_DOWN) != 0)
{
mikrobus_logWrite("SWIPE DOWN", _LOG_LINE);
}
if((gestures & _SWIPESWITCH_GESTURE_SWIPE_LEFT) != 0)
{
mikrobus_logWrite("SWIPE LEFT", _LOG_LINE);
}
if((gestures & _SWIPESWITCH_GESTURE_SWIPE_RIGHT) != 0)
{
mikrobus_logWrite("SWIPE RIGHT", _LOG_LINE);
}
}
else if ((events & (_SWIPESWITCH_EVENT_TAP)) != 0)
{
mikrobus_logWrite("TAP", _LOG_LINE);
}
}
else
{
while(swipeswitch_waitForReady() != 0);
xCoordinate = swipeswitch_readXCoordinate();
while(swipeswitch_waitForReady() != 0);
yCoordinate = swipeswitch_readYCoordinate();
if((xCoordinate != oldXCoordinate) || (yCoordinate != oldYCoordinate))
{
mikrobus_logWrite("Coordinate : (", _LOG_TEXT);
IntToStr(xCoordinate, demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(",", _LOG_TEXT);
IntToStr(yCoordinate, demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(")", _LOG_LINE);
oldXCoordinate = xCoordinate;
oldYCoordinate = yCoordinate;
}
}
Delay_ms( 300 );
}
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
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.