Skip to content

ad485x_fmcz: Add 3 wire SPI support for LVDS #1635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/projects/ad485x_fmcz/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ To build the LVDS version of the interface, run:
$cd hdl/projects/ad485x_fmc/zed
$make LVDS_CMOS_N=1

The default LVDS configuration is for 4 wire SPI. To use the 3 wire SPI, run:

.. shell:: bash

$cd hdl/projects/ad485x_fmc/zed
$make LVDS_CMOS_N=1 THREE_W_SPI=1

A more comprehensive build guide can be found in the :ref:`build_hdl` user
guide.

Expand Down
31 changes: 31 additions & 0 deletions projects/ad485x_fmcz/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# AD485X-FMCZ HDL Project

- Evaluation boards product page:
- [EVAL-AD4851](https://www.analog.com/eval-ad4851)
- [EVAL-AD4852](https://www.analog.com/eval-ad4852)
- [EVAL-AD4853](https://www.analog.com/eval-ad4852)
- [EVAL-AD4854](https://www.analog.com/eval-ad4853)
- [EVAL-AD4855](https://www.analog.com/eval-ad4855)
- [EVAL-AD4856](https://www.analog.com/eval-ad4856)
- [EVAL-AD4857](https://www.analog.com/eval-ad4857)
- [EVAL-AD4858](https://www.analog.com/eval-ad4858)

- System documentation: https://wiki.analog.com/resources/eval/user-guides/ad4858_fmcz/ad4858_fmcz_hdl
- HDL project documentation: http://analogdevicesinc.github.io/hdl/projects/ad585x_fmcz/index.html

## Supported parts

| Part name | Resolution | Description |
|-----------------------------------------|:----------:|--------------------------------------------------|
| [AD4851](https://www.analog.com/ad4851) | 16-bit | Buffered, 4-Channel Simultaneous Sampling, 250kSPS DAS |
| [AD4852](https://www.analog.com/ad4852) | 20-bit | Buffered, 4-Channel Simultaneous Sampling, 250kSPS DAS |
| [AD4853](https://www.analog.com/ad4853) | 16-bit | Buffered, 4-Channel Simultaneous Sampling, 1MSPS DAS |
| [AD4854](https://www.analog.com/ad4854) | 20-bit | Buffered, 4-Channel Simultaneous Sampling, 1MSPS DAS|
| [AD4855](https://www.analog.com/ad4855) | 16-bit | Buffered, 8-Channel Simultaneous Sampling, 250 kSPS DAS |
| [AD4856](https://www.analog.com/ad4856) | 20-bit | Buffered, 8-Channel Simultaneous Sampling, 250 kSPS DAS|
| [AD4857](https://www.analog.com/ad4857) | 16-bit | Buffered, 8-Channel Simultaneous Sampling, 1 MSPS DAS |
| [AD4858](https://www.analog.com/ad4858) | 20-bit | Buffered, 8-Channel Simultaneous Sampling, 1 MSPS DAS |

## Building the project

Please enter the folder for the FPGA carrier you want to use and read the README.md.
8 changes: 0 additions & 8 deletions projects/ad485x_fmcz/Readme.md

This file was deleted.

1 change: 1 addition & 0 deletions projects/ad485x_fmcz/zed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ M_DEPS += ../../scripts/adi_pd.tcl
M_DEPS += ../../common/zed/zed_system_constr.xdc
M_DEPS += ../../common/zed/zed_system_bd.tcl
M_DEPS += ../../../library/common/ad_iobuf.v
M_DEPS += ../../../library/common/ad_3w_spi.v

LIB_DEPS += axi_ad485x
LIB_DEPS += axi_clkgen
Expand Down
75 changes: 75 additions & 0 deletions projects/ad485x_fmcz/zed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# AD485X-FMCZ/Zed HDL Project

## Building the project

The parameters configurable through the `make` command, can be found below, as well as in the **system_project.tcl** file; it contains the default configuration.

```
cd projects/ad485x/zed
make
```

The overwritable parameters from the environment are:

- LVDS_CMOS_N - selects the interface type to be used:
- 0 - CMOS interface (default)
- 1 - LVDS interface

- THREE_W_SPI - selects the SPI configuration to be used:
- 0 - 4 wire SPI (default)
- 1 - 3 wire SPI

- DEVICE - selects the device to be used:
- AD4851
- AD4852
- AD4853
- AD4854
- AD4855
- AD4856
- AD4857
- AD4858 (default)

### Example configurations

#### Configuration using CMOS interface, 4 wire SPI (default)

Connect the evaluation board FMC to the FMC connector of Zedboard.

This specific command is equivalent to running "make" only:

```
make LVDS_CMOS_N=0 THREE_W_SPI=0
```

#### Configurations using LVDS interface

To build the LVDS interface - 4 wire SPI:

```
make LVDS_CMOS_N=1 THREE_W_SPI=0
```

To build the LVDS interface - 3 wire SPI:

```
make LVDS_CMOS_N=1 THREE_W_SPI=1
```

#### Configurations using LVDS interface

To build a specific part configuration:

```
make DEVICE=AD4851
```

Corresponding device trees:

- [zynq-zed-adv7511-ad4851-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4851-fmcz.dts)
- [zynq-zed-adv7511-ad4852-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4852-fmcz.dts)
- [zynq-zed-adv7511-ad4853-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4853-fmcz.dts)
- [zynq-zed-adv7511-ad4854-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4854-fmcz.dts)
- [zynq-zed-adv7511-ad4855-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4855-fmcz.dts)
- [zynq-zed-adv7511-ad4856-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4856-fmcz.dts)
- [zynq-zed-adv7511-ad4857-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4857-fmcz.dts)
- [zynq-zed-adv7511-ad4858-fmcz.dts](https://github.com/analogdevicesinc/linux/blob/main/arch/arm/boot/dts/zynq-zed-adv7511-ad4858-fmcz.dts)
24 changes: 20 additions & 4 deletions projects/ad485x_fmcz/zed/system_project.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ if [info exists ::env(LVDS_CMOS_N)] {
set env(LVDS_CMOS_N) $LVDS_CMOS_N
}

set THREE_W_SPI 0
if [info exists ::env(THREE_W_SPI)] {
set THREE_W_SPI $::env(THREE_W_SPI)
} else {
set env(THREE_W_SPI) $THREE_W_SPI
}

set DEVICE "AD4858"
if [info exists ::env(DEVICE)] {
set DEVICE $::env(DEVICE)
Expand All @@ -26,6 +33,7 @@ if [info exists ::env(DEVICE)] {
adi_project ad485x_fmcz_zed 0 [list \
LVDS_CMOS_N $LVDS_CMOS_N \
DEVICE $DEVICE \
THREE_W_SPI $THREE_W_SPI \
]

if {$LVDS_CMOS_N == "0"} {
Expand All @@ -42,15 +50,23 @@ if {$LVDS_CMOS_N == "0"} {
]
}
} else {
adi_project_files {} [list \
"system_top_lvds.v" \
"system_constr_lvds.xdc" \
]
if {$THREE_W_SPI == "0"} {
adi_project_files {} [list \
"system_top_lvds.v" \
"system_constr_lvds.xdc" \
]
} else {
adi_project_files {} [list \
"system_top_lvds_3w_spi.v" \
"system_constr_lvds.xdc" \
]
}
}

adi_project_files {} [list \
"$ad_hdl_dir/projects/common/zed/zed_system_constr.xdc" \
"$ad_hdl_dir/library/common/ad_iobuf.v" \
"$ad_hdl_dir/library/common/ad_3w_spi.v" \
]

adi_project_run ad485x_fmcz_zed
Loading
Loading