I'm working on a new project now involving ADAQ4003 and Zedboard. Compared to a previous thread, I decided to do everything and not rely on other personnel here in my company. I posted this new question as I think my concern is more on the HDL side than a Linux driver one.
I'm using the EVAL-ADAQ4003 board with Zedboard and petalinux meta-adi 2020.1, as well as very recent ADI HDL checkout (hash ID 1fe0d5f8e00b119a5a389213cf05e9db4646c86a) for ad400x, I think the project name is ad40xx_fmc. I think the default settings of this HDL project is for AD4020 eval board (which I worked with before very recently). The HDL project has a constraint file for ADAQ400X which connects the board to a PMOD connector JA1, not FMC. So I made the following change to the project's system_bd.tcl and system_project.tcl files:
## Please select which eval board do you want to use
## 1 - EVAL-AD40XX-FMCZ
## 0 - EVAL-ADAQ400x
set AD40XX_ADAQ400X_N [get_env_param AD40XX_ADAQ400X_N 0]
# specify ADC resolution -- supported resolutions 16/18/20 bits
set ADC_RESOLUTION [get_env_param ADC_RESOLUTION 18]
I modified the default parameters in the tcl file and built it with the "make" command in the command-line (not through Vivado IDE). I also set the compatible string to "ad4003" in the device tree in Linux.
Overall, it works - Linux can get ADC values from the HDL and ADC, and it also works with libiio. However, the actual sampling rate is just around ~900000 samples per second. I didn't modify the sampling_rate parameter in the TCL files so I expected it to be 1800000 samples per second but it's just 900000 (I'm measuring it using oscilloscope). Whereas when the project was left in its default state to support AD4020 eval board, I've verified that indeed actual sampling rate is ~1800000 per second (sampling period is ~562ns) so the default project is okay.
There must be something I'm missing here. I'm not very experienced in HDL so I'm very reliant on ADI user guides or this forum.
Added hash of adi-hdl git checkout branch for identification
[edited by: ubermensch at 8:07 AM (GMT -4) on 24 Sep 2021]