EmbeddedRelated.com
Forums
Memfault Beyond the Launch

LPC's w/ ENC28J60 for ethernet via SPI

Started by Ryan Niemi January 5, 2006
Hello,

I'm working on a project that'll require ethernet. I was hoping the
LPC's w/ onboard MAC/PHY would come out before this project had to
start, but alas, no such luck! I've done the CS8900A, RTL8019A and
Asix 10/100 routes before on past projects, but this application needs
to be minimal space and lowest netlist connection count as possible to
route in a minimally sized PCB. Ethernet performance requirements
isn't high, it'll just be some signalling and status packets to a
control app over UDP.

Has anyone interfaced a Microchip ENC28J60 MAC/PHY to an LPC via SPI?
While looking at it, I ran across a potential problem. The LPC2292
datasheet section on the SPI interfaces say the SPI clock has a
maximum of 1/8 the input clock. The ENC28J60 errata says reading or
writing the MAC registers may be unreliable if the SPI clock is below
8MHz. At 60MHz, it would appear the max LPC SPI clock is 7.5MHz. I'm
contemplating overclocking the LPC slightly by using a 16MHz clock
scaled to 64MHz, which would allow an 8MHz SPI clock. But before I
spend a bunch of time and money (it's a semi-personal project just for
fun) to try it, I figured I'd check if anyone has blazed this trail
before..

Alternatives were Cirrus EP9301/2, but the package is large and I
still need an external PHY anyway. Atmel AT91RM9200 borders on cost
sensitivity and also requires external PHY. Not to mention external
flash and RAM. So I'm stuck with two chips minimum anyway, so might
as well try to go with the LPC2292 as the most suitable CPU choice and
select an ethernet solution around it.

-Ryan



An Engineer's Guide to the LPC2100 Series

Have a look at the Lantronix Xport it will do the job for you requiring only
a serial port to communicate... and in the smallest footprint I believe you
can ever get...

Regards
Lasse

-----Original Message-----
From: lpc2000@lpc2... [mailto:lpc2000@lpc2...] On Behalf Of
Ryan Niemi
Sent: 5. januar 2006 12:00
To: lpc2000@lpc2...
Subject: [lpc2000] LPC's w/ ENC28J60 for ethernet via SPI

Hello,

I'm working on a project that'll require ethernet. I was hoping the
LPC's w/ onboard MAC/PHY would come out before this project had to
start, but alas, no such luck! I've done the CS8900A, RTL8019A and
Asix 10/100 routes before on past projects, but this application needs
to be minimal space and lowest netlist connection count as possible to
route in a minimally sized PCB. Ethernet performance requirements
isn't high, it'll just be some signalling and status packets to a
control app over UDP.

Has anyone interfaced a Microchip ENC28J60 MAC/PHY to an LPC via SPI?
While looking at it, I ran across a potential problem. The LPC2292
datasheet section on the SPI interfaces say the SPI clock has a
maximum of 1/8 the input clock. The ENC28J60 errata says reading or
writing the MAC registers may be unreliable if the SPI clock is below
8MHz. At 60MHz, it would appear the max LPC SPI clock is 7.5MHz. I'm
contemplating overclocking the LPC slightly by using a 16MHz clock
scaled to 64MHz, which would allow an 8MHz SPI clock. But before I
spend a bunch of time and money (it's a semi-personal project just for
fun) to try it, I figured I'd check if anyone has blazed this trail
before..

Alternatives were Cirrus EP9301/2, but the package is large and I
still need an external PHY anyway. Atmel AT91RM9200 borders on cost
sensitivity and also requires external PHY. Not to mention external
flash and RAM. So I'm stuck with two chips minimum anyway, so might
as well try to go with the LPC2292 as the most suitable CPU choice and
select an ethernet solution around it.

-Ryan
Yahoo! Groups Links


Hi Lasse,

I agree that the Xport modules are nifty when you want to avoid
writing a network stack, but they're around $50. Not a big deal for
one-offs, but when you start building more than a few boards, it adds
up quick compared with a $8 ethernet MAC/PHY and $4 of passives and
magnetics. Other reasons I'm not looking for an IP coprocessor are
that I prefer to write the IP stack myself, and this is a
latency-critical motion control application. Ethernet throughput
needs are low, but latency is pretty critical. Most likely I'd rather
go the CS8900A route and deal with the extra hassle before falling
back to an Xport.

For anyone without experience homebrewing ethernet hardware, I'd agree
with Lasse's pointer toward the Xport modules. But for the rest of us
who like to do things the hard way (yay!), anyone have experience
overclocking an LPC just enough to get the SPI clock rate up to 8MHz?

-Ryan --- In lpc2000@lpc2..., "Lasse Madsen" <Lasse.Madsen@E...> wrote:
>
> Have a look at the Lantronix Xport it will do the job for you
requiring only
> a serial port to communicate... and in the smallest footprint I
believe you
> can ever get...
>
> Regards
> Lasse
>
> -----Original Message-----
> From: lpc2000@lpc2... [mailto:lpc2000@lpc2...] On
Behalf Of
> Ryan Niemi
> Sent: 5. januar 2006 12:00
> To: lpc2000@lpc2...
> Subject: [lpc2000] LPC's w/ ENC28J60 for ethernet via SPI
>
> Hello,
>
> I'm working on a project that'll require ethernet. I was hoping the
> LPC's w/ onboard MAC/PHY would come out before this project had to
> start, but alas, no such luck! I've done the CS8900A, RTL8019A and
> Asix 10/100 routes before on past projects, but this application needs
> to be minimal space and lowest netlist connection count as possible to
> route in a minimally sized PCB. Ethernet performance requirements
> isn't high, it'll just be some signalling and status packets to a
> control app over UDP.
>
> Has anyone interfaced a Microchip ENC28J60 MAC/PHY to an LPC via SPI?
> While looking at it, I ran across a potential problem. The LPC2292
> datasheet section on the SPI interfaces say the SPI clock has a
> maximum of 1/8 the input clock. The ENC28J60 errata says reading or
> writing the MAC registers may be unreliable if the SPI clock is below
> 8MHz. At 60MHz, it would appear the max LPC SPI clock is 7.5MHz. I'm
> contemplating overclocking the LPC slightly by using a 16MHz clock
> scaled to 64MHz, which would allow an 8MHz SPI clock. But before I
> spend a bunch of time and money (it's a semi-personal project just for
> fun) to try it, I figured I'd check if anyone has blazed this trail
> before..
>
> Alternatives were Cirrus EP9301/2, but the package is large and I
> still need an external PHY anyway. Atmel AT91RM9200 borders on cost
> sensitivity and also requires external PHY. Not to mention external
> flash and RAM. So I'm stuck with two chips minimum anyway, so might
> as well try to go with the LPC2292 as the most suitable CPU choice and
> select an ethernet solution around it.
>
> -Ryan >
> Yahoo! Groups Links
>




I'd use cs8900 instead. Why bother with overclocking and problems with
new and not fully tested ethernet device. You will spend too much time
with that.

Best regards

