|
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
CODE NAMES AND COMEDY
The whole process starts with understanding
the Ethernet core module definitions. There were numerous other code
definition areas for other Z-World and Rabbit Semiconductor modules
in the Dynamic C Premier Realtek library. I found an interesting code
name for a product in the Dynamic C Premier library source, "Blue
Cheese," which tells me that someone in the Z-World/Rabbit Semiconductor
programming staff has a great sense of humor. Blue Cheese references
Z-World and Rabbit Semiconductor modules with multiple Ethernet interfaces.
Some time ago, I wrote some code for a machine tool and peppered the
comments and module labels with the Beatlesı names and titles of their
songs. The owner liked the Beatles and it all was taken in good stride.
I only hope the person who has to maintain the code can stomach the
humor. Itıs good to see others having fun while they work, too.
For clarity, I singled out the one code
definition area (top section of Listing 1) particular to our RabbitCore
RCM2100. Because this is an online article, thereıs no reason to put
the RCM2100 schematics in the column area. So, fire up another instance
of your web browser and point it to Rabbit Semiconductorıs site (www.rabbitsemiconductor.com).
Go to the RCM2100 documentation area and pull up the RCM2100 schematic.
Iıll be referencing the 8019AS datasheet and its tables frequently
in this discussion. It would be a good idea to log on to www.realtek.com
for a real-time look at the datasheet from a web browser view. If
you would rather have the RTL8019AS datasheets on paper or in an Acrobat
window, to save you the trouble of searching the web collecting datasheets,
Iıve included a collection of National DP8390 and RTL8019AS datasheets
in Acrobat PDF format to download (see Rtinfo.zip
).
The RTL8019AS is based on the NE2000
specification and closely follows the DP8390 in the hardware sense.
Take a look at the RCM2100 schematic page that contains the processor
and Ethernet IC and youıll see that Listing 1ıs PD_WR1 and PD_RD1
are really I/O decode values for the RTL8019ASıs IOWB and IORB pins.
The RTL8019ASıs I/O base address is set to 0x300 by its hardwired
address lines. Some "Blue Cheese" Rabbit Semiconductor modules
(e.g., the RabbitLink) are capable of having two Ethernet interfaces.
The #undef entries for PD_WR2 and PD_RD2 tell you that along
with the schematic, the RCM2100 has a single Ethernet interface. The
PD most likely stands for packet driver. EESK, EEDI, and EEDO are
the ı9346 emulator lines that are driven from port D of the Rabbit
2000 microprocessor. The three EE definition descriptions follow the
RTL8019AS datasheet definitions and logically links these variables
to the ı9346 EEPROM. These three serial EEPROM lines represent the
ı9346 serial EEPROM clock, data input, and data output lines, respectively.
The last declaration in this area offers
Duplex mode selection bit masks. If you match up bits in the full
and half duplex defines with the bit definitions in the RTL8019AS
datasheet, youıll see that these values plug into the CONFIG3 byte
on page three of the RTL8019AS internal register set. The most significant
bit determines the Duplex mode. Bits in locations four and five determine
the operation of the LEDs. The current masks designate LED0 as the
link LED and LED1 as the carrier sense LED. The LED2 pin becomes the
MCSB signal. This signal puts the local buffer SRAM into Standby mode
in the absence of DMA activity to save power. As you can see in the
RCM2100 schematic, LED0 is indeed called the link LED and LED1 is
dubbed the activity LED, or ACT. The MCSB function is not used
as the pin is left floating. A coarse location of the CONFIG3 register
is found in Table 1. The bit-by-bit internal account of CONFIG3 is
found in the ı9346 detail of Table 3.
Moving to the Realtek definition area
in Listing 1, the first thing you encounter is a commented define
specifying Full Duplex mode. This implies that the RTL8019AS will
run in Half Duplex mode on the RCM2100. The reset of the define statements
follows the register layout in Table 1. Note the reference to the
ı9346 command register under the RTL8019AS page three define area.
The Page Stop value of 0x60 is the recommended maximum value for 8-bit
operation. This value is the stop page address of the receive buffer
ring. Finally, to seal the Duplex mode, an #ifdef block logically
determines which Duplex mode to operate in.
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. |