| Author |
Message |
Eugen_E
Joined: 29 Nov 2004 Posts: 358 Helped: 31
|
19 Apr 2008 22:07 enc28j60 |
|
|
|
|
I started building an embedded webserver with ENC28J60 and ATmega16. The circuit is inspired from http://www.tuxgraphics.org/electronics/200611/embedded-webserver.shtml, adapted for ATmega16, and with a few additions.
I started testing with firmware from http://www.tuxgraphics.org/common/src2/article06111/eth_rem_dev_tcp-2.10.tar.gz - adapted for ATmega16 and recompiled.
When I run the code from test1.c, the LEDs connected to ENC28J60 flash according to specifications, but finally the link state LED remains off. I use a 1m crossover cable connected to PC.
I want to ask if the link establishment problem could be because of a wrong Rbias value (I used 2k7 and 2k2). The Rbias value should be chosen according to the silicon revision of the chip, but i don't know the revision. However, if i used a wrong value, could this influence reception for a small length cable, or could it damage the chip?
ENC28J60 runs a bit warm, is this normal?
Thanks
Last edited by Eugen_E on 22 Apr 2008 1:06; edited 2 times in total |
|
| Back to top |
|
 |
blueroomelectronics
Joined: 17 Sep 2006 Posts: 1681 Helped: 99 Location: Toronto, Canada
|
19 Apr 2008 23:01 enc28j60 rbias |
|
|
|
|
| Depending on the revision you have to run the SPI bus between 8 & 10MHz or it won't talk. The ENC28J60 runs warm. The wrong resistor will just make the waveform incorrect but no damage.
|
|
| Back to top |
|
 |
Eugen_E
Joined: 29 Nov 2004 Posts: 358 Helped: 31
|
20 Apr 2008 16:28 rbias |
|
|
|
|
Thanks.
I read the silicon rev from the chip (using UART for debugging) and found it to be Rev. B4, so Rbias=2k7. I still have the link problem.
Reading on the Rev. B4 Silicon Errata I learned the chip has quite many bugs ranging from incorrect LED illumination to bad reception when the TPIN+/TPIN- are inverted, it's necessary to run the SPI at >8MHz...
I run the AVR uC at 12.5MHz, from the CLKOUT of ENC28J60, and the SPI is used at 6.25MHz. I think this is Ok, because it's recommended in the Errata and the uC can communicate with ENC28J60.
If you used a Rev. B4 chip, please share your experience.
|
|
| Back to top |
|
 |
blueroomelectronics
Joined: 17 Sep 2006 Posts: 1681 Helped: 99 Location: Toronto, Canada
|
20 Apr 2008 21:36 enc28j60 problem |
|
|
|
|
| Since you're using the CLKOUT it's fine at any speed.
|
|
| Back to top |
|
 |
Eugen_E
Joined: 29 Nov 2004 Posts: 358 Helped: 31
|
21 Apr 2008 15:58 enc28j60 magjack |
|
|
|
|
| Problem solved. The Ethernet integrated connector+transformer+filter had different internal connections than the one on the schematic when i designed the PCB. After I corrected the connections I received ping responses with 0% loss and 0.9ms delay. Now it works great.
|
|
| Back to top |
|
 |
hash84
Joined: 02 Nov 2007 Posts: 1
|
23 Feb 2009 12:48 enc28j60 revision |
|
|
|
|
i'm tring to build the same webserver . it's working perfect in simulation ( i use proteus 7.4) but on the board it doesn't. when the avr is sending spi commands to the enc28j60 the ethernet leds are turning off. i suspect it's a spi comunication problem. the wiring to the magjack is ok. i use atmega16 with a 16mhz crystal. i think i addapted the code ok(it's working in simulation). any ideeas ?
later edit: it's for sure a SPI problem. when i send something through SPI to the enc28j60 the leds turn off. i don't think this is normal...
|
|
| Back to top |
|
 |
Google AdSense

|
23 Feb 2009 12:48 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
Devansh
Joined: 15 May 2009 Posts: 1
|
04 Nov 2009 19:46 ENC28J60 - very precise value for Rbias is needed? - SOLVED |
|
|
|
|
| Hey can i get your adapted code for atmega16? thanks a lot.
|
|
| Back to top |
|
 |