Interface Design between AD7711 and TMS320F240

Publisher:hxcp18Latest update time:2011-10-19 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Interface Design for AD7711 and TMS320F240
GUO Shaopeng, WU Lanjun, YAN Xianyong, LI Jianguo
(Institute of Electrical Engineering, Chinese Academy of Science,
Bei jing 100080, China)
Key words: temperature measure; constant current source; DSP
1AD7711 peripheral interface circuit
Figure 1 is a peripheral circuit diagram that uses a three-wire connection method to eliminate the influence of the temperature sensor wire resistance.
REF+ is the reference positive power supply for AD7711 to perform AD conversion. The safe voltage of REF+ is any voltage between VSS- and AVDD. In use, it should be noted that the access voltage of REF+ is greater than the product of the analog input and the programmed gain, otherwise a conversion result of all 1 will appear.
MODE (6) pin is grounded: it means that the pulse SCLK (1) that controls serial data reading and writing is an input pin and is controlled by an external MCU; MODE (6) is connected to a high level, which means that SCLK is an output pin, and the MCU should read and write serial data according to the output pulse of SCLK.
RTD1 (9) and RTD2 (10) are a pair of 200μA current sources with an initial relative error of less than 1% and a temperature drift tracking accuracy of 3×10-6/℃. The temperature sensor shown in the figure adopts a three-wire connection method. The lengths of the three wires are basically the same, and the resistance is r, so the same common-mode voltage is generated at the IN+ and IN- input terminals; the voltage signal after the differential input is only the voltage generated by the IC exciting Pt100. This eliminates the wire resistance and improves the test accuracy.
TFS=0: indicates that the MCU is allowed to output data to AD7711 (write permission), RFS=0 indicates read permission, but read/write cannot be valid at the same time. A0=0: indicates reading and writing of the control register; A0=1: indicates reading and writing of the data register or calibration register; the data register or calibration register is selected by the value of the upper three bits of the control register. The MCU completes its operation through six pins: SCLK(1)/A0(4)/TFS(19)/RFS(20)/DRDY(21)/SDATA(22). Figure 1 uses six IO ports of MCU (TMS320F240) to connect with AD7711. When reading the device, DRDY and SDATA are output pins, and the rest are input pins; when writing, SDATA is an input pin, and DRDY is still an output, but it has no effect on the write operation.
After completing the correct line connection of AD7711, its control register needs to be correctly configured before it can work. The AD7711 control register is a 3-byte RAM (i.e. 24 bits), as shown in Table 1.
?
(0\0\0) The device enters the normal A/D conversion mode, and the conversion result is stored in the data register. (0\0\1) Perform zero input calibration and full-scale self-calibration on the device itself. (0\1\0), (0\1\1) Implement the zero input calibration and full-scale calibration of (0\0\1) in two steps. (1\0\0) System drift calibration. (1\0\1) Continuous background automatic calibration. (1\1\0), (1\1\1) Select the zero calibration register and full-scale calibration register of AD7711 respectively.
G2\G1\G0: Set the gain of the programmable amplifier. A=2g, g is (G2/G1/G0) binary converted to decimal.
CH: Select input channel (0: indicates differential channel (IN+\IN-); 1: indicates input channel IN2 (17)).
PD: Power control. 0: Normal operation; 1: Low power consumption.
WL: Setting the number of bits of AD conversion result. 0: 16-bit conversion result; 1: 24-bit conversion result.
RO: Excitation current supplied to the sensor. 0: Turn off 200μA excitation current; 1: Turn on 200μA excitation current. It is worth noting that when measuring the voltage across the platinum resistor, it is necessary to select channels 1 and 2 (CH=0, 1) respectively, and make RO=1; otherwise, there is no current output. BO: 4.5μA supply current to
judge whether the sensor is burned out. 0: Turn off; 1: Turn on. When the platinum resistor sensor is accidentally disconnected, by turning on the BO current, the AD conversion results are all 1, and the sensor is judged to be in a fault state of disconnection. In normal operation, BO=0 turns off the current.
B/U: AD conversion polarity selection. 0: Bipolar; 1: Unipolar.
FS11~FS0: filter frequency setting. The formula for setting the frequency of the on-chip low-pass filter is:
?
fclk is the frequency of the external crystal oscillator, generally 10MHz; code is the value of FS11~FS0 converted from binary to decimal. The calculated frequency is the frequency of the AD7711 conversion data refresh, which is about 3.8 times the cutoff frequency.
2.1 Reading and writing of the control register
Writing to the control register: The timing of writing to the control register is shown in Figure 2. A0(4)=0 selects the control register, TFS(19)=0/RFS(20)=1 indicates write permission, and SCLK is enabled. At the rising edge of the SCLK pulse, the data of SDATA(22) is sent to the control register, so the data sent on SDATA should be valid before the rising edge signal of SCLK. Each SCLK sends one bit, with the high bit first and the low bit last. 24 bits must be sent at a time. If it is less than 24 bits, the write command is invalid. If it is more than 24 bits, the excess part is ignored.
?
After writing (1\1\0) or (1\1\1) instructions to the upper three bits of the control register, the next instruction is to read and write the calibration register. (1\1\0) means that the subsequent operation is for the 0 calibration register, and (1\1\1) means for the full-scale calibration register. When reading and writing the calibration register, A0=1, and each write should be 24 bits. Therefore, the only difference between the timing diagram of the calibration register operation and the timing diagram of the control register operation is that A0 is a high level instead of a low level.
2.3 Reading the data register
The timing of reading the data register is shown in Figure 4. The data register stores the AD conversion result. DRDY=0 means that new result data is retained in it. If the data is not read out in time, the data in the data register will be updated in real time. When DRDY=0, the MSB is sent out first at the falling edge of RFS, and then the subsequent data is output from the data register to SDATA in sequence at the falling edge of SCLK. When the last bit of data is sent out, the DRDY output becomes high and the output of the SDATA signal is turned off.
As long as the timing diagram is followed, any MCU can use its general I/O pins to control AD7711. To make AD7711 work normally, at least two subroutines need to be written: writing control registers and reading data registers. If the content written to the control register is correct, a control register reading subroutine needs to be written. If the calibration register reading and writing subroutines are written, the calibration register content can also be directly modified to increase the flexibility of control. Since the writing of these subroutines is very similar, only the control register writing subroutine is given below.


The function is called twice to set the IN2 and IN1 (IN+, IN-) channels respectively. 3a50c4 means: MD2/MD1/MD0=0/0/1, that is, 0 input and full-scale input self-calibration; G2/G1/G0=1/1/0: amplification factor 26=64; WL=0 means 16-bit AD conversion, RO=1 turns on 200μA excitation current, filter frequency 10MHz/512/0x0c4=100Hz, and the corresponding cutoff frequency is 26Hz. It should be noted that even if only one channel is used, both channels must be set, otherwise the two high-precision follower current sources will not be turned on.
AD7711 integrates the necessary components of Pt100 conditioning circuit, simplifies circuit design, brings great convenience to high-precision temperature measurement, and ensures reliability and stability. The author uses it in high-precision dynamic temperature control instruments with ideal results.
Reference address:Interface Design between AD7711 and TMS320F240

Previous article:Driver Design of Graphic LCD Module Based on SPCE061A Single Chip Microcomputer
Next article:Design of Intelligent Temperature Controller for Dry-Type Transformer Based on ATmega16 Single Chip Microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号