Wiki

This version (28 Oct 2021 13:27) was approved by Andrei Drimbarean.The Previously approved version (28 Apr 2020 10:16) is available.Diff

AD7134 No-OS Software

Introduction

This document describes the No-OS software used to control the AD7134 and AD4134 parts and includes an example of how to initialize a AD7134 part.

Overview

The AD7134/ AD4134 24-bit, 4-channel simultaneous sampling 1.5MSPS, precision, alias free ADC. It contains a continuous time Σ-Δ modulation technology that does not use sample-and-hold circuitry to alleviate the side effects introduced by it, like charge kickback and signal aliasing. This inherent alias rejection is up to 100dB.

The device has an asynchronous sample rate converter used to synchronize two or more devices using only a signal line. To do this one of the devices will generate the synchronization signal while the others will receive it. This also allows for freely programmable data rates from 10SPS up to 1.496MSPS.

It has excellent AC and DC performance with 107dB dynamic for the FIR filter at 374kSPS and 138dB dynamic range for the sinc3 filter at 10SPS. The offset drift is 1.5uV/°C, gain drift of 2ppm/°C and INL of ±2.5ppm.

It can be powered from a 4.5V to 5.5V power supply and a 1.65V to 1.95V digital power supply for 1.8V I/O level. It can have external voltage reference of 2.5V, 4.096V and 5V and a crystal or CMOS external clock of 48MHz. The device can be configured and controlled by GPIOs or SPI. It has temperature operating range between 0°C and 85°C.

Applications:

  • Electrical test and measurement;
  • Audio test;
  • 3-phase power quality analysis;
  • Control and hardware in loop verification;
  • Sonar;
  • Condition and monitoring for predictive maintenance;
  • Acoustic and material science research and development.

Supported Devices

Evaluation Boards

Driver Description

The driver itself is generic and can be used with any controller, but the controller must implement the serial communication and the GPIO control. These platform drivers are the connection between the driver and the hardware and hide the actual details of the communication protocol from the ADI driver. The platform drivers functions called by the AD7134 driver are:

  • spi_init() - initialize the controller's SPI peripheral.
  • spi_remove() - free the memory allocated by spi_init().
  • spi_write_and_read() - do a SPI transmission.
  • gpio_get_optional() - initialize a GPIO if it's ID is provided.
  • gpio_remove() - free memory allocated by gpio_get_optional().
  • gpio_direction_output() - set GPIO as digital output and set the output level.

SPI platform driver architecture

The AD7134 driver contains the following:

  • AD714.h - Header file of the driver. Contains the driver function declarations, custom data types to be used by the driver and driver specific constants.
  • AD7134.c - Implementation file of the driver. Contains the implementations of the driver functions.

The following functions are implemented as API in this version of AD7134 driver:

Function Description
int32_t ad713x_spi_reg_read(struct ad713x_dev *dev,
       uint8_t reg_addr,
       uint8_t *reg_data)
Read from device.
int32_t ad713x_spi_reg_write(struct ad713x_dev *dev,
        uint8_t reg_addr,
        uint8_t reg_data)
Write to device.
int32_t ad713x_spi_write_mask(struct ad713x_dev *dev,
        uint8_t reg_addr,
        uint32_t mask,
        uint8_t data)
SPI write to device using a mask.
int32_t ad713x_set_power_mode(struct ad713x_dev *dev,
        enum ad713x_power_mode mode)
Device power mode control.
int32_t ad713x_set_out_data_frame(struct ad713x_dev *dev,
        enum ad713x_adc_data_len adc_data_len,
        enum ad713x_crc_header crc_header)
ADC conversion data output frame control.
int32_t ad713x_dout_format_config(struct ad713x_dev *dev,
        enum ad713x_doutx_format format)
DOUTx output format configuration.
int32_t ad713x_mag_phase_clk_delay(struct ad713x_dev *dev,
        bool clk_delay_en)
Magnitude and phase at 2 clock delay.
int32_t ad713x_dig_filter_sel_ch(struct ad713x_dev *dev,
        enum ad713x_dig_filter_sel filter,
        enum ad713x_channels ch)
Digital filter type selection for each channel.
int32_t ad713x_clkout_output_en(struct ad713x_dev *dev,
        bool enable)
Enable/Disable CLKOUT output.
int32_t ad713x_ref_gain_correction_en(struct ad713x_dev *dev,
        bool enable)
Enable/Disable reference gain correction.
int32_t ad713x_wideband_bw_sel(struct ad713x_dev *dev,
        enum ad713x_channels ch,
        uint8_t wb_opt)
Select the wideband filter bandwidth for a channel.
int32_t ad713x_init(struct ad713x_dev **device,
        struct ad713x_init_param *init_param)
Initialize the device.
int32_t ad713x_remove(struct ad713x_dev *dev)
Free the resources allocated by ad713x_init().

The driver has to be instantiated by using an initialization structure with the following composition:

/**
 * @struct ad713x_init_param
 * @brief AD713x driver initialization structure
 */
struct ad713x_init_param {
	/** SPI layer initialization structure. */
	struct spi_init_param spi_init_prm;
	/** MODE GPIO initialization structure. */
	struct gpio_init_param *gpio_mode;
	/** DCLKMODE GPIO initialization structure. */
	struct gpio_init_param *gpio_dclkmode;
	/** DCLKIO GPIO initialization structure. */
	struct gpio_init_param *gpio_dclkio;
	/** RESET GPIO initialization structure. */
	struct gpio_init_param *gpio_resetn;
	/** PDN GPIO initialization structure. */
	struct gpio_init_param *gpio_pnd;
	/** MODE GPIO starting value */
	bool mode_master_nslave;
	/** DCLKMODE GPIO starting value */
	bool dclkmode_free_ngated;
	/** DCLKIO GPIO starting value */
	bool dclkio_out_nin;
	/** PDN GPIO starting value */
	bool pnd;
	/** ID of supported device. */
	enum ad713x_supported_dev_ids dev_id;
	/** Length of data in bits. */
	enum ad713x_adc_data_len	adc_data_len;
	/** CRC option. */
	enum ad713x_crc_header	crc_header;
	enum ad713x_doutx_format	format;
	/** Clock delay state. */
	bool 			clk_delay_en;
	/** SPI layer handler if the SPI bus is shared with another device. In this
	 *  case the SPI should not be initialized again. */
	struct spi_desc *spi_common_dev;
};

Downloads

Using the API

The following link shows an example of using the driver with two devices working in tandem with a Xilinx platform: https://github.com/analogdevicesinc/no-OS/blob/master/projects/ad713x_fmcz/src/ad713x_fmc.c

More information

01 Jun 2012 12:17
resources/tools-software/uc-drivers/ad713x.txt · Last modified: 28 Oct 2021 13:26 by Andrei Drimbarean