How does it work?
Expand 14 Click as its foundation uses the CAT9555, a general-purpose I/O expander from ON Semiconductor. It contains two 8-bit configuration ports (input or output), input, output, and polarity inversion registers, alongside an I2C-compatible serial interface, where any of the sixteen I/Os can be configured as an input or output by writing to the configuration register. This port expander represents a simple solution when additional I/Os are needed while keeping interconnections to a minimum; particularly great for sensors, power switches, LEDs, pushbuttons, and fans.
Each I/O port is 5V input tolerant, with a high current I/O drive sink of up to 25mA and an I/O source of up to 10mA, maximum. Additionally, each I/O port is compatible with logic thresholds of 2.5V, 3.3V, and 5V.
This Click board™ communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 400kHz. The CAT9555 has a 7-bit slave address with the first four MSBs fixed to 0100. The address pins A0, A1, and A2, are programmed by the user and determine the value of the last three LSBs of the slave address, which can be selected by positioning onboard SMD jumpers labeled as ADDR SEL to an appropriate position marked as 0 or 1.
Besides, it also features an active-low interrupt feature, routed to the INT pin of the mikroBUS™ socket, indicating to the host controller that an input state has been changed.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Port expander
Applications
Can be used for sensors, power switches, LEDs, pushbuttons, and fans
On-board modules
CAT9555 – general-purpose I/O expander from ON Semiconductor
Key Features
16 I/O Pins that default to inputs at Power−Up, 5V Tolerant I/Os, high drive capability, individual I/O configuration, polarity inversion register, interrupt, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Expand 14 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 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2-JP4 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
J1-J2 | P0-P1 | Populated | I/O Expander Ports |
Expand 14 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Output Current – Source/Sink | – | 10/24 | – | mA |
Number of I/Os | – | – | 16 | pins |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Expand 14 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Expand 14 Click driver.
Key functions
-
expand14_set_pin_direction
This function sets the direction of the selected pins. -
expand14_set_all_pins_value
This function sets the value of all output pins. -
expand14_read_port_value
This function reads the value of the selected port input pins.
Example Description
This example demonstrates the use of Expand 14 Click board™ by setting and reading the ports state.
void application_task ( void )
{
uint8_t port_value = 0;
for ( uint16_t pin_num = EXPAND14_PIN_0_MASK; pin_num <= EXPAND14_PIN_7_MASK; pin_num <<= 1 )
{
expand14_set_all_pins_value( &expand14, pin_num );
expand14_read_port_value( &expand14, EXPAND14_PORT_0, &port_value );
log_printf( &logger, " Status port 0 (output): 0x%.2Xrn", ( uint16_t ) port_value );
expand14_read_port_value( &expand14, EXPAND14_PORT_1, &port_value );
log_printf( &logger, " Status port 1 (input) : 0x%.2Xrnn", ( 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 way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Expand14
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 MikroElektronika compilers.
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.