How does it work?
Expand 17 Click is based on the TCAL6408, an 8-bit I/O expander from Texas Instruments designed to provide input/output expansion through the I2C protocol. This Click board™ offers an ideal solution for adding more I/Os to the system when dealing with switches, sensors, push-buttons, LEDs, fans, and other peripherals. The TCAL6408 IC features agile I/O configuration registers, providing programmable output drive strength, latchable inputs, maskable interrupts, programmable pull-up/down resistors, and the ability to configure open-drain or push-pull outputs. These advanced features ensure enhanced I/O performance with improved speed, power consumption, and reduced electromagnetic interference (EMI).
The TCAL6408 supports independent logic and power supplies. The logic voltage is supplied via the 3.3V mikroBUS™ power rail, while the main power can be selected between 3.3V from the mikroBUS™ or an externally provided supply through the VIN terminal, with a range of 1.08V to 3.6V. The main power selection is managed by the VCCP SEL jumper, allowing users to set the appropriate power source for the TCAL6408 based on their application’s requirements.
Expand 17 Click communicates with the host MCU via the standard 2-wire I2C interface, supporting clock frequencies up to 1MHz. The I2C address is easily configurable using the onboard ADDR SEL jumper. Additionally, this board also uses an active-low reset (RST) pin, used for initializing the device, and an open-drain active-low interrupt (INT) pin, which provides notification of changes in input status, ensuring efficient handling of external events and inputs.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
Port expander
Applications
Ideal for applications requiring additional I/Os, such as controlling switches, sensors, push-buttons, and LEDs
On-board modules
TCAL6408 – 8-bit I/O expander from Texas Instruments
Key Features
8-bit I/O expander, I2C interface, programmable output drive strength and pull-up/pull-down resistors, configurable open-drain or push-pull outputs, latchable inputs and maskable interrupts, independent logic and main power supplies, and more
Interface
I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V,External
Pinout diagram
This table shows how the pinout on Expand 17 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 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
JP2 | VCCP SEL | Left | TCAL6408 Power Supply Selection 3V3/VIN: Left position 3V3, Right position VIN |
Expand 17 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
External Power Supply | 1.08 | – | 3.6 | V |
Output Current | – | – | 25 | mA |
Software Support
We provide a library for the Expand 17 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), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for Expand 17 Click driver.
Key functions
-
expand17_set_io_dir
This function is used to set input or output direction of pins. -
expand17_set_output_state
This function is used to set output state of the pins. -
expand17_get_input_state
This function is used to get state of the input pins.
Example Description
This example demonstrates the use of Expand 17 Click by setting and reading the ports state.
void application_task ( void )
{
uint8_t input_state = 0;
log_printf( &logger, " Setting output pins state: HIGH rn" );
log_printf( &logger, " = = = = = = = = = = = = = = = = = rn" );
expand17_set_output_state( &expand17, EXPAND17_NO_IO_PIN_MASK, EXPAND17_IO_5_PIN_MASK |
EXPAND17_IO_6_PIN_MASK | EXPAND17_IO_7_PIN_MASK |
EXPAND17_IO_8_PIN_MASK );
log_printf( &logger, " State of input pins: rn" );
log_printf( &logger, " = = = = = = = = = = = = = = = = = rn" );
expand17_get_input_state( &expand17, &input_state );
if ( input_state & EXPAND17_IO_1_PIN_MASK )
{
log_printf( &logger, " IO1 - HIGH rn" );
}
else
{
log_printf( &logger, " IO1 - LOW rn" );
}
if ( input_state & EXPAND17_IO_2_PIN_MASK )
{
log_printf( &logger, " IO2 - HIGH rn" );
}
else
{
log_printf( &logger, " IO2 - LOW rn" );
}
if ( input_state & EXPAND17_IO_3_PIN_MASK )
{
log_printf( &logger, " IO3 - HIGH rn" );
}
else
{
log_printf( &logger, " IO3 - LOW rn" );
}
if ( input_state & EXPAND17_IO_4_PIN_MASK )
{
log_printf( &logger, " IO4 - HIGH rn" );
}
else
{
log_printf( &logger, " IO4 - LOW rn" );
}
log_printf( &logger, " = = = = = = = = = = = = = = = = = rn" );
Delay_ms( 2000 );
log_printf( &logger, " Setting output pins state: LOW rn" );
log_printf( &logger, " = = = = = = = = = = = = = = = = = rn" );
expand17_set_output_state( &expand17, EXPAND17_IO_5_PIN_MASK | EXPAND17_IO_6_PIN_MASK |
EXPAND17_IO_7_PIN_MASK | EXPAND17_IO_8_PIN_MASK,
EXPAND17_NO_IO_PIN_MASK );
log_printf( &logger, " State of input pins: rn" );
log_printf( &logger, " = = = = = = = = = = = = = = = = = rn" );
expand17_get_input_state( &expand17, &input_state );
if ( input_state & EXPAND17_IO_1_PIN_MASK )
{
log_printf( &logger, " IO1 - HIGH rn" );
}
else
{
log_printf( &logger, " IO1 - LOW rn" );
}
if ( input_state & EXPAND17_IO_2_PIN_MASK )
{
log_printf( &logger, " IO2 - HIGH rn" );
}
else
{
log_printf( &logger, " IO2 - LOW rn" );
}
if ( input_state & EXPAND17_IO_3_PIN_MASK )
{
log_printf( &logger, " IO3 - HIGH rn" );
}
else
{
log_printf( &logger, " IO3 - LOW rn" );
}
if ( input_state & EXPAND17_IO_4_PIN_MASK )
{
log_printf( &logger, " IO4 - HIGH rn" );
}
else
{
log_printf( &logger, " IO4 - LOW rn" );
}
log_printf( &logger, " = = = = = = = = = = = = = = = = = rn" );
Delay_ms( 2000 );
}
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.Expand17
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.