Accurately manage four individual loads in automated test equipment, instrumentation, and telecommunications applications.
A
A
Hardware Overview
How does it work?
Relay 6 Click is based on the 9913-05-20TR, a reed relay from Coto Technology, a component known for its ultra-miniature SMD design, standing for the smallest footprint in the market. This Click board™ features four relays, each equipped with four terminals for load connections that are controlled via these relays. Beneath each relay is a blue LED indicator that illuminates to signal when the relay is active, serving as an operational status indicator. This setup provides clear and immediate feedback on the status of each relay, enhancing user control and system monitoring. This Click board™ is ideal for automated test equipment, instrumentation, and telecommunications applications, highlighting high reliability and long
life due to relays hermetically sealed contacts. The 9913-05-20TRs also feature a high insulation resistance of a minimum of 1011Ω and an external magnetic shield. Its electrical specifications include a coil voltage of 5VDC, a coil resistance of 200Ω, a single-pole single-throw normally open (SPST-NO, 1 Form A) contact form, with the contact current rating capped at 250mA and the switching voltage limited to 100VAC and 100VDC. Control and communication between the relays and the host MCU are managed via the PCA9538A port expander, which uses an I2C communication interface. This device supports both Standard and Fast modes, with frequencies up to 400kHz. The PCA9538A's I2C address can be configured
through the ADDR SEL jumpers, allowing flexible integration with various MCU systems. The PCA9538A also uses an RST pin that ensures the registers and I2C-bus state machine remain in their default settings until this pin is set to a HIGH logic state, where the device returns to normal operational status. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Features overview
Development board
Clicker 2 for Kinetis is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4F microcontroller, the MK64FN1M0VDC12 from NXP Semiconductors, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a JTAG programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and
features quickly. Each part of the Clicker 2 for Kinetis development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for Kinetis programming method, using a USB HID mikroBootloader or an external mikroProg connector for Kinetis programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Micro-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or
using a Li-Polymer battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for Kinetis is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Architecture
ARM Cortex-M4
MCU Memory (KB)
1024
Silicon Vendor
NXP
Pin count
121
RAM (Bytes)
262144
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via Debug Mode
1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.
2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.
Software Support
Library Description
This library contains API for Relay 6 Click driver.
Key functions:
relay6_reset_port_expander
- Relay 6 reset port expander function.relay6_port_expander_write
- Relay 6 port expander write register function.relay6_set_relay
- Relay 6 set relay state function.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file main.c
* @brief Relay 6 Click example
*
* # Description
* This example demonstrates the use of Relay 6 click board by toggling the relays state.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and logger.
*
* ## Application Task
* Switches all relays state every second and displays the state on the USB UART.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "relay6.h"
static relay6_t relay6;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
relay6_cfg_t relay6_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
relay6_cfg_setup( &relay6_cfg );
RELAY6_MAP_MIKROBUS( relay6_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == relay6_init( &relay6, &relay6_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( RELAY6_ERROR == relay6_default_cfg ( &relay6 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
uint8_t relay_data;
relay_data = RELAY6_RELAY1_PIN;
log_printf( &logger, " Turning on only Relay 1 \r\n" );
log_printf( &logger, " = = = = = = = = = = = = = \r\n" );
relay6_set_relay( &relay6, relay_data, ~relay_data );
relay_data <<= 1;
Delay_ms( 1000 );
log_printf( &logger, " Turning on only Relay 2 \r\n" );
log_printf( &logger, " = = = = = = = = = = = = = \r\n" );
relay6_set_relay( &relay6, relay_data, ~relay_data );
relay_data <<= 1;
Delay_ms( 1000 );
log_printf( &logger, " Turning on only Relay 3 \r\n" );
log_printf( &logger, " = = = = = = = = = = = = = \r\n" );
relay6_set_relay( &relay6, relay_data, ~relay_data );
relay_data <<= 1;
Delay_ms( 1000 );
log_printf( &logger, " Turning on only Relay 4 \r\n" );
log_printf( &logger, " = = = = = = = = = = = = = \r\n" );
relay6_set_relay( &relay6, relay_data, ~relay_data );
relay_data <<= 1;
Delay_ms( 1000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END