serializer 2.0.0.0
Main Page

Serializer click

‍Serializer Click is a compact add-on board that contains a digital input translator/serializer. This board features the MAX31910, an eight-channel digital input serializer for high-channel density digital input modules in industrial and process automation from Analog Devices. The MAX31910 translates, conditions, and serializes the 24V digital output of sensors and switches to 5V CMOS-compatible signals required by the MCU. It provides the front-end interface circuit of a programmable logic controller (PLC) digital input module. It communicates with MCU via the SPI interface and comes in configuration with an installed digital isolator. This Click boardâ„¢ is suited for various applications such as industrial, process, and building automation, digital input modules for PLCs, and more.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Oct 2021.
  • Type : SPI type

Software Support

We provide a library for the Serializer Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

‍This library contains API for Serializer Click driver.

Standard key functions :

Example key functions :

  • serializer_get_flt_pin This function returns the fault pin logic state.
    uint8_t serializer_get_flt_pin(serializer_t *ctx)
    Serializer get FLT pin function.
  • serializer_read_input This function reads the input data by using SPI serial interface, and then checks the data integrity by verifying the CRC byte.
    err_t serializer_read_input ( serializer_t *ctx, uint8_t *data_out );
    err_t serializer_read_input(serializer_t *ctx, uint8_t *data_out)
    Serializer read input function.

Example Description

‍This example demonstrates the use of a Serializer click board by reading the state of all inputs and displaying the results on the USB UART.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and logger.

void application_init ( void )
{
log_cfg_t log_cfg;
serializer_cfg_t serializer_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
serializer_cfg_setup( &serializer_cfg );
SERIALIZER_MAP_MIKROBUS( serializer_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == serializer_init( &serializer, &serializer_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define SERIALIZER_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition serializer.h:104
void application_init(void)
Definition main.c:30

Application Task

‍Reads the state of all inputs and displays the results on the USB UART approximately once per second. Also, if there's any fault indication detected, it will be displayed accordingly.

void application_task ( void )
{
uint8_t input_data = 0;
err_t status = serializer_read_input ( &serializer, &input_data );
if ( SERIALIZER_ERROR != status )
{
for ( uint8_t cnt = 0; cnt < 8; cnt++ )
{
log_printf( &logger, " IN%u: %s\r\n", ( uint16_t ) cnt + 1,
( char * ) ( ( input_data & ( 1 << cnt ) ) ? "High" : "Low" ) );
}
{
log_info( &logger, "Undervoltage fault" );
}
{
log_info( &logger, "Overtemperature fault" );
}
log_printf( &logger, "\r\n" );
Delay_ms ( 1000 );
}
}
#define SERIALIZER_STATUS_UNDERVOLTAGE
Definition serializer.h:75
#define SERIALIZER_STATUS_OVERTEMPERATURE
Serializer status bits values.
Definition serializer.h:74
void application_task(void)
Definition main.c:60
@ SERIALIZER_ERROR
Definition serializer.h:159

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Serializer

Additional notes and informations

Depending on the development board you are using, you may need 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.