0. Introduction
The remote elevator monitoring system is an advanced technology in the elevator field today. The computer located in the elevator center remotely monitors and controls the elevators in the building, monitors and analyzes the fault and operating status data, etc. It also controls the elevator and makes anti-counterfeiting judgments. When the elevator fails, it receives the fault status signal and judges the fault type, and transmits the fault type and operating status information to the service center computer; this article creatively uses the dual serial port microcontroller C8051F340 as the main control chip of the front-end machine, communicates through 232 and 485, and completes scheduling, operation and maintenance.
1. System hardware design
The overall block diagram of this system design is shown in Figure 1.
The PLC communicates via RS-232 through the serial port of the main control chip C805 1F340, while the main control chip and the elevator controller communicate via RS-485. RS-232 communication is also done through the serial port of the main control chip through the two-wire/four-wire conversion circuit. If an ordinary single-serial-port microcontroller is used, even if a two-way three-way design is added, it cannot meet the requirements. Therefore, the C8051F340 microcontroller with dual serial ports is used as the main control chip, so that the three-way communication is carried out on different serial ports.
1.1 Main CPU system
The C8051F340 chip is a fully integrated mixed-signal system-level MCU chip that is high-speed, flexible and low-cost. It has an 8051-compatible CIP-51 core (up to 25MIPS). It is fast. A new FLASH memory has been added, which has the ability to be reprogrammed in the system, can be used for non-volatile data storage, and allows the 8051 firmware to be updated on site. The on-chip JTAG debugging circuit allows non-intrusive, full-speed, in-system debugging using the product MCU installed on the final application system. The debugging system supports observing and modifying memory and registers, and supports breakpoints, watchpoints, single steps, and run and stop commands. The C8051F340 is a typical control system used in industrial systems. In view of the above advantages, and combined with the design goals, this microcontroller is specially selected. The C8051F340 main control unit circuit is shown in Figure 2:
1.2 Communication circuit between main control system and PLC
Serial communication is widely used because it uses fewer lines and is low in cost, especially in remote transmission, as it avoids the inconsistency of multiple line characteristics. In serial communication, both parties are required to use a standard interface so that different devices can be easily connected for communication. The RS-232-C interface is currently the most commonly used serial communication interface. Its full name is "Technical Standard for Serial Binary Data Exchange Interface between Data Terminal Equipment (DTE) and Data Communication Equipment (DCE)".
In practice, only the 3rd to 9th leads of RS-232-C are used in computer and terminal communication. The electrical characteristics of the interface are that the voltage of any signal line in RS-232-C is a negative logic relationship. That is, logic "1", -5--15V; logic "0" +5-+15V. The noise tolerance is 2V.
Therefore, it is necessary to use the MAX232 chip for level conversion. The communication circuit between the C8051F340 main control unit and the PLC is shown in Figure 3:
1.3 Communication circuit between main control system and internal call board
The communication circuit between the C8051F340 main control unit and the internal call board is shown in Figure 4:
According to the actual situation, special requirements such as long distance, high accuracy, enhanced anti-common mode interference ability, and fast transmission rate are required. Here the author uses 485 for communication. Compared with RS-232, RS-485 has the following characteristics:
(1) The interface signal level is lower than that of RS-232-C, so it is not easy to damage the chip of the interface circuit. In addition, the level is compatible with the TTL level and can be easily connected to the TTL circuit.
(2) The maximum data transmission rate of RS-485 is 10Mbps.
(3) The RS-485 interface uses a combination of a balanced driver and a differential receiver, which has enhanced common-mode interference resistance, that is, good noise interference resistance.
(4) The transmission distance of RS-485 interface can actually reach 3000 meters. In addition, RS-485 interface has multi-station capability, which meets our requirement of establishing a device network using a single RS-485 interface.
1.4 Serial port self-test circuit design
The design requires that the serial port has self-test capability, that is, when the system is started or allowed to be checked, the high-speed microcontroller C8051F340 can detect its own serial port, that is, send any byte and receive this byte. If the sending and receiving are consistent, a signal is sent to the PLC and the microcontroller on the internal call board, and waits for the signal from the other party to pass the self-test. If the other party also passes the self-test, the self-test ends and enters normal working state.
1.5 Contactless IC card input and output circuit
Contactless IC card, also known as radio frequency card or induction card, successfully combines radio frequency identification technology, solves the problem of passive and contactless, and is a major breakthrough in the field of electronic devices.
The electrical part of the card consists of a component and AISC. The antenna in the card is only a coil, which is very suitable for sealing into the card. ASIC consists of a high-speed (106KB baud rate) interface, a control unit and an EEPROM. The card reader sends a set of fixed-frequency electromagnetic waves to the IC. There is an IC series resonant circuit in the card, and its frequency is the same as the frequency of the reader. This will produce electromagnetic resonance, so that there is a charge in the capacitor. A one-way electronic pump is connected to the other end of the capacitor to send the charge in the capacitor to another capacitor for storage. When the stored accumulated charge reaches the rated voltage, this power supply can be used as a power supply to provide working voltage for other circuits, transmit the data in the card or receive data from the reader. The control input and output circuit of the contactless IC card is shown in Figure 5:
2. System software design
2.1 Main program design flow chart
The main program design flow chart is shown in Figure 6.
2.2 Communication of interrupt processing module
First, the time conflict problem must be solved. The time for the hardware to receive or send a byte is about 1ms, while the time for the software to receive or send a byte is only a few μs, which provides conditions for dual serial ports to communicate simultaneously. Simultaneous communication actually divides the CPU time into very small time slices. Assuming that the longest time for the faster serial port to send or receive a byte is TRbyteMax, the CPU longest time slice should generally be less than TRbyteMax/2. Of course, in the gap after receiving or sending a frame of data, the CPU time slice can be appropriately extended to do some necessary data processing. Secondly, the data conflict problem must be solved. The two serial ports use their own receiving and sending data buffers and control variables to reduce the amount of interrupt protection data and prevent data conflicts. When the main program, serial port interrupt handler and other interrupt handlers write data to the memory (the memory used for communication with the host computer), the other serial port interrupt must be closed in the shortest possible time. The interrupt closing time should be less than a few hundred μs to prevent the serial port from reading this data before other program data is written. The high-reliability cyclic redundancy check (CRC) technology is used in the serial communication data frame, which greatly reduces the data bit error rate. No bit errors were found in the large amount of data running continuously for several months.
3. Conclusion
This system design is based on C8051F340 dual serial port for elevator remote control. It adopts modular, structured, and object-oriented design methods to make the system highly reliable and real-time. At the same time, the hardware circuit module and software program diagram are given. The hardware circuit diagram is highly versatile and easy to reference and design. In addition, the IC card circuit and dual serial port communication also provide guarantees for the reliability and security of the system.
Previous article:Data Acquisition System Based on C8051f060 Single Chip Microcomputer
Next article:Design of logic non-circulating reversible speed regulation system based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- Mission-oriented wireless communications for cooperative sensing in intelligent unmanned systems
- CVPR 2023 Paper Summary: Embodied Vision: Active Agents, Simulation
- ICCV2023 Paper Summary: Fairness, Privacy, Ethics, Social-good, Transparency, Accountability in Vision
- Introduction to Artificial Intelligence and Robotics (Murphy)
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
- Microwave and RF Applications
- With the advent of 5G, what should we pay attention to when designing mobile phone antennas?
- 220V motor control board, discharges very slowly after power failure, and can still shock people after a long time
- [ESP32-S2-Kaluga-1 Review] 3. Physical buttons?
- Has anyone seen this chip?
- Unable to search for Bluetooth signal after adding characteristic value
- [Automatic clock-in walking timing system based on face recognition] Maixbit K210 drives MAX98357A to play WAV audio
- A brief talk about RISC-V GCC: Linker script learning notes (I)
- How to insert assembly code in Keil 5 version?
- [Raspberry Pi Pico Review] VII. Raspberry Pi Pico Review Summary