|
|||||||||||||
Web51-CEnglish version Czech version - Basic description - Block Diagram - Hardware - Software - Examples - Conclusion - Ordering - Related - Shortcuts Web51-C is a development kit for creating embedded
Ethernet UDP and SNMP applications based on the 8051 microcontroller
family.
|
Address
Space |
Used |
0x0000 – 0xFBFF |
FLASH 63 kB (CODE) |
0xFC00 – 0xFFFF |
Bootloader 1 kB |
Address
space |
Used |
0x0000 – 0x7FFF |
SRAM 32 kB (XRAM) |
0x8000 – 0x801F |
RTL8019as Ethernet controller |
0x8020 – 0x80FF |
Free for the additional HW |
0x8100 – 0xFFFF |
Overlaps 0x8000 – 0x80FF address space |
Address space |
Used |
Address
space |
Used |
0x0000 – 0x03FF |
SRAM 1 kB (XRAM) |
0x0000 – 0x07FF |
EEPROM 2 kB |
Using the ISP method with the AT89C51RD2 serial port (see chapter “Firmware Programming) performs the programming of the internal FLASH and EEPROM memory. This method requires no additional hardware and fully eliminates using of a classical microcontroller programmer.
The Realtek RTL8019AS Ethernet converter is connected in the minimal mode without the external 93c46 EEPROM memory. The communication with the controller is in 8-bit mode, which allows you to address the 8kB of controller’s internal SRAM memory. This internal memory is used for receiving and transmitting the Ethernet packets. After the Ethernet controller receives the packet, an interrupt signal generated.
| Charon I DK | (Development Kit) is a simple and low cost development kit which you can use for testing and final applications. It contains only basic peripherals. |
| Charon I&II DB | (Development Board) is a development kit which contains direct inputs and outputs, shift registers for external inputs/outputs, LCD display connection and direct 1-Wire output. The Charon I&II DB also contains a second serial RS-232 port, JTAG, SERIAL FLASH up to 4 MB and an ISP programming interface. |
Either of these two development boards is recommended for testing your application. Your production product should use the Charon I or II module combined with your product specific peripheral circuitry.
Serial shift register I/O Ports
The DB series boards contain serial shift register support for extending parallel I/O. The input/output width (maximum 32) depends on the number of connected shift registers. This extended peripheral mode can be enabled by a special set command issued from either the JAVA application or snmp client. In the “parallel“ mode, you can access the microcontroller’s P1 8 bit I/O port directly.
GNU SDCC Compiler (Small Device C Compiler), a freeware compiler, is much better as compared to many commercial projects. We can say, with confidence, that it is situated somewhere in the middle of the compiler ranking list. However, It lacks an IDE and many additional development tools found in commercial products. The expanded C language 8051 syntax is included and it’s the same as in the Keil compiler. So, it is easy to write programs for SDCC that are directly portable to Keil.
However, because of the lack of an IDE, you need to be well skilled in using the GNU tool chain (make, ar, etc.) when programming applications with many separate modules.
Keil C51 is one of, if not the best C compiler in the 8051 world. It has an integrated IDE, so the project development cycle is easier.
Note: The Keil compiler uses the Big Endian method for saving
the data to the memory compared to SDCC, which uses the Little Endian
method.
web51c\app ... The user applications (for instance the demonstration
examples)
web51c\bin ... The other Web51-C system Add on programs (e.g.
RD2-Flasher)
web51c\dev ... Hardware device drivers (e.g. RTL8019AS Ethernet
controller driver)
web51c\doc ... Documentation
web51c\include ... The Web51-C system header files
web51c\lib ... Pre-Compiled libraries (udp, snmp library and
so on)
web51c\net.. The Web51-C system source codes.
The SNMP implementation was developed only for the Keil C compiler.
The Web51-C system uses the internal EEPROM memory to save configuration parameters (see example 1). It is necessary to configure it in the following manner:
The source codes of the example are co-located with the web51.uv2 project. The project includes the information useful for the compiler and linker together. You can open the project in Project -> Open Project menu, where you have to add the following path: \web51c\app\00.eeprom.setup and choose web51.uv2 project.
The project’s information is displayed in the left window:
The source codes of the example are situated in the web51.uv2 project. The project includes the information useful for the compiler and linker together. You can open the project in Project => Open Project menu, where you have to add the following path: \web51c\app\00.eeprom.setup and choose web51.uv2 project.
There are the project’s information displayed in the left window:

