Introduction
SOPC (System On a Programmable Chip) is called a programmable system on chip. It is a reconfigurable system on chip (SOC) based on programmable logic devices (FPGA or CPLD). Programmable system on chip (SOPC) is a flexible and efficient SOC solution proposed by AL-TERA. It integrates the functional modules required for system design such as processor, memory, I/O port into a programmable device to form a programmable system on chip. SOPC combines the advantages of SOC, CPLD and FPGA, and has the following basic features: at least one embedded processor core; small-capacity on-chip high-speed RAM resources; rich IP core resources to choose from; sufficient on-chip programmable logic resources; processor debugging interface and FPGA programming interface; contains some programmable analog circuits; single chip, low power consumption, micro packaging.
Temperature and humidity are important parameters in industrial and agricultural production, meteorology, environmental protection, national defense, scientific research, aerospace and scientific experiments, and temperature and humidity automatic control systems are widely used in many fields such as industrial production, medicine, crop cultivation and scientific experiments. At present, most of the temperature and humidity automatic control systems on the domestic market are designed based on single-chip microcomputers or ARM series chips. Comparing these two designs, the temperature and humidity automatic control system based on SOPC has a higher degree of integration and is more portable; it has higher stability and accuracy than the temperature and humidity automatic control system based on single-chip microcomputer, and it is more convenient to design than the temperature and humidity automatic control system based on ARM series chips, with a shorter design cycle and more cost advantages.
1 System composition
The overall block diagram of the temperature and humidity automatic control system is shown in Figure 1. The system is structurally divided into two layers: the first layer is composed of a PC, which serves as the upper computer; the second layer is composed of a Nios system and peripheral devices, which serves as the lower computer. The upper computer and the lower computer communicate using the RS485 bus.
The structure diagram of the lower computer is shown in Figure 2. It is composed of the Nios system, actuators, and display, input, and output ports. The Nios system consists of the CPU (Nios), on-chip RAM, timer, bus, asynchronous serial port UART, and general PIO. Among them, the NIOS system is connected to the A/D converter, keyboard, LED display, actuator, etc. through PIO.
The working process of the temperature and humidity automatic control system is: first, information is collected through the temperature and humidity sensor; second, the NIOS system transmits the collected information to the host computer through the UART interface. The host computer analyzes and processes the collected information; finally, the NIOS system outputs decision-making instructions to the terminal control device based on the analysis and processing results of the host computer. If the temperature or humidity exceeds the limit, it will display and alarm, and drive devices such as fans or heaters. The control system also adds keyboard input to the lower computer, so that the lower computer can be used alone, making the lower computer itself an independent control system. We will focus on the design process of the lower computer below.
2 Hardware Design of System Lower Computer
The hardware development steps of SOPC system are as follows: generate NiosⅡ embedded processor with SOPC Builder; combine NiosⅡ embedded processor with other logic circuits with QuartusⅡ for design input; then compile (including analysis, synthesis and layout and routing); finally download hardware configuration data to FPGA through download cable.
The lower computer hardware design of this system adopts SOPC development tool (i.e. SOPC Builder) of ALTERA Company for design. SOPC Builder tool provided by ALTERA Company can conveniently design personalized NiosⅡ soft core. Cut out unnecessary peripherals to save system resources and add required interfaces. Using SOPC Builder tool, designers can easily connect processor, memory, other peripheral modules and necessary PIO interfaces to develop a complete system. In SOPC Builder. Graphical user interface, designers can also manage IP modules, set system parameters and select available ports and peripherals. After completing the design, the system starts the generation program, and a large number of output files will be generated, including HDL logic files, program header files and library files. These files are included in the Nios II IDE development environment, and Nios II software development can be performed on this software development platform.
2.1 Nios II soft-core processor
The NiosⅡ soft-core processor is a general-purpose 32-bit RISC embedded processor launched by ALTERA. It is specially optimized for programmable logic and equipped with a fully functional development kit. Including C/C++ compiler, integrated development environment (1DE), JTAG debugger, etc., it is the core of ALTERA's programmable single-chip system solution.
As a soft-core processor. NIOS II provides configurable hardware and software debugging features. Including basic JTAG operation control (run, stop, single step, memory, etc.), hardware breakpoints, data triggers, on-chip and off-chip tracking, embedded logic analyzer. These powerful tools can be used in the development stage and can be removed after debugging to save resources. The NIOSⅡ processor also provides three cores with different performances: high, medium and low. By combining with more than 60 IP cores provided by ALTERA (such as UART, clock, DMA, SDRAM, parallel IPO, etc.), designers can easily create a perfect solution in terms of processor, peripherals, memory and PIO interface for specific applications. In addition, NIOSlI has many other excellent features, such as instruction customization, hardware accelerator, etc.
2.2 AVALON bus
AVALON bus is a simple bus structure designed to connect the on-chip processor and peripherals into a programmable system on chip (SOPC). The bus specifies the port connection between the controller and the slave components and the timing of the communication between the components. The basic transmission mode of the AVALON bus is to transfer a single byte, half word or word between a master peripheral and a slave peripheral. When a transmission is completed, regardless of whether the new transmission process is still between the same peripherals, the AVALON bus can always start another transmission immediately in the next clock cycle. The AVALON bus supports multiple bus master peripherals, allowing multiple data units to be transferred between peripherals in a single bus transaction. This multi-master device structure provides great flexibility for building SOPC systems and can adapt to high-bandwidth peripherals.
2.3 Peripherals
In this system. The NIOS system includes peripherals such as on-chip RAM, timers, asynchronous serial ports UART and general PIO. These peripherals are integrated in the SOPC BUILDER development tool. Users only need to integrate the required peripheral components and CPU into the FPGA through the AVALON bus to complete the entire lower-level computer hardware design, thereby shortening the design cycle.
2.4 Temperature and humidity sensor
The temperature and humidity sensor selected for this system is SHTll, which is a single-chip fully calibrated digital relative humidity and temperature sensor with a PC bus interface produced by the Swiss Sensirion company. The sensor uses a unique CMOSens TM technology and has the characteristics of digital output, no debugging, no calibration, no peripheral circuits, and full interchangeability.
3 Software Design of System Lower Computer
The software design of the system lower computer is carried out in the NIOS IDE development environment. Based on the software generated by SOPC Builder, the source program is written in C/C++ language, and then compiled, linked, and debugged to generate an executable file. Finally, the executable program is debugged and run through the download cable. The system lower computer software mainly includes initialization, data acquisition subroutine, serial port receiving and sending subroutine, temperature and humidity control subroutine and display subroutine. Here we focus on the flow chart of the temperature and humidity control subroutine. As shown in Figure 3.
The temperature of this temperature and humidity automatic control system is required to be controlled between 5℃ and 30℃. If the collected temperature T>30℃, the program turns to Jw (cooling processing program) and sends an alarm signal; if T<5℃, the program turns to SW (heating processing program). And send an alarm signal; if 30℃>T>5℃, the program turns to the display subroutine and returns to the main program. The humidity control process is similar to the temperature.
4 Conclusion
This system uses SOPC technology to cleverly integrate the signal acquisition module and the microprocessor module into an FPGA. And by using the flexibility of programmable logic and the powerful processing power of NIOS II, the temperature and humidity automatic control function is conveniently realized. The implementation function of this system is relatively simple. Since there are still a lot of logic resources inside the FPGA that can be used, more complex functions can be realized.
The actual results show that the temperature and humidity automatic control system based on SOPC runs normally, data transmission is reliable, and operation and management are convenient. If it is equipped with a 485 bus, the whole system will be even more powerful.
Due to the programmable characteristics of FPGA, the system can be upgraded in software and hardware without changing any peripheral circuits, which greatly extends the life cycle of the system. This is also an advantage over other control systems. The use of SOPC solution for system design is in line with the development direction of today's science and technology.
Previous article:Application of DCS Control System in Coke Oven Ground Dust Removal Station
Next article:Design of a humidity measurement circuit
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Basic principles of static timing analysis and timing analysis models
- Need c51 double precision floating point program
- Sketching the halogen lamp driver power supply schematic diagram solution
- [Environmental Expert's Smart Watch] Part 5: Data Communication Design between Devices
- Making the Most of Every Coulomb: The Art of Power Management in the Portable Era
- The national competition topic has been released. Have you chosen your topic yet?
- What is Wearable Technology
- What does this paragraph in the ADS1220 data sheet mean?
- Mobile IoT market statistics: Huawei chips rank second in the world
- MM32F103 lighting and serial port experiment