Due to the distance limit of the connecting cable of the acceleration sensor and the charge amplifier, it is difficult to implement a centralized data acquisition and processing system in a space with a long distance, and its reliability and anti-interference problems are difficult to solve. Distributed detection method is often used: that is, multiple data acquisition sites are set up, each site uses a separate data acquisition and processing system, and each site is connected to each other through network communication, and then a system machine performs centralized data processing to extract relevant feature information.
Performance characteristics of C8051F020 microcontroller
CYGNAL's C8051F020 is a mixed signal system-level SOC (System On Chip) microcontroller integrating analog and digital signals, which is fully compatible with the currently commonly used 51 series microcontroller instruction set. It uses a 100-pin TQFP package, which is small in size and fast in computing speed. It uses CYGNAL's patented CIP-5l microprocessor core. CIP-5l takes a new approach to improve the speed of 805l, that is, it tries to implement pipeline operation for instruction operation while keeping the CISC structure and instruction system unchanged. In this mode, the concept of machine cycle is abolished, and instructions are run in clock cycles. On average, one single-cycle instruction can be executed per clock, which greatly improves the instruction running speed.
Compared with 8051, the single-cycle instruction running speed of C8051F020 is 12 times that of the original under the same clock, and the average running speed of the entire instruction set is 9.5 times that of the original 8051, making the CYGNAL microcontroller series enter the ranks of 8-bit high-speed microcontrollers. At the same time, the C8051F020 microcontroller continues the priority digital cross switch configuration technology unique to the C8051F series. The core of this technology is to configure the port I/O pins for the internal digital resources in hardware. Unlike standard multiplexed digital I/O, this structure can support more functional combinations. PCA, comparators, timers, etc. are assigned to the selected port according to priority. Users can also allocate I/O pins only for the digital resources used. Any port I/O that is not configured for use is combined together as GPIO.
Performance characteristics of MXA2500GL accelerometerMXA2500GL
is a dual-axis absolute analog output accelerometer produced by MEMSIC's patented technology. It can measure dynamic acceleration (such as vibration) and static acceleration (such as gravity acceleration) on both axes based on the principle of thermal convection, so it is widely used in automotive stability control, safety control, approach angle control, blood pressure monitors, electronic compass tilt correction, digital cameras, elevators and other fields. Unlike ordinary piezoelectric accelerometers, MXA2500GL is actually a monolithic integrated circuit manufactured according to standard CMOS technology. Its output is a voltage signal of 0.1~4.9V (in the case of 5V power supply), which can be directly connected to the A/D card without a charge amplifier, so the entire test system is not only compact in structure, but also very anti-interference. The
basic working principle is: a gas heat source is suspended in the cavity in the center of the silicon wafer, and aluminum/polysilicon thermocouples are evenly placed at the four diagonals of the heat source (i.e., the two axis directions). When the acceleration is zero, the temperature gradient of the heat source is symmetrical, so the temperature of the four thermoelectric piles is the same, so the two axis directions output the same voltage. Acceleration in any direction will disrupt this balanced temperature form, making the temperature gradient of the heat source asymmetrical. According to the free convection principle of heat conduction, the temperature of the four thermoelectric piles and their output signal - voltage are different. However, these voltage signals change proportionally with the acceleration. In this way, the value of acceleration can be determined by measuring the voltage. There are two identical acceleration signal channels on the sensor, one measuring the X direction and the other measuring the Y direction. Figure 1 shows its basic structure. Figure 1
Structure diagram of MXA2500GL acceleration sensor
Hardware architecture of the distributed detection system
The system uses the C8051F020 microcontroller as the slave and the PC as the host. Because the microcontroller is small in size, powerful in function and low in price, it has a very high cost performance. At present, mainstream PCs have two standard RS-232 serial ports, which use EIA level, while the TX pin (sending data) and RX pin (receiving data) of the C8051F020 microcontroller use TTL level. For reliable communication between the two, a level conversion chip must be used. The system uses MAX232/MAX485 chips. In order to achieve the goal of resource sharing and task sharing, the key in a distributed computer system is to ensure the accuracy and reliability of data communication between the host and each slave.
Since the PC itself does not have the function of multi-machine communication, there are currently two commonly used communication methods: one is to use the "bridge" hardware - multi-machine communication card. Communication cards generally have two forms. The most widely used one is a communication card composed of 51 microcontrollers as the core and 8255, 6116, 2716 and other chips. The card can be inserted into the expansion slot of the PC, and each slave communicates serially with the microcontroller in the communication card, while the PC communicates in parallel with the microcontroller on the card through the 8255 chip. Another communication card is composed of a single chip (that is, a single chip is sacrificed as a communication relay), and the slave and the communication card and the PC and the communication card are all serial communications; another way is to simulate the 51 series single chip serial port programmable 9th bit data function on the PC serial port to achieve multi-machine communication. The system adopts the latter method. In addition, due to long-distance transmission, the MAX485 chip is used in the system, and optoelectronic isolation is also used to improve the system's anti-interference ability. Figure 2 shows the overall hardware architecture. Figure 2 Hardware
architecture of distributed detection system
Multi-machine communication protocol
C8051F020 single chip has a special function suitable for multi-machine communication, namely mode 2 (3). In these two modes, the received 9th bit enters RB8, and then it is the stop bit. The serial port can be programmed as follows: when the stop bit is received, a serial port interrupt is generated only when RB8=1. This feature can be controlled by setting SM2 in SCON. The way to use this feature in multi-machine communication is: when the host wants to send a data block to one of several slaves, it first sends an address byte of the target slave, with the 9th bit of the address byte being 1 and the 9th bit of the data byte being 0. When SM2=1, the data byte will not interrupt any slave, however, the address byte will interrupt all slaves, so that each slave can check the received address to see if it is addressed to itself. The addressed slave clears SM2 to 0 and prepares to receive the transmitted data byte. The slaves that are not addressed keep SM2 set and continue to process other tasks. The information frame format of the C8051F020 microcontroller in mode 3 is shown in
Figure 3. Figure 3 Information frame format of the C8051F020 microcontroller in mode 3 The
asynchronous serial communication port of the PC is composed of a universal asynchronous receiver transmitter (UART) as the core. There are many UART product models, most of which use the Ins8250 chip. Programming the UART is actually the operation of its internal registers. There are 10 internal registers in the UART. When programming, the data format of serial communication must be determined first. This is done by writing the selected data format parameters into the line control register LCR. Next, the baud rate factor needs to be written into the baud rate factor register to determine the baud rate of both parties. Then, the line status register LSR is read to determine whether the chip is ready or has an error. The format of the communication line control register LCR is shown in Figure 4.
Figure 4 Communication line control register LCR
By writing the parameter byte into the line control register, the UART can be programmed into the following serial communication data format: 1 start bit, 8 data bits, 1 parity bit, 1 stop bit, 11 bits in total for 1 frame. Since the 11-bit data format can be realized on the PC, and the parity bit can be set to "constant 1" or "constant 0" by changing the values of the D5, D4, and D3 bits of the line control register, if the parity bit is set to "constant 1" when sending the address frame, and the parity bit is set to "constant 0" when sending the data bit, the multi-machine communication point of the 51 series microcontroller can be simulated on the PC, thereby directly using this feature to realize the master-slave distributed multi-machine communication between them.
The host and the slave follow the master-slave principle. The host selects the slave by calling. The data is transmitted bidirectionally between the host and the slave. The mutual communication between the slaves needs to be mediated by the host. Some commands and status words for them to recognize should also be transmitted between the master and the slave, such as 00H for the host to send the slave to receive the command, and 01H for the slave to send the host to receive the command, etc.
Implementation method of PC host communication program
Programming of PC UART is the core of host communication program. Generally, there are two ways to implement the operation of UART. One is to directly access the underlying address to implement the operation of LCR, LSR, and baud rate factor registers. This method is only applicable to Windows 9X. In Windows NT environment, the system prohibits user programs from directly accessing hardware and physical addresses, so this method is not advisable. The specific process is implemented by calling standard communication functions inp() and outp(). Another way is to indirectly perform related operations on LCR, LSR, and baud rate factor registers through communication controls or Windows API functions. Therefore, this system also uses MSComm controls, and Windows API functions are more suitable for application in multiple current process fields.
Conclusion
Practice has proved that the vibration signal distributed detection system based on C8051F020 microcontroller and MXA2500GL sensor has reliable performance and greatly saves costs. Therefore, this system has great promotion value in the testing and diagnosis process of automobile complete vehicles and parts.
Previous article:Research on Uninterruptible Power Supply Based on MR16 Single Chip Microcomputer
Next article:Design of infrared temperature monitoring system based on C8051F340 single chip microcomputer and CPLD
Recommended ReadingLatest update time:2024-11-16 19:42
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- Introduction to Internet of Things Engineering 2nd Edition (Gongyi Wu)
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Modern Motor Control Technology (Wang Chengyuan, Xia Jiakuan, Sun Yibiao)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- If you don’t understand millimeter wave, ask: the latest application of millimeter wave radar in automobiles
- The basic principles and effective use of RF directional couplers
- NXP Rapid IoT Review] +⑥NXP Rapid IoT self-exploration program, review summary and impressions
- RF Circuit PCB Design Processing Techniques
- RSL10-002GEVB Plant Manager Node Design
- Development environment preparation
- Random notes small total small picture signal reflection picture
- Basic knowledge of radome structure
- (Repost) Getting Started with Bluetooth Development
- [Shanghai Hangxin ACM32F070 development board evaluation] 5. Run the watchdog