Pages: 1 [2] 3   Go Down
Author Topic: Testing homebrew ENC28J60 Ethernet interface  (Read 10809 times)
0 Members and 1 Guest are viewing this topic.
China, Suzhou
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi ill_switch,

I've built a ENC28J60 Ethernet breakout board successfully.
I also used nuelectronics' schematic.
http://www.nuelectronics.com/download/projects/Ethernet_v1_0.pdf

Here is my PCB board sketch:


And here is also some tips for you:

1. please notice the polarity of the tantalum capacitors. C2 and C3 must be 10uF tantalum capacitors.
2. I've checked the datasheet of ENC28J60, and it said that the rated current of the ferrite bead L1 must greater than 100mA. So I think must use a 1206 or greater ferrite bead here.
3. please handle the pins of HanRun HR911105A carefully, make sure you connected these pins in correct sequence and position.

and here is my board: ;D



Good luck!!!!! 8-)
  
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the help everyone.

My 3v3 power supply SEEMS stable. It's the same IC that the nuelectronics' shield uses and the output sits right at 3.287v no matter what.

China Red, you mentioned that those two caps are critical. Right now, I have a 10uF electrolytic on the output of the voltage reg (C2 in their schematic) and a 10uF SMT ceramic on the VCAP pin (C3 in their schematic). Could it be THAT critical that I use tants for these two caps?

I will keep plugging at this, so any other comments/suggestions welcome.
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Quote
Make sure that you have lots of 100nF decoupling on the ENC28J60 and a good 10uF minimum reservoir cap on the 3V3 rail.
What's the symptom of not doing this?

Thanks,

Ian
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Srry to push my problem in here,
I too have a similar game running.

I have an ENC28J0 based shield,bought online.(No Level converters on it.)

I have a Serial Arduino(Atmega328p).

I have connected it up as the enc28j60.h file demanded(as in the nu electronics library) .

I have attached a 16x2LCD for debugging. The Code doesnt get stuck anywhere.

Case1. No LAN cable connected:
-the green LED- blinks a bit and then switches off
-the yellow LED-never switches on at all.
-End result- both off

Case2. LAN Cable Connected :
Both Green and Yellow LEDs give a flurry of blinks on startup,and then both stay off.

I have the following questions:
1.I dont have any router or anything. Just a PC<--LanCable-->Shield.
So,what network settings do I keep on the PC side? I am using Windows 7 32bit.(On connection to the shield,the networking icon shows a red cross,indicating no network present.)
   My PC is currently configured to be a part of another subnet,which has DHCP running.

Ping example fails to blink even the LAN port's LEDs or show debugging messages on the LCD.

I suspect a problem with the way my PC handles the network.

Please Advise.


« Last Edit: August 24, 2010, 07:38:52 am by kmmankad » Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1.I dont have any router or anything. Just a PC<--LanCable-->Shield.
Are you using a cross over cable?

Unless your network card has auto switching, you'll need either a switch or use a cross over cable.

I'd also try setting the IP manually on the PC instead of trying to use DHCP.

Ian
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll check up about the cable,

My board is set at 10.3.8.15,and the PC network settings are as below:



On resetting the sketch,the Icon on my PC does go into identifying mode,so it did detect something.... The ping error i get is "Destination Host Unreachable"
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lotsa 100nF decoupling caps in my design - one on every Vdd/Vss pair, and they're right next to the pins, so it should be "best case."

Can someone suggest the next step to take for troubleshooting? It SEEMS to me like the Arduino is in fact attempting to communicate with the ENC, based on the stuff I probed back in my last few posts. Assuming those results look OK, how can I proceed to test if the ENC is getting initialized correctly? Is there a simple way to get it to respond back to the Arduino, or code I can add that will let me know that the Arduino and the ENC are, in fact, communicating?