--- In lpc2000@lpc2..., "Ryan Niemi" <ryan@f...> wrote:
>
> Hi Lasse,
>
> I agree that the Xport modules are nifty when you want to avoid
> writing a network stack, but they're around $50. Not a big deal for
> one-offs, but when you start building more than a few boards, it adds
> up quick compared with a $8 ethernet MAC/PHY and $4 of passives and
> magnetics. Other reasons I'm not looking for an IP coprocessor are
> that I prefer to write the IP stack myself, and this is a
> latency-critical motion control application. Ethernet throughput
> needs are low, but latency is pretty critical. Most likely I'd rather
> go the CS8900A route and deal with the extra hassle before falling
> back to an Xport.
>
> For anyone without experience homebrewing ethernet hardware, I'd agree
> with Lasse's pointer toward the Xport modules. But for the rest of us
> who like to do things the hard way (yay!), anyone have experience
> overclocking an LPC just enough to get the SPI clock rate up to 8MHz?
>
> -Ryan > --- In lpc2000@lpc2..., "Lasse Madsen" <Lasse.Madsen@E...>
wrote:
> >
> > Have a look at the Lantronix Xport it will do the job for you
> requiring only
> > a serial port to communicate... and in the smallest footprint I
> believe you
> > can ever get...
> >
> > Regards
> > Lasse
> >
> > -----Original Message-----
> > From: lpc2000@lpc2... [mailto:lpc2000@lpc2...] On
> Behalf Of
> > Ryan Niemi
> > Sent: 5. januar 2006 12:00
> > To: lpc2000@lpc2...
> > Subject: [lpc2000] LPC's w/ ENC28J60 for ethernet via SPI
> >
> > Hello,
> >
> > I'm working on a project that'll require ethernet. I was hoping the
> > LPC's w/ onboard MAC/PHY would come out before this project had to
> > start, but alas, no such luck! I've done the CS8900A, RTL8019A and
> > Asix 10/100 routes before on past projects, but this application needs
> > to be minimal space and lowest netlist connection count as possible to
> > route in a minimally sized PCB. Ethernet performance requirements
> > isn't high, it'll just be some signalling and status packets to a
> > control app over UDP.
> >
> > Has anyone interfaced a Microchip ENC28J60 MAC/PHY to an LPC via SPI?
> > While looking at it, I ran across a potential problem. The LPC2292
> > datasheet section on the SPI interfaces say the SPI clock has a
> > maximum of 1/8 the input clock. The ENC28J60 errata says reading or
> > writing the MAC registers may be unreliable if the SPI clock is below
> > 8MHz. At 60MHz, it would appear the max LPC SPI clock is 7.5MHz. I'm
> > contemplating overclocking the LPC slightly by using a 16MHz clock
> > scaled to 64MHz, which would allow an 8MHz SPI clock. But before I
> > spend a bunch of time and money (it's a semi-personal project just for
> > fun) to try it, I figured I'd check if anyone has blazed this trail
> > before..
> >
> > Alternatives were Cirrus EP9301/2, but the package is large and I
> > still need an external PHY anyway. Atmel AT91RM9200 borders on cost
> > sensitivity and also requires external PHY. Not to mention external
> > flash and RAM. So I'm stuck with two chips minimum anyway, so might
> > as well try to go with the LPC2292 as the most suitable CPU choice and
> > select an ethernet solution around it.
> >
> > -Ryan
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
>


I have a LPC2129 running for 1 year @ 61.44Mhz
and it have been ok running for some days @ 72Mhz.
Looks like the core is able to support higher speeds, but the flash
controller registers must be changed to slow down the flash access).
If you could share your findinds about the ENC + LPC, I will be very glad.

Mauricio
Ryan Niemi wrote:
> Hello,
>
> I'm working on a project that'll require ethernet. I was hoping the
> LPC's w/ onboard MAC/PHY would come out before this project had to
> start, but alas, no such luck! I've done the CS8900A, RTL8019A and
> Asix 10/100 routes before on past projects, but this application needs
> to be minimal space and lowest netlist connection count as possible to
> route in a minimally sized PCB. Ethernet performance requirements
> isn't high, it'll just be some signalling and status packets to a
> control app over UDP.
>
> Has anyone interfaced a Microchip ENC28J60 MAC/PHY to an LPC via SPI?
> While looking at it, I ran across a potential problem. The LPC2292
> datasheet section on the SPI interfaces say the SPI clock has a
> maximum of 1/8 the input clock. The ENC28J60 errata says reading or
> writing the MAC registers may be unreliable if the SPI clock is below
> 8MHz. At 60MHz, it would appear the max LPC SPI clock is 7.5MHz. I'm
> contemplating overclocking the LPC slightly by using a 16MHz clock
> scaled to 64MHz, which would allow an 8MHz SPI clock. But before I
> spend a bunch of time and money (it's a semi-personal project just for
> fun) to try it, I figured I'd check if anyone has blazed this trail
> before..
>
> Alternatives were Cirrus EP9301/2, but the package is large and I
> still need an external PHY anyway. Atmel AT91RM9200 borders on cost
> sensitivity and also requires external PHY. Not to mention external
> flash and RAM. So I'm stuck with two chips minimum anyway, so might
> as well try to go with the LPC2292 as the most suitable CPU choice and
> select an ethernet solution around it.
>
> -Ryan > >. >
>


Hello,

You can use the 25MHZ clk from ENC28J60 to drive the
LPC. In this case, you will "use the same clock
source for both ENC28J60 and the host controller..."

