Simple data acquisition solution based on ARM

Publisher:电子创新者Latest update time:2020-10-30 Source: elecfansKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  0 Preface

  In computer measurement, control and signal processing, data acquisition plays a vital role. Data acquisition is an important means of obtaining data. It is the process of automatically collecting information from analog or digital units under test such as sensors or other devices under test. The use of A/D conversion resources inside ARM has the advantages of high conversion speed, reliable operation, and low design complexity. At the same time, ARM also has the characteristics of small size, high computing speed, and high A/D conversion resolution, which makes ARM widely used. This paper uses AT91M55800A in the ARM7 series of ATMEL to design a simple data acquisition solution. This solution has the characteristics of simple structure, easy development, strong reliability, low price, etc., and has certain practical value.


  1 Structure and Functionality of Data Acquisition Solution

  The solution structure is shown in Figure 1.

  The scheme consists of three parts: receiving, A/D conversion and processing, and output. This scheme is based on AT91M55800A, which is a high-performance 32-bit processing chip with an 8-to-1 analog channel and a 10-bit A/D conversion channel. The preprocessing circuit isolates, amplifies and filters the signal picked up by the sensor to the 0-3 V required for A/D conversion. The processed analog signal is converted into a digital signal through the A/D conversion channel in AT91M55800A, and is processed accordingly according to the requirements, and finally output by the LCD display. At the same time, this scheme uses Flash memory as program memory to save data.

  

  2 Hardware Composition

  AT91M55800A is a member of ATMEL's AT91 16/32-bit microcontroller family based on the ARM7TDMI core. It is directly connected to the off-chip memory through a fully programmable external bus interface, so that the read or write operation can reach one clock cycle at the fastest. By integrating the ARM7TDMI processor core with on-chip SRAM, various peripheral function modules, analog interfaces and low-power oscillators into a single silicon chip, AT91M55800A provides a highly flexible and cost-effective solution for low-power applications. Its main features are as follows:

  a) Integrates ARM7TDMI ARM Thumb processor core, high-performance 32-bit RISC architecture, high-code-density 16-bit instruction set, and embedded ICE;

  b) 8 kB on-chip SRAM, 32-bit data bus width, single clock cycle access, solution can be expanded to a maximum of 64 MB memory, software programmable 8-bit or 16-bit external data bus;

  c) Master/slave SPI interface, 8-bit to 16-bit programmable data length, 4 external slave chip selects;

  d) Programmable watchdog circuit to improve the safety and reliability of the solution;

  e) 58 programmable I/O lines, expanding the input and output lines;

  f) Advanced power management controller with normal, wait, slow, standby and power-down modes;

  g) 8-priority, individually maskable vector interrupt controller, 6-channel 16-bit timer/counter, 3 USARTs, each USART has 2 dedicated PDC channels;

  h) 8-channel 10-bit A/D converter, 2-channel 10-bit D/A converter;

  i) Clock generator using on-chip main oscillator and PLL frequency multiplication, real-time clock using on-chip 32 kHz oscillator.

  Figure 2 is the actual application circuit of the solution.

  

  The chip contains two identical 4-channel 10-bit A/D converters, which can form an 8-channel 10-bit A/D converter. Each A/D converter has 4 analog input pins and a digital trigger input pin, and provides an AIC interrupt signal. The two A/D converters share the analog power pin and the reference voltage input pin. Each channel can be enabled or disabled individually and has its own data register. The A/D converter can be configured to automatically enter sleep mode after the conversion sequence and can be triggered by software, T/D or external signals.


  Since the AT91M55800A does not have an on-chip program memory, the solution needs to be expanded externally [1] Flash memory as program memory to store program code, constant tables, and data that needs to be saved after power failure. The bus read and write cycle of the AT91M55800A can have a maximum delay of 8 cycles, and the minimum read speed of the Flash memory is required to be no less than this speed. Considering the execution speed and program size of the solution, the HY29LV160 with an access speed of 70 ns (the chip capacity is 1 M×16 bit, a total of 2 MB) is selected, which can basically meet the requirements of the solution.


  The system uses AD590 [2] as a temperature sensor. The device uses current as output to indicate temperature, and the obtained signal is buffered and isolated by an amplifier to obtain a voltage proportional to the temperature, thereby realizing temperature measurement.


  3 A/D conversion programming

  In AT91M55800A, two A/D converters work independently, and each A/D converter can only read the A/D converter value of one channel. This program allows the user to specify which channel to work, then reads the value of the specified channel and displays it. Since the precision of the A/D converter is 10 bits and 8 bits, it is set to 10 bits here, so the data range obtained is between 0 and 3FF.


  The working process of the A/D converter is different from that of general peripheral devices. After initialization, there must be a trigger command for the high-speed A/D converter to collect. At this time, the A/D converter samples and holds the analog signal on a certain channel that it activates, and then converts it into data and stores it in the data register. The user can learn from the status register whether the A/D converter has completed the conversion, and then obtain the value after the A/D conversion by reading the data register.


  The A/D conversion program flow chart is shown in Figure 3.

  

  To program the A/D converter, use the AT91 library (in the /pe-riph/adc directory). The code section related to the A/D converter is as follows [3]:

  a) adc.h: A/D converter user interface structure definition StructADC, control register ADC-CR, mode register ADC-MR and other important registers, and A/D converter interrupt service routine function definition.

  b) Lid_adc.h: A/D converter descriptor definition and library function definition.

  e) Lid_adc.c: Detailed code of library functions, including: initializing ADC at91_adc_open, closing ADC at91_adc_close, getting the value of status register at91_adc_get_status, setting the value of control register at91_adc_trig_cmd, reading the value of A/D conversion at91_adc_read, opening the specified A/D conversion channel at91_adc_channel_open, closing the specified A/D conversion channel at91_adc_channel_close, getting the channel open and close status at91_adc_channel_get_status, etc.


  4 Conclusion

  This article introduces a data acquisition solution based on ARM7. The solution achieves the expected goal through specific hardware design and software programming. Using ARM for data acquisition can make the solution more stable, and can achieve the effect of low power consumption and high performance, which is suitable for application in various industrial occasions.


Keywords:ARM Reference address:Simple data acquisition solution based on ARM

Previous article:Design of wireless home gateway based on ARM-UClinux
Next article:Design of car black box based on ARM

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号