Intermediate
30 min

Establish long-distance wireless transmission with RFM75 and STM32F413RH

Stay connected without the hassle

ISM Click with Fusion for STM32 v8

Published May 14, 2023

Click board™

ISM Click

Dev Board

Fusion for STM32 v8

Compiler

NECTO Studio

MCU

STM32F413RH

Unleash the potential of your solution and get efficient, fast, and reliable wireless communication

A

A

Hardware Overview

How does it work?

ISM Click is based on the RFM75, a low-power, high-performance 2.4GHz GFSK transceiver operating in the worldwide ISM frequency band from 2400MHz to 2527MHz from RF Solutions. The RFM75 operates in TDD mode, either as a transmitter or as a receiver. Burst mode transmission and up to 2Mbps air data rate make it suitable for ultra-low power consumption applications. The embedded packet processing engines enable their entire operation with a simple MCU as a radio system. Auto re-transmission and auto acknowledge giving reliable link without any MCU interference. A transmitter and receiver must be programmed with the same RF channel frequency to communicate, supporting a programmable air

data rate of 250Kbps, 1Mbps, or 2Mbps. The RF channel frequency determines the center of the channel used by RFM75. The RF_CH register, in register bank 0, sets the frequency according to the following formula F0= 2400 + RF_CH (MHz), where the resolution of the RF channel frequency is 1MHz. ISM Click communicates with MCU using the standard SPI serial interface that operates at clock rates up to 8 MHz. In power-down mode, RFM75 is in Sleep mode with minimal current consumption. The SPI interface is still active in this mode, and all register values are available by the SPI interface. This Click board™ also has a yellow LED indicator routed on the INT pin of the mikroBUS™ socket (provide the user with feedback after

a successfully received package) and a chip-enable function routed on the RST pin of the mikroBUS™ which activates TX or RX mode of the RFM75.  Besides, it also has two additional LED indicators, a red and blue LED routed on the AN and PWM pins of the mikroBUS™ socket. The user can use it for visual indication when sending or receiving data. This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.

ISM Click top side image
ISM Click lateral side image
ISM Click bottom side image

Features overview

Development board

Fusion for STM32 v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different 32-bit ARM® Cortex®-M based MCUs from STMicroelectronics, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over WiFi. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for STM32 v8 provides a fluid and immersive working experience, allowing

access anywhere and under any circumstances at any time. Each part of the Fusion for STM32 v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.

Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for STM32 v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

Fusion for STM32 v8 horizontal image

Microcontroller Overview

MCU Card / MCU

default

Type

8th Generation

Architecture

ARM Cortex-M4

MCU Memory (KB)

1536

Silicon Vendor

STMicroelectronics

Pin count

64

RAM (Bytes)

327680

Used MCU Pins

mikroBUS™ mapper

Data Transmission Indicator
PB0
AN
Chip Enable
PC13
RST
SPI Chip Select
PA4
CS
SPI Clock
PA5
SCK
SPI Data OUT
PA6
MISO
SPI Data IN
PA7
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Data Reception Indicator
PA1
PWM
Interrupt
PB13
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Schematic

ISM Click Schematic schematic

Step by step

Project assembly

Fusion for PIC v8 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Fusion for STM32 v8 as your development board.

Fusion for PIC v8 front image hardware assembly
Buck 22 Click front image hardware assembly
SiBRAIN for PIC32MZ1024EFK144 front image hardware assembly
v8 SiBRAIN MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
NECTO Compiler Selection Step Image hardware assembly
NECTO Output Selection Step Image hardware assembly
Necto image step 6 hardware assembly
Necto image step 7 hardware assembly
Necto image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto PreFlash Image hardware assembly

Track your results in real time

Application Output

After pressing the "FLASH" button on the left-side panel, it is necessary to open the UART terminal to display the achieved results. By clicking on the Tools icon in the right-hand panel, multiple different functions are displayed, among which is the UART Terminal. Click on the offered "UART Terminal" icon.

UART Application Output Step 1

Once the UART terminal is opened, the window takes on a new form. At the top of the tab are two buttons, one for adjusting the parameters of the UART terminal and the other for connecting the UART terminal. The tab's lower part is reserved for displaying the achieved results. Before connecting, the terminal has a Disconnected status, indicating that the terminal is not yet active. Before connecting, it is necessary to check the set parameters of the UART terminal. Click on the "OPTIONS" button.

UART Application Output Step 2

In the newly opened UART Terminal Options field, we check if the terminal settings are correct, such as the set port and the Baud rate of UART communication. If the data is not displayed properly, it is possible that the Baud rate value is not set correctly and needs to be adjusted to 115200. If all the parameters are set correctly, click on "CONFIGURE".

UART Application Output Step 3

The next step is to click on the "CONNECT" button, after which the terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.

UART Application Output Step 4

Software Support

Library Description

This library contains API for ISM Click driver.

Key functions:

  • ism_cfg_setup - Config Object Initialization function.
  • ism_init - Initialization function.
  • ism_default_cfg - Click Default Configuration 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 Ism Click example
 *
 * # Description
 * This library contains API for the ISM Click driver.
 * This example transmits/receives and processes data from ISM clicks.
 * The library initializes and defines the UART bus drivers 
 * to transmit or receive data. 
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes driver and set performs the default configuration. 
 *
 * ## Application Task
 * Transmitter/Receiver task depends  on uncommented code.
 * Receiver logging each received byte to the UART for data logging,
 * while transmitted send messages every 1 second.
 *
 * @author Nenad Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "ism.h"

#define RECEIVER
// #define TRANSMITTER

static ism_t ism;
static log_t logger;

static uint8_t demo_message_1[ 9 ] = { 
    'M', 'i', 'k', 'r', 'o', 'E', 13, 10, 0 
    
};
static uint8_t demo_message_2[ 12 ] = { 
    'I', 'S', 'M', ' ', 'C', 'l', 'i', 'c', 'k', 13, 10, 0 
    
};

void application_init ( void ) {
    log_cfg_t log_cfg;  /**< Logger config object. */
    ism_cfg_t ism_cfg;  /**< Click config object. */

    // Logger initialization.

    LOG_MAP_USB_UART( log_cfg );
    log_cfg.level = LOG_LEVEL_DEBUG;
    log_cfg.baud = 115200;
    log_init( &logger, &log_cfg );
    log_printf( &logger, "------------------\r\n" );
    log_info( &logger, " Application Init " );

    // Click initialization.

    ism_cfg_setup( &ism_cfg );
    ISM_MAP_MIKROBUS( ism_cfg, MIKROBUS_1 );
    err_t init_flag  = ism_init( &ism, &ism_cfg );
    if ( init_flag == SPI_MASTER_ERROR ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    ism_default_cfg ( &ism );
    log_info( &logger, " Application Task " );
    log_printf( &logger, "------------------\r\n" );
    Delay_ms( 100 );

    #ifdef RECEIVER   
        ism_switch_rx_mode( &ism );
        log_printf( &logger, "   Receive data  \r\n" );
    #endif
   
    #ifdef TRANSMITTER
        ism_switch_tx_mode( &ism );
        log_printf( &logger, "  Transmit data   \r\n" );
    #endif
        
    log_printf( &logger, "------------------\r\n" );
}

void application_task ( void ) {
    #ifdef RECEIVER
        uint8_t rx_buf[ ISM_MAX_PACKET_LEN ] = { 0 };

        ism_receive_packet( &ism, &rx_buf[ 0 ] );
    
        if ( rx_buf[ 0 ] != 0 ) {
            log_printf( &logger, "  Rx : %s", rx_buf );
        }
    #endif

    #ifdef TRANSMITTER
        ism_transmit_packet( &ism, ISM_CMD_W_TX_PAYLOAD_NOACK, &demo_message_1[ 0 ], 9 );
        log_printf( &logger, "  Tx : %s", demo_message_1 );
        Delay_ms( 1000 );
    
        ism_transmit_packet( &ism, ISM_CMD_W_TX_PAYLOAD_NOACK, &demo_message_2[ 0 ], 12 );
        log_printf( &logger, "  Tx : %s", demo_message_2 );
        Delay_ms( 1000 );
    #endif
}

void main ( void ) {
    application_init( );

    for ( ; ; ) {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources