Figure 1: Simplified digital temperature sensor block diagram
The most popular digital temperature sensors are those with a serial bus interface. The choice of temperature sensor bus depends largely on what interfaces are available on the selected microprocessor or controller. The choice of controller depends on how much experience the engineer has with it. For system data that needs to be frequently streamed, SPI is the first choice because it has a faster clock rate, which can range from a few megahertz to tens of megahertz. However, for system management activities such as reading temperature sensor readings and querying the status of multiple slave devices, or when multiple master devices need to coexist on the same system bus (system redundancy often requires this), or for low-power applications, I2C or SMBus will be the preferred interface. The following sections will introduce each serial bus and its advantages and disadvantages.
1. SPI
SPI is a four-wire serial bus interface with a master/slave structure. The four wires are serial clock (SCLK), master output slave input (MOSI), master input slave output (MISO) and slave select (SS) signals. The master device is the clock provider and can initiate a read or write slave device operation. At this time, the master device will talk to a slave device. When there are multiple slave devices on the bus, to initiate a transmission, the master will pull the slave select line low and then start data transmission or reception through the MOSI and MISO lines respectively.
The SPI clock speed is very fast, ranging from a few megahertz to tens of megahertz, and there is no system overhead. The disadvantage of SPI in system management is the lack of flow control mechanism. Neither the master nor the slave confirms the message, and the master cannot know whether the slave is busy. Therefore, a clever software mechanism must be designed to handle the confirmation problem. At the same time, SPI does not have a multi-master device protocol, and very complex software and external logic must be used to implement a multi-master device architecture. Each slave device requires a separate slave select signal. The total number of signals is ultimately n+3, where n is the number of slave devices on the bus. Therefore, the number of wires will increase in proportion to the number of slave devices added. Similarly, it is not convenient to add new slave devices to the SPI bus. For each additional slave device added, a new slave select line or decoding logic is required. Figure 2 shows a typical SPI read/write cycle. A read/write bit follows the address or command byte. Data is written to the slave device through the MOSI signal and read from the slave device through the MISO signal. Figure 3 shows the system block diagram of the I2C bus/SMBus and SPI.
Figure 2: SPI typical read/write cycle
Figure 3: (a) I2C bus/SMBus system interface; (b) SPI system interface
I2C is a two-wire serial bus interface that works in master/slave mode. The two-wire communication signals are open-drain SCL and SDA serial clock and serial data respectively. The master device is the clock source. Data transmission is bidirectional, and its direction depends on the state of the read/write bit. Each slave device has a unique 7 or 10-bit address. The master device initiates a transmission through a start bit and terminates a transmission through a stop bit. The start bit is followed by a unique slave device address, followed by the read/write bit.
The I2C bus speed ranges from 0Hz to 3.4MHz. It is not as fast as SPI, but it is ideal for system management devices such as temperature sensors. I2C has system overhead, which includes start/stop bits, confirmation bits, and slave address bits, but it has a flow control mechanism as a result. The master device always sends an confirmation bit when it has finished receiving data from the slave device, unless it is ready to terminate the transmission. The slave device always sends an confirmation bit when it receives a command or data from the master device. When the slave device is not ready, it can hold or stretch the clock until it is ready to respond again.
I2C allows multiple masters to operate on the same bus. Multiple masters can easily synchronize their clocks so all transmit using the same clock. Multiple masters can detect which master is using the bus through data arbitration, thus avoiding data corruption. Since the I2C bus has only two wires, new slaves can simply be connected to the bus without additional logic. Figure 4 shows a typical I2C bus read/write operation.
Figure 4: Typical read/write operation of I2C bus/SMBus
SMBus is a two-wire serial bus, and the first version of the specification was commercialized in 1996. It is largely based on the I2C bus specification. Like I2C, SMBus does not require additional pins. The bus was created mainly to add new features, but it only operates at 100kHz and is specifically targeted at smart battery management applications. It works in master/slave mode: the master device provides the clock, provides a start bit when it initiates a transmission, and provides a stop bit when it terminates a transmission; the slave device has a unique 7 or 10-bit slave address.
There are some differences in timing characteristics between SMBus and I2C buses. First, SMBus requires a certain data hold time, while the I2C bus extends the data hold time internally. SMBus has a timeout function, so when SCL is too low for more than 35 ms, the slave device will reset the ongoing communication. In contrast, I2C uses hardware reset. SMBus has an alert response address (ARA), so when a slave device generates an interrupt, it does not clear the interrupt immediately, but keeps it until it receives an ARA containing its address sent by the master device. SMBus only operates from 10kHz to a maximum of 100kHz. The minimum operating frequency of 10kHz is determined by the SMBus timeout function.
Previous article:Power plant temperature measurement and early warning system
Next article:Sensor temperature error compensation based on neural network fusion
- Popular Resources
- Popular amplifiers
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Milestone! SmartSens CMOS image sensor chip shipments exceed 100 million units in a single month!
- Taishi Micro released the ultra-high integration automotive touch chip TCAE10
- The first of its kind in the world: a high-spectral real-time imaging device with 100 channels and 1 million pixels independently developed by Chinese scientists
- Melexis Launches Breakthrough Arcminaxis™ Position Sensing Technology and Products for Robotic Joints
- ams and OSRAM held a roundtable forum at the China Development Center: Close to local customer needs, leading the new direction of the intelligent era
- Optimizing Vision System Power Consumption Using Wake-on-Motion
- Infineon Technologies Expands Leading REAL3™ Time-of-Flight Portfolio with New Automotive-Qualified Laser Driver IC
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications