Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

A problem with enc28j60

Status
Not open for further replies.

h.v

Junior Member level 2
Joined
May 27, 2008
Messages
22
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,281
Activity points
1,515
hi

i am doing a project with enc28j60 +AVR

i have written a function that sends out packet: send_packet(length,buffer);
i can successfully capture those packets with WIRESHAK program on the pc side
There is no problem when i send a few packets
but,
When i write this:

While(1) {
send_packet(90,buffer);
delay_ms(500);
}

WIRESHARK show hundreds of packets at the beginning but after a while WIRESHARK do not get my packets (it captures other packets but not the ones send out by ENC) and RJ45-LED connected to ENC stops blinking. When I reset the board the same thing happens, and every time number of captured packets varies

By the way: the fire wall is off-AVR (internal 8MHz)-ENC (25MHz)

any idea?
 

There are few silicon bugs in ENC28J60, make sure you have read errata sheet.

Other than that, did you test your setup against a fully functional program? Because in most cases RJ45 magnetics is source of all trouble, so you have to be sure that hardware part is functional before you dive into software.

Hope this helps
 

back again !!
Thanks to Jack for directing my notice to my Hardware!!
i found where my problem arise!! it is due to the SPI connection and clk of MCU and ENC but can't solve it completely yet.
i tried these things:

1-i added three 180 ohm on Serial-In, Clock-In and Chip-Select pins on the ENC28J60 (they help to send more packets before it stop sending)

2-changed clk source of MCU(atmega32) to external clk produced by ENC clk out (6.25 MHz)

3-changed the spi speed in MCU to focs/2, focs/32 ,focs/128 ,....

now packets are send continuously but "sometimes" it stops sending packets again!!!!!!

i know my problem is with SPI but have no idea what to do next

my questions:

1-what do you recommend about my MCU SPI speed ?
is focs/2 ok for SPI speed (it will be around 3.125 MZ)

2-what do you recommend about my MCU clk source?
is external 6.25 or 12.5 from ENC OK or may i use an xtal(8 or 16MHZ)

3-are my SPI connections OK?

MCU(5V) ENC(3.3V)

ss |===180ohm=== >|cs
sck|===180ohm=== >|sck
so |====180ohm===>|si
si |<===74hct125==|so
osc1|<===74hct125==|clkout

by the way my ENC is REV B7 and i read the Errata sheet but it did not help me much!!!
 

2-what do you recommend about my MCU clk source?
is external 6.25 or 12.5 from ENC OK or may i use an xtal(8 or 16MHZ)

3-are my SPI connections OK?

MCU(5V) ENC(3.3V)

ss |===180ohm=== >|cs
sck|===180ohm=== >|sck
so |====180ohm===>|si
si |<===74hct125==|so
osc1|<===74hct125==|clkout

Use XTAL to clock your MCU, I believe it will more stable than clockout from ENC and report your findings.

Good luck
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top