Design of portable instrument by using AVR microcontroller ATXmega128A1

Publisher:CrystalRoseLatest update time:2020-01-28 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Industrial instruments have become one of the foundations and cores of the industrial control field because they integrate information acquisition, conversion, storage, transmission, analysis, processing and display. With the development of computer technology and microelectronics technology, industrial instruments have gradually developed into intelligent instruments with microprocessor systems. Portable intelligent instruments are becoming more and more popular in today's life because of their convenience, easy operation, friendly interface, rich human-machine interface and low power consumption.


AVR XMEGA is an upgraded version of the 8/16-bit AVR microprocessor. It uses Atmel picoPower technology, and all devices can use 1.6V operating voltage. The MCU has a wake-up time of 5 seconds and an industry-low power consumption of 100nA. It has an integrated full-speed USB, high-speed and high-precision analog system, DMA controller and innovative event system, which maximizes data throughput and real-time performance and effectively reduces processor load. It has a higher degree of integration and more effectively reduces the total power consumption and cost of the system. It is particularly suitable for instrumentation and equipment applications in measurement, industry, medical and consumer fields.


2. Overall block diagram of instrument design

The overall block diagram of the system is shown in Figure 1. The power supply and reset circuit constitute the minimum system of the instrument. In line with the multi-purpose of the instrument, this design adds wireless transceiver based on Zigbee technology, USB data communication, Flash storage expansion, font chip data reading, data acquisition, color screen display and other functions. This article will detail the peripheral circuits and implementation of these six functions.

3. Instrument hardware design

3.1 Wireless Communication Circuit Design

During the use of instruments, when two instruments need to communicate with each other or it is inconvenient to connect to the PC by wire, data needs to be transmitted wirelessly. The ability to transmit wirelessly has also become a manifestation of the adaptability of many instruments to multiple conditions and multiple functions. Zigbee is an emerging wireless network communication technology standard in recent years. It has low power consumption and low cost, and has outstanding advantages in application. Its short connection time greatly reduces the probability of collision of communication data; it can reach a maximum of 65535 network nodes, which makes it have superior networking capabilities; its data transmission is encrypted, so it has high network security performance. In summary, Zigbee wireless transmission technology has a broad application prospect.


The design uses the AT86RF212 chip, which is a low-power, low-voltage 700/800/900 MHz band wireless transceiver that provides a complete radio interface between the antenna and the MCU, supports ZigBee technology IEEE 802.15.4 standard, supports 6LoW PAN technology and high data transmission rate ISM applications, and its peripheral circuit connections are shown in Figure 2.

3.2 Signal acquisition circuit design

This module uses TLV2543 as the voltage amplitude acquisition. Necessary voltage conversion is required before data acquisition. The chip interface connection is shown in Figure 3. The multi-channel data acquisition channel expands the shortcomings of the MCU. Single-channel or multi-channel channel signal acquisition can be used in control. It has 11 conversion channels, 12 bits of voltage conversion accuracy, and a conversion rate of up to 10 Ω. The AD chip uses the microcontroller SPI1 interface for data transmission, and its reference voltage is provided by the REF3030 chip.

3.3 Extended font library circuit design

In order to make the instrument more widely used, the design adds the GT23L16M2Y character chip produced by Jitong Digital Technology Company to meet the needs of more characters in the display interface. It contains 11×12 dot matrix and 15×16 dot matrix, which supports multiple Chinese characters and characters. The single-chip microcomputer uses the function calculation of the Chinese character source code to obtain the address of the Chinese character dot matrix in the chip. After reading the dot matrix data, it is transmitted to the single-chip microcomputer through the port line for display. The chip can choose PLII and SPI interfaces. In order to save port lines, this instrument uses the SPI interface mode. The connection with the CPU is shown in Figure 4.

3.4 Data Storage Circuit Design

When the instrument is operated in the field, when a lot of data needs to be collected but the data cannot be transmitted to the host computer in time, a large-capacity, non-volatile storage device is needed. When comparing and analyzing long-term data, a large batch of data records also need to be saved. The microcontroller itself has 128K bytes of flash storage, 8K bytes of SRAM storage, and 2K bytes of EEPROM storage units. However, after power failure, the FLASH storage cannot save data, and a large-capacity storage space is required to retain the batch data that has been recorded.


This design uses the ATDB011D memory produced by Atmel, which integrates 1M bytes of Flash storage and has a data access speed of up to 66MHz. It uses the SPI interface to transmit data with the microcontroller. The connection circuit with the microcontroller is shown in Figure 5.

3.5 USB communication interface design

USB interface is quite common in the use of instruments and meters. In the process of direct data transmission with the computer, its port is small and compact. It supports hot-swap operation and other features, making it the first choice for many portable instruments. This design uses the CP2102 chip to convert the microcontroller serial port into a USB port and use it as a virtual port, which simplifies the communication connection method and the program design of the microcontroller. It is fully pin-compatible with CP2101 and complies with the USB 2.0 specification: up to full speed (12Mbps); supports USB suspend state, and can be connected to a PC that supports COM port for communication. The integrated USB transceiver does not require external resistors , and the peripheral circuit is simple. The connection circuit is shown in Figure 6.

3.6 Display Interface Circuit

The display quality of the instrument is directly related to the user experience. The screens of traditional instruments are mostly monochrome or small in size. The color screen can highlight important content in the interface and enhance the user's visual effect of human-computer interaction.


The instrument uses a HY32B color display, which takes into account display speed, power consumption and user visual effects. It is equipped with a 3.2-inch TFT LCD color display and drive circuit, with a display resolution of 320×240. Its interface has multiple options, including 3-wire, 4-wire SPI and 6/9/16-bits6800/8080 parallel interface and 6/16/18-bit RGB interface. In order to increase the data transmission speed, the data signal uses 16-bit parallel transmission. The interface is shown in Figure 7.

4. System software design

The compilation and simulation of the system are all in the AVR Studio 6.0 software environment provided by Atmel. All module implementations are written in C language, which is conducive to the development and transplantation of the system. The software uses modular and hierarchical structure design, with a short development cycle and convenient maintenance. The overall block diagram of the system is shown in Figure 8. The bottom module is designed as the driver and interface program of each basic device, including wireless connection protocol, USB interface communication, AD acquisition driver, data storage, clock access interface, display interface data transmission and keyboard key identification. The second layer is mainly used to execute specified functions, including voltage, frequency measurement, record query, wireless connection, data access and key operation. The top layer is the corresponding function required in the display of the interface to realize human-computer interaction.

5. Summary

As a relatively new high-performance single-chip microcomputer, Xmega's application and development need to be further explored. Based on the actual project application, this article gives a specific peripheral circuit design and software process, providing a reference for its application in industry.

Reference address:Design of portable instrument by using AVR microcontroller ATXmega128A1

Previous article:Design of reactive power compensation control system based on ATT7022A chip and atmega128 microcontroller
Next article:Design of medical intelligent liquid drip speed control system using AVR single chip microcomputer

Latest Microcontroller Articles
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号