TOP Contributors

  1. MIKROE (2655 codes)
  2. Alcides Ramos (353 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 (136780 times)
  2. FAT32 Library (69977 times)
  3. Network Ethernet Library (55948 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41888 times)
  6. FT800 Library (41183 times)
  7. GSM click (28987 times)
  8. PID Library (26419 times)
  9. mikroSDK (26372 times)
  10. microSD click (25381 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 7 click

Rating:

5

Author: MIKROE

Last Updated: 2021-02-02

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Port expander

Downloaded: 1714 times

Not followed.

License: MIT license  

EXPAND 7 Click is a compact add-on board that contains a multi-port I/O expander with bi-directional input/outputs or PWM outputs. This board features the CY8C9540A, 40-bit I/O port expander with EEPROM and 8 independently configurable 8-bit PWM outputs from Cypress Semiconductor.

No Abuse Reported

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

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

Do you want to report abuse regarding "EXPAND 7 click".

  • mikroSDK Library 2.0.0.0
  • Comments (1)
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 7 Click

EXPAND 7 Click

Native view of the EXPAND 7 Click board.

View full image
EXPAND 7 Click

EXPAND 7 Click

Front and back view of the EXPAND 7 Click board.

View full image

Library Description

The library covers necessary functions that enables the usage of the EXPAND 7 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 expand7_read_pin ( uint16_t pin, uint8_t inv ); - Function is used to read the state of a defined pin.
  • void expand7_write_pin ( uint16_t pin, uint8_t pin_val ); - Function is used to set a single output pin's logic level.
  • void expand7_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 7 click by toggling each of 40 available pins.
void application_task ( )
{

    for ( pin_num = 0; pin_num < 40; pin_num++ )
    {
        expand7_write_all ( 0xFF );
        
        expand7_write_pin( pin_num, EXPAND7_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( 200 );
        expand7_write_all ( 0xFF );
    }
    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

Wirepas click

0

Wirepas Click is a compact add-on board that allows you to implement the Wirepas Mesh wireless connectivity stack to your application. This board features the WIRL-PRO2 Thetis-I (2.1.0.1121010), a radio module with Wirepas Mesh Protocol from Würth Elektronik. It supports creating a Wirepas routing mesh protocol and is optimized for ultra-low energy consumption. The large scalability is ideal for extensive IoT networks and can work as a host-controlled device.

[Learn More]

Programmable Relay Timers (PIC)

18

Build your own programmable timer relays using Ready for PIC, Keypad 4x4 board with EasyPull, RTC, Relay 4 and LCD 2x16 character display with adapter. Just load the demonstration project code and your device is ready to control 4 separate relays.

[Learn More]

Charger 23 click

0

Charger 23 Click is a compact add-on board providing a single-cell battery charging solution. This board features the ISL78693, a single-cell Li-ion or Li-polymer battery charger from Renesas. The ISL78693 can operate with an input voltage as low as 2.6V and works as a linear charger with the battery charged in a Constant Current/Constant Voltage (CC/CV) profile. The charge current is selectable with an external resistor between 250 and 500mA. Additional features include the preconditioning of an over-discharged battery, an NTC thermistor interface for charging the battery in a safe temperature range, automatic recharge, and more.

[Learn More]