TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139062 times)
  2. FAT32 Library (71593 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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: 2752 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

Tilt click

5

Tilt click carries RPI-1035, a 4-directional optical tilt sensor. This type of sensor provides positional feedback for left, right, up or down movements. Tilt click communicates with the target board microcontroller through mikroBUS PWM and INT lines, used here for vout1 and vout2 outputs from the sensor.

[Learn More]

Ambient 11 Click

0

The Ambient 11 Click is a Click board™ equipped with the VEML6035,a low power, high sensitivity, I2C ambient light sensor from Vishay Semiconductors.Because of the possibilities its features offer,the Ambient 11 Click can be used as an ambient light sensor for mobile devices,industrial lighting operation, and as an optical switch for consumer,computing and industrial devices and displays.

[Learn More]

EnOcean Click

0

EnOcean Click carries a TCM 310 transceiver, which is a bidirectional gateway for EnOcean’s 868 MHz radio systems. The Click is designed to run on a 3.3V power supply.

[Learn More]