[SOLVED] Arduino MINI 05 and W5200 Wiz820io (Ethernet, SPI)

hi folks

I’ve spent most of the past 24 hours trying to figure out why these two won’t make peace and work.
I’ve successfully connected the same module to a Duemilanove and UNO. no issues at all.

the MINI is powered by a USB adapter and the module via a 3v3 voltage regulator on a breadboard.
I use the modified library for W5200 with #define W5200 enabled.

I’ve tried every combination of Slave Select pin state, even added a delay upon module reset

void W5100Class::init(void)
{
  delay(300);

  SPI.begin();
  initSS();
  
  writeMR(1<<RST);
  delay(100);
 [...]
}

it just won’t work.
I start suspecting that the clock of the MINI has something that won’t allow it to align properly.
the module is rated as capable of handling 5v logic, but my next test will include a level converter, although I am able to set the module’s MAC/IP addresses and send a UDP message to MaxMSP.
the real issue comes with receiving messages, which I’m sure are sent out as the same patch will work with a Duemilanove or UNO connected to the same module.
I’ve tried both powering the module through the 3v3 coming out of another arduino (of course shared GND), and through the 3v3 regulator.

I have also tested mixed configuration with external power supplies.
no reset occurs, so I’m sure there’s no brown out anywhere.
if I keep sending messages they’re picked by my laptop but anything going the other way around just won’t make it through.
I can see the module LED blinking and it keeps working.
I’m sure it receives data because I’m able to ping it using the preset IP…

I’ve almost lost my mind on this, and I’ve searched the forums but everyone talks about Arduino Pro Mini and there’s very little mention of the official one produced by Arduino not Sparkfun.

can anyone shed some light on this?
thank you so much for reading my rants

I can supply some code, but this is more of a hardware or SPI issue than a code one, as all the code works on boards UNO, Duemilanove, Ethernet (both board and shield)

ubi

forgot to mention:
the library correctly sets DDRB and PB2 (DP10), and I've tried messing with it as I've read somewhere that when the pin is low it turns the SPI into slave mode to receive data pushed by the master.

again... the module works with the same code on Duemilanove and UNO...

scratch what I said last about losing my head... I think I've lost it

ubi

There are some changes you must make to Ethernet.h and Ethernet.cpp. Did you make those changes? Here is a link to the report that describes the changes:
https://code.google.com/p/arduino/issues/detail?id=898

hi @surferTim

thank you for your prompt reply :slight_smile:

I have indeed applied all the changes.
Having moderated forums in the past I know how annoying it is when someone posts a new thread without checking pre-existing instances of the issue on the same forum and elsewhere online.

the module, as I said, works great with other boards (testing the Teensy 3.1 later today).
it is very strange that nothing changes in matter of circuitry between the UNO/Duemilanove when it comes to PB2.
no extra components added, same micro (328p).

only thing that changes is that it's clocked at 16MHz with an oscillator rather than 20MHz with a crystal.
I've also posted a tweet to @WiznetTeam (they have been in touch with me over the past few days, so I have a direct contact as well)

I would like to address the issue, as the MINI is an exceptional piece for its cost/performance ratio when it comes to small projects with no budget/time to make a custom board.
I tend not to like it when the suggestion is "switch to a teensy". can't get over it :smiley:

in case anyone ends up here while searching, I've fixed this issue by removing the 1K resistor on SCK (13) and bridging it with a bit of wire.
all my SPI woes gone.
my prototype works beautifully.