TOP Contributors

  1. MIKROE (2656 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 (136807 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41192 times)
  7. GSM click (28990 times)
  8. PID Library (26420 times)
  9. mikroSDK (26376 times)
  10. microSD click (25382 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 click

Rating:

5

Author: MIKROE

Last Updated: 2021-10-04

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Clock generator

Downloaded: 4436 times

Not followed.

License: MIT license  

Waveform Click is a precise sine/triangle/square waveform generator, capable of reproducing frequencies up to 12MHz.

No Abuse Reported

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

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

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

  • mikroSDK Library 2.0.0.0
  • Comments (0)
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 Click

Waveform Click

Native view of the Waveform Click board.

View full image
Waveform Click

Waveform Click

Front and back view of the Waveform Click board.

View full image

Library Description

Library contains generic functions for controlling the waveform and frequency
output of the click board.

Key functions:

  • void waveform_sineOutput(uint32_t f) - Function for setting the sine wave output.
  • void waveform_triangleOutput(uint32_t f) - Function for setting the triangle wave output.
  • void waveform_squareOutput(uint32_t f) - Function for setting the square wave output.

Examples description

The application is composed of the three sections :

  • System Initialization - Initialize the GPIO and communication structures.
  • Application Initialization - Initialization driver init, default configuration and sets first volume.
  • 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.
void applicationTask()
{
    char rxDat;
    uint32_t freqTmp;
 
    if(UART_Rdy_Ptr())
    {
       rxDat = UART_Rd_Ptr();
       mikrobus_logWrite(&rxDat,_LOG_BYTE);
    }
    if(rxDat>0)
    {
       switch(rxDat)
       {
           case waveform_cmd[0]: {
                                     waveform_digipotInc();
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[1]: {
                                     waveform_digipotDec();
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[2]: {
                                     freq += 1;
                                     freqTmp = freq << 14;
                                     waveform_sineOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[3]: {
                                     freq -= 1;
                                     freqTmp = freq << 14;
                                     waveform_sineOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[4]: {
                                     freq += 1;
                                     freqTmp = freq << 14;
                                     waveform_triangleOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[5]: {
                                     freq -= 1;
                                     freqTmp = freq << 14;
                                     waveform_triangleOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[6]: {
                                     freq += 1;
                                     freqTmp = freq << 14;
                                     waveform_squareOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[7]: {
                                     freq -= 1;
                                     freqTmp = freq << 14;
                                     waveform_squareOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           default : {
                         break;
                     }
       }
    }
     rxDat = 0;
}

Additional Functions :

  • uint32_t waveform_aproxFreqcalculation(float freqency) - 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:

  • SPI
  • UART
  • Conversions
  • C_Sring

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

Magic RFID Click

5

Magic RFID Click is a compact add-on board that contains an embedded RFID module. This board features the M6E-NANO, UHF RFID module with ultra-low power consumption from JADAK.

[Learn More]

Let's make - Thermal Camera

0

Thermal camera project with two different screen resolutions composed of mikroMedia Plus for STM32 and IR Grid click board.

[Learn More]

Flash 3 click

8

Flash 3 click is a mikroBUS add-on board for adding more Flash Memory to your target board microcontroller. It carries an ISSI IS25LP128 IC with 128 Mbit capacity.

[Learn More]