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
EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. 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, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the EasyPIC v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board 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 DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC 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.
Microcontroller Overview
MCU Card / MCU

Architecture
PIC
MCU Memory (KB)
64
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
3896
You complete me!
Accessories
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