⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ethernet.html

📁 嵌入式系统的TCP/IP源代码
💻 HTML
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Werner Cornelius">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [de] (Win95; I) [Netscape]">
   <TITLE>Embedded Ethernet</TITLE>
</HEAD>
<BODY>
<B><FONT SIZE=+1>Implementation notes and Docs for an
Ethernet solution</FONT></B>
<BR><B><FONT SIZE=+1>usable for embedded systems using the RTL8019(AS)
chip</FONT></B>

<P>Notes and Docs collected by Werner Cornelius (Cornelius@ethernet.isdn-development.de)

<P>Some time ago when I have been searching for an ethernet controller
suitable for embedded applications using standard microcontrollers like
the 8051s or a NEC V25. I found the RTL8019AS chip manufactured by Realtek
Taiwan (www.realtek.com.tw).
<BR>This chip offers some advantages to other available solutions:
<BR>&nbsp;
<OL>
<LI>
A RAM buffer with 16KBytes size is included on the chip and needs no external
wiring. This RAM is completely controlled by the chip and offers buffering
for multiple packet data . The data is aligned to 256 byte boundaries,
so every received packet requires at least 256 bytes. If one send buffer
for an ethernet packet with 1576 bytes is assumed (occuping&nbsp; 1792
bytes due to alignment) and a maximum packet size of 1576 bytes is expected
for receive at least 8 received packets with full size may be buffered.
If the received packets are smaller of course more packets may be buffered.</LI>

<LI>
The chip is software compatible to the popular NE1000/NE2000 hardware offering
16 and 8 Bit access modes. So drivers may be easily adapted or written.</LI>

<LI>
There are only a few components required for using the chip, as the complete
address decode is included (10 or 16 address bits possible for decode).</LI>

<LI>
The chip is suitable for 10 Base T (twisted pair), BNC and AUI connections.
A media auto detect is build in.</LI>
</OL>
The only disadvantage may be the QFP100 package used, which is a bit complicated
to solder but with its 0.65mm spacing this might be achived if you have
some experience.

<P>Before creating a own board a test with an ready manufactured PC card
using this chip might be a quick check whether this solution is suitable
for the desired purposes. Wires connected via an connector or even soldered
directly to the card edge connector may be used for first tests.

<P><B>I/O-Address decoding</B>

<P>The RTL 8019AS has an included address decoder for minimal external
hardware requirements. Additionally the address may be changed inside the
running system via "Plug and Play" mechanism, which is normally not needed
in microcontroller applications.
<BR>The I/O address decoder setup is done during 2ms after a hardware chip
reset. The setup data is fetched from the external EEPROM or the jumpers
if set to jumper mode.
<BR>A common pitfall when using the device with the internal address decoder
is that there are 2 possible modes of decoding selectable:
<OL>
<LI>
The chip only decodes addresses A0 to A9. This mode is set when bit 0 of
byte offset 3 inside the EEPROM has a zero value.</LI>

<LI>
The chip decodes the I/O-address line range using A0 to A15. In this case
the bit must be set to 1</LI>
</OL>
The mode is determined at reset when reading the EEPROM and MAY NOT be
changed by the user afterwards. If an EEPROM with this bit reset to 0 is
used and all 16 address lines required or used to decode some problems
may occur.
<BR>The EEPROM may be reprogrammed inside the system if needed.
<BR>The following binary is taken from a card using full 16 address line
decode.
<BR>The Plug and Play data inside the EEPROM may be used to save additional
parms like IP-addresses and other user config data, when the Plug and Play
function normally not needed isn't used at all.

<P><B>Sample EEPROM config data</B>

<P>&nbsp;<A HREF="93c46.bin">93c46.bin</A>
<BR>&nbsp;

<P><B>How to connect the card/chip to a 8051 system:</B>

<P>I assume you will connect the card in the external RAM-space

<P>1. Connect the data lines and addresses A0-A4 directly to the RAMs addresses
<BR>2. Set the card to jumper mode, with the following setup:
<BR>&nbsp;&nbsp; An irq of your choice
<BR>&nbsp;&nbsp; Boot ROM disabled !!!
<BR>&nbsp;&nbsp; Select a base addresses selecting from the following criteria:

<P>&nbsp;&nbsp; If you would like the RTL8019 to completely decode your
address space
<BR>&nbsp;&nbsp; think about the area you would like to use.
<BR>&nbsp;&nbsp; Then select a jumpered base address (0x200-0x3e0) which
has the needed number
<BR>&nbsp;&nbsp; of 1 bits as the base (1 to 5 bits possible) and connect
the rest of the address lines
<BR>&nbsp;&nbsp; apropriately.

<P>&nbsp;&nbsp; Example1: You would like to use the standard base address
0x200
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Then connect the remaining address lines A5-A15 to the same ones on the
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RAM.

