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 (136967 times)
  2. FAT32 Library (70081 times)
  3. Network Ethernet Library (56019 times)
  4. USB Device Library (46340 times)
  5. Network WiFi Library (41958 times)
  6. FT800 Library (41266 times)
  7. GSM click (29051 times)
  8. mikroSDK (26482 times)
  9. PID Library (26447 times)
  10. microSD click (25411 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: 2238 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

Charger 23 click

0

Charger 23 Click is a compact add-on board providing a single-cell battery charging solution. This board features the ISL78693, a single-cell Li-ion or Li-polymer battery charger from Renesas. The ISL78693 can operate with an input voltage as low as 2.6V and works as a linear charger with the battery charged in a Constant Current/Constant Voltage (CC/CV) profile. The charge current is selectable with an external resistor between 250 and 500mA. Additional features include the preconditioning of an over-discharged battery, an NTC thermistor interface for charging the battery in a safe temperature range, automatic recharge, and more.

[Learn More]

Thermo 17 click

0

The Thermo 17 Click is a Click board™ based on the TMP451-Q1, a high-accuracy, lowpower remote temperature sensor monitor with a built-in local temperature sensor from Texas Instruments.

[Learn More]

I2C Isolator 2 click

5

I2C Isolator 2 click provides I2C lines and power isolation for slave devices. It carries the ADM3260 dual I2C isolator with an integrated DC-to-DC converter, from Analog Devices. I2C Isolator 2 click is designed to run on either 3.3V or 5V power supply.

[Learn More]