Skip to content

Commit

Permalink
V2: Add i2c por for evb eeprom
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Nov 5, 2024
1 parent f30f854 commit dc00ba9
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 19 deletions.
8 changes: 8 additions & 0 deletions projects/ad4052_ardz/common/ad4052_bd.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

create_bd_port -dir O adc_cnv
create_bd_intf_port -mode Master -vlnv analog.com:interface:spi_engine_rtl:1.0 adc_spi
create_bd_intf_port -mode Master -vlnv xilinx.com:interface:iic_rtl:1.0 iic_eeprom

source $ad_hdl_dir/library/spi_engine/scripts/spi_engine.tcl

set data_width 32
Expand All @@ -28,6 +30,8 @@ ad_ip_instance axi_pwm_gen adc_trigger_gen
ad_ip_parameter adc_trigger_gen CONFIG.PULSE_0_PERIOD 120
ad_ip_parameter adc_trigger_gen CONFIG.PULSE_0_WIDTH 1

ad_ip_instance axi_iic axi_iic_eeprom

# dma to receive data stream
ad_ip_instance axi_dmac axi_adc_dma
ad_ip_parameter axi_adc_dma CONFIG.DMA_TYPE_SRC 1
Expand Down Expand Up @@ -71,14 +75,18 @@ ad_connect spi_clk axi_adc_dma/s_axis_aclk
ad_connect sys_cpu_resetn $hier_spi_engine/resetn
ad_connect sys_cpu_resetn axi_adc_dma/m_dest_axi_aresetn

ad_connect iic_eeprom axi_iic_eeprom/iic

ad_cpu_interconnect 0x44a00000 $hier_spi_engine/${hier_spi_engine}_axi_regmap
ad_cpu_interconnect 0x44a30000 axi_adc_dma
ad_cpu_interconnect 0x44a40000 axi_iic_eeprom
ad_cpu_interconnect 0x44a70000 spi_clkgen
ad_cpu_interconnect 0x44b00000 adc_trigger_gen

ad_cpu_interrupt "ps-14" "mb-14" intr_slice_0/Dout
ad_cpu_interrupt "ps-13" "mb-13" axi_adc_dma/irq
ad_cpu_interrupt "ps-12" "mb-12" /$hier_spi_engine/irq
ad_cpu_interrupt "ps-11" "mb-11" axi_iic_eeprom/iic2intc_irpt

ad_mem_hp1_interconnect $sys_cpu_clk sys_ps7/S_AXI_HP1
ad_mem_hp1_interconnect $sys_cpu_clk axi_adc_dma/m_dest_axi
18 changes: 10 additions & 8 deletions projects/ad4052_ardz/common/eval_ad4052_ardz.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Header/Pin Port Schematic_name System_top_name IOSTANDARD Termination
Header/Pin Schematic_name Device.Pin System_top_name IOSTANDARD Termination

# eval_ad4052_ardz

P3.6 SCLK_ARD SCLK adc_spi_sclk LVCMOS33 IOB TRUE
P3.5 MISO_ARD SDO adc_spi_sdi LVCMOS33 IOB TRUE
P3.4 MOSI_ARD SDI adc_spi_sdo LVCMOS33 IOB TRUE
P3.3 CSB_ARD CSB adc_spi_cs LVCMOS33 IOB TRUE
P4.7 CNV_ARD CNV adc_spi_cnv LVCMOS33 IOB TRUE
P3.2 D9_ARD GP0 adc_spi_gpio0 LVCMOS33 #N/A
P3.1 D8_ARD GP1 adc_spi_gpio1 LVCMOS33 #N/A
P3.10 SCL_ARD EEPROM.SCL iic_eeprom_scl LVCMOS33 #N/A
P3.9 SDA_ARD EEPROM.SDA iic_eeprom_sda LVCMOS33 #N/A
P3.6 SCLK_ARD AD4052.SCLK adc_spi_sclk LVCMOS33 IOB TRUE
P3.5 MISO_ARD AD4052.SDO adc_spi_sdi LVCMOS33 IOB TRUE
P3.4 MOSI_ARD AD4052.SDI adc_spi_sdo LVCMOS33 IOB TRUE
P3.3 CSB_ARD AD4052.CSB adc_spi_cs LVCMOS33 IOB TRUE
P4.7 CNV_ARD AD4052.CNV adc_spi_cnv LVCMOS33 IOB TRUE
P3.2 D9_ARD AD4052.GP0 adc_spi_gpio0 LVCMOS33 #N/A
P3.1 D8_ARD AD4052.GP1 adc_spi_gpio1 LVCMOS33 #N/A
16 changes: 9 additions & 7 deletions projects/ad4052_ardz/coraz7s/system_constr.xdc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
###############################################################################

