Application of C8051F microcontroller in remote measurement and control devices

Publisher:草莓熊猫Latest update time:2006-11-28 Source: 电子设计应用Keywords:SoC  CDMA  programming Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The C8051F microcontroller is a fully integrated mixed-signal system-on-chip (SoC) with a CIP-51 core that is fully compatible with the 8051 instruction set and features high speed, high performance, and high integration. Good results have been achieved in a set of remote measurement and control devices designed in this article.

System Introduction:
The remote measurement and control device is a field programmable controller that can complete data collection and control, and upload the data to the central station or receive the central station through remote communication methods (such as radio, CDMA, dial-up, etc.) Remote control commands. It is often installed in places that are scattered, have harsh environments, have no power supply guarantee (frequent power outages or use solar energy), and are unattended, so the reliability and power consumption of its operation are particularly important. The C8051F microcontroller's industrial-grade operating temperature (-40℃~+84℃), low voltage, low power consumption, built-in watchdog and multiple reset sources meet the requirements of this system.

Based on the positioning of this system, C8051F064 is selected as the main control part and C8051F236 is used as the slave part. The system requires flexible configuration of input/output points, multiple communication ports, and the ability to modify configurations on site.

The system structure is shown in Figure 1. The system uses 220VAC or 24VDC power supply. The main unit consumes 3.3W power and each slave unit consumes 2.2W. It can expand up to 8 slave units.


Figure 1 System structure diagram

Main unit structure
The main unit structure is shown in Figure 2. According to the characteristics of the system, the functions of C8051F064 are configured as follows:

Memory
C8051F064 comes with 4352 bytes of RAM and 128 bytes of Flash. Since the system does not have high real-time requirements for data And using remote communication methods, in order to reduce power consumption, a large amount of data is often cached and sent collectively at a certain time, so a relatively large data storage area is required. The 32KB RAM can be expanded by using external data and address buses. In addition, as a field programmable device, a large number of parameters need to be set, and these parameters need to be retained when power is lost. Therefore, in addition to using the 128-byte non-volatile RAM inside the microcontroller, an 8KB E2PROM is also expanded.

Utilization of address and data buses
The address and data buses adopt a multiplexing method. C8051F064 supports 64KB of external storage space and the extended RAM is 32KB. Therefore, the remaining address line A15 is free. Use A15 and other low-order data lines to use The NAND gate can form a chip select signal to select the device on the bus. There is also an external real-time clock on the bus, which is used as a time mark for the system. Since this chip has a battery-retained RAM, data that needs to be maintained during frequent operations can be stored here, thus avoiding internal non-volatile Complex operations of RAM and E2PROM. In addition, the on-site digital I/O can also be composed of bus and chip select through photoelectric isolation, which can greatly reduce the pins of the microcontroller.


Figure 2 Main unit structure diagram

The serial port
C8051F064 has two UARTs inside. The serial port 0 is converted into an RS-485 signal through photoelectric isolation and is used to connect to other equipment on site. The serial port 1 plus 6 GPIO ports become a full-featured standard after level conversion. RS-232 interface, used to connect with Modem, radio, CDMA, etc. Use the SPI port of C8051F064 to expand into UART through MAX3100, and convert it into RS-232 or RS-485 signals through external optional accessories. The maximum analog input of

the analog
C8051F064 does not exceed 3.6V, so pay attention to its range when connecting the signal. For this system, since most of the on-site signals are 4mA~20mA current, a 100Ω precision resistor is used, coupled with a 2.5V Precision voltage source can adjust the accuracy of analog quantity to 1‰. In addition, activating the window detection function of the internal ADC0 can easily realize the upper and lower limit violation alarm function of the analog quantity. Most of

the digital quantities
are directly hung on the bus. In addition, there are two switching inputs directly connected to the pins of the microcontroller, and these two pins are allocated internally as inputs of the timer/counter. These two channels can be used simultaneously. Pulse amount.

MCU resource allocation
The port function allocation of C8051F064 uses the cross switch method, and it also has priority. This method is very flexible, but requires the designer to prepare the internal function allocation during circuit design, which means circuit board processing Once completed, you cannot modify the crossbar switch at will. In addition to realizing the traditional RESET signal reset,

the reset
C8051F064 also has reset functions such as power on, power off, external signals, software commands, comparator 0, clock loss detection and door open dog, with a total of 7 reset methods. After the microcontroller is reset, you can know what caused the reset by querying the register, which is very useful for data processing and fault analysis. This system uses power-on, software commands, clock loss and watchdog. The reason for adding software command reset is that because these devices are installed in relatively remote locations, when the central station detects an abnormality in the device, it can Restart to resolve some unusual issues.




