Just plug in your headphones and access your favorite stations wherever you go!
A
A
Hardware Overview
How does it work?
FM Click is based on the Si4703, a broadcast FM radio tuner from Silicon Labs. The radio tuner works in a worldwide FM band from 76-108MHz, whereas the antenna uses headphones. The stereo audio connector supports three and four-conductor earphones with a recommended cable length from 1.1m to 1.45m for the best signal reception. The Si4703, one of the industry’s smallest FM tuners, comes with a 32.768kHz reference clock for better frequency tolerance. It has two audio outputs, left and right. Each output uses an LM4864, an audio power amplifier from Texas Instruments, to amplify
the channel outputs. These amplifiers can deliver about 200mW of continuous average power into an 8Ω load. The FM Click is also used as a stereo device and mono. The FM Click can communicate to the host MCU over the I2C serial interface of the mikroBUS™ socket. Besides communication pins, this board also uses several others. The SEN pin routed to the CS pin of the mikroBUS™ socket serves as a serial interface activation signal, which, combined with I2C pins, forms a 3-wire interface. The RST pin is used as a general reset feature alongside two user-configurable pins, GP2 and
GP1, routed to the AN and INT pins of the mikroBUS™ socket. These I/O pins can be used as interrupt requests (seek/tune or RDS ready) or stereo/mono indicators. 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.
Features overview
Development board
Nucleo 32 with STM32F031K6 MCU board provides an affordable and flexible platform for experimenting with STM32 microcontrollers in 32-pin packages. Featuring Arduino™ Nano connectivity, it allows easy expansion with specialized shields, while being mbed-enabled for seamless integration with online resources. The
board includes an on-board ST-LINK/V2-1 debugger/programmer, supporting USB reenumeration with three interfaces: Virtual Com port, mass storage, and debug port. It offers a flexible power supply through either USB VBUS or an external source. Additionally, it includes three LEDs (LD1 for USB communication, LD2 for power,
and LD3 as a user LED) and a reset push button. The STM32 Nucleo-32 board is supported by various Integrated Development Environments (IDEs) such as IAR™, Keil®, and GCC-based IDEs like AC6 SW4STM32, making it a versatile tool for developers.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M0
MCU Memory (KB)
32
Silicon Vendor
STMicroelectronics
Pin count
32
RAM (Bytes)
4096
You complete me!
Accessories
Click Shield for Nucleo-32 is the perfect way to expand your development board's functionalities with STM32 Nucleo-32 pinout. The Click Shield for Nucleo-32 provides two mikroBUS™ sockets to add any functionality from our ever-growing range of Click boards™. We are fully stocked with everything, from sensors and WiFi transceivers to motor control and audio amplifiers. The Click Shield for Nucleo-32 is compatible with the STM32 Nucleo-32 board, providing an affordable and flexible way for users to try out new ideas and quickly create prototypes with any STM32 microcontrollers, choosing from the various combinations of performance, power consumption, and features. The STM32 Nucleo-32 boards do not require any separate probe as they integrate the ST-LINK/V2-1 debugger/programmer and come with the STM32 comprehensive software HAL library and various packaged software examples. This development platform provides users with an effortless and common way to combine the STM32 Nucleo-32 footprint compatible board with their favorite Click boards™ in their upcoming projects.
These standard small stereo earphones offer a high-quality listening experience with their top-notch stereo cable and connector. Designed for universal compatibility, they effortlessly connect to all MIKROE mikromedia and multimedia boards, making them an ideal choice for your electronic projects. With a rated power of 100mW, the earphones provide crisp audio across a broad frequency range from 20Hz to 20kHz. They boast a sensitivity of 100 ± 5dB and an impedance of 32Ω ± 15%, ensuring optimal sound quality. The Φ15mm speaker delivers clear and immersive audio. Cost-effective and versatile, these earphones are perfect for testing your prototype devices, offering an affordable and reliable audio solution to complement your projects.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for FM Click driver.
Key functions:
fm_get_received_signal_strength_indicator
- This function reads recived signal strength indicatiorfm_get_channel_frequency
- This function calculates current channel frequency based on band and space settingsfm_get_channel
- This function reads CHANNEL bits from READCHAN register
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief Fm Click example
*
* # Description
* This click represent FM radio tuner which supports worldwide FM band (76 – 108 MHz)
* and has a set of features such as automatic frequency and gain control, seek tuning and volume control.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializing I2C driver, powering up device, setting basic settings for Europe,
* setting values of seek threshold, volume, snr threshold and impulse detection threshold.
* Seek and memorize 5 radio stations with a signal strength above the set limit.
*
* ## Application Task
* Tunes all memorized stations. Switches the stations each 10 seconds.
*
* ## Additional Functions
* - void fm_case_plus( fm_t *ctx ) - Increases volume
* - void fm_case_minus( fm_t *ctx ) - Decreases volume
* - void fm_case_seek( fm_t *ctx ) - Seeks next station
* - void fm_case_tune( fm_t *ctx ) - Tunes default station
* - void fm_case_memorize( ) - Memorizes current station
* - void fm_case_station1( fm_t *ctx ) - Tunes memorized station 1
* - void fm_case_station2( fm_t *ctx ) - Tunes memorized station 2
* - void fm_case_station3( fm_t *ctx ) - Tunes memorized station 3
* - void fm_case_station4( fm_t *ctx ) - Tunes memorized station 4
* - void fm_case_station5( fm_t *ctx ) - Tunes memorized station 5
* - void fm_case_mute( fm_t *ctx ) - Mutes device
* - void fm_case_tune_up( fm_t *ctx ) - Fine tunes frequency
* - void fm_case_tune_down( fm_t *ctx ) - Fine tunes frequency
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "fm.h"
// ------------------------------------------------------------------ VARIABLES
#define SIGNAL_STRENGTH_LOWER_LIMIT 25
static fm_t fm;
static log_t logger;
static uint16_t received_signal_strength_indicator;
static uint16_t station_channel;
static uint16_t station1;
static uint16_t station2;
static uint16_t station3;
static uint16_t station4;
static uint16_t station5;
static uint8_t memory;
static uint8_t mute;
static uint8_t received_data;
static uint8_t data_ready;
static uint8_t error_flag;
static uint8_t cnt;
static float channel_frequency;
static float tuned_frequency;
static float tune_freq;
// ------------------------------------------------------- ADDITIONAL FUNCTIONS
void fm_case_plus ( fm_t *ctx )
{
error_flag = fm_volume_up( ctx );
if ( error_flag == 0 )
{
log_printf( &logger, "volume up\r\n" );
}
else
{
log_printf( &logger, "volume max\r\n" );
}
}
void fm_case_minus ( fm_t *ctx )
{
error_flag = fm_volume_down( ctx );
if ( error_flag == 0 )
{
log_printf( &logger, "volume down\r\n" );
}
else
{
log_printf( &logger, "volume min\r\n" );
}
}
void fm_case_seek ( fm_t *ctx )
{
fm_seek( ctx );
Delay_ms( 500 );
fm_end_seek( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
station_channel = fm_get_channel( ctx );
}
void fm_case_tune ( fm_t *ctx )
{
error_flag = fm_tune( ctx, tune_freq );
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
if ( error_flag == 0 )
{
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
tuned_frequency = fm_get_channel_frequency( ctx );
station_channel = fm_get_channel( ctx );
log_printf( &logger, "tune complete\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", tuned_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
else
{
log_printf( &logger, "frequency not in valid range\r\n" );
}
}
void fm_case_memorize ( )
{
switch ( memory )
{
case 0 :
{
station1 = station_channel;
memory += 1;
log_printf( &logger, "station 1 memorized\r\n" );
break;
}
case 1 :
{
station2 = station_channel;
memory += 1;
log_printf( &logger, "station 2 memorized\r\n" );
break;
}
case 2 :
{
station3 = station_channel;
memory += 1;
log_printf( &logger, "station 3 memorized\r\n" );
break;
}
case 3 :
{
station4 = station_channel;
memory += 1;
log_printf( &logger, "station 4 memorized\r\n" );
break;
}
case 4 :
{
station5 = station_channel;
memory = 0;
log_printf( &logger, "station 5 memorized\r\n" );
break;
}
default :
{
break;
}
}
}
void fm_case_mute ( fm_t *ctx )
{
if ( mute == 0 )
{
fm_mute_enable( ctx );
log_printf( &logger, "mute enabled\r\n" );
mute = 1;
}
else if ( mute == 1 )
{
fm_mute_disable( ctx );
log_printf( &logger, "mute disabled\r\n" );
mute = 0;
}
}
void fm_case_station_1 ( fm_t *ctx )
{
fm_tune_channel( ctx, station1 );
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
log_printf( &logger, "station 1 tuned\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
void fm_case_station_2 ( fm_t *ctx )
{
fm_tune_channel( ctx, station2 );
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
log_printf( &logger, "station 2 tuned\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
void fm_case_station_3 ( fm_t *ctx )
{
fm_tune_channel( ctx, station3 );
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
log_printf( &logger, "station 3 tuned\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
void fm_case_station_4 ( fm_t *ctx )
{
fm_tune_channel( ctx, station4 );
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
log_printf( &logger, "station 4 tuned\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
void fm_case_station_5 ( fm_t *ctx )
{
fm_tune_channel( ctx, station5 );
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
log_printf( &logger, "station 5 tuned\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
void fm_case_tune_up ( fm_t *ctx )
{
error_flag = fm_fine_tune_up( ctx );
if ( error_flag == 0 )
{
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
station_channel = fm_get_channel( ctx );
log_printf( &logger, "tune up\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
else
{
log_printf( &logger, "upper band limit reached\r\n" );
}
}
void fm_case_tune_down ( fm_t *ctx )
{
error_flag = fm_fine_tune_down( ctx );
if ( error_flag == 0 )
{
Delay_ms( 100 );
fm_end_tune( ctx );
Delay_ms( 10 );
received_signal_strength_indicator = fm_get_received_signal_strength_indicator( ctx );
channel_frequency = fm_get_channel_frequency( ctx );
station_channel = fm_get_channel( ctx );
log_printf( &logger, "tune down\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "tuned frequency: %.2f MHz\r\n", channel_frequency );
log_printf( &logger, "-----------------------\r\n" );
}
else
{
log_printf( &logger, "lower band limit reached\r\n" );
}
}
void fm_case_wrong_command ( )
{
log_printf( &logger, "wrong command\r\n" );
}
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
fm_cfg_t cfg;
/**
* 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.
fm_cfg_setup( &cfg );
FM_MAP_MIKROBUS( cfg, MIKROBUS_1 );
fm_init( &fm, &cfg );
Delay_ms( 500 );
fm_default_cfg( &fm );
memory = 0;
mute = 0;
fm_case_mute( &fm );
for ( cnt = 0; cnt < 5; )
{
log_printf( &logger, "seeking...\r\n" );
do
{
received_signal_strength_indicator = 0;
fm_case_seek( &fm );
}
while ( received_signal_strength_indicator < SIGNAL_STRENGTH_LOWER_LIMIT ); //rssi value
log_printf( &logger, "station found\r\n" );
log_printf( &logger, "rssi: %u dBuV\r\n", received_signal_strength_indicator );
log_printf( &logger, "channel frequency: %.2f MHz\r\n", channel_frequency );
fm_case_memorize( );
log_printf( &logger, "-----------------------\r\n" );
Delay_ms( 100 );
cnt++;
}
mute = 1;
fm_case_mute( &fm );
log_printf( &logger, "playing memorized stations...\r\n\r\n" );
}
void application_task ( void )
{
fm_case_station_1( &fm );
Delay_ms( 10000 );
fm_case_station_2( &fm );
Delay_ms( 10000 );
fm_case_station_3( &fm );
Delay_ms( 10000 );
fm_case_station_4( &fm );
Delay_ms( 10000 );
fm_case_station_5( &fm );
Delay_ms( 10000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END