Design of information appliance remote monitoring system based on 16-bit single-chip microcomputer SPCE061A

Publisher:EnchantedMelodyLatest update time:2013-01-18 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    At present, most access methods still use PC as gateway for connection. However, this is generally used in large industrial distributed control systems. If an additional PC is used for general information appliance access, it will inevitably bring high costs to the product, which is not feasible from the perspective of product economics. The method of using embedded devices to connect information appliances solves this problem well.

    With the advent of the Internet era, the Internet has become an important basic information facility. The technological progress in this area has had a positive impact on all aspects of society. Many fields are constantly exploring, developing and utilizing network resources. The so-called embedded devices are generally composed of embedded microprocessors, peripherals, specific network protocols and applications. They are used to realize the remote control, monitoring and management functions of information appliances. They replace traditional PCs or gateway devices, can meet the requirements when the data volume is not large, and have the advantages of reliability, flexibility and low cost.

    Proposal

    From the perspective of remote online access of information appliances, there are two situations when monitoring and controlling information appliances: (1) During remote access, the communication data volume of information appliances is not large, and a communication rate of 56Kbps can meet the requirements; (2) Information appliances do not have high requirements for real-time performance, and their delay can be more than 1 second. Based on the above two conditions, when selecting embedded devices, the single-chip microcomputer SPCE061A was selected as the microprocessor for information appliances to access the Internet, and RTL8019AS was used as the driver chip for Ethernet frames, which is responsible for receiving and sending Ethernet frames. Finally, the status information is sent to the Internet and the control data is received from the Internet through the RJ45 interface. In addition, to realize the access of information appliances to the Internet, it is also necessary to have a deep understanding of the TCP/IP protocol and the network card driver.

    Introduction to RTL8019AS Ethernet Controller

    The RTL8019AS Ethernet controller produced by Taiwan's RealTek company occupies a considerable proportion in the 10Mbps network card market due to its excellent performance and low price.

    2.1 Main performance

    (1) Comply with Ethernet II and IEEE802.3 (10Base5, 10Base2, 10BaseT) standards;

    (2) Full-duplex, sending and receiving can reach a rate of 10Mbps at the same time;

    (3) Built-in 16KB SRAM for transmit and receive buffering, reducing the speed requirements of the main processor;

    (4) Support 8/16-bit data bus, 8 interrupt request lines and 16 I/O base address selections;

    (5) Supports automatic detection of UTP, AUI, and BNC, and also supports automatic polarity correction for 10BaseT topology;

    (6) Allows 4 diagnostic LED pins to be programmable output;

    (7) 100-pin TQFP package reduces PCB size.

    The RTL8019AS can be divided into remote DMA interface, local DMA interface, MAC (media access control) logic, data encoding and decoding logic and other ports. Its internal structure is shown in Figure 1.

 

    The ISA bus interface, also known as the remote DMA interface, refers to the bus used by the host to control and operate the RTL8019AS. The local DMA interface refers to the connection channel between the RTL8019AS and the network cable, and its function is to complete the data exchange between the controller and the network cable. The PNP (Plug and Play) logic part is mainly used to solve the connection problem with the PC. The BootROM port is used to solve the remote startup problem. The EEPROM port is used to operate the interface between RTL8019AS and EEPROM chip 24C64. SRAM is used to store the received and sent data. The MAC logic completes some control in the process of sending and receiving data. When the host wants to send data, it sends a frame of data to the send buffer memory in the Ethernet controller through the remote DMA channel, and then issues a transmission command. The Ethernet controller completes the transmission of this frame after sending the data of the previous frame. When receiving data, the serial data is composed of bytes and sent to FIFO and CRC. The sending logic gradually shifts the bytes sent by FIFO and sends them to CRC under the control of the sending clock. The CRC logic performs CRC check on the input data when receiving, and compares the result with the CRC at the end of the frame. If they are different, the frame data will be rejected. If they are the same, they will be sent to the receiving buffer. After the receiving buffer is full of a frame, the main processor is notified to read the data by interrupt or buffer flag.

    2.2 I/O address allocation of RTL8019AS

    The built-in 16KB SRAM of Ethernet controller can be divided into two parts: receiving buffer and sending buffer. The buffer is in frames, with 256 bytes per page. The page range of 16KB SRAM is set at 0x40-0x80. The range of receiving buffer page is set by PSTART and PSTOP registers. CURR points to the starting page of the received frame, and BNRY points to the starting page of the frame that has not been read, that is, the page address of the next frame. When CURR reaches the bottom of the receiving buffer page, which is equal to PSTOP, CURR will automatically point to PSTART. Therefore, this 16KB SRAM is designed as a ring buffer to achieve the purpose of reusability.

    Hardware Description

    The core of the whole system design is a 16-bit high-performance CMOS microprocessor with bus structure launched by Taiwan Lingyang Technology Co., Ltd., which can perform high-speed calculations, flexible I/O port control and efficient data operations. SPCE061A has 2K words of SRAM and 32K words of flash ROM. Compared with the existing 8-bit microprocessors, it provides higher-speed 16-bit x 16-bit multiplication operation instructions Mul and inner product operation instructions Muls. With the optimized instruction set, the throughput of SPCE061A is greatly improved, which enables the streamlined instruction set to run reliably in it. The block diagram of the system hardware circuit is shown in Figure 2.