For LPC2292 you can have 25 or 50MHZ.

Adrian

--- Ryan Niemi <ryan@ryan...> wrote:

> Hello,
>
> I'm working on a project that'll require ethernet.
> I was hoping the
> LPC's w/ onboard MAC/PHY would come out before this
> project had to
> start, but alas, no such luck! I've done the
> CS8900A, RTL8019A and
> Asix 10/100 routes before on past projects, but this
> application needs
> to be minimal space and lowest netlist connection
> count as possible to
> route in a minimally sized PCB. Ethernet
> performance requirements
> isn't high, it'll just be some signalling and status
> packets to a
> control app over UDP.
>
> Has anyone interfaced a Microchip ENC28J60 MAC/PHY
> to an LPC via SPI?
> While looking at it, I ran across a potential
> problem. The LPC2292
> datasheet section on the SPI interfaces say the SPI
> clock has a
> maximum of 1/8 the input clock. The ENC28J60 errata
> says reading or
> writing the MAC registers may be unreliable if the
> SPI clock is below
> 8MHz. At 60MHz, it would appear the max LPC SPI
> clock is 7.5MHz. I'm
> contemplating overclocking the LPC slightly by using
> a 16MHz clock
> scaled to 64MHz, which would allow an 8MHz SPI
> clock. But before I
> spend a bunch of time and money (it's a
> semi-personal project just for
> fun) to try it, I figured I'd check if anyone has
> blazed this trail
> before..
>
> Alternatives were Cirrus EP9301/2, but the package
> is large and I
> still need an external PHY anyway. Atmel AT91RM9200
> borders on cost
> sensitivity and also requires external PHY. Not to
> mention external
> flash and RAM. So I'm stuck with two chips minimum
> anyway, so might
> as well try to go with the LPC2292 as the most
> suitable CPU choice and
> select an ethernet solution around it.
>
> -Ryan >
>


Adrian Valeanu.
SC PROSAFE SRL
J/40/11835/2002 ; CUI 15026939
Aleea Politehnicii nr. 2
Bl. 5A, sc. 1 Ap. 17 Sector 6, BUCHAREST
ROMANIA
Tel/fax +40 (21) 781.38.58
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com


Hi all!

I built several circuits with the Realtek chip and would love to experiment
with
the ENC28J60 from Microchip. Unfortunatly I did not find a dealer in
Austria.
Where do you buy this highly interesting chips ?

Cheers
Michael


Michael Rubitschka wrote:

> Hi all!
>
> I built several circuits with the Realtek chip and would love to
> experiment
> with
> the ENC28J60 from Microchip. Unfortunatly I did not find a dealer in
> Austria.
> Where do you buy this highly interesting chips ?
>
> Cheers
> Michael >
>

You can request free samples directly from Microchip or buy directly
from them. DigiKey got them to but had long delivery times last I
looked. But samples are delivered from stock now.

Regards
/Ake

--
---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavagen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 0533 146
Company home: http://www.eurosource.se
Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org


Michael Rubitschka ha scritto:

>Hi all!
>
>I built several circuits with the Realtek chip and would love to experiment
>with
>the ENC28J60 from Microchip. Unfortunatly I did not find a dealer in
>Austria.
>Where do you buy this highly interesting chips ?
You may buy directly by Microchip. They have a very good service also
for just 25-10 chips. If you just need 1 or 2 to make some tests you may
try to ask for samples. Go at www.microchip.com and select in BUY column
microchipDirect or Samples.
Massimo Manca, Micron Engineering

>Cheers
>Michael >Yahoo! Groups Links >
>


----------



> Alternatives were Cirrus EP9301/2, but the package is large and I
> still need an external PHY anyway. Atmel AT91RM9200 borders on cost
> sensitivity and also requires external PHY. Not to mention external
> flash and RAM. So I'm stuck with two chips minimum anyway, so might
> as well try to go with the LPC2292 as the most suitable CPU choice and
> select an ethernet solution around it.

Have you looked at the Atmel AT91SAM7X?
http://www.at91.com/Pages/products/microcontroller/AT91SAM/AT91SAM7X/at91sam
7x.html

Joel



Memfault Beyond the Launch