In measurement and instrumentation, temperature detection has almost become an indispensable part. Traditional analog temperature sensors are either complicated in peripheral circuits or require the design of A/D conversion and cumbersome operation, which are subject to certain restrictions in use. The digital temperature sensor AD7416 is used to design various control systems. It is small in size, low in power consumption, simple in programming and convenient in operation. The chip has automatic comparison and programmable control output terminal OTI, which has great advantages in the design of temperature control systems. In addition, AD7416 has low power consumption and can be programmed to control the switching between working and sleeping states. It is also widely used in low-power system design.
2 Structure and function of AD7416
2.1 Pin function
AD7416 has a total of 8 pins and adopts SOIC/MSOP package. Pin 1 is the data input and output port, IIC bus bidirectional data port; Pin 2 is the IIC bus clock port; Pin 3 OTI is the temperature comparison output terminal; Pin 4 GND ground terminal; Pin 5, 6, and 7 are IIC bus address programming bit input terminals; Pin 8 VDD is the power supply.
2.2 Internal Structure and Function
The internal structure of AD7416 is shown in Figure 2. The on-chip bandgap temperature sensor and 10-bit AD converter form a temperature measurement circuit, and the measurement result is stored in the temperature value register. There are 5 registers, a temperature comparator, and an error queue counter on the chip. The functions are introduced below. A serial bus interface is used for IIC address control and data transmission.
2.2.1 Internal registers
AD7416 has 5 internal registers: address pointer register, temperature value register (00H), upper limit register TOTI (03H), lower limit register THYST (02H), and configuration register (01H).
The address pointer register stores the address pointing to one of the four data registers. The first data byte of each serial write operation to AD7416 is the address of the data register, which is the address to which the subsequent data bytes are to be written. This value is stored in the address pointer register. Only the lowest two bits of this register are used to select a data register, and its value corresponds to the register address. The temperature value register is a 16-bit read-only register. Its upper 10 bits store the 10-bit temperature reading sent by the AD converter in 2's complement format, and the lower six bits are unused. The
configuration register is an 8-bit read/write register, which is used to set the working mode of AD7416. D7, D6, and D5 are used for channel selection and are all kept at 0; D4 and D3 set the error queue length; D2 sets the OTI output polarity; D1 sets the OTI working mode; DO sets the chip working mode. The THYST set point register and the TOTI set point register are both 16-bit read/write registers. Their 9 most significant bits store the low and high temperature threshold set points expressed in 2's complement format, corresponding to the upper 9 bits of the temperature value register, and the lower 7 bits are unused.
When the AD7416 is powered on, the address pointer points to the temperature value register, TOT1=80℃, THYST=75℃.
2.2.2 Basic working principle
The bandgap temperature sensor and the 10-bit A/D converter can measure the ambient temperature in real time according to the preset working mode. At the same time, the conversion result is saved in the temperature value register in the form of a 10-bit binary number. The
set point comparator compares the actual measured temperature value with the preset high and low threshold values. If the limit is exceeded, the high and low levels are output at the OTI end according to the configuration register setting. OTI needs to be connected to an external pull-up resistor of about 10 k when in use.
There is a fault queue counter in the AD7416 to avoid false triggering of the OTI output end caused by interference. The queue length of this counter is set by the configuration register. If the queue is set to 4, then it takes 4 consecutive temperature over-limit measurements to cause the effective output of OTI. Any less than 4 times is considered interference and the fault queue counter will be reset.
3 System Design
3.1 Hardware Design
The hardware schematic diagram of the AD7416 part of the system is shown in Figure 3. A2, A1, and A0 are connected to low, low, and high levels respectively. In the eight-bit address, the upper four bits are 1001 to select 7416, and the lower three bits are the addresses represented by A2, A1, and A0. The lowest bit represents read and write, so the write address of AD7416 in the application is 10010010B and the read address is 10010011B. In this example, only AD7416 is used to measure temperature, and OTI is left floating and not used. The serial clock and data bus correspond to the clock and data bus ports connected to the processor. [page]
3.2 Software Design
01H of AD7416 is the configuration register. If the lowest bit is 0, the chip is started to collect temperature values and perform AD conversion; if it is 1, the chip is stopped. The software starts the chip first, and the program is as follows:
This program writes 00H to the configuration register of AD7416 to complete the temperature measurement startup of the chip. The I2C_START subroutine starts the IIC bus, the I2C_WwRITE subroutine writes a byte to the IIC bus, and the I2C_STOP subroutine shuts down the IIC bus. The program first writes 92H to the IIC bus, selects the AD7416 chip, then writes 01H to the address pointer register of the AD7416, selects the configuration register, and finally writes 00H to the configuration register.
When reading a double-byte temperature value, first write the destination register address 00H to the AD7416, that is, the address of the register to read the data, which is stored in the address pointer register. Then send a read command. After receiving the first byte, the processor sends a response signal to the bus, and sends a non-response signal after receiving the second byte. After completion, the bus operation is stopped. Part of the program to read the temperature value from the AD7416 is as follows, TEMPH stores the high byte, and TEMPL stores the low byte:
4 Conclusion
The temperature measurement function of AD7416 is used in the system design. From the use process, the chip has a simple structure, easy operation, and low power consumption. It is the best choice for low-power temperature measurement systems. And because of the use of on-chip temperature sensors, the design structure is greatly simplified, and the reliability of the system is also greatly improved.
Previous article:Design of online laser power detection system based on single chip microcomputer
Next article:Design of automatic range switching voltage measurement system based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- "Verilog HDL Comprehensive Practical Tutorial" by J.Bhasker, translated by Sun Haiping.pdf
- Apply for a ZVS buck regulator for free, first come first served!
- Help with optocoupler usage issues
- Use CCS to install C2000ware and create a sample project
- Having trouble with impedance matching? Here’s the secret (Part 1)
- HuaDa MCU Design Considerations Flash and Serial Programming Application Notes
- Playing with Zynq Serial 35——Online board debugging based on Vivado Virtual IO
- Urgently looking for mid-level surveying/mapping, electrical, mechanical engineer technicians
- Facing the "Smith Chart" calmly, no longer confused
- Tell a joke every day to have fun in the busy life