Author Topic: RTL8139D ethernet card pinout  (Read 4377 times)

0 Members and 1 Guest are viewing this topic.

Offline izuaTopic starter

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
RTL8139D ethernet card pinout
« on: June 16, 2008, 10:01:05 AM »
Hi!
I'm sure everyone has a RTL8139A/B/C/D based card somewhere around (unless you directly switched to wifi). my network still uses those.
I've toyed around with the ENC28J60 (Spi ethernet chip) but it's only 10Base-T. I want the real thing, 100Base-T, so I want to use a RTL8139D chip. The chip itself is not hard to use, the real problem comes in the IP stack. But anyway, when you design a ethernet device, it also needs its magnetics (1:1 transformers and a coil) and magjacks are not available around.

So, why can't I use an ethernet card directly? It has the magnetics, connector, eeprom, pretty much everything you'd need. The problem is, I don't know how the RTL8139D pins are connected to the PCI pins. I wasn't able to find any schematic on this, and realtek support hasn't been too helpful.
There's the option of going with the multimeter over each PCI and chip pin and see what happens. There are 100 chip pins and 74 PCI pins used. So I'm really hoping someone has a better idea :P
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots

Offline izuaTopic starter

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: RTL8139D ethernet card pinout
« Reply #2 on: June 18, 2008, 09:30:36 AM »
no, you don't understand.
I know to work with that chip. I know its pins. I don't need the chip's datasheet.

I need to know how are the chips' pins connected to the PCI pins on REALTEK NICs. For example: pin 1 of the chip goes to PCI pin 17, pin 2 goes to PCI pin 43, etc..
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: RTL8139D ethernet card pinout
« Reply #3 on: June 18, 2008, 09:55:48 AM »
oops sorry . . . was wondering why the question seemed too easy :P

hmmm can't really help you there . . .

Offline krich

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: RTL8139D ethernet card pinout
« Reply #4 on: June 18, 2008, 10:26:50 AM »
I doubt you'll get any electronics manufacturer to share their schematics with you.

And before you say that PCI is a standard and they should at least share that, remember that PCI is a standard and you could probably find that information on your own.  I'll concede that the PCI specification may be available only under license from the owner of the intellectual property, so it's possible you couldn't find it on your own without tossing a roll of franklins at an unscrupulous Dell employee.

Now, before you go wasting your time reading the PCI specifications, realize that the PCI bus is a "protocol" bus.  This means its roughly akin to the I2C bus in that it's NOT a fancy way to connect a wire from point A to point B, rather its a structured and shared interconnect between multiple devices and requires that you communicate on the bus via a specific protocol.  Therefore, if you insist on going down this road, you'll need to develop a PCI bus for your microcontroller first.  Then, your network card will be plug and play.   ;)

Well, not really plug and play.  You see, after doing all that, you'll still need to develop an IP stack.  Yes, that's right, you'll still need to it.  The Ethernet card only handles the physical layer and serialization into the data link layer.  Some Ethernet cards can handle time consuming tasks at higher layers like calculating header checksums and whatnot, but they don't do it all for you.  You'll still need to develop your own data link layer protocol, or implement MAC (probably easier).  Then, if you want IP, you'll need to develop that part.  Then, if you want TCP or UDP, you'll need to develop that.  Oh yeah, you'll need ARP too.  I think that's the basics.

At this point, unless you're an assembly god-like figure, you've likely exceeded the ability of your poor microcontroller to hold the code to support IP, much less hold the code to do anything else useful.  Not only that, but here you've got a situation where you have the potential for 100mbps input into a (I'm being generous) 20mHz microcontroller.  Now, I'm not saying you'll be blasting it with a bunch of traffic, but, keep in mind that even 1 byte of data arrives at the same speed as 1Gb.  It just takes less time.  Imagine that you would like a cold refreshing drink of water.  You could chug a 16oz. bottled water, or you could have your friend give you a quick squirt from a firehose.  Both will deliver 16oz. of water.  Only one will quench your thirst.