At the very least I know the sketch is running and the RESET on the AVR is working, as I've got an LED wired on a digital pin and inserted code into the ping example sketch to get it to blink at different speeds in setup() and loop().
Logged

China, Suzhou
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@ ill_switch,

I think the electrolytic capacitor is ok,
and can you post your schematic, maybe we can help you to find some thing smiley
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure. There's a lot in this design not related to Ethernet functionality so in the interest of simplicity I'm only posting the section of the schematic showing the ENC28J60 and the AVR running the sketch. I'm 99.999% sure the problem isn't elsewhere in the design (i.e. something else causing interference), as I've tested with and without the rest of the PCB.

Here is the ENC28J60, magnetics, level shifting, and 3v3 supply:



Here is the AVR (there's a standard 7805 supplying 5v):

« Last Edit: August 24, 2010, 11:05:13 am by ill_switch » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ill_switch,

Your circuit appears to be fine.

I use a 10uF electrolytic on Vcap and that works fine.  I notice that the decoupling on the 50R networks is 100nF.  Microchip datasheet suggests 10nF.

If the '328 is successfully initialising the ENC28J60 then it should flash the green and yellow LEDS twice after start up.  

Check the continuity of SCK, SS  MISO and MOSI - it may be that you have a broken track and the SPI bus just is not fully connected.  As well as broken tracks - look for solder shorts or if it's a home made board - etching faults which might leave shorting slivers of copper between pins.

Check that the ENC28J60 is not being held in reset.

If your wiring is correct and intact then they should work with the original NuElectronics code.

Have you got anything else hanging on the SPI bus?  Unless you use a 74AHC125 tristate buffer in place of the 74XX08, then the MISO line will not be released and could cause something else to hang.

Possibly swap out the 74XX08, for a '125 and enable MISO with the SS line and see if that fixes it.

If all else fails, swap the ENC28J60 for a fresh one.

Sorry you've had so much grief with this - mine worked just fine on breadboard.



G

Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Out of interest, what would be the effect of leaving off the decoupling capacitors?

Thanks,

Ian
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ian,

The ENC28J60 uses high currents from the 3V3 rail when driving the ethernet. These high current transients are supplied by the decoupling capacitors.  Leaving them off would cause the 3V3 rail to dip greatly when the chip is doing internal switching.  Same with the 10uF cap on the Vcap pin - this acts as a reservoir capacitor for an internal voltage regulator.


G
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Ahh, ok - thanks for that.

Ian
Logged

China, Suzhou
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi ill_switch,

I think your design is ok,
and 100nF for the decoupling on the 50R networks is fine, because I used also it in my home made board, and it works fine.
(I have 2 version of ENC28J60 datasheet.  one is Chinese version, in this version, it suggested to use 0.01uF capacitors. Another is English version, in this version, it suggested to use 0.1uF capacitors. )

I think you may check your board to confirm all units were soldered properly and there was no short curcuit in your board.

BTW, in ENC28J60 datasheet, it suggested to use 1% resistor for 2K3 resistior which attached from RBIAS pin to ground, and also for 49.9Rs. But you said your ENC28J60 could not be initialized sucessfully (the green/yellow LEDs would not blink during starting up...), so I think it's not the root cause...

 
BR,
Wells.
« Last Edit: August 25, 2010, 07:17:36 am by wellswang » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Check that the ENC28J60 is not being held in reset.

How exactly would I check this? The RESET line from the ENC is tied to the RESET line on the AVR. I can ground the line and the AVR resets properly. If I probe the RESET pin right on the ENC (or the AVR for that matter) it sits at 5v when the sketch is running. So I am assuming that the RESET line is working, but don't know for sure.

I even tested the LEDs on the magjack to make sure they weren't malfunctioning and they're fine.

Nothing else on the SPI bus in this design (all other peripherals are I2C).

I'm close to starting over with the circuit (on a breadboard or another unpopulated PCB).
Logged

Pages: 1 [2] 3   Go Up
Jump to: