After some time developing an application on the Zedboard using the Python framework and a Matlab connection to visualize the data acquired by the AD4030 board, I wanted to go a little further.
The idea is to modify the reference design, i.e. add/modify blocks in the Vivado IP Integrator. Previously I have modified and developed other of these blocks for other SoC boards although they had a slightly different architecture since in this case I need to start from this reference to be able to use the acquisition board with its drivers to be able to use it later without too much complication and to be able to use the work already done by you.
If I understand the concept correctly, in Vivado we can visualize the 'axi_pwm_gen' which is in charge of sending the configuration commands to the acquisition block as I have read in this Wiki. In the post they also talk about the ext_sync signal that according to my understanding can be used to start the acquisition at a certain instant with an external trigger.
Therefore, in a first approach I had thought to add a very simple block that reads for example the press of one of the buttons of the PL (BTND - R16) and at that moment performs a HIGH to LOW transition in the 'external_sync' input of the 'axi_pwm_gen' block. I leave you a pictures and continue explaining below:
In the images you can see the block I had thought of using ('external_trigger_0'). The block has an 'external_pin' (std_logic) input that connects to an external port or input with the same name. In turn the block has an output 'trigger_out' (std_logic) which will be held at '1' after reset and will wait until it sees a stimulus on the button (value of '1') from which it will change the output value to '0'.
This output will be connected to the 'ext_sync' input of the 'axi_pwm_gen' block.
In addition to this, in constraints file I added a line indicating the assignment of this PL button (BTND) to the new port ('external_pin') like this:
set property -dict {PACKAGE_PIN R16 IOSTANDARD LVCMOS25} [get_ports {external_pin}]
For the design to run correctly the synthesis and implementation I had to change the previous assignment for pin R16 (in this case to gpio_bd[1]) and assign an unused PIN to that port.
In addition, I also added the external port as an input on the top module of the design so that it would be recognized.
Finally, I generated the bitstream without failures and exported the XSA. Although the block I have added follows the AXI protocol, in principle I have not used this functionality, I simply generated it this way for a future more advanced implementation in which the block could read commands from the PS.
Because of this, as I think it is not necessary to modify the .dtb file since I don't want to use it from the PS, right now it only has functionality in the PL so I have generated the new BOOT.BIN file as stated in this other Wiki.
What I expected after these modifications was to see that when I tried to capture the data without pressing the button I would not receive anything or I would receive random values or 0s by initializing the buffer. On the other hand, after pressing the button I expected to see a correct reception of the ADC data. However, when I try to receive the data from the buffer, the program freezes and I can't receive anything.
Thank you very much for your time if you read the whole post, I will be very grateful to receive any kind of help or feedback. And anything extra that is necessary for understanding, just let me know please.
PD:
For the verification of this data reception I am using in the first instance what I have seen in this post. Specifically the following code snippet:
root@analog:/sys/bus/iio/devices/iio:device0# echo 1 > scan_elements/in_voltage0_differential0_en root@analog:/sys/bus/iio/devices/iio:device0# echo 1 > scan_elements/in_voltage1_differential1_en root@analog:/sys/bus/iio/devices/iio:device0# echo 400 > buffer/length root@analog:/sys/bus/iio/devices/iio:device0# echo 1 > buffer/enable root@analog:/sys/bus/iio/devices/iio:device0# hexdump -n 400 /dev/iio\:device0 0000000 e942 000d 0011 0000 afaf 000d 0029 0000 0000010 753b 000d fff5 00ff 39fa 000d 0018 0000 0000020 013e 000d 0017 0000 c776 000c fff4 00ff 0000030 8e84 000c 0017 0000 55d4 000c 0052 0000 0000040 1dab 000c 000b 0000 e5b9 000b 0049 0000 0000050 ab19 000b 0013 0000 6f56 000b 0035 0000 0000060 3470 000b 0020 0000 f9a1 000a 0037 0000 0000070 bcc1 000a 0003 0000 7f89 000a 000d 0000 0000080 4458 000a 0003 0000 0978 000a 000d 0000 0000090 cea9 0009 0041 0000 9551 0009 fff2 00ff 00000a0 5b80 0009 fff1 00ff 210c 0009 0015 0000 00000b0 e486 0008 ffe8 00ff a8d1 0008 ffec 00ff 00000c0 6e13 0008 004e 0000 33a0 0008 001a 0000 00000d0 f7df 0007 fffd 00ff bba2 0007 fffd 00ff 00000e0 7ead 0007 fffe 00ff 43e0 0007 0041 0000 00000f0 08a8 0007 0023 0000 cc9c 0006 ffed 00ff 0000100 9031 0006 001c 0000 5370 0006 fff6 00ff 0000110 1721 0006 0040 0000 dcec 0005 ffe5 00ff 0000120 9ffc 0005 000d 0000 61f3 0005 0016 0000 0000130 247d 0005 0023 0000 e55d 0004 0006 0000 0000140 a725 0004 000e 0000 6d7b 0004 0045 0000 0000150 32e4 0004 ffaa 00ff f77e 0003 ffca 00ff 0000160 bc75 0003 0036 0000 809d 0003 0019 0000 0000170 4582 0003 ffe1 00ff 0921 0003 ffdf 00ff 0000180 c9a5 0002 ffd1 00ff 8a1c 0002 0015 0000 0000190 root@analog:/sys/bus/iio/devices/iio:device0/# echo 0 > buffer/enable
Although it is true, that the version of used for the Kuiper Linux image, the same elements do not appear to me under the directory "/sys/bus/iio/devices/iio:device0/scan_elements/". In the example, it looks like the following appears:
root@analog:/sys/bus/iio/devices/iio:device0/# ls buffer data_available enable length length_align_bytes watermark root@analog:/sys/bus/iio/devices/iio:device0# ls scan_elements/ in_voltage0_differential0_en in_voltage0_differential0_type in_voltage1_differential1_index in_voltage0_differential0_index in_voltage1_differential1_en in_voltage1_differential1_type
Something similar appears to me, as you can see here:
However, I modified the example a bit by running the following:echo 1 > scan_elements/in_voltage0_en echo 400 > buffer/length echo 1 > buffer/enable hexdump -n 400 /dev/iio\:device0
.
[edited by: jlanzuela at 8:32 AM (GMT -4) on 20 Oct 2023]