Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:eval:user-guides:ad7616-sdz [28 Aug 2019 09:28] – Fixed HDL Download link Stanca-Florina Popresources:eval:user-guides:ad7616-sdz [26 Jan 2024 11:55] (current) – Fix SDP-K1 intro sentence Esteban Blanc
Line 21: Line 21:
   * [[adi>EVAL-AD7616]]   * [[adi>EVAL-AD7616]]
  
-==== Supported carrier ====+==== Supported Carriers ====
   * [[xilinx>ZC706]]   * [[xilinx>ZC706]]
-  * [[http://www.xilinx.com/products/boards-and-kits/1-8dyf-11.html|ZedBoard]] +  * [[xilinx>products/boards-and-kits/1-8dyf-11.html|ZedBoard]] 
 +  * [[adi>SDP-K1]]
 ==== Other required hardware ==== ==== Other required hardware ====
-  * [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-SDP-I-FMC.html|SDP-I-FMC]]+  * [[adi>en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-SDP-I-FMC.html|SDP-I-FMC]] when using Zedboard 
 +  * [[https://www.st.com/en/development-tools/stlink-v3set.html | STLINK-V3]] when using SDP-K1 
 + 
 +===== Zedboard setup ===== 
 + 
 +==== EVAL-AD7616 Jumper setup ==== 
 + 
 +^ Jumper/Solder link ^ Position ^ Description ^ 
 +| SL1  | Unmounted | Channel Sequencer Enable | 
 +| SL2  | Unmounted | RC Enable Input | 
 +| SL3  | Mounted   | Selects 2 MISO mode | 
 +| SL4  | Unmounted | Oversampling Ratio Selection OS2 | 
 +| SL5  | Mounted   | If mounted, selects serial interface | 
 +| SL6  | Unmounted | Oversampling Ratio Selection OS1 | 
 +| SL7  | Unmounted | Oversampling Ratio Selection OS0 | 
 +| LK40 | A         | Onboard 5v0 power supply selected | 
 +| LK41 | A         | Onboard 3v3 power supply selected | 
 + 
 +==== Block Diagrams ==== 
 +  * AD7616_SDZ using the **SERIAL** interface 
 +{{:resources:eval:user-guides:ad7616_serial_hdl.svg?800|AD7616_SDZ with Serial Interface}} 
 +   * AD7616_SDZ using the **PARALLEL** interface 
 +{{:resources:eval:user-guides:ad7616_parallel_hdl.svg?800|AD7616_SDZ with Parallel Interface}}
  
 ==== Required software ==== ==== Required software ====
Line 31: Line 54:
   * An UART terminal (Tera Term/Hyperterminal), baud rate set to 115200.   * An UART terminal (Tera Term/Hyperterminal), baud rate set to 115200.
  
-===== Using the HDL reference design =====+==== Using the HDL reference design ====
  
 In the [[:resources/fpga/docs/hdl|ADI Reference Designs HDL User Guide]] can be found an in-depth presentation and instructions about the HDL design in general. In the [[:resources/fpga/docs/hdl|ADI Reference Designs HDL User Guide]] can be found an in-depth presentation and instructions about the HDL design in general.
Line 38: Line 61:
  
 The data path of the HDL design is simple as follows:  The data path of the HDL design is simple as follows: 
-  * the serial or parallel interface is controlled by the axi_ad7616 IP core+  * the parallel interface is controlled by the axi_ad7616 IP core 
 +  * the serial interface is controlled by the SPI Engine Framework
   * data is written into memory by a DMA (axi_dmac core)   * data is written into memory by a DMA (axi_dmac core)
   * all the control pins of the device are driven by GPIO's   * all the control pins of the device are driven by GPIO's
Line 48: Line 72:
   - Build the project (see https://wiki.analog.com/resources/fpga/docs/build)   - Build the project (see https://wiki.analog.com/resources/fpga/docs/build)
  
-==== Switching between interface types ====+=== Switching between interface types ===
  
-Before power-up the board, the user has to choose the required device interface and setup, in function of the required interface mode some hardware modification needs to be done on the board and/or Tcl script:+Before the board power-up, the user has to choose the required device interface and setup. Depending on the required interface modesome hardware modifications need to be done on the board and/or Tcl script:
  
-1) In case of the **SERIAL** interface:+In case of the **SERIAL** interface:
  
-   * open //**system_project.tcl**// and set:+<code c> 
 +$ make SER_PAR_N=1 
 +</code> 
 + 
 +In case of the **PARALLEL** interface:
  
 <code c> <code c>
-set ad7616_if 0+$ make SER_PAR_N=0
 </code> </code>
  
-  * Short the **SL5** on the board. (It is on the front side of the board, near of the device) +<note important>Because of the **SDP-I-FMC** the level of the **VADJ** in the carrier board needs to be set to **3.3V**.</note>
-  To activate both SDI line, short the **SL3** on the back of the board+
  
-2) In case of the **PARALLEL** interface:+=== CPU/Memory interconnects addresses === 
 + 
 +^ Instance             ^ Address    ^ 
 +|axi_ad7616_dma        | 0x44a30000 | 
 +|ad7616_pwm_gen        | 0x44b00000 | 
 +|spi_ad7616_axi_regmap | 0x44a00000 | 
 +|axi_ad7616            | 0x44a80000 | 
 + 
 +Note:  
 +  *  spi_ad7616 is instantiated only for SER_PAR_N=1  
 +  *  axi_ad7616 is instantiated only for SER_PAR_N=0 
 + 
 +=== PL Interrupts === 
 + 
 +^ Instance              ^ HDL interrupt ^ Linux PsU interrupt 
 +| ---                   | 0             | 89                   | 
 +| ---                   | 1             | 90                   | 
 +| ---                               | 91                   | 
 +| ---                   | 3             | 92                   | 
 +| ---                   | 4             | 93                   | 
 +| ---                   | 5             | 94                   | 
 +| ---                   | 6             | 95                   | 
 +| ---                   | 7             | 96                   | 
 +| ---                   | 8             | 104                  | 
 +| ---                   | 9             | 105                  | 
 +| axi_ad7616            | 10            | 106                  | 
 +| ---                   | 11            | 107                  | 
 +| spi_ad7616            | 12            | 108                  |  
 +| axi_ad7616_dma        | 13            | 109                  | 
 +| ---                   | 14            | 110                  | 
 +| ---                   | 15            | 111                  | 
 + 
 +Note:  
 +  *  spi_ad7616 is instantiated only for SER_PAR_N=1  
 +  *  axi_ad7616 is instantiated only for SER_PAR_N=0 
 + 
 + 
 +=== GPIO signals === 
 + 
 +Ps7 EMIO offset = 54 
 + 
 +^ GPIO Signal       ^ GPIO  ^ HDL GPIO EMIOn^ 
 +| adc_reset_n       | 97      | 43            | 
 +| adc_hw_rngsel     | 96-95   | 42-41         | 
 +| adc_os            | 94-92   | 40-38         | 
 +| adc_seq_en        | 91      | 37            | 
 +| adc_burst         | 90      | 36            | 
 +| adc_chsel         | 89-87   | 35-33         | 
 +| adc_crcen         | 86      | 32            | 
 + 
 +==== Create the SDK Project ==== 
 + 
 +To run the application the user has to create an **Empty Application Project** using Xilinx SDK, and have to copy all the [[https://github.com/analogdevicesinc/no-OS/tree/master/projects/ad7616-sdz/src|design sources]] to the **sw** directory. (see [[/resources/fpga/xilinx/software_setup|SDK Software Setup]] for more detailed instructions). In order to build the No-OS project, refer to the [[resources:no-os:build|No-OS build guide]]. 
 + 
 +==== HDL Downloads ==== 
 +<WRAP round download 50%> 
 +  * {{https://github.com/analogdevicesinc/hdl/tree/master/projects/ad7616_sdz|AD7616-SDZ HDL Project.}} 
 +</WRAP> 
 + 
 +==== No-OS Downloads ==== 
 +<WRAP round download 50%> 
 +  * {{https://github.com/analogdevicesinc/no-OS/tree/master/projects/ad7616-sdz|AD7616-SDZ No-OS Project.}} 
 +</WRAP> 
 + 
 +===== SDP-K1 setup ===== 
 + 
 +{{ :resources:eval:user-guides:ad7616_sdp-k1_setup.jpg?nolink&800 |}} 
 + 
 +[[adi>EVAL-AD7616]] is connected to [[adi>SDP-K1]] via fly-wire. In order to flash the SDP-K1, an [[https://www.st.com/en/development-tools/stlink-v3set.html | STLINK-V3]] is required 
 +<note warning>Make sure to power both [[adi>EVAL-AD7616]] and [[adi>SDP-K1]] via the barrel jack connector</note> 
 + 
 +==== EVAL-AD7616 Jumper setup ==== 
 + 
 +^ Jumper/Solder link ^ Position ^ Description ^ 
 +| SL1  | Unmounted | Channel Sequencer Enable | 
 +| SL2  | Unmounted | RC Enable Input | 
 +| SL3  | Unmounted | Selects 1 MISO mode | 
 +| SL4  | Unmounted | Oversampling Ratio Selection OS2 | 
 +| SL5  | Mounted   | If mounted, selects serial interface 
 +| SL6  | Unmounted | Oversampling Ratio Selection OS1 | 
 +| SL7  | Unmounted | Oversampling Ratio Selection OS0 | 
 +| LK40 | A         | Onboard 5v0 power supply selected | 
 +| LK41 | A         | Onboard 3v3 power supply selected | 
 + 
 +==== Fly-wire connection ==== 
 +| [[adi>EVAL-AD7616]] | [[adi>SDP-K1]] Arduino | 
 +| SCLK      | D13 | 
 +| DB10/SDI  | D11 | 
 +| DB12/SDOA | D12 | 
 +| CS        | D10 | 
 +| CONVST    | D5  | 
 +| RESET     | D7  | 
 +| BUSY      | D6  | 
 + 
 +==== No-OS Downloads ==== 
 +<WRAP round download 50%> 
 +  * {{https://github.com/analogdevicesinc/no-OS/tree/main/projects/ad7616-st|AD7616-ST No-OS Project.}} 
 +</WRAP> 
 + 
 +==== No-OS project build ==== 
 +To build the project, just run:
 <code c> <code c>
-set ad7616_if 1+$ make
 </code> </code>
  
-   * No hardware modification required for this interface mode.+To flash, run: 
 +<code c> 
 +$ make run 
 +</code>
  
-<note important>Because of the **SDP-I-FMC** the level of the **VADJ** in the carrier board needs to be set to **3.3V**.</note>+The project provides an iio device over the serial interface. The baudrate used is 230400. You can use the [[resources:tools-software:linux-software:iio_oscilloscope|IIO Oscilloscope]] to view the captured data. 
 + 
 +For further details, refer to the [[resources:no-os:build|No-OS build guide]]. 
 +
 ===== No-OS Driver Description ===== ===== No-OS Driver Description =====
 +
 +Each setup have its own project but they there one common [[repo>no-OS/tree/master/drivers/adc/ad7616 | driver]]
  
 ==== Functions Declarations ==== ==== Functions Declarations ====
Line 88: Line 223:
 |<code c>int32_t ad7616_set_mode(ad7616_dev *dev, ad7616_mode mode);</code>| Set the operation mode (software or hardware). | |<code c>int32_t ad7616_set_mode(ad7616_dev *dev, ad7616_mode mode);</code>| Set the operation mode (software or hardware). |
 |<code c>int32_t ad7616_set_oversampling_ratio(ad7616_dev *dev, ad7616_osr osr);</code>| Set the oversampling ratio. | |<code c>int32_t ad7616_set_oversampling_ratio(ad7616_dev *dev, ad7616_osr osr);</code>| Set the oversampling ratio. |
 +|<code c>int32_t ad7616_read_data_serial(struct ad7616_dev *dev, struct ad7616_conversion_result *results, uint32_t samples);</code>|Read data in serial mode.|
 |<code c>int32_t ad7616_setup(ad7616_dev **device, adc_core *core, ad7616_init_param init_param);</code>| Initialize the device. | |<code c>int32_t ad7616_setup(ad7616_dev **device, adc_core *core, ad7616_init_param init_param);</code>| Initialize the device. |
 +|<code c>int32_t ad7616_read_channel_source(struct ad7616_dev *dev, enum ad7616_ch *ch_a, enum ad7616_ch *ch_b);</code>| Read currently selected channel input sources. |
 +|<code c>int32_t ad7616_select_channel_source(struct ad7616_dev *dev, enum ad7616_ch ch);</code>| Select the input source for a channel. |
 +|<code c>int32_t ad7616_setup_sequencer(struct ad7616_dev *dev, struct ad7616_sequencer_layer *layers, uint32_t layers_nb, uint8_t burst);</code>| Setup sequencer with given layers. |
 +|<code c>int32_t ad7616_disable_sequencer(struct ad7616_dev *dev);</code>| Disable the sequencer. |
  
 ==== Types Declarations ==== ==== Types Declarations ====
  
 |<code c> |<code c>
-typedef enum { +enum ad7616_mode 
-    AD7616_SW, + AD7616_SW, 
-    AD7616_HW, + AD7616_HW, 
-ad7616_mode;+};
  
-typedef enum { +enum ad7616_interface 
-    AD7616_SERIAL, + AD7616_SERIAL, 
-    AD7616_PARALLEL, + AD7616_PARALLEL, 
-ad7616_interface;+};
  
-typedef enum { +enum ad7616_ch 
-    AD7616_VA0, + AD7616_VA0, 
-    AD7616_VA1, + AD7616_VA1, 
-    AD7616_VA2, + AD7616_VA2, 
-    AD7616_VA3, + AD7616_VA3, 
-    AD7616_VA4, + AD7616_VA4, 
-    AD7616_VA5, + AD7616_VA5, 
-    AD7616_VA6, + AD7616_VA6, 
-    AD7616_VA7, + AD7616_VA7, 
-    AD7616_VB0, + AD7616_VA_VCC, 
-    AD7616_VB1, + AD7616_VA_ALDO, 
-    AD7616_VB2, + AD7616_VA_RESERVED1, 
-    AD7616_VB3, + AD7616_VA_SELF_TEST, 
-    AD7616_VB4, + AD7616_VA_RESERVED2, 
-    AD7616_VB5, + AD7616_VB0, 
-    AD7616_VB6, + AD7616_VB1, 
-    AD7616_VB7, + AD7616_VB2, 
-ad7616_ch;+ AD7616_VB3, 
 + AD7616_VB4, 
 + AD7616_VB5, 
 + AD7616_VB6, 
 + AD7616_VB7
 + AD7616_VB_VCC, 
 + AD7616_VB_ALDO, 
 + AD7616_VB_RESERVED1, 
 + AD7616_VB_SELF_TEST, 
 + AD7616_VB_RESERVED2
 +};
  
-typedef enum { +enum ad7616_range 
-    AD7616_2V5 = 1, + AD7616_2V5 = 1, 
-    AD7616_5V  = 2, + AD7616_5V  = 2, 
-    AD7616_10V = 3, + AD7616_10V = 3, 
-ad7616_range;+};
  
-typedef enum { +enum ad7616_osr 
-    AD7616_OSR_0, + AD7616_OSR_0, 
-    AD7616_OSR_2, + AD7616_OSR_2, 
-    AD7616_OSR_4, + AD7616_OSR_4, 
-    AD7616_OSR_8, + AD7616_OSR_8, 
-    AD7616_OSR_16, + AD7616_OSR_16, 
-    AD7616_OSR_32, + AD7616_OSR_32, 
-    AD7616_OSR_64, + AD7616_OSR_64, 
-    AD7616_OSR_128, + AD7616_OSR_128, 
-ad7616_osr;+};
  
-typedef struct { +struct ad7616_dev 
-    /* SPI */ + /* SPI */ 
-    spi_device          spi_dev+ struct no_os_spi_desc *spi_desc; 
-    /* GPIO */ + struct spi_engine_offload_init_param *offload_init_param; 
-    gpio_device         gpio_dev; + uint32_t reg_access_speed; 
-    int8_t              gpio_hw_rngsel0; + uint8_t crc
-    int8_t              gpio_hw_rngsel1; + /* GPIO */ 
-    int8_t              gpio_reset; + struct no_os_gpio_desc *gpio_hw_rngsel0; 
-    int8_t              gpio_os0; + struct no_os_gpio_desc *gpio_hw_rngsel1; 
-    int8_t              gpio_os1; + struct no_os_gpio_desc *gpio_reset; 
-    int8_t              gpio_os2; + struct no_os_gpio_desc *gpio_os0; 
-    /* Device Settings */ + struct no_os_gpio_desc *gpio_os1; 
-    ad7616_interface    interface; + struct no_os_gpio_desc *gpio_os2; 
-    ad7616_mode         mode; + struct no_os_gpio_desc *gpio_convst; 
-    ad7616_range        va[8]; + struct no_os_gpio_desc *gpio_busy; 
-    ad7616_range        vb[8]; + /* AXI Core */ 
-    ad7616_osr          osr; + uint32_t core_baseaddr; 
-    adc_core            *core+ /* Device Settings */ 
-ad7616_dev;+ enum ad7616_interface interface; 
 + enum ad7616_mode mode; 
 + enum ad7616_range va[8]; 
 + enum ad7616_range vb[8]; 
 + enum ad7616_osr osr; 
 + void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count); 
 + /* Sequencer and burst mode */ 
 + uint8_t layers_nb
 +};
  
-typedef struct { +struct ad7616_init_param 
-    /* SPI */ + /* SPI */ 
-    uint8_t             spi_chip_select+ struct no_os_spi_init_param *spi_param
-    spi_mode            spi_mode+ struct spi_engine_offload_init_param *offload_init_param
-    spi_type            spi_type+ uint32_t reg_access_speed
-    uint32_t            spi_device_id+ uint8_t crc
-    /* GPIO */ + /* GPIO */ 
-    gpio_type           gpio_type+ struct no_os_gpio_init_param *gpio_hw_rngsel0_param
-    uint32_t            gpio_device_id+ struct no_os_gpio_init_param *gpio_hw_rngsel1_param
-    int8_t              gpio_hw_rngsel0+ struct no_os_gpio_init_param *gpio_reset_param
-    int8_t              gpio_hw_rngsel1+ struct no_os_gpio_init_param *gpio_os0_param
-    int8_t              gpio_reset+ struct no_os_gpio_init_param *gpio_os1_param
-    int8_t              gpio_os0+ struct no_os_gpio_init_param *gpio_os2_param
-    int8_t              gpio_os1+ struct no_os_gpio_init_param *gpio_convst_param
-    int8_t              gpio_os2+ struct no_os_gpio_init_param *gpio_busy_param; 
-    /* Device Settings */ + /* Core */ 
-    ad7616_mode         mode; + uint32_t core_baseaddr
-    ad7616_range        va[8]; + /* Device Settings */ 
-    ad7616_range        vb[8]; + enum ad7616_mode mode; 
-    ad7616_osr          osr; + enum ad7616_range va[8]; 
-} ad7616_init_param+ enum ad7616_range vb[8]; 
-</code>|+ enum ad7616_osr osr; 
 + void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
 +};
  
-===== Create the SDK Project =====+struct ad7616_conversion_result { 
 + uint16_t channel_a; 
 + uint16_t channel_b; 
 +};
  
-To run the application the user has to create a**Empty Application Project** using Xilinx SDK, and have to copy all the [[https://github.com/analogdevicesinc/no-OS/tree/2016_R2/ad7616-sdz|design sources]] to the **sw** directory. (see [[https://wiki.analog.com/resources/fpga/xilinx/software_setup|SDK Software Setup]] for more detailed instructions)+struct ad7616_sequencer_layer { 
 + enum ad7616_ch ch_a; 
 + enum ad7616_ch ch_b; 
 +}; 
 +</code>|
  
 +===== No-OS IIO Driver Description =====
 +==== Functions Declarations ====
 +^ Function       ^ Description     ^
 +|<code c>int ad7616_iio_init(struct ad7616_iio_dev **dev, struct ad7616_init_param *init_param);</code>| Initialize AD7616 for IIO interfacing |
 +|<code c>int ad7616_iio_remove(struct ad7616_iio_dev *dev);</code>| Remove AD7616 |
  
-===== HDL Downloads ===== +==== Types Declarations ==== 
-<WRAP round download 50%+<code c
-  {{https://github.com/analogdevicesinc/hdl/tree/master/projects/ad7616_sdz|AD7616-SDZ HDL Project.}} +struct ad7616_iio_dev 
-</WRAP> + struct ad7616_dev *ad7616_dev; 
- + struct iio_device *iio_dev; 
-===== No-OS Downloads ===== +}; 
-<WRAP round download 50%> +</code>
-  * {{https://github.com/analogdevicesinc/no-OS/tree/2016_R1/ad7616-sdz|AD7616-SDZ No-OS Project.}+
-</WRAP>+
  
 ===== Support ===== ===== Support =====
Line 201: Line 371:
 <WRAP round help 80%> <WRAP round help 80%>
 **Questions?** Feel free to ask your questions in EngineerZone support forums. **Questions?** Feel free to ask your questions in EngineerZone support forums.
-  * [[https://ez.analog.com/community/fpga|FPGA Reference Design]] +  * [[ez>community/fpga|FPGA Reference Design]] 
-  * [[https://ez.analog.com/community/linux-device-drivers/microcontroller-no-os-drivers|Microcontroller no-OS Drivers]].+  * [[ez>community/linux-device-drivers/microcontroller-no-os-drivers|Microcontroller no-OS Drivers]].
 </WRAP> </WRAP>
resources/eval/user-guides/ad7616-sdz.1566977304.txt.gz · Last modified: 28 Aug 2019 09:28 by Stanca-Florina Pop