And, on a side note, what's so hard about finding magjacks anyway?  They're on just about every 10/100 Ethernet card out there.  Heck, I think there's an entire bin of magjacks at my local surplus electronics shop ( Vetco <3 ).  You get 55 hits at Digikey when you type magjack in the search box.  So, I'm not sure where the issue is.

Probably one of the easiest ways to get Ethernet on your project, without requiring a team of developers, is to look at the Lantronix line of embedded Ethernet device server modules (MatchPort, XPort).  That's some good stuff right there.

Offline izuaTopic starter

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: RTL8139D ethernet card pinout
« Reply #5 on: June 18, 2008, 02:14:26 PM »
The OSI protocols are not a problem for me, I've been wandering around with tanenbaum's and jamsa's internet books since i was a kid. I can write you an ethernet packet with any major protocol you'd like, including the app layer given paper, pen, and a calculator that knows hex. If it wasn't for the small RAM in microcontrollers, i'd spit 10base-T signals right out of an AVR.

Now, I know the card works at way higher rates than an average microcontroller, but that's the whole purpose of having a network card. The chip has a ton of buffer memory, all I have to do is to read that. I know I might get into trouble if the network card doesn't have any filters and it lays in a busy network, but I'm willing to take that risk.

I doubt a PCI interface will be required. If you ever had one of these el-cheapo cards around, you noticed that 98% of the RTL pins are connected directly to the bus pins. That means, it's either got some smart silicon inside, or it has a smart driver. Since it's expensive to work with several silicon revisions and drivers are cheaper to write, not to mention realtek is a product of taiwan, i doubt that chip is even PCI aware (check how you pump data into the device).

Anyway, realtek never wrote drivers for linux. Still, someone took the challenge of understanding the PCI-to-chip relation and writing a kernel mode driver for it (i've only found pieces of it, where data is written/read from the 93C eeprom). The drivers work, so I'm sure someone out there knows thos PCI-to-NIC relationship.

Magjacks, well, they might be available where you are, but bet'cha never heard of romania. That's where I am, the place of no digikey, mouser and expensive imports :P I don't like development boards. good for prototyping, sure, but if I need to put that code into a real product, I can be pretty sure the only place where I'll find the components the board uses (for a new board) are on the board itself. Buying them online would suck, so I need to work with what I have.
« Last Edit: June 18, 2008, 02:15:01 PM by izua »
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline krich

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: RTL8139D ethernet card pinout
« Reply #6 on: June 18, 2008, 02:44:25 PM »
Hey izua, it seems I've gotten under your skin, and I do apologize.  I was simply ticking through some of the roadblocks I could see.  Reading through the post, I can see that I was perhaps a little harsh.  Some of my typical good humor came across as sarcasm, my bad.

I'm still thinking that what you are trying to do is a monumental task without documentation, but who am I to criticize?  I have a few of those projects myself.   ;)

I just had an idea.  You should find a friend in the US/UK/etc. that can send you "gifts" of electronic parts, to avoid the import duties.  Think that would work?

Offline izuaTopic starter

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: RTL8139D ethernet card pinout
« Reply #7 on: June 18, 2008, 04:59:36 PM »
Ah well, read yesterday's xckd (internet argument) :)
Anyway, I do am aware of the complexity of this task, but think of the results. You wouldn't need a special dedicated chip for ethernet. And if it works, we could develop even more cool stuff, like equipping a robot with a wifi card.
The documentation for the chip is available, as admin pointed it out. I also found on a repair manual site a schematic for a card with RTL8139C. it seems a bit compatible, in the sense that grounds are ok, and eeprom pins go to the correct chip pins. I haven't tested the rest.

I know that the PCI operates at 33MHz, and this might be a problem. Datasheet says that it can range from 0 to 40MHz, however, "normal network operation" requires 16.75, whatever "normal" means.

The idea sounds cool, but I don't know anyone in the states. Maybe a community for this purpose will form someday around here, to trade robot parts :P Then again, maybe I can just ask the senders not to include a bill and mark the products as gifts.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

 


Get Your Ad Here

data_list