TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (136736 times)
  2. FAT32 Library (69951 times)
  3. Network Ethernet Library (55941 times)
  4. USB Device Library (46266 times)
  5. Network WiFi Library (41886 times)
  6. FT800 Library (41171 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26360 times)
  10. microSD click (25376 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 6

Rating:

5

Author: MIKROE

Last Updated: 2020-09-11

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Port expander

Downloaded: 2092 times

Not followed.

License: MIT license  

EXPAND 6 Click is a compact add-on board that contains an I2C configurable multi-port I/O expander with independently configurable pins as bi-directional input/outputs or PWM outputs. This board features the CY8C9520A, 20-bit I/O expander with EEPROM, and 4 independently configurable 8-bit PWM outputs from Cypress Semiconductor.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "EXPAND 6" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "EXPAND 6" changes.

Do you want to report abuse regarding "EXPAND 6".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

EXPAND 6 Click

EXPAND 6 Click

Native view of the EXPAND 6 Click board.

View full image
EXPAND 6 Click

EXPAND 6 Click

Front and back view of the EXPAND 6 Click board.

View full image

Library Description

The library covers necessary functions that enables the usage of the EXPAND 6 click board. User can check or set the state of every pin, set PWM output or use on board user available EEPROM.

Key functions:

  • uint8_t expand6_read_pin ( uint16_t pin, uint8_t inv ); - Function is used to read the state of a defined pin.
  • void expand6_write_pin ( uint16_t pin, uint8_t pin_val ); - Function is used to set a single output pin's logic level.
  • void expand6_sel_pwm_pin ( uint16_t pin, uint8_t pwm_en ); - Function is used to enable or disable PWM output on a specific pin.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C module, LOG structure and sets RST pin as output and INT pin as input.
  • Application Initialization - Initalizes I2C driver and makes an initial log.
  • Application Task - (code snippet) This example shows the capabilities of the EXPAND 6 click by toggling each of 20 available pins.
void application_task ( )
{
    mikrobus_logWrite( " PORT 0 ", _LOG_LINE );
    for ( pin_num = 0; pin_num < 8; pin_num++ )
    {
        expand6_write_port( EXPAND6_PORT_0, 0xFF );
        expand6_write_pin( pin_num, EXPAND6_LOW );
        mikrobus_logWrite( "Pin ", _LOG_TEXT );
        ByteToStr( pin_num, log_txt );
        Ltrim( log_txt );
        mikrobus_logWrite( log_txt, _LOG_TEXT );
        mikrobus_logWrite( " is low!", _LOG_LINE );

        Delay_ms( 500 );
        expand6_write_port( EXPAND6_PORT_0, 0xFF );
    }
    Delay_ms( 1000 );
    mikrobus_logWrite( " PORT 1 ", _LOG_LINE );
    for ( pin_num = 8; pin_num < 16; pin_num++ )
    {
        expand6_write_port( EXPAND6_PORT_1, 0xFF );
        expand6_write_pin( pin_num, EXPAND6_LOW );
        mikrobus_logWrite( "Pin ", _LOG_TEXT );
        ByteToStr( pin_num, log_txt );
        Ltrim( log_txt );
        mikrobus_logWrite( log_txt, _LOG_TEXT );
        mikrobus_logWrite( " is low!", _LOG_LINE );

        Delay_ms( 500 );
        expand6_write_port( EXPAND6_PORT_1, 0xFF );
    }
    Delay_ms( 1000 );
    mikrobus_logWrite( " PORT 2 ", _LOG_LINE );
    for ( pin_num = 16; pin_num < 20; pin_num++ )
    {
        expand6_write_port( EXPAND6_PORT_2, 0xFF );
        expand6_write_pin( pin_num, EXPAND6_LOW );
        mikrobus_logWrite( "Pin ", _LOG_TEXT );
        ByteToStr( pin_num, log_txt );
        Ltrim( log_txt );
        mikrobus_logWrite( log_txt, _LOG_TEXT );
        mikrobus_logWrite( " is low!", _LOG_LINE );

        Delay_ms( 500 );
        expand6_write_port( EXPAND6_PORT_2, 0xFF );
    }
    mikrobus_logWrite( "-------------------", _LOG_LINE );
    Delay_ms( 1000 );
}

Other mikroE Libraries used in the example:

  • I2C
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

GSM 5 click

0

GSM 5 Click is a compact add-on board representing a compact GSM cellular network communication solution. This board features the SARA-G450, a GSM/GPRS quad-band cellular module certified and approved by the main regulatory bodies and operators from u-blox. It features class 12 GSM/GPRS connectivity in the popular u-blox SARA form factor and comes with a comprehensive feature set, including an extensive set of internet protocols designed to provide fully integrated access to u-blox GNSS positioning with embedded A-GPS (AssistNow Online and AssistNow Offline) functionality. Besides a data rate up to 85.6 kbps and an advanced jamming detection feature, this board also offers a high-quality integrated audio interface allowing voice communication.

[Learn More]

AnyNet 3G-AA click

0

AnyNet 3G-AA click is a cellular to AWS gateway device, which provides developers with the complete solution for various IoT applications, by using the AWS IoT and Cloud Storage services for the data storage, analyzing and processing. AnyNet click board™ provides a secure connection with the AWS over the air (OTA), by utilizing the Quectel UG95-AA 3G module, offering UMTS/HSPA coverage for the North American region, Eseye ES4623 embedded SIM card, that can work with all the major cellular operators within the NA region. The AnyNet 3G click can be used as an AWS IoT button with almost no configuration.

[Learn More]

Accel 25 click

0

Accel 25 Click is a compact add-on board that contains an acceleration sensor. This board features the MXC4005XC, a 12-bit three-axis thermal accelerometer from MEMSIC. It allows selectable full-scale acceleration measurements of ±2g, ±4g, or ±8g in three axes with a compatible I2C serial interface with 400KHz fast mode operation.

[Learn More]