ETH_ADDR MY_ETH_ADDR = {{0x00, 0x0A, 0x59, 0x00, 0x00, 0x00}};
// Web51 MAC address
IP_ADDR MY_IP_ADDR = {{192,168,6,68}}; // Web51 IP address
IP_ADDR GW_IP_ADDR = {{192,168,6,254}}; // mask
IP_ADDR NETMASK = {{255,255,255,0}}; // Gateway IP address
The IP address values must be set to be corresrespond with the other IP addresses in the local network, where the Charon device is connected.
Build a project in the Project => Build target menu. The
following files are created after the compilation is done:
File name |
Description |
| WEB51 | input data for debugger |
| WEB51.HEX | the program code (this file is be transferred to the MCU) |
| WEB51.M51 | symbol table |
| WEB51.OPT | current settings of µVision2 (opened files, window size, …) |
| WEB51.UV2 | project file |
| EESETUP.C | source code |
| EESETUP.LST | the output compilation list |
Note: The compilation result is in the bottom of Figure 1. The Web51Udp.LIB library contains some of the information, which is not used in the program. That’s why the compiler reports 14 warnings. These warnings are not an error, but only a notice, that we have increased the code size without any effect. The user can remove the functions, which are not used during the compilation process in the \include\config.h file. This step is recommended for more advanced users.
You can upload the firmware (the result of the compilation web51.hex) to the Charon I module using the flash.bat file (saved in the same directory as the project as well).

The EEPROM memory should now configured. If the data were stored successfully, the screen in Figure 2 is displayed following module reset.
Open the project in the µVision2 environment (see the guide in the
previous example). The source code of the example is stored in the web51c\app\02.udp.client
folder.
u_char EthFrmBuf[ ETH_FRM_SIZE ]; /* The memory for the received UDP datagram */ data WORD EthProt; /* The type of the detected protocol */
W51SystemInit(); /* Web51-C system initialization*/ W51VerStrComp(); /* Displaying the actual system version to the standard output */ W51SysInfo(); /* Displaying the configuration (MAC, IP address act.) */
if( RTLIrq0 ) // check for received ethernet data
// test RTL8019as interrupt request line
{ W51EthReadData( &EthFrmBuf[0] ); // read data from ethernet controller
EthProt = MAKEWORD(EthFrmBuf[12], EthFrmBuf[13]);
// --- decode received ethernet frame data --- //
if(EthProt == 0x0806) W51ArpInput( (ARP_FRAME *) EthFrmBuf ); // ARP
if(EthProt == 0x0800) // IPv4
{if( W51IpValid((IPv4_FRAME *) EthFrmBuf))
{if( EthFrmBuf[23] == IP_Prot_ICMP ) // ICMP
W51IcmpInput((ICMP_FRAME *) EthFrmBuf);
if( EthFrmBuf[23] == IP_Prot_UDP ) // UDP
{ if( W51UdpValidCRC( (UDP_FRAME *) EthFrmBuf))
{ // decode received UDP datagram here
if(W51UdpValidPort((UDP_FRAME *)EthFrmBuf)) // available UDP port
{ W51DisplayUdpData( (UDP_FRAME *) EthFrmBuf);
}
}
}
}
}
} The Web51-C system management – ARP cache management, is finding the physical address of the MAC interface for the IP address (ARP resolver).
W51ArpManagement(); // updata arp cache, resolve remote hosts,...

There is an udp_client.exe PC application for testing the example stored in the web51c\app\02.udp.client\udp.client.pc folder. The application reads the data from the standard input (a keyboard) and sends them to the port 2000 of the module.

Enter the test string „Web51-C project based on T89c51RD2 and RTL8019as.“. You can see the received data by Charon I module on Fig. 5:

Note: The Web51-C system uses the serial port of the T89c51RD2 processor as the standard input/output. You can use any standard serial terminal to display or send the data. You need to set the communication parameters to 9600, N, 8, 1 and disable data flow control.
Address |
Description |
Length [B] |
0x000 |
Web51 MAC address |
6 |
0x006 |
Web51 IP address |
4 |
0x00A |
Mask |
4 |
0x00E |
Gateway IP address |
4 |
0x012 |
DNS server IP address |
4 |
The program sets the Web51-C configuration parameters to the following values:
The source code of the example: web51c\app\00.eeprom.setup.
Note: The SNMP protocol implementation uses its own adaptive EEPROM memory structure, which is not the same as described in the tab. 4.
The source code of the example: web51c\app\01.wake.on.lan.
There is an application developed for testing this example called udp_client.exe, which reads the data from the standard input (a keyboard) and sends everything to Web51 system. The application is written in C language and you can build it using the MS Visual C++ environment or by using a free LCC-WIN32 project. IP address of the Web51 system is passed as a command line parameter for instance udp_client.exe 192.168.6.68.
The source code of the example: web51c\app\02.udp.client.
There is also a PC server application developed for testing this example called udp_server.exe, which receives the incoming data from the Web51 system. The application is written in C language and you should build it in MS Visual C++ or LCC-WIN32 as well.
The source code of the example: web51c\app\03.udp.server.
The source code of the example: web51c\app\04.udp.echo.server.
The source code of the example: web51c\app\05.icmp.ping.
You have to use the Keil C51 compiler to build it. Unfortunately the SDCC version is not ready yet.
In the last part of this text, an in-depth description on how to use
the “SNMP I/O Thermometer“ application is provided. This is also
available as a standalone document.
Or try to contact your nearest distributor of our's products - International Distributors.
You can have sample on your table in 5 days! Just fill OrderForm, fax it to our number and wait for confirmation email with the FedEx tracking number..
Please order item: "Web51 - C" OID is 600077
[1]
Charon I module - /products/charon1/| Main page | Products | Support & Download | Pricelist | Contacts | SiteMap |