This is an old revision of the document!
Analog Devices is an Mbed Partner and develops code on the platform for multiple products. The AD9106 and AD9102 Mbed-enabled evaluation boards and example Mbed codes can be used as starting point for characterizing the high-speed waveform generator digital-to-analog converters before integrating them into specific applications.
This guide will focus on how AD9106-ARDZ-EBZ/AD9102-ARDZ-EBZ works with SDP-K1 controller board and example Mbed program developed by Analog Devices. Users are not limited to using SDP-K1 for evaluation or prototyping. The evaluation boards and the example codes with minor changes can work with other ARM-based Mbed-enabled boards. User interface is text-based.
The evaluation setup can be powered by USB only and does not require a high-frequency waveform generator for clock input. The evaluation board has an on-board 156.25 MHz crystal oscillator. To fit the evaluation system in a small form factor and manage power consumption within USB specifications, AD9106 and AD9102 supply voltages AVDD, DVDD and CLKVDD are limited to 3.3V only.
Note: If the VIO is set to 1.8V, 0xFFFF data will be read to all registers and can't apply data changes to all registers.
Figure 10a. AD9106 example 3 waveforms out of RF transformers | Figure 10b. AD9106 example 5 waveforms out of RF transformers
Figure 11a. AD9102 example 3 waveform out of RF transformer | Figure 11b. AD9102 example 5 waveform out of RF transformer
Figure 12a. Restarting the program | Figure 12b. Exiting the program
The EVAL-AD910x Example Mbed Codes can be used as starting point for developing firmware for targeted applications. The codes in the repositories below demonstrates how to setup SPI communication between the ARM-based Mbed-enabled hardware, SDP-K1, and the waveform generator DACs, AD9106 or AD9102.
To import the program files to the Mbed compiler as discussed in the Quick Start Guide, the user should have a free Mbed account and is logged on to https://os.mbed.com/. After successful program import, the user is free to use and modify the codes without violating the Analog Devices Inc. Software License Agreement in the License.txt file.
Each file and each of the functions in the files have short descriptions or briefs. This section will focus on how several files and functions can be modified using the Mbed online compiler.
Figure 13. SPI protocol definitions, example SRAM vectors, and example SPI register configurations in config.h
Aside from choosing the active device as shown in the Quick Start Guide, SPI protocol parameters particularly the clock frequency can be set at the application-level codes. Word length WORD_LEN and polarity POL need not be changed and are already set specifically for AD9106 and AD9102. Refer to Mbed OS 6 SPI Documentation for more information on these parameters.
Instructions on setting the SPI clock (SCLK) frequency are already provided in config.h as shown in Figure 13. The reason why SCLK can only be set to a number of fixed frequencies is discussed in this Mbed wiki page on SPI output clock frequency. SPI lines out of the Arduino headers or SPI1 module of the SDP-K1 ARM processor, uses 90MHz peripheral clock. Refer to these relevant source codes:
Figure 14. Device-specific I/O pins and functions declarations in ad910x.h
Initialization of digital I/O pins connected to the DAC being evaluated, and declaration of SPI register addresses and device-specific functions are in ad910x.h. See Figure 14. The functions are implemented in ad910x.cpp. The Mbed platform drivers allow setup of 4-wire SPI interface. Refer to Mbed documentation for other configurations.
SRAM Vectors in config.h can be easily modified for a specific application. For both AD9106 and AD9102, there are 4096 addresses in the on-chip SRAM. Word length is 14 bits for AD9102, 12 bits for AD9106, and is left justified. For AD9102, data should be written in bits [15:2] and for AD9106 in bits [15:4] of each SRAM address.
Figure 15a. Waveforms that can be generated using DPG Lite
Figure 15b. Waveform vector generation using DPG Lite
Although the SRAM vectors can be modified manually, it will be more convenient to create new vectors using DPG Lite. Shown in Figure 15a are types of waveforms that can be generated using the software.
When creating data vectors for AD9106 and AD9102, make sure to choose the proper DAC resolution and leave the Unsigned Data box unchecked. A continuous wave vector with record length of 4096 can be created but the SRAM can also be composed of different types of waveforms like in the example in Figure 15b where there are 3 vectors with combined record length of 4096. These can be saved as text files and integrated into the source code.
It is not required to write to all 4096 addresses. Each DAC channel in a device can fetch data from a fixed SRAM address to another. The start and stop addresses can be set using the following registers:
SRAM data format or code follows two’s complement notation. Refer to Table 3 for the equivalent current output for an input code. 14-bit code should be shifted left by 2 bits before writing it to AD9102 SRAM while 12-bit code should be shifted left by 4 bits before writing it to AD9106 SRAM. Alternatively, 14-bit data shifted left by 2 bits can be written to AD9106 SRAM but the last two bits with be truncated. This is why in AD910x_update_sram() function in ad910x.cpp, SRAM data is by default shifted 2 bits to the left. Refer to Figure 16.
Figure 16. Function that writes to on-chip SRAM in ad910x.cpp
AD910x_print_sram() function is declared in ad910x.h and implemented in ad910x.cpp but is by default not called in the main program main.cpp. The function can be used to print in the console n number of data words from SRAM. This can be done by calling the function in main.cpp after an AD910x_update_sram().
AD9106 and AD9102 have similar register maps. The latter only has less number of registers that affect device functionality because writing to registers for the 3 other DAC channels will only have an effect to AD9106. Nonetheless, the defined SPI registers address in ad910x.h will work for both devices.
The SPI register addresses were written as comment in config.h and aligned with example SPI register values for user’s convenience. Same as the SRAM vectors, these SPI register values can also be easily modified for specific applications. Refer to the device datasheets for the SPI register descriptions.
Figure 17. Power supply enable/shutdown pins in main.cpp
Other I/Os like the ones connected to the EN pin of the on-board oscillator supply, CVDDX, and to the SHDN_N pin of the on-board amplifier supply, LT3472, are defined in main.cpp.
As shown in Figure 17, if external or off-board clock source is chosen, en_cvddx = 0 and no power is supplied to CVDDX. If the on-board oscillator is chosen, en_cvddx = 1 and 3.3V is supplied to CVDDX.
If the user confirms that the DAC outputs are connected to the on-board amplifiers, shdn_n_lt3472 = 1 and 5.2V and -5.2V are supplied to the amplifiers provided a wall wart is connected to SDP-K1 or the evaluation board. Otherwise, shdn_n_lt3472 = 0 and the amplifiers are not powered up.