Expand 7 Click Board
Expand 7 Click Board
Key Features
- 20-Bit, 100 kHz I2C-Port-Expander, flexible I2C-Adresskonfiguration, interner 3-KByte-EEPROM, benutzerdefinierter Standardspeicher und mehr.
- Basierend auf EXPAND 7 Click basiert es auf dem CY8C9540A, einem 40-Bit-E/A-Expander mit EEPROM und 8 unabhängig konfigurierbaren 8-Bit-PWM-Ausgängen von Cypress Semiconductor.
- Kann zur Überwachung und Steuerung von LEDs und Systemeinbruchserkennungsgeräten verwendet werden, aber auch als Speicher für Informationen wie Fehlercodes oder Platinenherstellungsdaten für Diagnosezwecke.
- mikroBUS: I2C-Schnittstelle
Overview
Das Expand 7 Click Board™ ist eine kompakte Zusatzplatine, die einen Multiport-E/A-Expander mit bidirektionalen Ein-/Ausgängen oder PWM-Ausgängen enthält. Diese Platine verfügt über den CY8C9540A, einen 40-Bit-E/A-Port-Expander mit EEPROM und 8 unabhängig konfigurierbaren 8-Bit-PWM-Ausgängen von Cypress Semiconductor. Das CY8C9540A arbeitet als zwei I2C-Slave-Geräte, zunächst als Multiport-E/A-Expander und zweitens als serielles EEPROM mit 11 KB Adressraum. Es verfügt über einen benutzerdefinierten Standardspeicher, eine flexible I2C-Adresskonfiguration und eine programmierbare Interrupt- und Reset-Funktion. Dieses Click Board™ kann zur Überwachung und Steuerung von LEDs und Systementriegelungsgeräten verwendet werden, aber auch als Speicher für Informationen wie Fehlercodes oder Platinenherstellungsdaten für Diagnosezwecke.
Das Expand 7 Click wird von einer mikroSDK-kompatiblen Bibliothek unterstützt, die Funktionen enthält, die die Softwareentwicklung vereinfachen. Dieses Click Board™ wird als vollständig getestetes Produkt geliefert und ist bereit für den Einsatz auf einem System, das mit der mikroBUS™-Buchse ausgestattet ist.
How Does The Expand 7 Click Board™ Work?
The Expand 7 Click Board™ is based on the CY8C9540A, 40-bit I/O expander with EEPROM, and 8 independently configurable 8-bit PWM outputs from Cypress Semiconductor. The main blocks of the CY8C9540A include the control unit, PWMs, EEPROM, and I/O ports. The I/O expander's data pins can be independently assigned as inputs, outputs, or PWM outputs, and can be configured as open-drain or collector, strong drive (10 mA source, 25 mA sink), resistively pulled up or down, or high impedance which can be selected in the Port Drive Mode register. It operates as two I2C slave devices, where the first device is a multi-port I/O expander (single I2C address to access all ports through registers), and the second device is a serial EEPROM with 11 Kbyte address space.
Configuration and output register settings are storable as user defaults in a dedicated section of the EEPROM. If user defaults were stored in EEPROM, they are restored to the ports at Power-Up. The EEPROM is byte readable and supports byte-by-byte writing. A pin 3 of the Port 2 on this Click board™ can be configured as an EEPROM Write Disable (WD) input that blocks write operations when set high. The configuration registers can also disable EEPROM operations.
EXPAND 7 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum frequency of 100kHz. The CY8C9540A has, by default, two possible I2C slave address formats: the first is used to access the multi-port device, and the second to access the EEPROM. This selection of I2C slave addresses is performed by setting the logic level on the A0 pin of the CY8C9540A which can be done by using the SMD jumper labeled as ADDR SEL.
It also generates a programmable interrupt signal routed on the INT pin of the mikroBUS™, which can inform the system master that there is incoming data on its ports or that the PWM output state was changed. The reset signal routed on the RST pin of the mikroBUS™ socket is similar to POR (Power-ON Reset) function. When the CY8C9540A is held in Reset, all In and Out pins are held at their default High-Z State.
This Click board™ is designed to be operated with both 3.3V and 5V logic voltage levels that can be selected via VCC SEL jumper. This allows for both 3.3V and 5V capable MCUs to use the I2C communication lines properly. More information about the CY8C9540A can be found in the attached datasheet. However, the Click board™ comes equipped with a library that contains easy to use functions and a usage example that may be used as a reference for further development.
SPECIFICATIONS
Type | Port expander |
Applications | Can be used to monitor and control LEDs and system intrusion detection devices, but also as a storage for information such as error codes or board manufacturing data for diagnostic purposes. |
On-board modules | EXPAND 7 Click is based on the CY8C9540A, 40-bit I/O expander with EEPROM, and 8 independently configurable 8-bit PWM outputs from Cypress Semiconductor. |
Key Features | 20-bit, 100kHz I2C port expander, flexible I2C address configuration, internal 3Kbyte EEPROM, user default storage, and more. |
Interface | I2C |
Compatibility | mikroBUS |
Click board size | L (57.15 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
PINOUT DIAGRAM
This table shows how the pinout on EXPAND 7 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 |
JP1 | VCC SEL | Left | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | ADDR SEL | Left | Communication interface selection: Left position 0, Right position 1 |
J1-J6 | P0-P5 Port | - | I/O Expander Ports |
EXPAND 7 CLICK ELECTRICAL SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | -0.5 | - | 6 | V |
High Level Source Current | 10 | - | - | mA |
Low Level Sink Current | 25 | - | - | mA |
Operating Temperature Range | -40 | - | +85 | °C |
Software Support
We provide a library for the Expand 7 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers necessary functions that enable the usage of the Expand 7 Click Board™. Users can check or set the state of every pin, set PWM output or use onboard 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.
Example 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 an input.
- Application Initialization - Initializes the 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 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need a 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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
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.
Software Support
We provide a library for the Expand 7 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers necessary functions that enable the usage of the Expand 7 Click Board™. Users can check or set the state of every pin, set PWM output or use onboard 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.
Example 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 an input.
- Application Initialization - Initializes the 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 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need a 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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
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.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.