TOP Contributors

  1. MIKROE (2655 codes)
  2. Alcides Ramos (353 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 (136767 times)
  2. FAT32 Library (69975 times)
  3. Network Ethernet Library (55944 times)
  4. USB Device Library (46270 times)
  5. Network WiFi Library (41888 times)
  6. FT800 Library (41182 times)
  7. GSM click (28987 times)
  8. PID Library (26414 times)
  9. mikroSDK (26372 times)
  10. microSD click (25381 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: 87 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

EEPROM 6 click

5

EEPROM 6 Click is a compact add-on board that contains a serial EEPROM memory that operates from the 1-Wire interface. This board features the DS28EC20, a 20480-bit EEPROM organized as 80 memory pages of 256 bits each from Maxim Integrated.

[Learn More]

3D Hall click

1

3D Hall click carries the MLX90333 Triaxisâ„¢ Hall sensor, capable of detecting the position of any magnet in nearby space. It does so by being sensitive to three components of flux density (BX, BY, BZ). The board communicates with the target MCU through the mikroBUS SPI interface. 3D Hall click is designed to use a 5V power supply only.

[Learn More]

GPS 3 click

5

Simple example which demonstrates usage of the GPS3 Click board with QUECTEL L80 GPS module. It displays a map of the world on the GLCD and shows the location of the GPS module on it.

[Learn More]