Abstract: Modern electronic testing instrument systems centered on computers are developing rapidly, and the objects being measured are very broad. To meet the ever-increasing performance demands of digital systems and the need for high integration to reduce chip manufacturing costs, the development of low-power, multi-functional intelligent instrument systems is particularly important. This paper first analyzes various factors affecting power consumption, and with low power consumption as the primary objective, develops a general-purpose, multi-purpose, low-power instrument system based on the MSP430 chip. The paper introduces the characteristics of the MSP430 chip, carefully analyzes each functional module of the hardware and software, and optimizes its design.
Keywords: low power consumption, MSP430, instrumentation system
Designation of Low Cost Instrument System Based on MSP430 XIE Min
Abstract: At present modern electrical testing instruments is developing rapidly. Because of the improvement of the digital systems capability and the requirement of the low producing cost, it is so important to develop an all-purpose and muti-function low cost instrument. Aiming at the low system cost, Many factors which affect the system cost were analyzed in the paper, then I give out a new all-purpose and muti-function low cost instrument based on the MSP430. of the main function module of the hardware and software. At last some optimal and anti-jamming improvements were developed and used in the low cost system.
Keywords: low system cost, MSP430, instrument
1 Introduction
In today's highly developed scientific and technological society, intelligent testing instruments and instrumentation systems are developing rapidly, with a wide range and diversity of tested objects. The rapid development of computer technology has propelled the development of instrumentation to a new level, with traditional testing equipment being replaced by intelligent instruments. The two main development directions of intelligent instruments are large-scale automatic testing systems and portable, low-power intelligent instruments, making power consumption a crucial factor to consider in circuit design. In this paper, I will propose a design scheme for a general-purpose low-power instrumentation system based on the MSP430. This low-power system, combined with different sensors, can achieve data acquisition and processing, and features keyboard input and LCD display functions, making it suitable for various working environments.
2. Hardware Design of Low-Power Instrumentation System
2.1 Overall Hardware System Design
The MSP430 chip is selected in this instrumentation system. The MSP430 series is a 16-bit ultra-low-power mixed-signal microcontroller with a reduced instruction set. It includes a flexible clock system with von Neumann architecture addressing mode (MAB) and data storage mode (MDB). With a CPU containing a standard address mapping and digital-analog peripheral interfaces, the MSP430 provides a solution for mixed-signal application requirements.
The main features of the MSP430 series include: an ultra-low power architecture that significantly extends battery life; ideal high-performance analog characteristics for precision measurements; a 16-bit RISC CPU that provides new features for the code segment capacity processed per time slice; and a system-programmable Flash memory that allows for repeated code erasure, block erasure, and data loading. Figure 3-1 shows the hardware block diagram of the energy meter.
Figure 1 System Hardware Block Diagram
The hardware in Figure 1 can be divided into functional modules such as data acquisition, amplification and filtering, microcontroller, keyboard, LCD display, clock circuit, data storage, DAC, alarm, watchdog circuit, RS485 communication and power management.
2.2 Module Design
2.2.1 Power Module Design
Throughout the system, I used ±5V, ±12V, 2.5V, and 3V. The ±5V and ±12V voltages were powered by dedicated power modules. Since the MSP430 microcontroller is a low-power microcontroller and uses a 3V power supply, a dedicated power module was required. The microcontroller's power module is the Texas Instruments TPS76301, a surface-mount power module with continuously adjustable output voltage, capable of outputting 1.6-5.0V. It has only 5 pins. It can provide 150mA of current. The application circuit for the output voltage is shown in Figure 2.
Figure 2 Application circuit of TPS76301
The current flowing through resistors R1 and R2 must be around 7μA. Lower resistances can be used, but this wastes power; excessively high resistances are also unsuitable, as they will increase leakage current at the FB terminal and cause voltage errors. The recommended resistance value is R2 = 169KΩ, ensuring the current flowing through R1 and R2 is approximately 7μA. R1 can be calculated using the following formula:
Typical values for some resistors and output voltages are shown in Table 1:
Table 1 Typical values of output voltage and resistance
2.2.2 Amplification and Filtering Module
The preamplifier I used in the input channel of this low-power system is the TI OPA349. The input channel circuit is shown in Figure 3. In addition to amplification, this circuit also has a filtering function to eliminate irrelevant AC components.
Figure 3 Amplification and Filtering Circuit Diagram
2.2.3 RS-485 Communication Circuit
The communication module is a crucial component of this system. The controller uses the communication module to upload historical operating data and related information, and to receive basic parameters and control commands. A well-designed communication circuit directly impacts the controller's debugging, functionality, and versatility.
Figure 4 RS-485 serial communication
Figure 4 shows the RS-485 communication interface circuit. Data transmission between the microcontroller and the host computer is handled by the RS485 transceiver NAX485, with the microcontroller's USARTI pins controlling sending and receiving. The communication mode is half-duplex, controlled by the microcontroller's P3.5 port. To improve data transmission immunity, the RS-485 is powered by a separate +5V supply, using a high-speed optocoupler for complete isolation from other power supplies and not sharing a common ground. Due to the long transmission line and the potential for electromagnetic interference in the field, a transient voltage suppressor (TVSC) is connected in parallel on the transmission line, and a fuse is connected in series. Shielded cables are also used for the transmission line.
Other components, such as the clock circuit module, A/D conversion module, LCD display interface design, keyboard interface module, and storage expansion module, will not be described in detail.
Figure 5 Flowchart of the main program of the smart terminal
3. Low-power system software design
The software design of a microcontroller application system differs from general programming. It involves the design of various calculation programs and control strategy programs, as well as the design of various input/output programs in conjunction with specific hardware circuits. This instrument system software adopts a modular structure design, with each functional module designed as an independent programming and debugging block. This facilitates future functional expansion, makes debugging and connection easier, and is more conducive to program portability and modification.
The software design of this system uses C language suitable for the MSP430 series, which is highly compatible with standard C language. The development platform uses IAR's integrated debugging environment Embedded Workbench and C-SPY debugger, specifically provided for the MSP430 series.
3.1 Introduction to Time-Triggered Hybrid Scheduling
The scheduler is like a simple operating system, capable of periodically or one-time task execution. In essence, the scheduler is a timer interrupt service routine shared by many different tasks; by initializing a single timer, multiple tasks can be scheduled. A task's characteristics consist of four parts: a pointer to the task function, a delay time, the task execution cycle, and a task execution availability flag. The scheduler uses a timer to generate regular time intervals and determines and schedules tasks based on the task execution availability flag.
In this general-purpose intelligent terminal, tasks such as AD conversion, switch quantity acquisition, LCD display, and output control are cooperative tasks, executed sequentially according to delay time and cycle. Keyboard scanning is decomposed into short tasks. 485 communication is an interrupt-driven task, executing host computer commands. In reality, most command tasks change the contents of certain variables or registers according to command requirements, and the execution speed is very fast, executing once for each incoming command, thus belonging to single-task operations. Based on the system task and scheduler design principles, the attribute list of scheduler tasks is given in Table 2.
Table 2 Task Attribute Table
3.2 Main Program Design
This design employs a time-triggered hybrid scheduler system. The scheduler sequentially schedules and executes tasks based on their execution cycle and latency, ensuring that only one event is processed at a time. This reduces CPU load and memory usage, thereby enhancing system reliability and scalability, and facilitating low-power system design. The main system program primarily includes a system initialization subroutine and a task scheduling subroutine. The main program flowchart is shown in Figure 5.
4. Summary
By analyzing various factors affecting system power consumption, it was determined that power consumption should be minimized by simultaneously considering both hardware selection and software design, and by combining hardware and software approaches. The multi-purpose low-power instrument system studied in this paper can serve as a solution for the urgent need for electronic intelligence in my country's water meters, gas meters, heat meters, electricity meters, as well as various detectors and monitors.
The innovation of this paper lies in its focus on reducing power consumption. The multi-purpose low-power instrument system studied is a relatively concrete and general-purpose implementation scheme for portable, low-power devices. By adding appropriate sensors and modifying the specific software according to actual needs, this system can be easily applied to various detection devices that require battery power.
References:
[1] Wei Xiaolong. MSP430 Series Microcontroller Interface Technology and System Design Examples. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002, 11
[2] Hu Dake. MSP430 Microcontroller C Language Programming and Development. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003, 1
[3] Gao Haisheng, Yang Wenhuan. Complete Guide to Microcontroller Application Technology. Xi'an: Xi'an Jiaotong University Press, 1996, 10
[4] Xu Zhijun, Large-Scale Programmable Logic Devices and Their Applications, University of Electronic Science and Technology of China Press, 2000
[5] Zhou Wenju. Meter reading system based on single-chip microcomputer infrared wireless communication [J], Microcomputer Information, 2006 (2-2): P45-47, P113
[6] MSP430-FET Simulation Tool User Guide. Lierda China Co., Ltd.