Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Implementation on the basis of the W5100 chip of a device for working in Ethernet networks. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Computers

Comments on the article Comments on the article

Currently, remote access to information, data collection, remote control and monitoring in industry, security systems, IP telephony and video communication services are widely developed in everyday life and business life. All this becomes an integral part of modern life.

An obligatory component of such systems is communication channels, and wire lines remain the basis for building computer networks and telecommunications. The main technology used in local area networks is Ethernet.

The most common protocol stack in Ethernet networks is TCP/IP. Their structure turned out to be successful for the transmission of heterogeneous information; it is optimal for high-speed local networks with multimedia traffic. It was these protocols that formed the basis of the Internet. They can be implemented in several ways.

The first way is software. But there are many difficulties along the way. Creating a software protocol stack or even porting existing, freely distributed in source code stacks (such as IwlP, ulP) is a rather complex and time-consuming task. The stack requires an operating system, which can also take a long time to adapt to a specific microcontroller. In addition, almost all operating systems (with the exception of a few clones of Linux) are not distributed for free. The software implementation of the protocols intensively uses the resources of the operating system, processor and memory, which negatively affects the performance of the system as a whole.

To save the microcontroller from performing data transfer procedures over a communication channel and significantly reduce the development time, the second method allows - the hardware implementation of part of the protocols using specialized LSI. This article will describe the practical implementation of a system designed to work in Ethernet networks using standard protocols, built on a microcontroller and a specialized LSI from WIZnet, which implements the TCP / IP protocol stack in hardware.

The AT91SAM9261 microcontroller with an ARM9 processor core was used. His choice was influenced by the presence of a number of necessary peripheral functions. However, it is possible to use almost any other microcontroller, including a much less productive one, although this may have to be paid for by a decrease in the exchange rate.

For hardware implementation of TCP / IP protocols, the W5100 chip is used, which has the following capabilities:

- hardware implementation of protocols TCP, UDR ICMR IPv4 ARR IGMR PPPoE, Ethernet;
- built-in 10BaseT/100BaseTX Ethernet physical layer converter;
- automatic detection of operating modes full duplex, half duplex, 10 or 100 Mbps;
- three ways to connect to the microcontroller. Direct, Indirect, SPI;
- support for ADSL connections under the PPPoE protocol;
- the ability to work simultaneously with four connections, each of which is configured to work in client or server mode;
- 16 Kbytes of internal memory allocated for receive and transmit buffers.

The existing AT91SAM9261-EK development board served as the basis for the system layout. A WIZ810MJ module was installed on the board, containing a W5100 chip with the necessary "piping" and an RJ113BZ assembly - an RJ-45 connector with built-in galvanic isolation transformers and matching elements. For connection with a control device (microcontroller), the module is equipped with two pin connectors PBD2-28.

All documentation required to work with the W5100 chip and with the WIZ810MJ module is available on the official WIZnet website: wiznet.co.kr. There is also the driver's C source text, which implements high-level functions for working with W5100 sockets, as well as a guide for porting the driver. I want to note that all the documentation is written in a very understandable form, so it will not be difficult to figure out how to connect and program the W5100. Documentation for the AT91SAM9261 microcontroller can be found at at91.com

The connection diagram of the WIZ810MJ module to the AT91SAM9261 microcontroller for operation in Direct mode is shown in the figure. Numbers of pins of the microcontroller are indicated in brackets.

Implementation on the basis of the W5100 chip of a device for working in Ethernet networks

The DO-D7 lines form the data bus, the AO-A14 lines form the address bus. NRD signal - reading from memory, NWE signal - writing to memory. The RESET signal, which resets the W5100 chip, can be sent from any free line of the microcontroller port. The RVO line was used.

The AT91SAM9261 microcontroller provides the ability to connect up to eight devices, data exchange with which is carried out as with external memory. For each of them, an area is allocated in the memory space of the microcontroller and its own device select signal (CS) is generated. In this case, the CS6 signal (alternative function of the PCO line) is involved.

In order to quickly respond to a change in the state of the W5100 microcircuit, it is necessary to apply the INT signal to the microcontroller and configure the port line to which it is applied to generate interrupt requests on a falling level difference. The software interrupt handler must parse the contents of the Sn_IR register on the W5100 chip. In this case, the interrupt request input from the W5100 is the PC2 line.

The following describes the steps required to configure the microcontroller and the W5100 chip to work on Ethernet. Program fragments are written in C and can be used practically without changes for any Atmel ARM microcontrollers.
The driver to be "downloaded" from the WIZnet website consists of files w5100.c, socket.c, types.h, w5100.h, socket.h. These files must be included in the project. The original version of the driver is designed to work in the ATmega128 microcontroller, but it is very easy to adapt it to almost any other microcontroller, replacing just a few program lines.

First of all, we need to make some changes to the types.h file.

String replacement

#define _DEF_IINCHIP_MAP_BASE_ 0x8000
on
#def i ne _DEF_IINCHIP_MAP_BASE_ 0x70000000
set the address from which the registers and buffers of the W5100 chip will be accessed (from the address 0x70000000 in the memory space of the microcontroller, the area corresponding to the CS6 signal begins). After that you need to comment out the line
#include
and save the modified types.h file.
Open the W5100.C file. Here you should comment out the line
#include
and add a line after it
#include

Next, you need to convert the 16-bit pointers to the receive and transmit buffers into 32-bit ones.

To do this, in the lines

static uintl6
SBUFBASEDDRESS[MAX_SOCK_NUM]; /**< Tx
buffer base address by each channel */
и
static uintl6
SBUFBASEDDRESS[MAX_SOCK_NUM]; /**< Tx buffer base address by each channel */
(conditional transfers) we will replace the type descriptors of the variable uint16 with uint32.

Further in the text of the program, we replace all 16-bit addresses passed as function parameters with 32-bit ones. After these replacements are made, you can save the file and use the high-level functions of the driver in the main program.

It remains only to initialize the SMC (Static Memory Controller) of the microcontroller to generate the CS6 signal (Table 1) and enter the desired values ​​into the registers of the W5100 chip (Table 2).

Now that all the necessary settings have been made, the system is ready to work on any of the protocols supported by the W5100 chip.

For example, in table. 3 shows a possible procedure for receiving messages in the "server" mode, and in table. 4 - the transfer procedure in the "client" mode.

The most significant drawback of the W5100 chip is the lack of a built-in ability to fragment packages. Therefore, when sending large amounts of information, their breakdown into packages will have to be dealt with by the microcontroller program. This also prevents the chip from being used as a router. Nevertheless, the W5100 chip, due to its low cost and the availability of driver source codes, can be recommended for connecting microcontroller systems to an Ethernet network using standard TCP / IP protocols.

Author: K. Snegov, R. Shishko, Voronezh; Publication: radioradar.net

See other articles Section Computers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Social navigator for cyclists 30.09.2013

Using the Hammerhead navigation device connected to a smartphone, cyclists can navigate in the city and on rough terrain. The direction of movement will be shown by LED signals. The creators also intend to create a social network of gadget owners for meetings and competitions. The pre-order of devices for $75 is open.

Hammerhead Navigation has developed a navigator for cyclists. A device called Hammerhead is attached to the steering wheel and uses LEDs to indicate the direction of movement along the route previously set on the smartphone screen, and also notifies the cyclist of the arrival at the destination.

The compact navigation system communicates with an external device via a Bluetooth wireless connection and a dedicated app for iOS and Android mobile platforms. At the same time, the smartphone itself can be kept in your pocket during the trip. According to the developers, their navigator is perfectly oriented not only on city streets, but also in off-road conditions.

At night, Hammerhead acts as an additional light thanks to the built-in flashlight. Without recharging, the device can work up to 15 hours. The developers tried to increase the operating time of the phone connected to the diode navigator using Bluetooth Low Energy technology.

When building a route, the mobile application takes into account various factors, including the complexity of the distance, its length, elevation difference, and more. As for the social functionality of the application, users can tell other cyclists about the routes they have traveled.

The social component is not limited to this: by analogy with the Strava and MapMyRide programs, the Hammerhead system will allow cyclists to compete with each other in the speed of passing certain sections of the road. In addition, the application will help to organize a meeting of Hammerhead owners who are nearby.

Those who haven't bought a bike yet can rent bikes from bike shops like Bixi and B-Cycle in the US. Hammerhead will point you to the nearest bike rental location, as well as tell you how much time is left until your bike rental ends (requires $3 accessory).

The Hammerhead bike navigator is available for pre-order on the Dragon Innovation crowdfunding platform. As soon as the project raises $145, its authors will start delivering the device. The cost of the product for sponsors who supported Dragon Innovation is $75.

Other interesting news:

▪ Artificial intelligence received copyright

▪ faster than the wind

▪ Tsunami pacified by mathematics

▪ Smartphone Smartisan T2

▪ Cheap water treatment

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Indicators, sensors, detectors. Article selection

▪ article Miracle-yudo fish-whale. Popular expression

▪ article When was the first mummy made? Detailed answer

▪ article dugout boat. Tourist tips

▪ article On the repair of microcomputers. Encyclopedia of radio electronics and electrical engineering

▪ article Match in balance. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024