TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139560 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47607 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42551 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Rec N Play Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.13

mikroSDK Library: 2.0.0.0

Category: Signal processing

Downloaded: 167 times

Not followed.

License: MIT license  

Rec&Play Click is a digital voice recorder on a Click board™. It is based on the ISD3900, a multi-message record and playback device. It features the ChipCorder® technology, offering digital sound compression, smart message management, digitally configurable signal path, and more.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Rec N Play Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Rec N Play Click" changes.

Do you want to report abuse regarding "Rec N Play Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Rec & Play Click

Rec&Play Click is a digital voice recorder on a Click board. It is based on the ISD3900, a multi-message record and playback device. It features the ChipCorder technology, offering digital sound compression, smart message management, digitally configurable signal path, and more.

recnplay_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : Feb 2020.
  • Type : SPI type

Software Support

We provide a library for the RecNPlay 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for RecNPlay Click driver.

Standard key functions :

  • Config Object Initialization function.

    void recnplay_cfg_setup ( recnplay_cfg_t *cfg );

  • Initialization function.

    RECNPLAY_RETVAL recnplay_init ( recnplay_t ctx, recnplay_cfg_t cfg );

Example key functions :

  • Function queries the ISD3900 device status.

    RECNPLAY_RETVAL recplay_read_status ( recnplay_t ctx, uint8_t interr_status );

  • Function erases the message starting at the specified address.

    RECNPLAY_RETVAL recplay_erase_msg ( recnplay_t* ctx, uint32_t mem_addr );

  • Function initiates a managed record at first available location in memory.

    RECNPLAY_RETVAL recplay_record_msg ( recnplay_t* ctx );

Examples Description

This application demonstrates the process of recording a message and playing it back.

The demo application is composed of two sections :

Application Init

Initializes SPI interface in proper mode and performs all the necessary commands to put the device in proper working mode (chip reset, chip power up, chip erasing, clock configuration).


void application_init ( void )
{
    log_cfg_t log_cfg;
    recnplay_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.

    recnplay_cfg_setup( &cfg );
    RECNPLAY_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    recnplay_init( &recnplay, &cfg );

    log_printf( &logger, "Chip reset...\r\n" );
    recplay_reset( &recnplay );
    log_printf( &logger, "Power up...\r\n" );
    recplay_pwr_up( &recnplay );
    wait_power_up( );
    log_printf( &logger, "Chip Erasing...\r\n" );
    recplay_erase_chip( &recnplay );
    wait_cmd_fin( );
    log_printf( &logger, "Clock Configuration...\r\n" );
    status_byte = recplay_set_clk_cnfg( &recnplay, 0x34 );
    log_printf( &logger, "----------------------------\r\n" );
    volume = 0;
    Delay_ms ( 1000 );
}

Application Task

Performs the chip configuration for recording message via microphone, then records a message for 8 seconds to specified memory location. After that, it reads the recorded message address with message length and then plays the recorded message. When playback is done it erases the recorded message from memory. Afterwards, it repeats all the operations every 10 seconds.


void application_task ( void )
{
    uint8_t cnt;
    log_printf( &logger, "Preparing to record a message\r\n" );
    for ( cnt = 0; cnt < 32; cnt++ )
    {
        if ( ( cnt != RECPLAY_CFG0A_REG ) && ( cnt != RECPLAY_CFG1C_REG ) && ( cnt != RECPLAY_CFG1E_REG ) )
        {
            wait_ready( );
            temp_var = config_rec_mic[ cnt ];
            status_byte = recplay_write_cnfg_reg( &recnplay, cnt, &temp_var, 1 );
        }
    }
    wait_ready( );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "Message recording" );
    status_byte = recplay_record_msg_addr( &recnplay, 0x12000 );
    time_record( 8 );
    status_byte = recplay_stop( &recnplay );
    wait_cmd_fin( );
    log_printf( &logger, "End of recording\r\n" );

    status_byte = recplay_read_msg_addr( &recnplay, &msg_addr, &msg_len );
    log_printf( &logger, "Message Address: 0x%lx\r\n", msg_addr );
    log_printf( &logger, "Message Length: %u\r\n", msg_len );
    Delay_ms ( 1000 );

    log_printf( &logger, "Preparing to play a message\r\n" );
    set_volume( 100 );
    for ( cnt = 0; cnt < 32; cnt++ )
    {
        if ( ( cnt != RECPLAY_CFG0A_REG ) && ( cnt != RECPLAY_CFG1C_REG ) && ( cnt != RECPLAY_CFG1E_REG ) )
        {
            wait_ready( );

            if ( cnt == RECPLAY_CFG03_REG )
            {
                temp_var = volume;
            }
            else
            {
                temp_var = config_play_pwm_spk[ cnt ];
            }
            status_byte = recplay_write_cnfg_reg( &recnplay, cnt, &temp_var, 1 );
        }
    }

    wait_ready( );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "Message is playing...\r\n" );
    status_byte = recplay_play_msg( &recnplay, 0x12000, 0 );
    wait_cmd_fin( );
    log_printf( &logger, "End of playing...\r\n" );


    log_printf( &logger, "Status Byte: 0x%x\r\n", ( uint16_t ) status_byte );
    log_printf( &logger, "Interrupt byte: 0x%x\r\n", ( uint16_t ) interr_byte );
    Delay_ms ( 1000 );

    log_printf( &logger, "Message erasing...\r\n" );
    status_byte = recplay_erase_msg( &recnplay, 0x12000 );
    wait_cmd_fin( );
    log_printf( &logger, "End of erasing\r\n" );

    log_printf( &logger, "----------------------------\r\n" );
    Delay_ms ( 1000 );
}  

Note

The ISD3900 must be properly configured to work in record mode every time when user wants to record a message. When user wants to play a recorded message, then ISD3900 must be properly configured, but now to work in play mode.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.RecNPlay

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.


ALSO FROM THIS AUTHOR

I2C 1-Wire Click

0

I2C 1-Wire Click carries DS2482-800, a bridge device that performs bidirectional conversions between I2C masters and 1-Wire slave devices. These can be EEPROM chips, temperature sensors and similar devices that have momentary high source current modes.

[Learn More]

6DOF IMU 25 Click

0

6DOF IMU 25 Click is a compact add-on board for biopotential signal detection and motion tracking applications. This board features the ST1VAFE6AX biosensor from STMicroelectronics, which combines a vertical analog front-end (vAFE) for biopotential sensing with a high-performance 6-axis IMU. The IMU features a 3-axis accelerometer and 3-axis gyroscope with adjustable full-scale ranges, along with advanced functionalities like finite state machine (FSM), adaptive self-configuration (ASC), and a machine learning core (MLC) for on-device processing. The board also includes a 4.5KB FIFO buffer for efficient data handling and supports I2C and SPI communication interfaces for easy integration.

[Learn More]

IPS Display 2 Click

0

IPS Display 2 Click is a compact add-on board that displays high-resolution graphics in embedded applications. This board features the ER-TFT1.54-2, a 1.54inch TFT LCD display from EastRising Technology, and uses the ST7789V2 controller for 262K color output. The display offers a 240x240 pixel resolution, operates through a 3-wire SPI interface, and includes additional control signals for precise display management. Its small form factor and high-resolution output make it suitable for various projects, including handheld devices, smart displays, and panels requiring clear visual output.

[Learn More]