<P>&nbsp;&nbsp; Example2: As 200 to 3e0 hex is normally used for RAMs you
might like to occupy
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
the chip the high 2 KBytes of the RAM space.
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Set the jumpers to base address 0x3E0
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Connect A5-A9 to A15-A11 of the RAM and the rest of the cards address
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lines A10-A15 to A5-A10 of the ram.
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
The card then will occupy addresses 0xF800-0xFFFF each 32 bytes
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
duplicated of course.
<BR>&nbsp;&nbsp; In this both examples the /AEN line of the connector needs
to be grounded !
<BR>&nbsp;
<BR>&nbsp;&nbsp; If you want to use an already existing Address decoder
with an active low output
<BR>&nbsp;&nbsp; inside your system, setup a desired address with the jumpers
and connect
<BR>&nbsp;&nbsp; A15-A5 to the appropriate levels for the card to be decoded.
<BR>&nbsp;&nbsp; Connect the /AEN line to your decoder.

<P>&nbsp;&nbsp; For all examples the cards addresses A19-A16 and the /MEMCS16
lines should be
<BR>&nbsp;&nbsp; grounded !
<BR>&nbsp;&nbsp; /IORD and /IOWR of the card are connected to the 8051s
/RD and /WR.
<BR>&nbsp;&nbsp; /MEMRD and /MEMWR must be pulled high because else the
card may use the ready
<BR>&nbsp;&nbsp; line not supported by any 8051 !!!
<BR>&nbsp;&nbsp; Now only the positive Reset input for the card may be
connected to a reset on the
<BR>&nbsp;&nbsp; 8051 system or may be better connected to a single pulled
up port line, allowing
<BR>&nbsp;&nbsp; hardware reset of the card in the running system.
<BR>&nbsp;&nbsp; (After a hardware reset wait at least 2ms before accessing
the card)
<BR>&nbsp;&nbsp; The selected interrupt line from the jumpers may be connected
via an inverter to
<BR>&nbsp;&nbsp; an 8051s interrupt line. This line of the card is active
positive, so the inverter
<BR>&nbsp;&nbsp; is required. Edge or level irq may be used, depending
on the implemented software.

<P>&nbsp;&nbsp; Now all connections are complete !
<BR>&nbsp;&nbsp; You may test the circuit.

<P><B>How to connect the card/chip to a V25 system:</B>

<P>Mainly the same thinsg regarding address decoding as above apply but
there are a few differences:
<OL>
<LI>
The /AEN line of the controller needs to be connected to /IOSTB of&nbsp;
the V25</LI>

<LI>
The /IOWR line of the controller is connected to /WR of the V25</LI>

<LI>
The /IORD line needs to be an inverted signal from the V25 /WR</LI>

<LI>
The reset signal may be derived from the inverted V25s /RESET or a positive
RESET line available in the system. Also the solution to connect it to
a port line (pullup required) is suitable.</LI>

<LI>
I have used the V25+ with 10 MHz and 2 wait states for the io access. In
this case the RTL chip never generated a wait on the ready line, so connecting
this line is not needed. Boot rom must be disabled and /MEMWR and /MEMRD
pulled up of course.</LI>
</OL>
<B><FONT SIZE=+1>Dokumentation and data sheets</FONT></B>

<P>For the first I may offer the following documents I got from Realtek:
<BR>Please send me additional docs you got or wrote.

<P>Data sheets:

<P>RTL 8019 data sheet (version without internal RAM)
<BR>&nbsp;<A HREF="rtl8019.pdf">rtl8019.pdf</A>

<P>RTL 8019AS addendum to RTL 8019 data sheet (with internal RAM)
<BR>&nbsp;<A HREF="8019asds.pdf">8019asds.pdf</A>

<P><B><FONT SIZE=+1>Schematics (For Orcad schematic (DOS version))</FONT></B>

<P>2 in 1 (An ISA card offering 10 Base T (twisted pair) and BNC
<BR><A HREF="2in1.zip">2in1.zip</A>

<P>3 in 1 ( Same as above but additionally with auto sense AUI connection)
<BR><A HREF="3in1.zip">3in1.zip</A>

<P><B><FONT SIZE=+1>Software</FONT></B>

<P>Packet driver coded in 8086 asm adapted from NE1000/2000 driver for
use with RTL8019(AS) chip by Realtek.
<BR>Please tell me if additional software may be put here.
<BR><A HREF="pkt8019.zip">pkt8019.zip</A>
<BR>&nbsp;

<P>I hope this documentation will help to implement new designs.
<BR>In the meantime I spoke to Realtek and I decided to supply interested
developers in germany (other locations on request)&nbsp; with chips in
small sample quantities, as it would not be a good idea to order and sent
5, 10 or 20 pieces directly from Taiwan to Europe. If you need samples
please contact me and I will give you the details.

<P>Werner Cornelius
<BR>E-Mail to: Cornelius@ethernet.isdn-development.de
<BR>&nbsp;
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -