TOP Contributors

  1. MIKROE (2654 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 (136744 times)
  2. FAT32 Library (69952 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46267 times)
  5. Network WiFi Library (41887 times)
  6. FT800 Library (41173 times)
  7. GSM click (28985 times)
  8. PID Library (26413 times)
  9. mikroSDK (26362 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

H-Bridge 5 click

0

The H-Bridge 5 Click is designed for control DC motors and inductiv loads. This Click board™ contains the MP6515GF-Z, a H-bridge motor driver from MPS, It features an Full H-Bridge driver with Internal safety features include over-current protection, input over-voltage protection, under voltage lockout (UVLO), and thermal shutdown.

[Learn More]

8-pin I2C click

0

8-pin I2C Click is a compact add-on board that represents a breakout board that simplifies the connection of add-on boards with 8 pin Female Connector to mikroBUS™ socket.

[Learn More]

StereoAmp click

0

StereoAmp click functions as a stereo amplifier and is ideal for battery powered devices. It features two LM48100Q-Q1 Boomer ICs by Texas Instruments.

[Learn More]