Pick   want:       This article describes how to implement a token bus LAN using COM20022 .
introduction
The bus contention of the bus LAN makes it unsuitable for some time-critical real-time control systems, while ARCNET (Attached Resource Computer NET) has high reliability, high communication rate, determinable network performance, and long-distance communication capabilities. Features are an ideal fieldbus technology. It has the following three outstanding advantages: First, it uses the token transfer protocol to ensure the completion of message transmission within a certain time; second, it supports variable length data frames (0~507 bytes ) with low overhead. In addition, its high bus speed ( up to 10Mbps) makes it responsive to short messages. Third, the built-in 16 -bit CRC checksum and data link layer protocol make it highly reliable and software. easy to use. The ARCNET network is physically a bus network, but logically a token ring. COM20022 is a high-speed embedded ARCNET controller from SMSC Corporation. It is easy to implement 10Mbps token bus LAN with COM20022 .
COM20022
The COM20022 supports bus speeds up to 10Mbps and rates can be set in registers. Can support a variety of microprocessors, data bus port width 8 / 16 bits optional, integrated 2K bytes of dual-port RAM , new programmable DMA channel. Software programmable node ID number, supporting up to 255 nodes. Automatic network reconfiguration when nodes are added or removed, supporting duplicate node ID detection. All the nodes on the network form a logical loop in the order of the node IDs from small to large. The tokens are passed between the nodes along the logical ring. The node that obtains the token can send a data frame. If no data is sent, The token is then passed to the next adjacent logical node. The token is passed cyclically to provide equal network access services for each node.
Figure 1 Â COM20022 and 8051 interfaces
Figure 2 Â Coax cable connected token bus LAN
Â
Figure 3 Â Twisted pair connected token bus LANÂ
Figure 4 Â Token bus LAN with star bus structure
Interface between COM20022 and microprocessor
In order to be able to adapt to more microprocessor types without adding extra pins, COM20022 has the function of automatically adapting the microprocessor. It is compatible with both INTEL microprocessors ( Figure 1) and MOTOROLA microprocessors. The access bus has two modes: composite mode and non-composite mode. COM20022 determines the type of its data bus by the state of address line A0 . If A0 is grounded, COM20022 is a composite bus; if A0 is connected to the address line A0 of the microprocessor , COM20022 is a non-composite bus.
The following is the initialization procedure for COM20022 to determine its data bus type:
Unsigned char Com20022Init(COM20022_CONFIG xdata *cfg)
{
                    ...
   /*inTIalize the bus type of the Com20022*/
   TO_ADDR_LO_REG( 0 );       / * Odd address write operation * /
   Temp = FROM_ADDR_LO_REG( );     /* odd address
                                 Read operation */
                    ...
 }
First , write a write to the odd address register of COM20022 , and then perform a read operation. Once the bus type is determined, COM20022 will keep this interface mode unchanged until the next reset.
COM20022 network interface driver chip
When COM20022 is interconnected, the driver can be left without a driver when it is very close, such as the inside of the same instrument. When two or more (not more than 255) to be connected ARCNET devices, it is necessary to add the drive. Both Figure 2 and Figure 3 use the 75176 , which is a DC-coupled RS-485 driver. Since the RS-485 interface is relatively simple, only five types of twisted pairs can be transmitted, so installation and maintenance are relatively convenient. To make it easier to select the transmission medium, you can also use SMSC 's HYC9088A , which is a twisted pair and coaxial cable compatible drive, but it only supports up to 2.5Mbps bus speed. If you need to travel longer distances, you can use a fiber optic transceiver with a transmission distance of more than one kilometer.
Networking
COM20022 can be done by using the card, into the computer's expansion slots, so that the connecting cable composed of computers access token bus LAN, it may also be used for data transmission device COM20022 data transmission or point-multipoint. For better networking, you can also use the HUB to extend the network. The HUB is divided into two categories, one is a passive HUB and the other is an active HUB . Passive HUBs are cheap. Passive HUBs typically have four ports for connecting to a star-structured coaxial cable transceiver. An active HUB is actually a circuit repeater that can be interconnected using a variety of connection media. The coverage is much longer than the passive HUB , which can isolate cable faults and prevent signal reflections, and is often used in distributed star networks. When networking, you need to use a terminator. When using coaxial cable, any unused passive HUB port or cable should be terminated with a 93 Ω terminator. When twisted pair is used, the terminator is inserted into the network card at the end of the cable. Above, the terminator resistance is the value of the characteristic impedance of the twisted pair used. After the network card, HUB , and terminator are available, they can be networked. The network formed is the token bus LAN.
There are two main ways to route ARCNET token bus LAN: one is the bus type, and the other is the star bus type.
Bus structure
The bus structure of the coaxial cable for connecting the medium is similar to that of the Ethernet thin cable, as shown in Figure 2 . The maximum length of the ARCNET bus is 305 meters. Up to 8 devices can be connected . The connection of the device to the bus passes through a T -connector, the top of which is connected to the cable and the bottom is connected to the network card. Both ends of the cable must be terminated with a 93W terminator.
When a twisted pair cable is used as the connection medium, the network card suitable for the medium has two ports, one port is connected to the node, and the other port is connected to the next node, so that the connection can be connected to a maximum of 17 nodes ( using DC coupling) the RS-485). The redundant ports on the NICs at both ends can be connected to the terminator. Figure 3 shows a NIC with two RJ11 connectors. The two ports that are not connected are connected to a 120W terminator.
Star bus structure
The star bus wiring is centered on the HUB to form a multi-star interconnect structure, as shown in Figure 4 . This structure is called a bus because all workstations share a common cable.
This structure can use either a coaxial cable or a twisted pair. When using a coaxial cable, the HUB can be either active or passive. If an active HUB is used , the bus cable is plugged into one of its ports and the remaining ports are connected to the workstation. The maximum distance between the workstation and the active HUB is 610 meters.
When using twisted pair, an active HUB is required , the HUB is connected to the file server, and the workstation is directly connected to it. In this way, the distance between the server or workstation and the active HUB can be up to 1220 meters. Ports not used on the NIC must be shorted with a 93 Ω terminator. Table 1 shows the maximum allowable length of the network segment and the maximum number of nodes allowed on the single bus network segment when the networking is established (the bus transmission rate is 2.5 Mbps) .
Conclusion
COM20022 token bus LAN implemented using a number of advantages. In the field of real-time control, the media is flexible and easy to set up. It is an excellent ARCNET controller. At present, it has been well used in the digital in-vehicle communication system developed by our company, and has achieved good results in both data transmission and real-time voice communication.