TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 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 (137002 times)
  2. FAT32 Library (70121 times)
  3. Network Ethernet Library (56028 times)
  4. USB Device Library (46348 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41286 times)
  7. GSM click (29055 times)
  8. mikroSDK (26489 times)
  9. PID Library (26451 times)
  10. microSD click (25413 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

DTMF Generator click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: Signal processing

Downloaded: 88 times

Not followed.

License: MIT license  

DTMF Generator Click is a compact add-on board that generates DTMF (Dual-Tone Multi-Frequency) signals designed for MCU interfaces. This board features the HT9200A, a dual-tone multi-frequency decoder mostly used in mobile communications systems from Holtek Semiconductor Inc.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DTMF Generator click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DTMF Generator click" changes.

Do you want to report abuse regarding "DTMF Generator click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


DTMF Generator click

DTMF Generator Click is a compact add-on board that generates DTMF (Dual-Tone Multi-Frequency) signals designed for MCU interfaces. This board features the HT9200A, a dual-tone multi-frequency decoder mostly used in mobile communications systems from Holtek Semiconductor Inc.

dtmfgenerator_click.png

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Jul 2021.
  • Type : GPIO type

Software Support

We provide a library for the DTMFGenerator 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 DTMFGenerator Click driver.

Standard key functions :

  • dtmfgenerator_cfg_setup Config Object Initialization function.

    void dtmfgenerator_cfg_setup ( dtmfgenerator_cfg_t *cfg );
  • dtmfgenerator_init Initialization function.

    err_t dtmfgenerator_init ( dtmfgenerator_t *ctx, dtmfgenerator_cfg_t *cfg );

Example key functions :

  • dtmfgenerator_set_dat Set DATA ( RST ) pin state function.

    void dtmfgenerator_set_dat ( dtmfgenerator_t *ctx, uint8_t pin_state );
  • dtmfgenerator_power_on Power ON function.

    void dtmfgenerator_power_on ( dtmfgenerator_t *ctx );
  • dtmfgenerator_transmit_out_tone The function transmit duration time of the desired tone.

    void dtmfgenerator_transmit_out_tone ( dtmfgenerator_t *ctx, uint8_t out_tone, uint16_t delay_m_s );

Example Description

This is an example which demonstrates the use of DTMF Generator Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - GPIO, run the power-on sequence, also write log.


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

    /** 
     * 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.
    dtmfgenerator_cfg_setup( &dtmfgenerator_cfg );
    DTMFGENERATOR_MAP_MIKROBUS( dtmfgenerator_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == dtmfgenerator_init( &dtmfgenerator, &dtmfgenerator_cfg ) ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    log_printf( &logger, " Powering on device \r\n" );
    log_printf( &logger, "--------------------\r\n" );
    dtmfgenerator_power_on( &dtmfgenerator );
    Delay_ms ( 1000 );
    log_info( &logger, " Application Task " );
}

Application Task

DTMF Generator click board DTMF generator transmits the signal for generating tone for digits : "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "*" and "#". All data logs write on USB uart changes.


void application_task ( void ) {
    log_printf( &logger, " TONE      '0' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_0, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '1' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_1, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '2' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_2, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '3' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_3, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '4' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_4, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '5' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_5, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '6' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_6, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '7' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_7, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '8' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_8, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '9' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_9, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      'A' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_A, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      'B' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_B, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      'C' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_C, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      'D' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_D, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '*' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_ASTERISK, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );

    log_printf( &logger, " TONE      '#' \r\n");
    log_printf( &logger, "---------------\r\n" );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_HASH, signal_duration );
    dtmfgenerator_transmit_out_tone( &dtmfgenerator, DTMFGENERATOR_OUT_TONE_STOP, signal_duration );
 }

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.DTMFGenerator

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

Vibro Motor 3 click

5

Vibro Motor 3 Click is a compact add-on board that makes an ideal solution for adding simple haptic feedback in any design.

[Learn More]

BUCK 7 click

0

Buck 7 Click is a high-efficiency buck (step-down) DC-DC converter, which can provide digitally adjusted step-down voltage on its output while delivering up to 3.5A of current.

[Learn More]

IR Grid 2 click

0

IR Grid 2 click is a thermal imaging sensor. It has an array of 768 very sensitive factory calibrated IR elements (pixels), arranged in 32 rows of 24 pixels. Each one of them is measuring an object temperature up to 300˚C within its local Field of View (FOV). The MLX90640ESF-BAB IR sensor used on this Click board™ has just four pins, and it is mounted inside of the industry standard TO39 package. It is equipped with 2Kbit of EEPROM for storing the compensation and calibration parameters.

[Learn More]