text: This document describes the No-OS software used to control the AD7124 part and includes an example of how to initialize a AD7124 part.
  The AD7124 is a low power, low noise, completely integrated analog front end for high precision measurement applications. The device contains a low noise, 24-bit Σ-Δ analog-to-digital converter (ADC).
  AD7124-4 4 differential / 7 single-ended inputs, 24-lead TSSOP / 32-lead LFCSP
  AD7124-8 8 differential / 15 single-ended inputs, 32-lead LFCSP
  The on-chip low gain stage ensures that signals of small amplitude can be interfaced directly to the ADC.
  One of the major advantages of the AD7124 is that it gives the user the flexibility to employ one of three integrated power modes. The current consumption, range of output data rates, and rms noise can be tailored with the power mode selected. The device also offers a multitude of filter options, ensuring that the user has the highest degree of flexibility.
  The AD7124 can achieve simultaneous 50 Hz and 60 Hz rejection when operating at an output data rate of 25 SPS (single cycle settling), with rejection in excess of 80 dB achieved at lower output data rates.
  The AD7124 establishes the highest degree of signal chain integration. The device contains a precision, low noise, low drift internal band gap reference, and also accepts an external differential reference, which can be internally buffered. Other key integrated features include programmable low drift excitation current sources, burnout currents, and a bias voltage generator, which sets the common-mode voltage of a channel to AVDD/2. The low-side power switch enables the user to power down bridge sensors between conversions, ensuring the absolute minimal power consumption of the system. The device also allows the user the option of operating with either an internal clock or an external clock.
  The integrated channel sequencer allows several channels to be enabled simultaneously, and the AD7124 sequentially converts on each enabled channel, simplifying communication with the device. As many as 16 channels can be enabled at any time; a channel being defined as an analog input or a diagnostic such as a power supply check or a reference check. This unique feature allows diagnostics to be interleaved with conversions. The AD7124 also supports per channel configuration. The device allows eight configurations or setups. Each configuration consists of gain, filter type, output data rate, buffering, and reference source. The user can assign any of these setups on a channel by channel basis.
  The AD7124 also has extensive diagnostic functionality integrated as part of its comprehensive feature set. These diagnostics include a cyclic redundancy check (CRC), signal chain checks, and serial interface checks, which lead to a more robust solution. These diagnostics reduce the need for external components to implement diagnostics, resulting in reduced board space needs, reduced design cycle times, and cost savings. The failure modes effects and diagnostic analysis (FMEDA) of a typical application has shown a safe failure fraction (SFF) greater than 90% according to IEC 61508.
  The device operates with a single analog power supply from 2.7 V to 3.6 V or a dual 1.8 V power supply. The digital supply has a range of 1.65 V to 3.6 V. It is specified for a temperature range of −40°C to +105°C.
  The driver contains two parts:
  The Communication Driver has a standard interface, so the AD7124 driver can be used exactly as it is provided.
  There are three functions which are called by the AD7124 driver:
  SPI driver architecture
  The AD7124 driver contains the following:
  The following functions are implemented in this version of AD7124124_Setup() which has the following parameters:
  struct ad7124_device my_ad7124;
  ad7124_st_reg my_ad7124_regs[AD7124_REG_NO];
  A AD7124_Setup() call will also reset the part then use all register values stored in the array pointed by the regs parameter to configure the part (the registers flagged as “Read-only” will be skipped).
  The following code snipped provides an example of driver usage:
  #include "AD7124.h" /* AD7124 definitions */ #include "AD7124_regs.h" /* We want to use the ad7124_regs array defined in ad7124_regs.h/.c */ void main(void) { struct ad7124_device my_ad7124; /* A new driver instance */ struct ad7124_device *ad7124_handler = &my_ad7124; /* A driver handle to pass around */ enum ad7124_registers regNr; /* Variable to iterate through registers */ long timeout = 1000; /* Number of tries before a function times out */ long ret = 0; /* Return value */ long sample; /* Stores raw value read from the ADC */ /* Initialize AD7124 device. */ ret = AD7124_Setup(ad7124_handler, AD7124_SLAVE_ID, (ad7124_st_reg *)&ad7124_regs); if (ret < 0) { /* AD7124 initialization failed, check the value of ret! */ } else { /* AD7124 initialization OK */ } /* Read all registers */ for (regNr = AD7124_Status; (regNr < AD7124_REG_NO) && !(ret < 0); regNr++) { ret = AD7124_ReadRegister(ad7124_handler, &ad7124_regs[regNr]); } /* Read data from the ADC */ ret = AD7124_WaitForConvReady(ad7124_handler, timeout); if (ret < 0) { /* Something went wrong, check the value of ret! */ } ret = AD7124_ReadData(ad7124_handler, &sample); if (ret < 0) { /* Something went wrong, check the value of ret! */ } }