EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

PIC to ethernet - is it possible?

Started by zalzon July 26, 2004
Hi,
    My research into my embedded webserver project is going in
circles.  I need to find some way to connect the PIC to an ethernet
controller before I attempt to write a working TCP/IP stack.  

I have a 32bit 5volt PCI ethernet card.  Is it possible to connect the
PIC chip to just a few of the ethernet card's pins and get it to work?

1) Can it be done?

2) What is the minimum number of pins needed to receive data from the
PCI ethernet card?

3) Can anyone suggest a better way to connect to ethernet?  Note : I'm
sticking with the PIC.

Thanks!
 
>I have a 32bit 5volt PCI ethernet card. Is it possible to connect the >PIC chip to just a few of the ethernet card's pins and get it to work? >
You're probably better off getting an ethernet controller meant to be used with microcontrollers than trying to use one that was meant for a general purpose CPU. I mean you're tryng to connect an 8-bit PIC to a 32-bit bus card. I have no idea what is involved with PCI protocols in just trying to talk to the chip, but I'm guessing that you are surely looking at having to load several 8-bit latches just to talk to the card. I'm sure there are Ethernet controllers that are meant for use with 8 or 16-bit CPUs. I think some even use I2C or SPI to talk to the microcontroller. Of course, if your goal really is to write your own TCP/IP stack, then some of those chips might be more than you need as some, like i2Chips' 3100, already have a TCP/IP stack built-in.
In article <sp39g0l2ome4tpllt0513u6q3cnvc4chno@4ax.com>,
zalzon  <zalzonishappy@zalll.com> wrote:
>Hi, > My research into my embedded webserver project is going in >circles. I need to find some way to connect the PIC to an ethernet >controller before I attempt to write a working TCP/IP stack. > >I have a 32bit 5volt PCI ethernet card. Is it possible to connect the >PIC chip to just a few of the ethernet card's pins and get it to work?
Probably not.
> >1) Can it be done?
Probably not. PCI is a really fast, complex interconnection system. It'll simply be too complicated for you poor little PIC to handle.
> >2) What is the minimum number of pins needed to receive data from the >PCI ethernet card?
Don't even try.
> >3) Can anyone suggest a better way to connect to ethernet? Note : I'm >sticking with the PIC.
Sure. Here's a complete package you all your problems: http://members.vol.at/home.floery/electronix/picnic Describes exactly what you want to do and for the same reasons. You have the right idea (attach a PC NIC to the PIC). But the wrong bus. If you downgrade to ISA, then it becomes doable. So now your problem is locating a suitable ISA card. Good Luck in your mission. BAJ
zalzon <zalzonishappy@zalll.com> wrote:
> Hi, > My research into my embedded webserver project is going in > circles. I need to find some way to connect the PIC to an ethernet > controller before I attempt to write a working TCP/IP stack. > > I have a 32bit 5volt PCI ethernet card. Is it possible to connect the > PIC chip to just a few of the ethernet card's pins and get it to work? > > 1) Can it be done? > > 2) What is the minimum number of pins needed to receive data from the > PCI ethernet card? > > 3) Can anyone suggest a better way to connect to ethernet? Note : I'm > sticking with the PIC. > > Thanks! >
Can't help you with pci stuff but there are stacks of resources about connecting microcontrollers to the net. Try the following: http://www.embeddedethernet.com/ http://www.edtp.com/ http://www.beyondlogic.org/etherip/ip.htm http://home19.inet.tele.dk/micro-io/ http://www.digi.com/products/embeddeddeviceservers/digiconnectme.jsp http://www.embedtronics.com/ -- Wing Wong. Webpage: http://wing.ucc.asn.au FAQs about me: Are you and undergrad? Yes Are you looking for work and do you want to work for us? Yes, but only if it pays. Are you insane? No, not at the moment.
zalzon <zalzonishappy@zalll.com> wrote:

>Hi, > My research into my embedded webserver project is going in >circles. I need to find some way to connect the PIC to an ethernet >controller before I attempt to write a working TCP/IP stack. > >I have a 32bit 5volt PCI ethernet card. Is it possible to connect the >PIC chip to just a few of the ethernet card's pins and get it to work? > >1) Can it be done?
No, PCI bus is too complicated
> >2) What is the minimum number of pins needed to receive data from the >PCI ethernet card?
More than you've got. Most PCI network cards act as bus masters, i.e. they control the PCI bus to transfer the data into PC memory at high speed. It is difficult to imagine how this could work with a PICmicro.
>3) Can anyone suggest a better way to connect to ethernet? Note : I'm >sticking with the PIC.
Many designs use a Realtek RTL8019AS ISA-bus chip, as this was adopted by Microchip for their PICDEM.net PICMicro Ethernet board, see http://ww1.microchip.com/downloads/en/DeviceDoc/39563b.pdf Appendix A of this manual has the circuit diagram, which works with a PIC16F877 or PIC18f452; the latter is recommended as the larger RAM makes TCP/IP development easier. Various PICmicro prototyping boards are available that use the same circuitry, but if you really want to build your own then look in a computer surplus shop for an old ISA networking card using the RTL8019 or 8019AS; you can even solder wires directly to the gold-plated ISA bus connector pads. I think that writing your own TCP/IP stack is a laudable idea, but don't underestimate the work involved; my book "TCP/IP Lean" (now in 2nd edition) was written specifically to help in projects such as yours, and comes with source code that is directly compatible with PICDEM.net type of boards. Jeremy Bentham Iosoft Ltd.
On Mon, 26 Jul 2004 08:40:32 +0100, Jeremy Bentham <jben@iosoft.nospam.uk>
wrote:

