|Subject:||Re: [lwip-users] Ethernet package through SPI interface|
|Date:||Tue, 8 Mar 2016 08:15:24 +0530|
Microchip’s Enc28j60 is another example of spi Ethernet controller and is used widely. You can also easily get a sample driver on GitHub or available drivers list of LwIP. That can be a good start for a reference driver.
Sorry to jump in. I think what you wrote needs some clarification to those that do not understand it in full.
In a normal Ethernet connection we have the ETH connector from one side and the micro or TCP stack on the other side.
From the ETH connector it is connected to a transformer, normally referred to as the "magnetics", from
the magnetics it is connected to the ETH PHY or ETH switch with a PHY interface, from the PHY or switch it is connected
to the micro via RMII/MII Interface.
It may be connected differently if you have a none standard PHY or some other interface.
The ETH PHY is connected from one side to the magnetics and from the other side it has a MAC interface.
The interface is either via RMII/MII while control of the PHY is via MDIO/SIO etc...
At the micro side normally the MAC interface has DMA and MDIO.
The ETH driver on the micro side handles the setting of the MAC interface / settings (speed, duplex etc...)
All the above is not related to MAC address but rather the interface only.
LwIP or any other TCP stack need to read/or data to/from the MAC interface. This is the hardware driver that connects
the LwIP with the hardware.
If one wants to run LwIP over RS232, SPI or any other interface it simply needs to write the driver that gives LwIP the
ability to read/write data to/from that interface.
If one connects LwIP to SPI (for example) as the interface the MAC interface is NOT used. There is a need for a driver for
SPI to LwIP (data read/wright) and a driver or some code to initialize the SPI.
For example: http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8851snl_ds.pdf
The above link is for a microchip PHY that has an SPI interface rather than the common ETH MAC interface.
As one can see that from one side it has an SPI interface and from the other side it has 4 differential lines to be connected
to the ETH magnetics.
I hope now it is clear :-)
From: address@hidden [mailto:address@hidden On Behalf Of address@hidden
Sent: Sunday, March 06, 2016 2:52 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Ethernet package through SPI interface
> I several times came across references that SPI is used in place of
> RMII, to communicate over LAN. Frankly I'm in doubt this is possible
> at all
You're not interfacing the LAN through SPI (BTW, you're not doing that with RMII, either, you interface the PHY). Instead, you interface a MAC through SPI when your uC does not have one (or you need to use a different one). This MAC then connects to the LAN - either directly or through a PHY.
lwip-users mailing list
lwip-users mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|