How does it work?
Expand 16 Click is based on the FXL6408, a fully configurable 8-bit GPIO expander from ON Semiconductor. The input default values can be programmed independently, allowing customized input detection. All inputs can be configured with pull−up or pull−down resistors to pre−bias the inputs in open−drain or non−driven applications. The FXL6408 is designed to allow voltage translation from levels as low as 1.65V and up to 4.0V. For this purpose, you can supply the FXL6408 with an external voltage source over the VEXT terminal. The choice between the external voltage and the 3.3V from the mikroBUS™ socket for the voltage reference input of the I/O expander can be set over the VDDIO SEL jumper.
Expand 16 Click uses a standard 2-wire I2C interface to communicate with the host MCU, supporting clock frequency up to 400kHz. The I2C address can be selected over the ADDR SEL jumper. The FXL6408 has three reset options: power-on reset, over the software, and the RST pin by writing the logic LOW. When the event occurs, the I/O expander will assert the host MCU over the interrupt INT pin.
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
Can be used for the development of applications where additional I/Os are needed for switches, sensors, push-buttons, LEDs, fans, and more
On-board modules
FXL6408 – fully configurable 8-bit GPIO expander from ON Semiconductor
Key Features
Eight independently configurable input/output ports, fully integrated I2C slave, low-power quiescent current, voltage translation capability, all inputs configurable with pull-up or pull-down resistors to pre-bias inputs, in output mode can drive up to 6mA of current, PoR, software and hardware reset, 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 16 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 | VDDIO SEL | Left | Voltage Reference for I/O Selection VEXT/3V3: Left position VEXT, Right position 3V3 |
JP2 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
Expand 16 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
External Supply Voltage | 1.65 | – | 4 | V |
Output Current | – | – | 6 | mA |
Software Support
We provide a library for the Expand 16 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 16 Click driver.
Key functions
-
expand16_write_reg
Expand 16 register write function. -
expand16_set_io_dir
Expand 16 set pin input or output direction function. -
expand16_set_output_state
Expand 16 set output pins state function.
Example Description
This example demonstrates the use of Expand 16 click board by setting and reading the ports state.
void application_task ( void )
{
uint8_t tmp_data = 0;
log_printf( &logger, "Output pins state: HIGH rn" );
log_printf( &logger, "- - - - - - - - - - - - -rn" );
expand16_set_output_state( &expand16, EXPAND16_PIN_MASK_NONE, EXPAND16_PIN_MASK_GPIO_4 |
EXPAND16_PIN_MASK_GPIO_5 | EXPAND16_PIN_MASK_GPIO_6 |
EXPAND16_PIN_MASK_GPIO_7 );
expand16_read_reg( &expand16, EXPAND16_REG_INPUT_STATE, &tmp_data );
show_input_pin_state( tmp_data );
Delay_ms( 2000 );
log_printf( &logger, "Output pins state: LOW rn" );
log_printf( &logger, "- - - - - - - - - - - - -rn" );
expand16_set_output_state( &expand16, EXPAND16_PIN_MASK_GPIO_4 | EXPAND16_PIN_MASK_GPIO_5 |
EXPAND16_PIN_MASK_GPIO_6 | EXPAND16_PIN_MASK_GPIO_7,
EXPAND16_PIN_MASK_NONE );
expand16_read_reg( &expand16, EXPAND16_REG_INPUT_STATE, &tmp_data );
show_input_pin_state( tmp_data );
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.Expand16
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.