How does it work?
Expand 19 Click is based on the TCAL9538, an 8-bit I2C-bus I/O expander from Texas Instruments. This Click board™ provides a simple solution for applications that require additional input/output lines, such as controlling switches, sensors, push-buttons, LEDs, and more. Operating at 3.3V, the TCAL9538 allows easy integration into existing systems using the standard two-wire I2C communication protocol. At its core, the TCAL9538 features 8-bit data registers that enable users to configure the I/O pins as inputs or outputs. Upon power-up or a software reset, all I/Os are set as inputs by default. However, they can be reconfigured by the host microcontroller through the Configuration registers. The data for each pin is stored in dedicated Input Port or Output Port registers, which are accessible for reading by the host MCU. Additionally, the polarity of the Input Port can be adjusted via the Polarity Inversion register, offering flexibility in design and signal interpretation.
This Click board™ is designed in a unique format supporting the newly introduced MIKROE feature called “Click Snap.” Unlike the standardized version of Click boards, this feature allows the main sensor area to become movable by breaking the PCB, opening up many new possibilities for implementation. Thanks to the Snap feature, the TCAL9538 can operate autonomously by accessing its signals directly on the pins marked 1-8. Additionally, the Snap part includes a specified and fixed screw hole position, enabling users to secure the Snap board in their desired location.
One of the key features of the TCAL9538 is its Agile I/O functionality, which enhances the performance of the I/O ports. This includes configurable output drive strength, programmable pull-up and pull-down resistors, latchable inputs, and maskable interrupts. The device also offers programmable open-drain or push-pull output modes, making it adaptable to various application requirements. These Agile I/O features provide the flexibility to optimize your design for power consumption, speed, and electromagnetic interference (EMI).
Expand 19 Click uses an I2C interface with clock speeds of up to 1MHz, ensuring fast and efficient communication with the host MCU. The I2C address can be easily configured via onboard jumpers, allowing multiple devices to coexist on the same bus. Additionally, the board features an interrupt (INT) pin triggered whenever there is a change in the state of any input port, ensuring real-time response to external events, and a reset (RST) pin for power cycling to return the device to its default state. This ensures reliable operation and easy recovery in case of unexpected issues.
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.
Click Snap
Click Snap is an innovative feature of our standardized Click add-on boards, introducing a new level of flexibility and ease of use. This feature allows for easy detachment of the main sensor area by simply snapping the PCB along designated lines, enabling various implementation possibilities. For detailed information about Click Snap, please visit the official page dedicated to this feature.
Specifications
Type
Port expander
Applications
Ideal for systems requiring additional I/O control, such as managing sensors, switches, and LEDs
On-board modules
TCAL9538 – 8-bit I2C-bus I/O expander from Texas Instruments
Key Features
8 configurable I/O pins (input or output), polarity inversion for input pins, programmable output drive strength and pull-up/pull-down resistors, agile I/O features including latchable inputs and maskable interrupts, interrupt and reset feature, and more
Interface
I2C
Feature
Click Snap,ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Expand 19 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-JP2 | ADDR SEL | Right | I2C Address Selection 0/1: Left position 0, Right position 1 |
Expand 19 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Output Current – Source | – | – | 10 | mA |
Output Current – Sink | – | – | 25 | mA |
Software Support
We provide a library for the Expand 19 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 19 Click driver.
Key functions
-
expand19_set_pin_direction
This function sets the direction of the selected pins. -
expand19_set_all_pins_value
This function sets the value of all output pins. -
expand19_read_port_value
This function reads the value of all input pins.
Example Description
This example demonstrates the use of Expand 19 Click by setting and reading the port state.
void application_task ( void )
{
uint8_t port_value = 0;
for ( uint16_t pin_num = EXPAND19_PIN_0_MASK; pin_num <= EXPAND19_PIN_3_MASK; pin_num <<= 1 )
{
expand19_set_all_pins_value( &expand19, pin_num );
expand19_read_port_value( &expand19, &port_value );
log_printf( &logger, " Port status: 0x%.2Xrn", ( uint16_t ) port_value );
Delay_ms( 1000 );
}
}
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.Expand19
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.