Design of digital acquisition controller based on LM3S101

Publisher:cwm6269310Latest update time:2012-09-20 Source: 电子元器件应用 Keywords:LM3S101 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
With the development of science and technology and the progress of society, field monitoring systems have been increasingly widely used in finance, transportation, commerce, industrial and agricultural production and other fields. As the main equipment for digital quantity acquisition and control in field monitoring systems, the performance of digital acquisition and control plays a very important role in the stability of the field monitoring work of the entire system. Therefore, it is of great significance to develop a new type of digital acquisition and control device with simple structure, stable performance, high reliability and low cost. This paper introduces a design method of a digital acquisition and control device that uses the LM3S101
microcontroller newly launched by Luminary Company and uses the ARM Cortex-M3 core as the control core, and uses the RS-485 communication dedicated device SP3485 for the design of the communication interface, and uses the serial input/parallel output 8-bit shift register 74HC164 and the parallel input/serial output 8-bit shift register 74HC165 for parallel digital input/output expansion. The digital acquisition and control device has the characteristics of high cost performance, novel design, practicality, strong anti-interference ability, etc. It can be widely used in various field monitoring systems, and after modification, it can also be used in remote control systems.


1 Overall working principle
of the system The digital acquisition and control hardware uses the LM3S101 ARM microcontroller as the control core, and mainly realizes RS485 communication, baud rate setting, local address setting, 8-channel digital quantity acquisition and 8-channel digital quantity control. The hardware composition of the system is shown in Figure 1.

The main function of the digital acquisition and control device is to collect the status of the digital quantities of 8 sensors according to the status monitoring commands of the on-site monitoring digital sensors (such as glass breakage monitoring, far infrared monitoring, etc.) issued by the remote monitoring center, and then send the collected digital quantity results to the monitoring center; at the same time, it receives the digital quantity switch control commands sent from the remote monitoring center, and performs digital quantity output control to control the monitoring auxiliary equipment at the monitoring site, such as: lights, alarms, etc.


2 Hardware Structure
This system is mainly composed of LM3S101 ARM microcontroller main control system, RS485 communication interface, communication baud rate and local address setting circuit, 8-way digital input circuit, 8-way digital output circuit, etc.
2.1 LM3S101 main control system
LM3S101 ARM microcontroller is a 32-bit microcontroller with simple structure, outstanding performance and ARM Codex-M3 processor core launched by Luminary. Codex-M3 processor is the first ARMv7M architecture-based embedded application field that is extremely sensitive to cost and power consumption, such as automotive body systems, industrial control systems and wireless networks. It is an ARM core specially designed for the purpose of achieving high system performance.
The biggest feature of LM3S101 is low cost and high cost performance. Usually, the impression in most people's minds is that 32-bit microcontrollers are expensive. Therefore, when designing low-cost embedded application systems, they often consciously or unconsciously choose 8/16-bit microcontrollers. The launch of LM3S101 microcontroller chip has completely changed this situation. Because its selling price is less than 1 US dollar, when building an application system with the same performance-price ratio, the cost of using the 32-bit LM3S101 chip is lower than that of using other 8/16-bit chips. [page]

LM3S101 integrates 8 KB single-cycle FlashROM and 2KB single-cycle SRAM, and contains two 32-bit timers, a synchronous serial interface (SSI), a watchdog timer, a UART, two analog comparators and 18 GPIO (general purpose input/output). The chip uses a 6 MHz crystal oscillator, and the operating clock frequency can be set to 20 MHz through the on-chip software PLL.
The use of LM3S101 can greatly simplify the system circuit and improve the stability and reliability of the system.
2.2 RS-485 communication interface
RS-485 bus is the most common communication interface in the current field monitoring system. This is because the maximum communication distance allowed by the RS-485 bus can reach more than 1,200 meters, and each bus can connect up to 32 devices. After appropriate serial port expansion, it can fully meet the requirements of the field monitoring system for communication distance and number of devices. Since the power supply of LM3S101 is +3.3 V, the RS-485 communication interface also uses the SP3485E special chip with a power supply voltage of +3.3 V for communication interface design. The interface circuit schematic is shown in Figure 2. The SMD010 in the figure is a self-recovery fuse with a current of 100 mA. When the communication network fails and the current at the A and B terminals is greater than 100 mA, the resistance of the self-recovery fuse SMD010 will increase, thereby protecting the SP3485 chip from damage.

2.3 Digital Input Circuit
Although the LM3S101 has 18 GPIO pins, most of them have other system peripheral functions in addition to general input/output functions. Five of them can be used as JTAG interfaces for system debugging and programming, and three can be used for RS-485 communication and control. Obviously, it is impossible to use the LM3S101 GPIO pins directly as 8-way digital input, 8-way digital control output, communication baud rate, and local address settings. Therefore, the 8-way digital input circuit should be designed using the 8-bit shift register 74HC165 with parallel input and serial output and the photocoupler TLP521-4. The schematic diagram of the digital input circuit is shown in Figure 3.

