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]
Rating:
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.
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".
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 :
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:
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.