Figure 3 Some technical issues
from the module structure diagram Data storage
There are multiple memories that can store data in this system, such as 256 bytes of internal RAM, 4KB of internal expansion RAM, 32KB of external expansion RAM, and 128 bytes of Flash , 114 bytes of battery-maintained RAM in the real-time clock and an external 8KB E2PROM. With so many data storage areas, their uses must be carefully allocated in order to give full play to their functions and speed. This system makes the following allocation: 256 bytes of internal RAM has the fastest read and write speed, and it is occupied by the microcontroller core, so its use should be reduced. It is used in places with high speed requirements and frequent use, such as within interrupts. variables, etc.; 4KB internal extended RAM and 32KB external extended RAM have the same status, and are generally used as intermediate variables of the program; 128-byte Flash is modified as a whole, so all data must be read into the buffer before modification. Change the modified bytes, erase the entire chip, and then write the data. Although it is troublesome to write, it is very convenient to read, so it is used to store some data that is not frequently changed and needs to be retained when power is turned off, such as the correction value of analog quantities, etc.; the 114-byte RAM in the real-time clock is faster to read and write, and It is easy to access, so it is used to store intermediate variables that need to be retained after power-off, so that they can be read and written at will. The 8KB E2PROM is limited by the bus logic and is slow to read and write, but the data area is large and is used to store function settings. When the program is initialized, read it out and put it in the intermediate variable area, and do not operate it in the future. Modifying internal data operations should not be performed during an interrupt to prevent prolonging the interrupt time. This article uses a 22.1184MHz crystal oscillator for

the watchdog , so the maximum watchdog monitoring time is only 47.4ms, which does not require high real-time performance.
This article uses the method of interrupting dog feeding. Generally speaking, it is not possible to simply interrupt feeding the dog, because the main loop is responsible for the program, and when the main loop enters an abnormal state, the interruption is often still in progress, so using the interrupt to feed the dog requires the cooperation of the main loop. What is used here is a 5ms interrupt to feed the dog. The variable a is used to accumulate in the interrupt. When a accumulates to 100, the dog will no longer be fed; and a is continuously cleared to 0 in the main loop, so that the watchdog time can be extended. to 500ms. The ADC of

the analog filter
C8051F064 is a successive approximation type. Although the speed is as fast as 1MSPS, the jitter of the data is extremely large. Therefore, when applied in a hybrid system, a filter circuit must be added to the periphery. It does not matter if it is not considered in the hardware design. You can take full advantage of its speed and use software filtering internally. This system does not have high requirements for the acquisition speed of analog quantities, but only requires stability and accuracy. It uses a 20-point median average filter internally, and then uses 20 average values. In this way, even if there are no external filtering measures, Can also get good results.

Slave unit structure
The slave unit adopts the method of adding modules to the base plate, and arranges four module positions on the base plate. The interfaces of these positions must be exactly the same, so that the points can be flexibly configured. According to the system requirements, all I/O points must be electrically isolated. There is no need to choose a microcontroller with ADC and DAC. It only needs to have enough GPIO. According to this principle, this system selected C8051F236, such as As shown in Figure 3. The slave unit retains the LCD and keyboard interfaces when the master unit was designed. Although most parameters are set in the master unit, retaining this interface allows you to see the module’s software version number and other information. If there are parameter settings in the future, you can also Set here to the non-volatile RAM area in the microcontroller.

The communication between master/slave adopts Modbus protocol. There is no need to expand the slave unit. You can use this port to connect to external Modbus protocol devices. The structure of the slave unit is relatively simple, and the microcontroller is only responsible for a small part of the work, which is omitted here.


In practical applications, system networking usually does not use one device, but connects multiple devices into a wired or wireless network. Wired networks generally use RS-485 structure or dial-up method, and are used in systems with close distances. The central station patrols each site; wireless networks generally use radio stations and CDMA. Unlike wired networks, this link is charged, so communication cannot use patrol mode. When communicating with radio stations, the distance is often long and power supply is difficult, so the method of reporting when there is a change should be adopted. The switch value will be sent as long as it changes position, and the analog value will be sent when it exceeds the preset dead zone range. Since radio stations often Frequency division multiplexing is used, so each station must have its own time slice. When there is data that needs to be sent, the data will be cached. When its own time slice is reached, the cached data will be sent, so that no data will appear. It also helps reduce power consumption, which is very beneficial for solar-powered systems. Simply reporting when there is a change is flawed, because when the system has not changed, it does not send data, so it is not known whether the data has not changed or there is a problem with the site, so this system has added an hourly safety reporting function. , that is, at regular intervals, such as 4 hours, all sites will send all their data once, so that the problem can be clearly seen. When using CDMA communication, although there is no problem of frequency division multiplexing, the transmission data must be sent in time division to avoid a large amount of data flooding into the data center at the same time under certain circumstances, causing channel congestion.