When it is necessary to collect the status of each digital quantity monitoring sensor at the monitoring site, it is only necessary to read the digital quantity of the 8-bit shift register with parallel input and serial output, and then encapsulate the data and send it to the remote monitoring center.
2.4 Communication baud rate and local address setting circuit
The communication baud rate and local address setting circuit belong to the digital quantity input circuit, so it can be completed by a 74HC165. It’s just that the input is set by the dip switch. Two sets of switches are used for communication baud rate setting, which can set four communication baud rates of 1200 b/s, 2400 b/s, 4800 b/s and 9600 b/s; the other six sets of switches are used for local address setting, which can be set to 64 device addresses: 0~63. The
74HC165 that constitutes the communication baud rate and local address setting circuit is connected in series with the 74HC165 in the 8-way digital quantity input circuit to form a 16-bit shift register with parallel input and serial output. Before the system is initialized, it is only necessary to read the digital quantity of the 16-bit shift register, and then take the lower 8 bits of the binary number as the communication baud rate and the local address setting value, take the lower six bits as the local address, and the upper two bits as the communication baud rate setting value.

[page]

2.5 Digital quantity control output circuit
The 8-way digital quantity control output circuit can be composed of an 8-bit shift register 74HC164 with serial input and parallel output, an 8-bit latch 74L5373, an 8-way Darlington array integrated circuit ULN2803, and 8 relays with a rated voltage of 12 V and a load capacity of 10 A at 250 V AC. Its 8-way digital quantity control output circuit is shown in Figure 4. When the digital acquisition controller receives the digital quantity output control command sent by the remote monitoring center, the 8D latch 74LS373 can first latch the state of each bit of 74HC164, and then output 8-bit binary control information to the 8-bit shift register 74HC164 with serial input/parallel output in sequence. Finally, before the shift output and after the 8-bit binary control data is completed, and after the state of the 74HC164 output is stabilized, the new binary control information is output.


3 System software design The integrated development environments
that can support LM3S101 include KeilμVision3 for ARM, IAR Embedded Workbench forARM and Rowley Crosswork. Luminarv provides a complete and rich driver library Stellaiis Driver Library for different integrated development environments, and encapsulates direct operations on the underlying registers in the program driver library. In application development, you can also directly call the functions in the library to complete most of the program design. You don't have to worry about the underlying operation details, which provides great convenience for the design of system software programs. The universal asynchronous receiver and transmitter (UART) in LM3S101 has independent transmit FIFO and receive FIFO. This feature makes it unnecessary for LM3S101 to send and receive data byte by byte in serial communication, so it can go all out to do other things. The software of this digital acquisition controller consists of two parts: the system main program and the serial communication main program. The program flow chart of these two parts is shown in Figure 5.

4 Conclusion
The digital acquisition and control hardware based on LM3S101 introduced in this paper adopts the cost-effective 32-bit ARM microcontroller designed by Luminarv for industrial applications as the control core. SP3232E realizes the RS-485 communication interface, parallel input/serial output shift register and serial input/parallel output shift register settings, as well as the design of 8-bit parallel input and 8-way parallel output digital interface circuits. The system software follows the modular programming concept and the program is written in C language. The Stellaris Driver Library developed by Luminarv can directly call the function driver library in the library, which is flexible in programming and convenient and quick to modify. The field test of this system shows that the digital acquisition and control based on LM3S101 runs reliably and stably in a certain security monitoring system.

Keywords:LM3S101 Reference address:Design of digital acquisition controller based on LM3S101

Previous article:Design of groundwater level monitoring system based on LM3S615
Next article:Handheld touch screen based on AT91X40 series

Recommended ReadingLatest update time:2024-11-17 04:39

Practical Four-wire Full-duplex RS-485 Repeater
1. Introduction Theoretically, the maximum transmission distance of RS-485 is 4000 feet (about 1219 meters), and the maximum transmission rate is 10Mb/s. However, the transmission distance of its balanced twisted pair is inversely proportional to the transmission rate. Only when the rate is below 100kb/s can the maxim
[Power Management]
Practical Four-wire Full-duplex RS-485 Repeater
#51 MCU #RS-485 communication functions and features
RS-485 communication is commonly used in industrial control, power communication, smart instruments and other fields. This communication method mainly has the following five capabilities: ①Adapt to complex construction sites ② Anti-electromagnetic interference ③ Networking ④Longer transmission distance ⑤ A
[Microcontroller]
STMicroelectronics' RS-485 transceivers combine robustness and speed for industrial automation, smart buildings, and robotics
STMicroelectronics' RS-485 transceivers combine robustness and speed for industrial automation, smart buildings, and robotics April 23, 2024, China – STMicroelectronics has launched the ST4E1240 RS-485 transceiver chip. The new product has a transmission speed of 40Mbit/s and PROFIBUS-
[robot]
STMicroelectronics' RS-485 transceivers combine robustness and speed for industrial automation, smart buildings, and robotics
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号