><snip>>>I have a 32bit 5volt PCI ethernet card. Is it possible to connect the >>PIC chip to just a few of the ethernet card's pins and get it to work? >> >>1) Can it be done? > >No, PCI bus is too complicated >> >>2) What is the minimum number of pins needed to receive data from the >>PCI ethernet card? > >More than you've got. Most PCI network cards act as bus masters, i.e. >they control the PCI bus to transfer the data into PC memory at high >speed. It is difficult to imagine how this could work with a PICmicro. ><snip>
I'm surprised no one has even mentioned that PCI is a reflection wave technology, depending on unterminated lines and very special driving requirements. 1-2ns clock skew (33MHz is 2ns, 66MHz is 1ns), etc. It's just not in the cards. Jon
Jonathan Kirwan wrote:
> On Mon, 26 Jul 2004 08:40:32 +0100, Jeremy Bentham <jben@iosoft.nospam.uk> > wrote: > > >><snip>>>I have a 32bit 5volt PCI ethernet card. Is it possible to connect the >> >>>PIC chip to just a few of the ethernet card's pins and get it to work? >>> >>>1) Can it be done? >> >>No, PCI bus is too complicated >> >>>2) What is the minimum number of pins needed to receive data from the >>>PCI ethernet card? >> >>More than you've got. Most PCI network cards act as bus masters, i.e. >>they control the PCI bus to transfer the data into PC memory at high >>speed. It is difficult to imagine how this could work with a PICmicro. >><snip> > > > I'm surprised no one has even mentioned that PCI is a reflection wave > technology, depending on unterminated lines and very special driving > requirements. 1-2ns clock skew (33MHz is 2ns, 66MHz is 1ns), etc. > > It's just not in the cards. > > Jon
everything in PCI is synchronous i.e. done on clock edges and usally static so the clock can be anything from 0 to 33/66MHz Bitbanging PCI is doable, just setup all the pins, toggle clk high then low, read pins, following the standard for the transctions you need We've done it here for a test systems that needed to boot code into a CPU through its buildin PCI interface for the simpel transactions it wasn't too bad, but it'll probably get complicated if you need bus mastering -Lasse
there goes that idea..

the only reason i was looking at pci was because i had a pci ethernet
card i yanked out from my old computer.  I had seen PICs connected to
ISA ethernet cards and figured connecting a PCI shouldn't be all that
difficult.  I even found & downloaded the pci specification from a
website.  

sadly connectiing an 8 bit device to a 32 bit device is not to be.

btw i have that guy's book TCP/IP Lean which i only just started
reading.  Its got sooooo much info.  Iits a wonder how he managed to
figure all that out in a human's lifetime.
  

  
On 26 Jul 2004 02:39:54 -0400, byron@cc.gatech.edu (Byron A Jeff)
wrote:

>Sure. Here's a complete package you all your problems: > >http://members.vol.at/home.floery/electronix/picnic
Yup I saw that webpage. Amazing that the guy wrote a TCP/IP stack in assembler!
Jeremy Bentham <jben@iosoft.nospam.uk> wrote in message news:<ulb9g05etabuisdib3dqfqpuks616j9q9a@4ax.com>...
> zalzon <zalzonishappy@zalll.com> wrote: > > >Hi, > > My research into my embedded webserver project is going in > >circles. I need to find some way to connect the PIC to an ethernet > >controller before I attempt to write a working TCP/IP stack. > > > >I have a 32bit 5volt PCI ethernet card. Is it possible to connect the > >PIC chip to just a few of the ethernet card's pins and get it to work? > >
Why bother with PCI? Your PIC is not going to saturate even the ISA bus.
> >1) Can it be done? > > No, PCI bus is too complicated
And unnecessary.
> > > >2) What is the minimum number of pins needed to receive data from the > >PCI ethernet card?
My guess for port pins: For ISA, 16 data, 10 addresses and 5 controls. For PCI, 32 data/addresses and 5 controls. plus other hard wired addresses.
> > More than you've got. Most PCI network cards act as bus masters, i.e. > they control the PCI bus to transfer the data into PC memory at high > speed. It is difficult to imagine how this could work with a PICmicro.
Depends on the chip, it could implement polled mode. Of course, you have to ignore all the plug and play junks.
> > >3) Can anyone suggest a better way to connect to ethernet? Note : I'm > >sticking with the PIC.
If you must do it, an FPGA with 2K static ram buffer. We have a 100T partial core in VHDL. We can build you a PIC w/ a 200,000 gates FPGA for approx $50 each. We are doing it for an AVR. You have to port it to the PIC.
> > Many designs use a Realtek RTL8019AS ISA-bus chip, as this was adopted > by Microchip for their PICDEM.net PICMicro Ethernet board, see > http://ww1.microchip.com/downloads/en/DeviceDoc/39563b.pdf > > Appendix A of this manual has the circuit diagram, which works with a > PIC16F877 or PIC18f452; the latter is recommended as the larger RAM > makes TCP/IP development easier. > > Various PICmicro prototyping boards are available that use the same > circuitry, but if you really want to build your own then look in a > computer surplus shop for an old ISA networking card using the RTL8019 > or 8019AS; you can even solder wires directly to the gold-plated ISA > bus connector pads. > > I think that writing your own TCP/IP stack is a laudable idea, but > don't underestimate the work involved; my book "TCP/IP Lean" (now in > 2nd edition) was written specifically to help in projects such as > yours, and comes with source code that is directly compatible with > PICDEM.net type of boards. > > Jeremy Bentham > Iosoft Ltd.

The 2024 Embedded Online Conference