waveform4 2.0.0.0
Main Page

Waveform 4 click

‍Waveform 4 Click is a compact add-on board that represents a high-performance signal generator. This board features the AD9106, a quad-channel, 12-bit, 180MSPS waveform generator, integrating on-chip static random access memory (SRAM) and direct digital synthesis (DDS) for complex waveform generation from Analog Devices. The DDS is up to a 180 MHz master clock sinewave generator with a 24-bit tuning word allowing 10.8 Hz/LSB frequency resolution.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Sep 2021.
  • Type : SPI type

Software Support

We provide a library for the Waveform4 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 Waveform4 Click driver.

Standard key functions :

Example key functions :

Example Description

‍This example demonstrates the use of Waveform 4 click board.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and performs the click default configuration which resets the registers and sets the sine wave output with default gain and default frequency for all channels. After that it displays the list of supported commands on the USB UART.

void application_init ( void )
{
log_cfg_t log_cfg;
waveform4_cfg_t waveform4_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
waveform4_cfg_setup( &waveform4_cfg );
WAVEFORM4_MAP_MIKROBUS( waveform4_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == waveform4_init( &waveform4, &waveform4_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( WAVEFORM4_ERROR == waveform4_default_cfg ( &waveform4 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define WAVEFORM4_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition waveform4.h:261
void application_init(void)
Definition main.c:59
void waveform4_display_commands(void)
Waveform 4 display commands function.
Definition main.c:122
@ WAVEFORM4_ERROR
Definition waveform4.h:319

Application Task

‍Depending on the command character received from USB UART it changes the signal frequency, gain or wave of the selected channel.

void application_task ( void )
{
uint8_t command = 0;
if ( log_read ( &logger, &command, 1 ) > 0 )
{
}
}
void application_task(void)
Definition main.c:96
err_t waveform4_parse_command(uint8_t command)
Waveform 4 parse command function.
Definition main.c:143

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.Waveform4

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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.