“ADS1216 is a new type, high, wide dynamic range, delta-sigma type 8-channel 24-bit ADC in the Burr-Brown product line. It exchanges information with the outside world through the SPI interface, has 22-bit effective resolution, and has an operating Voltage range of 2.7V~5.25V. The device can increase the impedance by selecting the internal buffer, and can provide 50% offset correction of the full-scale voltage. In addition, the ADS1216 also has two internal and external reference voltage supply methods.
“
1、ADS1216 overview
ADS1216 is a new type, high, wide dynamic range, delta-sigma type 8-channel 24-bit ADC in the Burr-Brown product line. It exchanges information with the outside world through the SPI interface, has 22-bit effective resolution, and has an operating voltage range of 2.7V~5.25V. The device can increase the impedance by selecting the internal buffer, and can provide 50% offset correction of the full-scale voltage. In addition, the ADS1216 also has two internal and external reference voltage supply methods.
ADS1216 is mainly used in industrial process control, liquid/gas chromatograph, blood analysis, smart transmitter, portable instrument, pressure sensor and other measuring instruments that require high and low power consumption. The main features of ADS1216 are as follows:
●Low nonlinearity: 0.0015%;
●Adopt single-cycle conversion mode;
●Power consumption is less than 1mW;
●Can be configured as 8 differential inputs;
●With programmable gain amplifier, when G=1, it can provide 22-bit effective resolution; when G=128, it can provide 19-bit effective resolution;
●With SPI communication interface;
●The data output rate is programmable within 10Hz~1kHz;
●With chip self-calibration function.
2、The structure principle and register function of ADS1216
2.1 Internal structure and working principle of ADS1216
Figure 1 shows the internal structure and external main pins of ADS1216. ADS1216 is mainly composed of analog multiplexer (MUX), input buffer (BUF), programmable gain amplifier (PGA), second-order delta-sigma modulator, Programmable digital filter, microcontroller, 16 status/control registers, 128 bytes RAM, serial SPI interface, two 8-bit DACs, internal reference voltage generator and clock generator etc. The selector (MUX) is mainly used to provide a differential combination of eight analog inputs. When channel 1 of the analog input is selected as the positive differential input channel, the remaining channels can be selected as the negative differential input terminal. In this way, its common ground terminal The pin AINCOM can easily implement eight-channel differential input. There is also a diode temperature sensor inside ADS1216, and whether it works can be selected by configuring the internal MUX register.
The input buffer (BUF) is used to isolate the switched capacitor array from the external circuit in the signal path. When there is no input buffer, the input impedance of the ADS1216 is 5MΩ. When the ADS1216 internal buffer is used, the fluctuation of its input voltage is reduced, The input current increases. Its internal input buffer is controlled by the BUFFER pin and the BUFFER bit of the internal ACR register.
The amplification factor of the programmable gain amplifier (PGA) inside the ADS1216 can be set from 1 to 128 through the ACR register, and the gain step size is 2.
The regulator inside the ADS1216 is a second-order delta-sigma system. The regulator operates at the frequency of fMOD, and the fMOD clock frequency comes from the external clock fOSC. The frequency division comes from the SPEED bit of the setup register (SETUP). During design, the SPEED bit is used as 1 or 0 can set the frequency of fMOD to fOSC/256 or fOSC/128.
The conversion and resolution of ADC can be improved by digital filter. Digital filter has a certain settling time. ADS1216 can be divided into three filtering methods: fast settling, sinc2 or sinc3. Settling time is the longest, but filtering.
The ADS1216 provides two reference voltage supply methods. The default reference voltage at power-on is the internal 2.5V. The selection of the reference voltage can be done through the setting of the SETUP register. The internal reference voltage can be selected from 1.25V or 2.5V. The reference voltage output terminal should have A 0.1μF capacitor is connected to ground. The external reference voltage is a differential input, and the input range is 0~2.5V. A bypass capacitor can be provided for the internal reference voltage through the VRCAP pin of the ADS1216 to filter out the noise of the internal reference voltage. When using When external reference voltage is used, this pin can be disconnected.
ADS1216 adopts four-wire system (clock signal line SCLK, data input line DIN, data output line DOUT and chip select line CS) SPI communication mode. The communication clock of SPI can reach fosc/4. ADS1216 can only work in slave mode of SPI communication In the SPI transmission process, data is sent and received synchronously, and SCLK and DIN and DOUT move synchronously. Figure 2 shows the SPI communication Timing relationship, in which the POL signal is used to control the polarity of the clock pulse. Through POL, SCLK can be selected to be active high or active low.
The ADS1216 uses two typical memories: registers and RAM. 16 registers can directly control the working process of the ADS1216, and these 16 registers can be directly read and written. In fact, these registers include all the parts used to configure the ADS1216, such as Data format, channel selection, reference voltage setting, etc.
The establishment of the entire device operation process can be completed by setting up 16 independent registers. Reading or writing registers or memory is in units of bytes. The data transfer between registers and RAM is on a block basis. It is carried out. RAM and registers are independent of each other.
The addresses of the internal memory (including registers and RAM) are linear, and the register addresses are 00H~0FH. In order to facilitate the independent storage of eight-channel data and the block transfer of data between the same registers, the 128-byte RAM is divided into 8 mutual Independent block. The offset of each block is 00H~0FH. Therefore, the address of each unit of each block can be regarded as a combination of block address and offset. For example, address 14H is equal to a RAM block and the offset is 04H unit.
The synchronous operation of the ADS1216 can provide a synchronisation with external time for A/D conversion. It can be provided either through the DSYNC pin of the chip or through the internal DSYNC command.
2.2 ADS1216 main register function
Among the 16 registers of ADS1216, five registers are the most important. Table 1 shows the operation format of these five registers.
Table 1 Main register format of ADS1216
(1) The SETUP register (address is 00H) is a setup register; the reset value is xxx 01110. The first three ID bits of this register are set by the factory; SPEED is the multiplexer clock speed, when it is 0, fMOD=fOSC /128; when it is 1, fMOD=fOSC/256; REF EN is used to select the reference voltage, when it is 0, the internal reference is used; when it is 1, the external reference is used; when REF HI is 0, the internal reference voltage is 1.25V; When it is 1, the internal reference is 2.5V; BUF EN is used to select the buffer, 0 means that the internal buffer is not used; 1 means that the internal buffer is used; BIT ORDER is used to indicate the output order of the data buffer data bits; First, a value of 1 means the low order is first.
(2) The MUX register (address 01H) is the multiplexer control register; the reset value is 01H. Among them, PGA2?PGA1?PGA0 are used for the selection of programmable gain amplification, specifically: 000=1, 001=2,010 =4,011=8,…?111=128.
(3) ACR register (address is 02H), which is an analog control register; the reset value is 00H. Among them, DRDY is the data ready signal (read-only); U/B is used to indicate the data format, 0 is bipolar, 1 is Unipolar; SMODE1 and SMODE0 are used to set the filter mode, 00 is automatic; 01 is the fast establishment filter mode, 10 is the Sinc2 filter mode; 11 is the Sinc3 filter; DEC10, DEC09 and DEC0 8 are the upper three bits of the sampling frequency.
(4) The EDCD register (address 08H) is the sampling time register (lower eight bits), and the reset value is 80H. Among them, PSEL3? PSEL2? PSEL1? PSEL0 and NSEL3? NSEL2? NSEL1? NSEL0 are used for positive and negative channel selection respectively ,0000~0111 represent channels AIN0~AIN7 respectively, 1XXX represents AINCOM? Except all are 0 or 1? 1111 represents the temperature sensor working.
(5) The M/DEC1 register (address is 09H) is the mode and sampling frequency register, and the reset value is 07H. The sampling time range of ADS1216 is 20~2047 (11 bits), the DEC0 register is its lower eight bits, and 11 The upper three bits of the bits are in the M/DEC1 register, and the default sampling frequency is 10Hz (the crystal oscillator is 2.4576Hz).
3、Application of ADS1216
3.1 Interface between ADS1216 and MCU C8051F020
C8051F020 (F020 for short) is a mixed-signal SOC type 8-bit microcontroller launched by Cygnal in the United States. It can implement SPI serial interface by hardware, so when communicating with ADS1216, it can save the general I/O port to simulate SPI communication. It is troublesome, but directly use the SPI communication control register inside the F020 to set, so as to easily realize the communication with the ADS1216. In the actual design, the author uses one F020 to control four pieces of ADS1216 to realize the upward and downward radiance in seawater. Optical signal detection of 12 bands. For simplicity, Figure 3 shows the interface circuit between ADS1216 and F020. In Figure 3, the interface signals between ADS1216 and C8051F020 include SCLK, Din, Dout, CS, and data ready signals DRDY, A/D conversion synchronization signal DSYNC and internal buffer enable signal BUFFER. Among them, SCLK, Din and Dout are respectively connected to P0.2, P0.3 and P0.4 of F020. These three pins pass through F020 internal The SPI control register is configured as the SPI communication port, and other signal lines are directly connected to the ordinary I/O port of the F020 to perform bit control or status bit reading.
3.2 Software Process
According to the design requirements, when the system is applied to the optical illuminance and radiance measuring instrument of the ocean optical buoy, for the specific application, the main part of the program flow is shown in Figure 4.
4. Summary
Through the design and experiment, the following points should be paid attention to when using ADS1216:
(1) The analog ground and digital ground should be connected together outside the ADS1216, otherwise the ADS1216 will not work properly.
(2) When designing the printed circuit board, the external crystal oscillator should be as close as possible to the ADS1216. The author found in the experiment that the farther the crystal oscillator is from the ADS1216, the smaller the amplitude of its input timing. When the amplitude is too small, it can be reduced by reducing Small capacitors are connected to both ends of the crystal oscillator to increase its amplitude, and its range should be between 0~20pF.
(3) When using SPI communication, you must pay attention to the SCLK polarity of the microcontroller and ADS1216. The SCLK polarity of the main controller and ADS1216 can be kept consistent through the setting of the POL pin.
(4) In order to obtain stable conversion results, a delay should be added before each channel change and synchronization signal transmission. The delay time should vary with the AD sampling frequency and filtering method.