Carte Click Extend SPI
Carte Click Extend SPI
La carte Click Board™ SPI Extend est une carte complémentaire compacte destinée aux applications qui nécessitent l'extension du bus de communication SPI sur une longue distance. Cette carte est équipée du LTC4332, un dispositif d'extension esclave SPI d'Analog Devices. À l'aide d'un émetteur-récepteur différentiel protégé contre les défauts de ±60 V, le LTC4332 peut transmettre des données SPI, y compris un signal d'interruption, jusqu'à 2 MHz sur deux câbles à paires torsadées. La plage de mode commun étendue et le rejet élevé du mode commun sur la liaison différentielle offrent une tolérance aux grandes différences de masse entre les nœuds. Cette carte Click Board™ fournit également une interface de contrôle utilisant une sélection d'esclave distincte pour la configuration et la surveillance des défauts. Toutes ces fonctionnalités font de SPI Extend Click un excellent choix pour diverses applications qui nécessitent l'extension du bus SPI sur une longue distance, telles que le contrôle industriel, les installations de capteurs, le contrôle des systèmes d'éclairage et de sonorisation, etc.
La carte Click Board™ SPI Extend est prise en charge par une bibliothèque compatible mikroSDK, qui comprend des fonctions qui simplifient le développement logiciel. Cette carte Click Board™ est un produit entièrement testé, prêt à être utilisé sur un système équipé du socket mikroBUS™.
How Does The SPI Extend Click Board™ Work?
The SPI Extend Click Board™ is based on LTC4332, a 2MHz point-to-point SPI bus extender designed for operation in high noise industrial environments, IC from Analog Devices. The SPI bus is extended over two twisted pairs by ±60V fault protected differential transceivers. The LTC4332's extended 25V common-mode voltage range allows it to bridge across different ground potentials. This Click board™ has 3 extended slave selects (SS1, SS2, SS3), has separate programmable SPI modes, and also supports external galvanic isolation on the link. Slave select output pin SS1 is used as a standard CS pin in SPI communication, while the other two pins SS2 and SS3 are used as GPIO output pins on the local side in terms of mikroBUS standard.
NOTE: In order to achieve the complete functionality of this Click board™, it is necessary to use crossover twisted-pair cables with RJ45 connectors, the same ones used with Ethernet devices.
Alongside with it's extended functionalities, this Click board™ also supports local to remote control and interrupt functions. Using an integrated high-performance differential transceiver for link communication, a local SPI master can access remote slave devices up to 1200m using differential-pair type cabling. Because of the dual functionality of the SPI Extend Click, the user needs to set the mode of operation of the Click board™, which is adjusted by setting onboard MODE SEL switch to the appropriate position (set low for local SPI slave mode or set high for SPI master mode).
The SPI Extend Click Board™ communicates with MCU using the SPI serial interface that supports SPI modes (0,0) and (1,1) only, with a maximum SPI frequency of 2 MHz. The LTC4332 provides a separate slave select pin, SSC, that allows a user to access the internal control interface for configuration and monitoring. It also has an interrupt pin (INT) that acts as an open-drain output in local mode and an input in remote mode. On the remote side, INT is an input pin that can be connected to remote SPI devices, while on the local side INT operates as an open-drain output that can be connected to a shared local interrupt line. In addition to the mode selection, there are SPEED SEL jumpers that select the link baud rate and the remote SCK timing parameters, and Link Status LED indicator that is active when the device successfully establishes link communication between the local and remote sides.
The SPI Extend Click Board™ uses the SPI communication interface with both 3.3V and 5V. The onboard SMD jumper labelled as VCC SEL allows voltage selection for interfacing with both 3.3V and 5V MCUs. More information about the LTC4332's functionality, electrical specifications, and typical performance 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 the development.
SPECIFICATIONS
Type | SPI |
Applications | An excellent choice for various applications that require extending the SPI bus over a long distance, such as industrial control, sensor installations, lighting and sound system control, and more. |
On-board modules | The SPI Extend Click Board™ is based on LTC4332, a 2MHz point-to-point SPI bus extender designed for operation in high noise industrial environments, IC from Analog Devices. |
Key Features | Operation over long distances, extended slave selects, overvoltage protection, low power consumption... |
Interface | GPIO,SPI |
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 of the SPI Extend Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
Slave Select 3 | SS3 | 1 | AN | PWM | 16 | SSC | Control Interface Select |
Slave Select 2 | SS2 | 2 | RST | INT | 15 | INT | Interrupt |
SPI Chip Select | SS1 | 3 | CS | RX | 14 | NC | |
SPI Clock | SCK | 4 | SCK | TX | 13 | NC | |
SPI Data OUT | SDO | 5 | MISO | SCL | 12 | NC | |
SPI Data IN | SDI | 6 | MOSI | SDA | 11 | NC | |
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | 5V | Power Supply |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
LD2 | LINK | - | Link Status LED Indicator |
JP1 | VCC SEL | Left | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | SPEED SEL | Left | Communication Speed Selection: Left position 0, Right position 1 |
SW1 | MODE SEL | Right | Local to Remote Control Selection: Left position RMT, Right position LCL |
SPI EXTEND CLICK ELECTRICAL SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | -0.3 | 3.3 | 6 | V |
SPI Serial Clock Frequency | - | - | 2 | mHz |
Extension Range | - | - | 1200 | m |
Operating Temperature Range | 0 | - | 70 | °C |
Software Support
We provide a library for the SPI Extend 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 all the necessary functions to control the SPI Extend Click Board™. Library performs a standard SPI interface communication.
Key Functions
void spiextend_generic_write ( uint8_t reg, uint8_t tx_data )
- Generic write data function.void spiextend_get_config ( spiextend_config_data_t *config_data )
- Get the configuration function.uint8_t spiextend_rmt_read ( uint8_t reg, uint8_t sel_slave )
- Generic read data in Remote Mode function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes SPI, sets INT pin as input and AN, RST, CS nad PWM pins as outputs and begins to write log.
- Application Initialization - Initialization driver enables - SPI, set default configuration of the Accel 14 Click connected to the SPI Extend Click ( Remote Mode ).
- Application Task - (code snippet) This is an example which demonstrates the use of the SPI Extend Click Board™. In this example, if the connection is established, we read Accel axis of the connected Accel 14 Click boards to the SPI Extend Click Board™ ( Remote Mode ) which is connected by a LAN cable to the SPI Extend Click Board™ ( Local Mode ) placed in the mikroBUS 1. Results are being sent to the USART Terminal where you can track their changes. All data logs write on USB UART changes for every 1 sec.
void application_task ( ) { spiextend_get_status( &spiextend_status ); if ( spiextend_status.nlink == SPIEXTEND_STATUS_ACTIVE ) { spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTX_L_A ); mikrobus_logWrite( " Accel X : ", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTY_L_A ); mikrobus_logWrite( " Accel Y : ", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTZ_L_A ); mikrobus_logWrite( " Accel Z : ", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); } else { mikrobus_logWrite( " LINK not established", _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); } }
Additional Functions :
void spiextend_accel14_get_axis ( uint8_t axis_out_reg )
- Read axis.void spiextend_display_status ( uint8_t check_status )
- Display status.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- SPI
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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
The SPI Extend 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 SPI Extend 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 all the necessary functions to control the SPI Extend Click Board™. Library performs a standard SPI interface communication.
Key Functions
void spiextend_generic_write ( uint8_t reg, uint8_t tx_data )
- Generic write data function.void spiextend_get_config ( spiextend_config_data_t *config_data )
- Get the configuration function.uint8_t spiextend_rmt_read ( uint8_t reg, uint8_t sel_slave )
- Generic read data in Remote Mode function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes SPI, sets INT pin as input and AN, RST, CS nad PWM pins as outputs and begins to write log.
- Application Initialization - Initialization driver enables - SPI, set default configuration of the Accel 14 Click connected to the SPI Extend Click ( Remote Mode ).
- Application Task - (code snippet) This is an example which demonstrates the use of the SPI Extend Click Board™. In this example, if the connection is established, we read Accel axis of the connected Accel 14 Click boards to the SPI Extend Click Board™ ( Remote Mode ) which is connected by a LAN cable to the SPI Extend Click Board™ ( Local Mode ) placed in the mikroBUS 1. Results are being sent to the USART Terminal where you can track their changes. All data logs write on USB UART changes for every 1 sec.
void application_task ( ) { spiextend_get_status( &spiextend_status ); if ( spiextend_status.nlink == SPIEXTEND_STATUS_ACTIVE ) { spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTX_L_A ); mikrobus_logWrite( " Accel X : ", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTY_L_A ); mikrobus_logWrite( " Accel Y : ", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTZ_L_A ); mikrobus_logWrite( " Accel Z : ", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); } else { mikrobus_logWrite( " LINK not established", _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); } }
Additional Functions :
void spiextend_accel14_get_axis ( uint8_t axis_out_reg )
- Read axis.void spiextend_display_status ( uint8_t check_status )
- Display status.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- SPI
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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
The SPI Extend 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.
Carte Click Extend SPI
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.