System testing and operation
After the system design was completed, strict testing was conducted. The operating speed of the microcontroller achieved the expected results, and the power consumption and overall heat dissipation were better than the original system. Experiments on fast transients, radiation immunity, electrostatic discharge and voltage mutations were conducted in the electromagnetic compatibility laboratory, and the indicators are better than the national requirements for such products. At the same time, the system was subjected to high temperature (60°C) and low temperature tests (-20°C), constant humidity and heat, vibration, collision, insulation strength and other tests, all of which were better than national standards. In various applications such as flood control, water network, heating network, etc., this system is used to form a wireless network with CDMA and radio stations, which can reach up to more than 60 points, and the operation is stable and reliable. In the building control system, the wired network composed of RS-485 has also achieved good results.

References
1. [US] Cygnol Integrated Products, Inc. C8051F microcontroller application analysis. Translated by Pan Zhuojin, Sun Delong, Xia Xiufeng, Beijing: Beihang University Press, 2002
2. Silabs.C8051F06X Data Sheet.http://www.silabs.com.2004
3. Tong Changfei. C8051F series microcontroller development and C language programming, Beijing: Beihang University Press, 2005

Keywords:SoC  CDMA  programming Reference address:Application of C8051F microcontroller in remote measurement and control devices

Previous article:Simple intelligent robot designed based on AT89C51 microcontroller
Next article:Application of C8051F microcontroller in remote measurement and control devices

Recommended ReadingLatest update time:2024-11-16 16:19

Vehicle Remote Fault Diagnosis System Based on CDMA and CAN Bus
   1 Introduction   All cars and light trucks manufactured and sold in the United States must be equipped with an on-board diagnostic system (OBD-II) from January 1, 1996. However, OBD-II is mainly used for emission system diagnosis, and other subsystems of the vehicle can be diagnosed by OBD-II. Although these diag
[Microcontroller]
Vehicle Remote Fault Diagnosis System Based on CDMA and CAN Bus
Zhenxin Technology: The company continues to promote the research and development of SOC/CMOS RF and other technologies
Recently, Zhenxin Technology said in an institutional survey that in the field of integrated circuits, the company has more than ten years of technical accumulation and brand advantages in the design of related components. The company's independently designed and developed high-end integrated circuit products are divi
[Mobile phone portable]
FG25 sub-GHz SoC with long transmission distance, large memory and high security is now generally available
FG25 sub-GHz SoC with long transmission distance, large memory and high security is now generally available Flagship sub-GHz SoC ideal for smart cities and long-range IoT Beijing, China – February 15, 2023 – Silicon Labs, a leader in secure, intelligent wireless technologies for a mor
[Industrial Control]
FG25 sub-GHz SoC with long transmission distance, large memory and high security is now generally available
Measuring Blocking of CDMA Receivers
Overview The CDMA wireless system was designed to operate in the same radio frequency band as the older Advanced Mobile Phone System (AMPS), which operated in the U.S. cellular band before the introduction of CDMA technology. The AMPS radio scheme divides the frequency into many adjacent relatively narrowband FM cha
[Test Measurement]
Measuring Blocking of CDMA Receivers
Broadcom releases its first WiFi 7 SoC BCM4916, quad-core Armv8
Although the WiFi 7 (802.11be) specification won't be ratified until 2024, manufacturers are already preparing for it. Today, Broadcom released its first WiFi 7 SoC, model BCM4916, which uses a quad-core ARMv8 processor, can provide up to 24 DMIPS performance, with 1 MB L2 cache and 64 kB L1 cache. Other specificati
[Network Communication]
Broadcom releases its first WiFi 7 SoC BCM4916, quad-core Armv8
Automotive SoC Security: Securing In-Vehicle Computers to Enable SDV Instances
It is a computer system that collects information and processes complex and high bandwidth data from different ECUs and sensors in the vehicle, such as Adas, infotainment, navigation, powertrain applications. Most of these onboard computers require a System-on-Chip (SoC) to compute large amounts of data a
[Embedded]
Automotive SoC Security: Securing In-Vehicle Computers to Enable SDV Instances
Goertek and Shanghai Taisi Microelectronics jointly develop dedicated SoC to promote the development of TWS headsets
On December 11, 2020, Goertek Co., Ltd. (hereinafter referred to as "Goertek") and Shanghai Taishi Microelectronics Co., Ltd. (hereinafter referred to as "Taishi Micro") signed a long-term cooperation framework agreement, a chip cooperation development agreement and a procurement framework agreement at Goertek's headq
[Internet of Things]
Goertek and Shanghai Taisi Microelectronics jointly develop dedicated SoC to promote the development of TWS headsets
How to use software as stimulus to accelerate SoC system-level verification?
Verifying complex SoC designs is extremely costly and time consuming. It has been shown that the time required to verify a design increases exponentially with the size of the design. Over the past few years, a number of techniques and tools have emerged that enable verification engineers to address this problem. Howeve
[Power Management]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号