How does it work?
Expand 9 Click as its foundation uses the SX1509QB, a 16-channel lowest voltage level shifting GPIO expander from Semtech Corporation. The expander devices, like this one, can provide additional control and monitoring when the MCU has insufficient I/O ports or in systems where serial communication and control from a remote location are advantageous. The SX1509QB has a built-in level shifting feature making it highly flexible in power supply systems where communication between incompatible I/O voltages is required, thus eliminating extra level translating circuits.
The SX1509QB features a fully programmable LED driver with an internal oscillator for enhanced lighting control such as intensity (via 256-step PWM), blinking, and breathing (fade In/Out) which makes them highly versatile for a wide range of LED applications. Also, keypad applications are supported with an on-chip scanning engine enabling continuous keypad monitoring up to 64 keys (8×8 matrix) without any additional host interaction reducing bus activity.
Expand 9 Click communicates with MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting a Fast Mode operation up to 400kHz. The selection of the I2C slave address is also possible, using the ADD pin routed to the AN pin of the mikroBUS™ socket. This way, the SX1509QB provides the opportunity of the two possible different I2C addresses by setting ADD pin to an appropriate logic state. In addition to selecting a Slave address, the SX1509QB can generate mask-programmable interrupts based on a falling/rising edge of any of its GPIO lines. A dedicated interrupt pin, routed to the INT pin of the mikroBUS™ socket, indicates to a host controller that a state change occurred on one or more of the expand lines, while the RST pin of the mikroBUS™ socket represents a Reset feature used to reset the chip at any time.
Each GPIO on I/O Expander channels is programmable via a bank of 8-bit configuration registers, including data, direction, pull-up/pull-down, interrupt mask, and interrupt registers. The user is also given an option of selecting the expander port supply voltage, which is realized by two onboard switches labeled as VCCA and VCCB, allowing one to choose between 3.3V and 1.8V. To obtain 1.8V, a small LDO regulator is added, AP2112 from Dialog Incorporated, to provide 1.8V out of mikroBUS™ power rail.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before use with MCUs with different logic levels. However, the Click board™ 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 low-power portable equipment, keypad scanning, driving LEDs, and many more
On-board modules
SX1509QB – 16-channel lowest voltage level shifting GPIO expander from Semtech Corporation
Key Features
Low power consumption, integrated LED driver for enhanced lighting, on-chip keypad scanning engine, interrupt and reset feature, selectable I2C slave address, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Expand 9 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 |
SW1-SW2 | VCCA-VCCB | – | Expander Channels Supply Voltage Selection 3V3/1V8: Left position 3V3, Right position 1V8 |
Expand 9 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Maximum GPIO Input Voltage | – | – | 5.5 | V |
Maximum GPIO Output Current | – | – | 15 | mA |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Expand 9 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 9 Click driver.
Key functions
-
expand9_set_ch_output_state
Expand 9 set channel output state function. -
expand9_led_driver_config
Expand 9 LED driver configuration function. -
expand9_soft_reset
Expand 9 software reset function.
Example Description
This is an example that demonstrates the use of the Expand 9 Click board™. The library initializes and defines the I2C bus drivers to write and read data from registers.
void application_task ( void )
{
expand9_soft_reset( &expand9 );
Delay_ms( 100 );
for ( uint8_t cnt = 0; cnt < 16; cnt++ )
{
expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_ON );
Delay_ms( 100 );
expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_OFF );
Delay_ms( 100 );
}
for ( uint8_t cnt = 15; cnt > 0; cnt-- )
{
expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_ON );
Delay_ms( 100 );
expand9_set_ch_output_state( &expand9, cnt, CH_OUTPUT_OFF );
Delay_ms( 100 );
}
expand9_soft_reset( &expand9 );
Delay_ms( 100 );
for ( uint8_t cnt = 0; cnt < 16; cnt++ )
{
expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
expand9_set_intensity( &expand9, cnt, 10 );
Delay_ms( 100 );
expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
expand9_set_intensity( &expand9, cnt, 200 );
Delay_ms( 100 );
}
for ( uint8_t cnt = 15; cnt > 0; cnt-- )
{
expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
expand9_set_intensity( &expand9, cnt, 200 );
Delay_ms( 100 );
expand9_led_driver_config( &expand9, cnt, EXPAND9_FREQ_DIV_1, EXPAND9_LED_MODE_LINEAR );
expand9_set_intensity( &expand9, cnt, 10 );
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.Expand9
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.