With the rapid development of computer technology and communication technology, it has become a reality to collect, transmit and process data from numerous metering points. The Automatic Meter Reading (AMR) technology came into being and gradually became the mainstream of meter reading technology.
1 Composition of the centralized power meter reading system
The electric power centralized meter reading system adopts a three-layer architecture, as shown in Figure 1. The first layer is the main station server, which is mainly responsible for storing the data of the multi-function meter and realizing the functions of remote monitoring and remote control of the meter. The server is installed in the meter reading main station of the customer service center, and receives the relevant data and parameters of each multi-function meter through GPRS/GSM. The second layer is the concentrator, which is connected to the main station server through GPRS/GSM and connected to the collection terminal of the third layer through the CAN bus to complete the data communication with the collector and the main station server. The third layer is the collector. Various standard communication protocols are embedded in the collector to realize the collection of various meters. The collector can collect and store data from 64 meters at the same time. It not only completes the electricity data collection of the meter, but also completes the data communication with the concentrator according to the requirements of the system, and sends the electricity data to be transmitted to the concentrator. Through GPRS/GSM wireless communication, the system can transmit remote information in a timely and convenient manner and exchange information with the main station server; each concentrator can manage up to 110 collectors through the CAN bus.
2 CAN bus communication system design
2.1 Introduction to CAN Bus
Controller Area Network (CAN) is one of the most widely used fieldbuses in the world. It has the advantages of advanced technology, high reliability, complete functions and reasonable cost, and has been widely used in various automation control systems. This design gives a CAN bus node solution and uses the built-in multi-channel CAN bus controller LPC2294 as the main controller.
2.2 CAN node hardware circuit composition
Figure 2 shows the CAN node hardware circuit, which consists of the AMR microcontroller LPC2294, CAN bus transceiver TJA1050T, high-speed optocoupler 6N137 and power isolation module B0505S.
2.2.1 Controller Features
The LPC2294 selected in this design is a powerful, ultra-low power 32-bit microcontroller with ARM7TDMI core newly launched by Philips. It has a 144-pin package, 2 32-bit timers, 8 10-bit ADCs, 4 CAN channels and PWM channels, and up to 9 external interrupts. It has an internal embedded 256 KB high-speed FLASH memory and 16 KB static RAM, and contains 76 (using external memory) to 112 (single chip) GPIO ports. Such rich on-chip resources can fully meet the needs of general industrial control, while also reducing the complexity of system hardware design. In addition, LPC2294 supports JTAG real-time simulation and tracking, a 128-bit wide memory interface and a unique acceleration structure, which can enable 32-bit code to run at an operating frequency of up to 60 MHz. LPC2294 has 4 CAN controllers integrated inside; it complies with CAN specification CAN2.0B and ISO 11989-1 standard; the bus data baud rate can reach 1 Mb/s; it can access 32-bit registers and RAM; the global acceptance filter can identify the 11-bit and 29-bit Rx identifiers of almost all buses; the acceptance filter provides FullCAN-style automatic reception function for selecting standard identifiers. As the core component of this design, LPC2294 not only plays the role of the main controller, but also serves as the node controller of the CAN network to realize data transmission and exchange with other nodes in the network. [page]
2.2.2 Transceiver Features
The transceiver TJA1050T is the interface between the CAN protocol controller and the physical bus and is fully compatible with the "ISO 11898" standard. CANH and CANL work together ideally to reduce electromagnetic radiation to a minimum. In addition, when the TJA1050T is not powered, the bus is passive, which makes the TJA1050T much better than previous CAN bus transceivers in terms of performance. The TJA1050T has two operating modes: high speed and silent (they are controlled by pin "S"). In high speed mode, the bus output signal has a fixed slope and switches as fast as possible. High speed mode is suitable for maximum bit speed and maximum bus length, and its transceiver cycle delay is minimal at this time; in silent mode, the transmitter is disabled regardless of the input signal of TxD. Silent mode prevents network communication from being blocked when the CAN controller is uncontrolled.
3 CAN bus communication system software design
For the LPC2294 microprocessor, the CAN controller is completely event-triggered, that is, when its own state changes, the CAN controller will tell the microprocessor the result of the state change. Therefore, the central microprocessor can use interrupt mode or polling mode to make corresponding processing on the CAN controller. Each CAN node sends data to the bus in the specified format and cycle, and takes the required message as needed. For receiving data, it is implemented in an interrupt mode. Once an interrupt occurs, the received data is loaded into the corresponding message register. At this time, the mask filter register is used to selectively compare the identifier of the received message with the identifier set in advance when the receive buffer is initialized. Only messages with matching identifiers can enter the receive buffer, and those messages that do not meet the requirements will be shielded outside the receive buffer, thereby reducing the burden of CPU processing messages.
3.1 CAN controller initialization
The operations of initializing the CAN controller include hardware enable, software reset, setting alarm limits, setting bus baud rate, setting interrupt working mode, setting acceptance filter working mode, setting working mode and starting CAN, etc. The initialization procedure is as follows:
3.2 Data transmission
After the data to be sent is packaged into a frame format that conforms to the CAN protocol, it can be written into the send buffer and the transmission can be started. Before writing the send buffer, its status must be queried. Each CAN controller in the LPC2294 has 3 send buffers, and their status can be obtained by querying CANSR. Data can only be written when there is an idle send buffer. This step is particularly important when sending a large amount of data, otherwise the reliability of the transmission cannot be guaranteed. After the transmission is successfully started, the data can only be judged whether it has been sent successfully by querying the TCS bit of CANGSR or cooperating with the successful transmission interrupt.
3.3 Data Reception
Data can be received in query mode or interrupt mode. The CAN bus is not always active during a period of time. To improve efficiency, the interrupt mode can be used. The receive interrupt must be enabled in the initialization program. In the interrupt service subroutine, read CANICR to determine whether there is a receive interrupt flag. If so, read the receive buffer data. In order to prevent the receive buffer data from overflowing, a circular receive data queue can be opened to temporarily store data, and the main program obtains bus data by querying the queue.
4 Conclusion
Based on the ARM CAN bus, the data communication of the centralized electric power meter reading system has strong real-time, reliability and anti-interference performance. The prototype of the system is undergoing network testing in order to further improve the communication processing, error correction and fault tolerance capabilities of the program through research and improvement.
References:
[1]. GPRS datasheet http://www.dzsc.com/datasheet/GPRS_1594650.html.
[2]. LPC2294 datasheet http://www.dzsc.com/datasheet/LPC2294_454558.html.
[3]. TJA1050T datasheet http://www.dzsc.com/datasheet/TJA1050T_649183.html.
[4]. 6N137 datasheet http://www.dzsc.com/datasheet/6N137_91364.html.
[5]. ARM7TDMI datasheet http://www. dzsc.com/datasheet/ARM7TDMI_139812.html.
Previous article:Research and implementation of dynamic password terminal based on ARM7 smart card
Next article:Software Implementation of FIR Digital Filter Based on ARM
- Popular Resources
- Popular amplifiers
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 I give you a...
- Using C6748 and C5509A to drive nRF24L01 for data transmission
- Dual-band Wi-Fi 6 front-end modules are here, and the era of Wi-Fi 6 is coming soon
- Free gifts! 11 popular Maxim development boards are waiting for you!
- Learn about PI's new PowiGaN switching power supply IC and answer questions to win prizes!
- MSP430 MCU Development Record (28)
- [nRF52840 DK Review] Custom BLE Services
- Download and get a gift | Keysight Technologies [Cheats on how to choose and use oscilloscope probes]
- Correct timing
- msp430g2553 microcontroller