Design of Network Switch Based on AL101 Single Chip Microcomputer Control

Publisher:SerendipityJoyLatest update time:2011-11-22 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

随着计算机性能的提高及通信量的聚增,传统局域网已经越来越超出了自身负荷,交换式以太网技术应运而生,大大提高了局域网的性能。网络交换机能显著的增加带宽,可以建立地理位置相对分散的网络。局域网交换机的每个端口可并行、安全、实时传输信息,而且性能稳定、结构灵活、易于安装、便于管理,能很好地满足企业网和电信运营商宽带接入的需求。

1 Hardware Design of Network Switch

As people demand more security and high bandwidth in network applications, network switches are becoming more and more widely used. This switch uses the ROX bus of the AL101 chip, connecting three 8-port switch chips to form a 24-port switch, meeting the user's demand for multiple switch ports.

1.1 Circuit performance requirements

The high-speed PCB circuit board of the switch has relatively high requirements on EMC and ESD. It uses 75MHz and 50MHz high-speed clocks, and requires the accuracy of the crystal oscillator to be less than 50PPM. At the same time, the clock needs to be sent to different chips through the clock distribution circuit, and the phase difference between the distributed clocks needs to be less than 2ns.

The switch has 24 10/100M adaptive ports, each of which can achieve line-speed switching. According to user needs, the ports can be set to 10/100M rate, full/half duplex, flow control, static MAC address, mirroring, VLAN, etc.

1.2 Switch Block Diagram

The switching technology of this switch adopts the store-and-forward method, and is mainly composed of five parts: interface unit, switching unit, management unit, light display unit and power interface unit. Its block diagram is shown in Figure 1.

AL101 Block Diagram


After the RJ45 interface receives the data packet with Ethernet frame structure, it is sent to PHY (physical interface chip) after transformer isolation and impedance matching. In this chip, the conversion of analog signal to digital signal of RMII interface is completed, and the link status, conflict, whether the information is too long, rate and other information are obtained.

The data enters the switching chip (composed of three chips, forming a loop through the ROX bus, which can complete the data exchange between the three chips), and the switching chip will obtain the destination address and source address of the data, and perform error checking on the Ethernet frame. The switching chip saves the source address in its own MAC address table, and then matches the destination address with the address in the MAC address table to obtain the corresponding port to which the data will be forwarded. If the destination port is in the same switching chip, the data is taken out of the SGRAM and forwarded to the corresponding port; if the destination port is not in the same switching chip, the data is transmitted to the corresponding switching chip through the ROX bus and then forwarded out; if the corresponding destination address is not found in the MAC address table, the frame is forwarded to all ports other than the source port that belong to the same VLAN or to a certain uplink port (related to the setting of the switching chip register).

The light display is given by PHY, through which you can observe the working speed, connection and data transmission and reception of each port.

During each startup or reset of the switch chip, the contents of the external EEPROM are first read to initialize the switch chip registers. The contents of the switch chip registers can be read and written through the PC management program or the PC's hyperterminal to control or read the switch's working configuration.

2 Network switch software design

The software of the entire network switch system includes the control software of the microcontroller, the EEPROM configuration data and the management program of the PC.

The control software of the microcontroller mainly completes the reading and writing of registers and the communication with the PC. Through this management unit, the switch can be configured into various working modes to meet the needs of different users.

The switch chip is connected to EEPROM (24C02) via I2C bus to save configuration data. When the device is powered on or reset, the device will read this data from EEPROM for system initialization.

The management program of the PC allows the user to connect the serial port of the PC to the system device and configure the system easily through the management program interface of the PC.

2.1 Software Design of MCU Control

The management unit consists of a single-chip microcomputer and a serial port, and the registers of the EEPROM or the switching chip are configured through the PC. The single-chip microcomputer mainly completes the reading and writing of the registers and the communication with the PC. The serial port plays a role in connecting with the PC. There is also a level conversion chip between the microcontroller and the serial port to complete the signal conversion between the microcontroller and the PC. Through the management unit, the switch can be configured into various working modes to meet the needs of different users, such as: 10/100M rate setting, full/half-duplex setting, flow control, static MAC address setting, mirror setting, broadcast storm control, VLAN setting, etc. The software flow of the single-chip microcomputer is shown in Figure 2.

[page]

The modules are described as follows:

main——main program;
init_uart——serial port initialization;
delay——system delay;
helpMenu——help menu;
systemCheck——check system device ID;
whict>:——command prompt (whict is the abbreviation of Wuhan Institute of Chemical Technology);
D——view the entire configuration data of the system;
E——edit the configuration data of the system;
F——configure and manage various functions of the switch;
R——read the configuration data of the system;
W——the system saves the current configuration data to EEPROM;
L——configure the system static MAC address;
M——change the system password;
I——system software reset;
S——the system downloads the default configuration to EEPROM.

2.2 PC management program design

The management program of the PC is programmed in VB language and has an easy-to-understand software interface. Users can easily configure the network switch. The management program of the PC is shown in Figure 3, and the switch management software interface is shown in Figure 4.


Reference address:Design of Network Switch Based on AL101 Single Chip Microcomputer Control

Previous article:Design and implementation of network switch based on single chip microcomputer control
Next article:Low-cost LIN bus based on Microchip microcontroller and transceiver

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号