# ADC SPI interface
set_property -dict {PACKAGE_PIN G15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sclk] ; ## Arduino_IO13
set_property -dict {PACKAGE_PIN J18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdi] ; ## Arduino_IO12
set_property -dict {PACKAGE_PIN K18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdo] ; ## Arduino_IO11
set_property -dict {PACKAGE_PIN U15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_cs] ; ## Arduino_IO10
set_property -dict {PACKAGE_PIN R17 IOSTANDARD LVCMOS33} [get_ports adc_cnv] ; ## Arduino_IO06
set_property -dict {PACKAGE_PIN M18 IOSTANDARD LVCMOS33} [get_ports adc_gp0] ; ## Arduino_IO09
set_property -dict {PACKAGE_PIN N18 IOSTANDARD LVCMOS33} [get_ports adc_gp1] ; ## Arduino_IO08
set_property -dict {PACKAGE_PIN P16 IOSTANDARD LVCMOS33} [get_ports iic_eeprom_scl] ; ## Arduino_SCL
set_property -dict {PACKAGE_PIN P15 IOSTANDARD LVCMOS33} [get_ports iic_eeprom_sda] ; ## Arduino_SDA
set_property -dict {PACKAGE_PIN G15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sclk] ; ## Arduino_IO13
set_property -dict {PACKAGE_PIN J18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdi] ; ## Arduino_IO12
set_property -dict {PACKAGE_PIN K18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdo] ; ## Arduino_IO11
set_property -dict {PACKAGE_PIN U15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_cs] ; ## Arduino_IO10
set_property -dict {PACKAGE_PIN R17 IOSTANDARD LVCMOS33} [get_ports adc_cnv] ; ## Arduino_IO06
set_property -dict {PACKAGE_PIN M18 IOSTANDARD LVCMOS33} [get_ports adc_gp0] ; ## Arduino_IO09
set_property -dict {PACKAGE_PIN N18 IOSTANDARD LVCMOS33} [get_ports adc_gp1] ; ## Arduino_IO08

# rename auto-generated clock for SPIEngine to spi_clk - 160MHz
# NOTE: clk_fpga_0 is the first PL fabric clock, also called $sys_cpu_clk
Expand Down
13 changes: 9 additions & 4 deletions projects/ad4052_ardz/coraz7s/system_top.v
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,19 @@ module system_top (
inout fixed_io_ps_porb,
inout fixed_io_ps_srstb,

inout [ 1:0] btn,
inout [ 5:0] led,

inout iic_eeprom_scl,
inout iic_eeprom_sda,

output adc_spi_sclk,
input adc_spi_sdi,
output adc_spi_sdo,
output adc_spi_cs,
output adc_cnv,
inout adc_gp0,
inout adc_gp1,

inout [ 1:0] btn,
inout [ 5:0] led
inout adc_gp1
);

// internal signals
Expand Down Expand Up @@ -155,6 +158,8 @@ module system_top (
.spi1_sdi_i (1'b0),
.spi1_sdo_i (1'b0),
.spi1_sdo_o (),
.iic_eeprom_scl_io(iic_eeprom_scl),
.iic_eeprom_sda_io(iic_eeprom_sda),
.adc_spi_sclk(adc_spi_sclk),
.adc_spi_sdi(adc_spi_sdi),
.adc_spi_sdo(adc_spi_sdo),
Expand Down
9 changes: 9 additions & 0 deletions projects/ad4052_ardz/de10nano/system_project.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ adi_project ad4052_ardz_de10nano

source $ad_hdl_dir/projects/common/de10nano/de10nano_system_assign.tcl

# eeprom

set_location_assignment PIN_AH9 -to i2c_sda ; ## Arduino_SDA
set_location_assignment PIN_AG11 -to i2c_scl ; ## Arduino_SCL

# ad4052 interface

set_location_assignment PIN_AH12 -to adc_spi_sclk ; ## Arduino_IO13
Expand All @@ -22,6 +27,10 @@ set_location_assignment PIN_AG8 -to adc_cnv ; ## Arduino_IO06
set_location_assignment PIN_AE15 -to adc_gp0 ; ## Arduino_IO09
set_location_assignment PIN_AF17 -to adc_gp1 ; ## Arduino_IO08


set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to i2c_scl
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to i2c_sda

set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to adc_spi_sclk
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to adc_spi_sdi
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to adc_spi_sdo
Expand Down
15 changes: 15 additions & 0 deletions projects/ad4052_ardz/de10nano/system_top.v
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ module system_top (
inout hdmi_i2c_scl,
inout hdmi_i2c_sda,

inout i2c_sda,
inout i2c_scl,

// ad4052

output adc_spi_sclk,
Expand Down Expand Up @@ -157,6 +160,18 @@ module system_top (

// IO Buffers for I2C

ALT_IOBUF scl_iobuf (
.i(1'b0),
.oe(i2c1_scl_oe),
.o(i2c1_scl),
.io(i2c_scl));

ALT_IOBUF sda_iobuf (
.i(1'b0),
.oe(i2c1_sda_oe),
.o(i2c1_sda),
.io(i2c_sda));

ALT_IOBUF scl_video_iobuf (
.i(1'b0),
.oe(i2c0_out_clk),
Expand Down

0 comments on commit dc00ba9

Please sign in to comment.