How does it work?
Expand 12 Click as its foundation uses the MAX7300, a general-purpose input/output (GPIO) expander from Analog Devices, now part of Analog Devices. This port expander is a simple solution when additional I/Os are needed while keeping interconnections to a minimum, particularly great for system monitoring applications, industrial controllers, portable equipment, and others. The MAX7300 comes in a 28-port configuration, which can be configured to any combination of logic inputs and logic outputs, and default to logic inputs on Power-Up.
Any I/O port can be configured as a push-pull output (sinking 10mA, sourcing 4.5mA) or a Schmitt-trigger logic input. Each input has an individually selectable internal pull-up resistor. Additionally, transition detection allows seven ports (from port 24 up to port 30) to be monitored in any maskable combination for changes in their logic status. A detected transition is flagged through a status register bit, as well as an interrupt pin (port 31) if desired.
Expand 12 Click communicates with MCU using the standard I2C 2-Wire interface to read data and configure settings with a maximum frequency of 400kHz. Besides, it also allows the choice of the least significant bit of its I2C slave address by positioning the SMD jumpers labeled as ADDR SEL to an appropriate position marked as 1 and 0. This way, the MAX7300 provides the opportunity of the 16 possible different I2C addresses by positioning the SMD jumper to an appropriate position.
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 I2C 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 in system monitoring applications, industrial controllers, portable equipment, and many more
On-board modules
MAX7300 – general-purpose input/output (GPIO) expander from Maxim Integrated, now part of Analog Devices
Key Features
Remote I/O pins that default to inputs at Power-Up, compliant with the I2C-bus Fast and Standard modes, 5V tolerant I/Os, sinking 10mA and sourcing 4.5mA, programmable slave addresses, 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 12 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-JP3 | ADDR SEL | Left | I2C Address Selection 1/0: Left position 1, Right position 0 |
J1-J4 | 4-31 | Populated | I/O Expander Ports |
Expand 12 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Port Sink Current | – | 10 | – | mA |
Port Source Current | – | 4.5 | – | mA |
Number of I/Os | – | – | 28 | pins |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the Expand 12 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 12 Click driver.
Key functions
-
expand12_set_pin_direction
This function sets the direction of the selected pin. -
expand12_set_pin_value
This function sets the logic level of the selected pin. -
expand12_read_all_pins_value
This function reads all pins logic levels.
Example Description
This example demonstrates the use of Expand 12 Click board™.
void application_task ( void )
{
static uint8_t port_value = 0;
static uint32_t pins_status = 0;
expand12_set_port_value( &expand12, EXPAND12_PORT_4_7, EXPAND12_ALL_PINS, port_value );
expand12_set_port_value( &expand12, EXPAND12_PORT_8_15, EXPAND12_ALL_PINS, port_value );
expand12_set_port_value( &expand12, EXPAND12_PORT_16_23, EXPAND12_ALL_PINS, port_value++ );
expand12_read_all_pins_value( &expand12, &pins_status );
log_printf( &logger, " Pins status (32-bit) : 0x%.8LXrnn", pins_status );
Delay_ms( 100 );
}
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.Expand12
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.