TOP Contributors

  1. MIKROE (2652 codes)
  2. Alcides Ramos (351 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 (136615 times)
  2. FAT32 Library (69820 times)
  3. Network Ethernet Library (55883 times)
  4. USB Device Library (46220 times)
  5. Network WiFi Library (41859 times)
  6. FT800 Library (41074 times)
  7. GSM click (28942 times)
  8. PID Library (26401 times)
  9. mikroSDK (26314 times)
  10. microSD click (25327 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

Waveform 2 click

Rating:

6

Author: MIKROE

Last Updated: 2021-08-13

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Clock generator

Downloaded: 2186 times

Not followed.

License: MIT license  

Waveform 2 Click is a compact add-on board that contains a direct digital synthesis device for waveform generator applications. This board features the AD9834, a 75 MHz low power DDS device capable of producing high-performance sine/triangle/square outputs from Analog Devices.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Waveform 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Waveform 2 click" changes.

Do you want to report abuse regarding "Waveform 2 click".

  • mikroSDK Library 2.0.0.0
  • Comments (1)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Waveform 2 Click

Waveform 2 Click

Native view of the Waveform 2 Click board.

View full image
Waveform 2 Click

Waveform 2 Click

Front and back view of the Waveform 2 Click board.

View full image

Library Description

Library contains generic functions for working with the Waveform 2 Click™ board.

Key functions:

  • void waveform2_set_freq ( uint32_t freq ) - Function for setting the output frequency.
  • void waveform2_sine_output ( void ) - Function for setting the sine output.
  • void waveform2_triangle_output ( void ) - Function for setting the triangle output.

Examples description

The application is composed of three sections :

  • System Initialization - Initialize the GPIO and communication structures.
  • Application Initialization - Initialize the communication interface and configure the Click board™.
  • Application Task - Predefined characters are inputed from the serial port. Depending on the character sent the signal frequency, waveform or amplitude will be changed.
  • Command: [ + ] - Increase frequency [ - ] - Decrease frequency [ t ] - Triangle-shaped signal [ s ] - The signal in the form of a sinusoid
void application_task ( )
{
    char rx_data;
    uint32_t freq_data;

    if ( UART_Rdy_Ptr( ) )
    {
       rx_data = UART_Rd_Ptr( );
    }

    if ( rx_data > 0 )
    {
        switch ( rx_data )
        {
            case '+': 
            {
                f += 10;
                freq_data = f << 14;
                waveform2_set_freq( freq_data );
                rx_data = 0;
                mikrobus_logWrite( ">> Increasing the frequency ", _LOG_LINE );
                break;
            }

            case '-': 
            {
                if ( f <= 9 )
                { 
                    f = 0;
                }
                f -= 10;
                freq_data = f << 14;
                waveform2_set_freq( freq_data );
                rx_data = 0;
                mikrobus_logWrite( ">> Decreasing the frequency ", _LOG_LINE );
                break;
            }

            case 't': 
            {
                waveform2_triangle_output( );
                rx_data = 0;
                mikrobus_logWrite( ">> Triangle output ", _LOG_LINE );
                break;
            }

            case 's': 
            {
                waveform2_sine_output( );
                rx_data = 0;
                mikrobus_logWrite( ">> Sinusoid output ", _LOG_LINE );
                break;
            }
        }
    }
    rx_data = 0;
}


Additional Functions : aprox_freq_calculation( ) - This function is used to calculate the aproximate value that will be written to the frequency set register.

Other mikroE Libraries used in the example:

  • UART Library
  • I2C Library
  • SPI Library
  • Conversions Library

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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

Thermo 18 click

0

Thermo 18 Click is a compact add-on board that provides an accurate temperature measurement. This board features the WSEN-TIDS, a silicon-based, high-precision digital temperature sensor with embedded analog and digital signal processing unit from Würth Elektronik.

[Learn More]

Matrix G click

0

Matrix G click is a mikroBUS add-on board with two green 5x7 matrices driven by two MAX7219 8-bit LED Display Drivers. The active area of each matrix is 7.62mm high and 5.08 mm wide. 7x5 is a standard resolution for displaying ASCII characters, so the click is essentially a dual-character display capable of showing letters in more readable typefaces compared to a 14-segment display. The click communicates with the target MCU through the mikroBUS SPI interface with two separate Chip Select lines for each matrix (CSL for the left, CSR for the right). This board is designed to use a 5V power supply.

[Learn More]

Tamper click

0

Tamper click is equipped with SDS001, a low profile side-actuated detect switch, made by C&K company. This is a high-quality, low-current detection switch, which is designed in a form of a push button. The switch itself is very small - only 2mm of switch overtravel length, which coupled with its low actuation force, makes it ideal for using it as a contact detector in various applications - consumer electronics devices, medical devices, smart card detection and similar applications.

[Learn More]