Waveform Click-Platine
Waveform Click-Platine
Overview
Das Waveform Click Board™ ist ein präziser Sinus-/Dreieck-/Rechteck-Wellenformgenerator, der Frequenzen bis zu 12 MHz wiedergeben kann. Es verwendet einen Direct Digital Synthesis (DDS) IC von Analog Devices, einem Unternehmen, das für seine Spezialisierung auf DSP-Entwicklung und -Technik bekannt ist. Der AD9833-Wellenformgenerator-IC erfordert nur sehr wenige zusätzliche Komponenten: Abgesehen von der externen Taktquelle benötigt er fast keine Komponenten, sodass das Click Board™ mit einigen zusätzlichen Schaltkreisen ausgestattet werden kann. Ein digitaler Potentiometer-IC wird verwendet, um das Ausgangssignal zu dämpfen, während der hochwertige Operationsverstärker als Puffer verwendet wird.
How Does The Waveform Click Board™ Work?
The main component of the Waveform Click Board™ is the AD9833, a low-power, programmable waveform generator, produced by Analog Devices. This company is well-established in the market of high-quality Digital Signal Processing (DSP) solutions. The AD9833 IC is based on the Direct Digital Synthesis (DDS), producing a waveform with the programmable frequency and selectable wave shape at its output. The AD9833, along with the AD5227, a digital potentiometer IC from the same company is controlled over the SPI interface, allowing both the frequency and the amplitude to be changed very quickly, without additional latency.
DDS is a method of producing an analog waveform, by exploiting the fact that the phase of the signal is changed linearly. For simple periodic functions such as the sine function, the phase changes linearly between 0 and 2π. This allows building the Numerically Controlled Oscillator (NCO) block, which outputs a numerical value that linearly changes over time, in the range between 0 and 228 – 1 (since the AD9833 IC has a 28-bit phase accumulator). The continuously changing output of the NCO block is used as the index for the Lookup Table (LUT) which contains amplitudes of the output waveform. The faster the NCO output changes, the higher the frequency of the output signal, which is a basis for DDS. The main advantage over some other types of synthesis (PLL for example), is its simplistic approach. The frequency can be changed in very small steps (depending on the clock generator), while the maximum frequency can easily reach GHz.
Besides the NCO and the LUT, the AD9833 contains other blocks, necessary to produce the waveform at the output. It also features a 10-bit DAC, which allows the digital value to be translated into an analog voltage at the output. Since the ADC is only 10 bits wide, there is no need for the LUT to have too many elements. The resolution of the ADC is the bottleneck, so just a slightly higher resolution is required for the LUT data. This further reduces the complexity and costs. The AD9833 can completely avoid using the LUT, producing a square wave (by using only the MSB of the DAC), with the frequency that can be further multiplied by 2, and triangle wave (by redirecting the NCO directly to DAC instead using it for sweeping through the LUT). The operating modes of the AD9833 can be set up by using the config-register over the SPI interface. For more detailed information about the AD9833 IC, please refer to the datasheet of the AD9833. However, the mikroSDK compatible library contains functions that simplify working with the AD9833 IC.
The output of the AD9833 is routed to the AD5227 digital potentiometer, which is used to set the amplitude of the output signal. This potentiometer is used to scale down the amplitude in the range between 0V and 3.3V. It is controlled over the SPI interface. The potentiometer is used since the AD9833 IC does not provide means to regulate the amplitude of the signal at the output.
The Waveform Click Board™ uses the clock generator of 25MHz, which allows changing the frequency in steps of 0.1Hz. High speed of the clock allows very high frequencies to be produced, so this Click board™ can generate a very clean sine wave with the frequency up to 5MHz, and square wave with the frequency up to 12MHz. The integrated clock generator offers a STAND-BY pin, which is used to enable or disable the clock. If there is a HIGH logic state on this pin, the clock generator will produce 25MHz clock signal. This pin is pulled to VCC by a pull-up resistor, so by default, the 25MHz clock generator is enabled.
The output signal of the Waveform Click Board™ is buffered by an ADA4891-1 low-noise op-amp, which provides a constant impedance and limited protection to the whole circuit. It is available over the SMA connector, allowing the shielded coaxial cable to be used.
SPECIFICATIONS
Type | Measurements |
Applications | The Waveform Click Board™ can be used in various applications, including test equipment, frequency sweep/clock generators, line loss or attenuation testers, waveform generators, in fluid flow measuring applications, and other similar applications that require pulse, triangle, or sinusoidal waveform for their operation. |
On-board modules | AD9833, a low-power, programmable waveform generator; AD5227, a 64-position digital potentiometer; ADA4891, a high speed, rail-to-rail operational amplifier; all ICs from Analog Devices. |
Key Features | Simple yet powerful waveform generator based on DSS, low power consumption, 0 to 12MHz(5MHz sine) in steps of 0.1 Hz, 28-bit accumulator resolution, integrated sinewave ROM LUT, high-quality SMA connector for the signal protection, etc. |
Interface | SPI |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Input Voltage | 3.3V |
PINOUT DIAGRAM
This table shows how the pinout of the Waveform Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | OEN | Clock Generator Enable | |
Chip Select for AD9833 | FSN | 2 | RST | INT | 15 | NC | |
Chip Select for AD5227 | CS | 3 | CS | RX | 14 | NC | |
SPI Clock | SCK | 4 | SCK | TX | 13 | NC | |
NC | 5 | MISO | SCL | 12 | NC | ||
SPI Data IN | SDI | 6 | MOSI | SDA | 11 | NC | |
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | NC | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED indicator |
CN1 | OUTPUT | - | Output signal connector |
Software Support
We provide a library for the Waveform Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
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.
Example Description
The application is composed of three sections :
- System Initialization - Initialize the GPIO and communication structures.
- Application Initialization - Initialization driver init, default configuration and sets the first volume.
- Application Initialization - Initialize the communication interface and configure the click board.
- Application Task - Predefined characters are inputted 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.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
SPI
UART
Conversions
C_Sring
Additional Notes and Information
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.
MIKROSDK
The Waveform Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Software Support
We provide a library for the Waveform Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
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.
Example Description
The application is composed of three sections :
- System Initialization - Initialize the GPIO and communication structures.
- Application Initialization - Initialization driver init, default configuration and sets the first volume.
- Application Initialization - Initialize the communication interface and configure the click board.
- Application Task - Predefined characters are inputted 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.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
SPI
UART
Conversions
C_Sring
Additional Notes and Information
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.
MIKROSDK
The Waveform Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.