Figure 2 System hardware circuit block diagram [page]

    The hardware structure mainly includes two parts: 1. Information collection reflecting the working status of information appliances 2. After the data is compressed by the TCP/IP protocol, it is output to the Internet through the Ethernet control chip, or the control data from the Internet is received and unpacked. The system is built based on IEEE1451.2 and TCP/IP protocols, with a standardized network interface, allowing instant connection with the Internet or Ethernet network, thereby realizing direct communication between home appliances and external networks, solving the interface problem between monitoring equipment and communication networks, and providing the underlying hardware interconnection for realizing remote monitoring based on WEB.

    Single chip microcomputer controls Ethernet card for data transmission

    The MCU must be embedded with TCP/IP protocol when it is connected to Ethernet. It loads TCP/IP protocol to control Ethernet card for data transmission and connects to the Internet through TCP/IP protocol. The basic idea is: the operation performed at the remote control end first finds the target through the router, and then transmits it to the MCU through the ISA interface of the network card. The driver loaded in the MCU converts it into a physical frame format, and finally the TCP/IP protocol converts it into an application layer control command. Because the internal resources of the MCU are limited, the TCP/IP protocol must be streamlined to complete the Internet access task. This system uses some protocols such as ARP, RARP, IP, UDP, etc., which can ensure that the MCU is connected to Ethernet and the code volume is small enough. The MCU mainly completes the unpacking of network data and the packaging of serial port data. When Ethernet data arrives at the device, the MCU uses the query method to read and analyze the network data. If it is an ARP (physical address resolution protocol) data packet, it will be transferred to the ARP processing program and send a RARP data packet to add the IP address and physical address to the local area network to establish a mapping. If it is a UDP data packet and the IP address and port number are correct, the data packet is received, and after the data is unpacked, the data part is output through the serial port to control the field equipment. On the contrary, if the field equipment sends data to the microcontroller through the serial port, the microcontroller packages the data according to the UDP protocol format and sends it to RTL8019AS, which then outputs the data to the local area network. If needed, the data preprocessing can be completed when the serial port data is received, and then the processed data is sent to the local area network.

    Software implementation part

    The software design mainly includes: Ethernet controller initialization program, driver, TCP/IP protocol stack program, and system network configuration program. The Ethernet controller driver is used to set the working state of the Ethernet control chip, that is, the working mode, and allocate the buffer for sending and receiving data; the system network configuration program is used to allocate IP addresses and domain names to the monitoring system. Due to space limitations, only part of the RTL8019AS initialization code written in assembly language is given below.

    .includehardware.inc; //Configuration unit definition

    .publIC_init//RTL8019AS initialization subroutine

    _init:

    R1=0xffff; //Initialize port A as output

    [P_IOA_Attrib]=R1;

    [P_IOA_Dir]=R1;

    R1=0xfc07; //Set IOB0~IOB2, IOB10~IOB15 as outputs, and the others as inputs

    [P_IOB_Attrib]=R1;

    [P_IOB_Dir]=R1;

    R1=0x0001; //Select register 00H

    [P_IOB_Data]=R1;

    R1=0x0021; //Select register page 0, the chip does not work

    [P_IOA_Data]=R1;

    [P_IOB_Data]=R1;

    R1=0x004c; //Set the receive buffer, the page address is 0x4c~0x7f

    [P_IOA_Data]=R1;

    R1=0x0001; //Select register 02H

    [P_IOB_Data]=R1;

    R1 = 0x0080;

    [P_IOA_Data]=R1;

    ...

    R1=0x0801; //Select register 01H

    R1=0x0001; //Select register 00H

    [P_IOB_Data]=R1;

    R1=0x0061; //Select register page 1

    [P_IOA_Data]=R1;

    ...

    R1 = 0x0001;

    [P_IOB_Data]=R1;

    R1=0x0022; //Select register page 0, the chip enters working state

    [P_IOA_Data]=R1;

    retf; //Program returns

    By using the 16-bit single-chip microcomputer SPCE061A to drive the Ethernet control chip RTL8019AS, information appliances can be connected to the Internet via an embedded gateway, and the working status of information appliances can be conveniently and cheaply sent to a remote PC for monitoring. This low-cost, high-performance solution is reliable and flexible, and is suitable for home automation devices with low communication rates and delays. Users can use the above method to give traditional home appliances the ability to access the Internet as needed.

Reference address:Design of information appliance remote monitoring system based on 16-bit single-chip microcomputer SPCE061A

Previous article:Application of COP8CDR9 microcontroller in multi-channel data acquisition
Next article:Detailed explanation of the concepts and important parts of learning and application of single chip microcomputers

Recommended ReadingLatest update time:2024-11-16 19:56

Application design of MGLS12864 LCD display module based on SPCE061A single chip microcomputer
0 Introduction In many single-chip microcomputer application systems, liquid crystal displays (LCDs) are widely used in terminal display human-machine interfaces. Dot-matrix LCDs can display not only characters and numbers, but also graphics, curves and Chinese characters, and can achieve a variety of animation displ
[Microcontroller]
Application design of MGLS12864 LCD display module based on SPCE061A single chip microcomputer
Robot design solution based on S3C44B0X and SPCE061A
1 Introduction Mobile robots use navigation technology to obtain the current location of the robot, combine it with sensor technology to detect the surrounding external environment (obstacles, etc.) in real time, and plan a feasible path based on the information provided by the environment to complete the task of reac
[Microcontroller]
Robot design solution based on S3C44B0X and SPCE061A
Design of digital controlled DC current source scheme using SPCE061A single chip microcomputer
The digitally controlled DC current source designed in this paper can effectively reduce the output error caused by component aging, temperature drift, etc. The output current is adjustable from 20mA to 2000mA, the output current can be preset, and has "+" and "-" step adjustment. The output current signal can
[Microcontroller]
Design of digital controlled DC current source scheme using SPCE061A single chip microcomputer
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号