|
Part 2: Ethernet-Equipped
RabbitCore Modules
by Fred Eady
Start
• The Networking Core
• Code Names and Comedy
• Where and Why • Completing
Initialization Down
to Business • Now What?
• Sources and PDF
THE NETWORKING CORE
It’s pretty obvious
that the Rabbit 2000 processor is the computing
core of the RCM2100, but the Rabbit 2000 microprocessor
by itself cannot implement the lower levels of networking
functionality. As far as the RabbitCore RCM2100
is concerned, a UART (on- or off-chip hardware or
bit-banged in software) and usually an RS-232 converter
IC or similar conversion circuit must be employed
to deploy a usable and globally acceptable serial
communications interface. The same goes for RS-485.
Likewise, the physical and Media Access Control
(MAC) of an Ethernet interface are provided by ICs
like the Realtek RTL8019AS.
The RTL8019AS is the
Ethernet IC of choice for all of the Rabbit Semiconductor
core modules and the Z-World BL2000. The hardware
implementation of the RTL8019AS is an 8-bit scheme
directly connected to the RCM2100 processor. To
simplify the RJ-45 end of the interface, an LF1S022
integrated magnetics unit adorns the new models
of Ethernet-capable RabbitCore modules. That’s nice,
but highly integrated hardware often depends on
rock-solid software. Fortunately, Rabbit Semiconductor
and Z-World provide full C and assembler source
code that describes their Dynamic C Premier library
functions. Let’s look at what it takes to bring
the RCM2100-mounted RTL8019AS online.
Table 1 is a layout of
the RTL8019AS internal registers. The larger and
lower portion of Listing
1 is the actual
Rabbit code snippet defining the registers laid
out in Table 1. The RCM2100 does some ’9346 EEPROM
emulation and defines the EEPROM pins (EESK, EEDI,
and EEDO) in the code area you see at the beginning
of Listing 1. As far as RTL8019AS initialization
goes, the idea is to push values into the RTL8019AS
internal registers and set up memory areas within
the RTL8019AS’s 16 KB of on-chip SRAM for transmit
and receive ring buffers.
|
No. (hex)
|
Page 0
|
Page 0
|
Page
1
|
Page 2
|
Page 3
|
Page 3
|
| |
[R]
|
[W]
|
[R/W]
|
[R]
|
[R]
|
[W]
|
|
00
|
CR
|
CR
|
CR
|
CR
|
CR
|
CR
|
|
01
|
CLDA0
|
PSTART
|
PAR0
|
PSTART
|
9346CR
|
9346CR
|
|
02
|
CLDA1
|
PSTOP
|
PAR1
|
PSTOP
|
BPAGE
|
BPAGE
|
|
03
|
BNRY
|
BNRY
|
PAR2
|
|
CONFIG0
|
|
|
04
|
TSR
|
TPSR
|
PAR3
|
TPSR
|
CONFIG1
|
CONFIG1
|
|
05
|
NCR
|
TBCR0
|
PAR4
|
|
CONFIG2
|
CONFIG2
|
|
06
|
FIFO
|
TBCR1
|
PAR5
|
|
CONFIG3
|
CONFIG3
|
|
07
|
ISR
|
ISR
|
CURR
|
|
|
|
|
08
|
CRDA0
|
RSAR0
|
MAR0
|
|
CSNSAV
|
|
|
09
|
CRDA1
|
RSAR1
|
MAR1
|
|
|
HLTCLK
|
|
0A
|
8019ID0
|
RBCR0
|
MAR2
|
|
|
|
|
0B
|
8019ID1
|
RBCR1
|
MAR3
|
|
INTR
|
|
|
0C
|
RSR
|
RCR
|
MAR4
|
RCR
|
|
|
|
0D
|
CNTR0
|
TCR
|
MAR5
|
TCR
|
|
|
|
0E
|
CNTR1
|
DCR
|
MAR6
|
DCR
|
|
|
|
0F
|
CNTR2
|
IMR
|
MAR7
|
IMR
|
|
|
|
10–17
|
Remote DMA port
|
|
|
|
|
|
|
18–1F
|
Reset port
|
|
|
|
|
|
| Table
1—With the exception of page three, this is
the standard DP8390/NE2000 NIC register set.
Note that the registers that are used the most
are the easiest to access. |
Some of this register
stuffing is normally found in an external serial
EEPROM that is specified in the datasheet as a type
‘9346 EEPROM or similar device. One real-life example
of this type of serial EEPROM is Atmel’s AT93C46.
Tables 2 and 3 show the layout for data contained
within the serial EEPROM. The RTL8019AS has to be
informed of its base I/O address, interrupt request
line, and Ethernet or MAC address, and this data
is normally kept within the ’9346.
|
Bytes
|
|
Contents
|
Comments
|
|
00H–03H
|
(4 bytes)
|
|
Powerup initial
value of page 3 and PnP logical device configuration
registers
|
| |
00H
|
CONFIG1
|
|
| |
01H
|
CONFIG2
|
|
| |
02H
|
CONFIG3
|
|
| |
03H
|
CONFIG4
|
|
|
04H–11H
|
(14 bytes)
|
|
NE2000 IDPROM
|
| |
04H–09H
|
Ethernet ID
0–5
|
Ethernet node
address
|
| |
0AH–11H
|
Product ID
0–7
|
Assigned by
card makers; negligible
|
|
12H–1AH
|
(9 bytes)
|
|
Plug-and-Play
serial identifier
|
| |
12H–15H
|
Vendor ID 0–3
|
|
| |
16H–19H
|
Serial number
0–3
|
|
| |
1AH
|
Serial ID checksum
|
|
|
1BH–7FH
|
(101 bytes)
|
|
Plug-and-Play
resource data
|
| Table
2—The only reason the ’9346 is emulated is
because three bits (FUDUP, LEDS1, and LEDS0)
cannot be set using the parallel interface. |
| |
Bit 7
|
Bit 6
|
Bit 5
|
Bit 4
|
Bit 3
|
Bit 2
|
Bit 1
|
Bit 0
|
|
CONFIG1
|
*
|
IRQS2
|
IRQS1
|
IRQS0
|
IOS3
|
IOS2
|
IOS1
|
IOS0
|
|
CONFIG2
|
PL1
|
PL0
|
*
|
BS4
|
BS3
|
BS2
|
BS1
|
BS0
|
|
CONFIG3
|
PNP
|
FUDUP
|
LEDS1
|
LEDS0
|
*
|
*
|
PWRDN
|
ACTIVEB
|
|
* denotes
"don’t care"
Table 3—This
is the layout of the contents of the optional
’9346 EEPROM. It’s cheaper to leave the
EEPROM out of the design and fake its existence
like the Dynamic C Premier code does. But,
if you are designing an Ethernet interface
board for the PC market, this is the way
to go.
|
In the case of the
RCM2100, there is no ’9346 physically mounted on
the RCM2100 printed circuit board and no provision
to add one. The absence of a configuration serial
EEPROM is shared by the absence of any configuration
jumpers. Bill’s Plug and Play is not a factor here
either. So, it’s up to the Dynamic C Premier library
routines to trick the RTL8019AS into believing that
there is a ’9346 present and programmatically load
some useful data into the RTL8019AS’s registers
you see in Tables 1, 2, and 3.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for
engineers. Visit www.circuitcellar.com
for more information and additional articles.
For subscription information, call (860) 875-2199,
subscribe@circuitcellar.com
or subscribe
online. ©Circuit Cellar, the Magazine for Computer
Applications. Posted with permission. |