TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139058 times)
  2. FAT32 Library (71588 times)
  3. Network Ethernet Library (56988 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29768 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Expand 13 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: Port expander

Downloaded: 212 times

Not followed.

License: MIT license  

Expand 13 Click is a compact add-on board that contains a multi-port I/O expander. This board features the PI4IOE5V96248, a 48-bit general-purpose I/O expander providing remote I/O expansion for most MCU’s families from Diodes Incorporated. The PI4IOE5V96248 comes in a 6-channel configuration and allows easy addition of I/O through a standard I2C serial interface. It has a built-in level shifting feature that makes it highly flexible in power supply systems where communication between incompatible I/O voltages is required.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Expand 13 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Expand 13 Click" changes.

Do you want to report abuse regarding "Expand 13 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Expand 13 Click

Expand 13 Click is a compact add-on board that contains a multi-port I/O expander. This board features the PI4IOE5V96248, a 48-bit general-purpose I/O expander providing remote I/O expansion for most MCU’s families from Diodes Incorporated. The PI4IOE5V96248 comes in a 6-channel configuration and allows easy addition of I/O through a standard I2C serial interface. It has a built-in level shifting feature that makes it highly flexible in power supply systems where communication between incompatible I/O voltages is required.

expand13_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Oct 2021.
  • Type : I2C type

Software Support

We provide a library for the Expand13 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 Expand13 Click driver.

Standard key functions :

  • expand13_cfg_setup Config Object Initialization function.

    void expand13_cfg_setup ( expand13_cfg_t *cfg );
  • expand13_init Initialization function.

    err_t expand13_init ( expand13_t *ctx, expand13_cfg_t *cfg );

Example key functions :

  • expand13_enable_device This function enables the device by setting the RST pin to high logic state.

    void expand13_enable_device ( expand13_t *ctx );
  • expand13_write_all_ports This function writes a desired data to all 6 ports.

    err_t expand13_write_all_ports ( expand13_t *ctx, uint8_t *ports );
  • expand13_read_all_ports This function reads the state of all 6 ports.

    err_t expand13_read_all_ports ( expand13_t *ctx, uint8_t *ports );

Example Description

This example demonstrates the use of Expand 13 Click board, by writing data to all six ports and then reading back the status of the ports.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the Click board.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    expand13_cfg_t expand13_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    expand13_cfg_setup( &expand13_cfg );
    EXPAND13_MAP_MIKROBUS( expand13_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == expand13_init( &expand13, &expand13_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    expand13_enable_device ( &expand13 );
    log_info( &logger, " Application Task " );
}

Application Task

Sets the pins of all ports and then reads and displays their status on the USB UART approximately once per second.


void application_task ( void )
{
    uint8_t port_value[ 6 ] = { 0 };
    uint16_t pin_num = 0;

    for ( pin_num = EXPAND13_PIN_0_MASK; pin_num <= EXPAND13_PIN_7_MASK; pin_num <<= 1 )
    {
        if ( !expand13_get_int_pin ( &expand13 ) )
        {
            log_printf( &logger, " External input has occurred.\r\n" );
        }

        memset ( port_value, pin_num, 6 );
        expand13_write_all_ports( &expand13, port_value );

        expand13_read_all_ports( &expand13, port_value );
        for ( uint8_t cnt = EXPAND13_PORT_0; cnt <= EXPAND13_PORT_5; cnt++ )
        {
            log_printf( &logger, " Status port %d : 0x%.2X\r\n", ( uint16_t ) cnt, ( uint16_t ) port_value[ cnt ] );
        }
        log_printf( &logger, "\n" );
        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.Expand13

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.


ALSO FROM THIS AUTHOR

SE051 Plug n Trust Click

0

SE051 Plug&Trust Click is a compact add-on board representing a ready-to-use IoT security solution. This board features the SE051C2, an updatable extension of the EdgeLock™ SE050 from NXP Semiconductor, which delivers proven security certified to CC EAL 6+, with AVA_VAN.5up to the OS level. Designed for the latest IoT security requirements, it allows securely storing and provisioning credentials performing cryptographic operations, giving edge-to-cloud security capability right out of the box. It also provides upgrade functionality of the IoT applet while preserving on-device credentials, alongside reconfiguration possibility.

[Learn More]

GainAMP click

11

GainAMP click carries the LTC®6912 dual channel, low noise, digitally programmable gain amplifier (PGA). The click is designed to work on either 3.3V or 5V power supply. It communicates with the target MCU over SPI interface, with additional functionality provided by the following pins on the mikroBUS line: AN, RST.

[Learn More]

Temp-Log Click

0

Temp-Log Click is a precise ambient temperature measurement device, equipped with 8Kbit (1024 bytes) of EEPROM memory, which can be used to permanently store system configuration or log application specific or user preference data. This Click covers a range of temperatures from -55°C to +125°C with the highest accuracy of ±0.5°C, in the range of 0°C to 85°C. The device can also send an ALERT signal to the INT pin of the mikroBUS™ every time programmed temperature thresholds are reached.

[Learn More]