Go Down

Topic: DUE and Ethernet (Read 6092 times) previous topic - next topic

davidreeves20

Not wanting to completely hijack another thread...here is my issue and testing to date.

SurferTim - I did test with the abbreviated ethernet code removing the pin 4 set to OUTPUT and only setting to HIGH but still wrong IP.

To quickly summarize - I have been trying to get both Ethernet and SD to work in the same program.  I keep getting the incorrect ip address when I define a static IP at begin...even when using your abbreviated startup code. (now removing pin 4 OUTPUT)

Assuming that you are referring to the Official Arduino Ethernet R2 Shield - can you even get them anymore?  The only Official Arduino Ethernet shields I see available cost $45-$50 which is not an ideal solution for this application but ...

Anyway I have some interesting results if not success in testing the following:

1)
I first started with the ENC28J60 module and UIPEthernet library and made good progress testing sockets client but it locks on begin when the SD is powered.

http://www.ebay.com/itm/New-ENC28J60-Ethernet-LAN-Network-Module-For-Arduino-SPI-AVR-PIC-LPC-STM32-/310670027142?hash=item4

2)
Then tried W5100 shield to move to the Ethernet library but with static IP even with abbreviated code returns wrong IP address  This one says R3 and has SCL/SDA and RESET.

W5100 (NHW5100) HanRun HR911105A 15/26 - WRONG ADDRESS but lots of lights including RX

http://www.ebay.com/itm/161406767490?_trksid=p2057872.m2749.l2648&ssPageName=STRK%3AMEBIDX%3AIT

3)
Same symptoms as #2 the W5200 including updated lib doesn't have all of the lights

http://www.ebay.com/itm/131603255867?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

4)
Same symptoms as #2 with W5500 - updated lib

http://www.ebay.com/itm/291495860309?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

5)
The most promising has been the Red Board Module (NOT SHIELD) with W5100 which returns the CORRECT IP from the abbreviated test code IF the separate SD module is NOT powered on, however with the SD powered on it also returns an incorrect IP.  I also get plenty of lights with this one including RX and TX IF the SD in NOT POWERED ON.

http://www.ebay.com/itm/252056619027?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

on this one I also added 10k pullup resistors on both CS as well as 10k voltage divider on the MISO as mentioned below:

 http://www.dorkbotpdx.org/blog/paul/better_spi_bus_design_in_3_steps

I'm wondering if there might just be something wrong with my SD module even though I am trying to run it at 3.3V and I need to use external level shifters somehow...however the SD module works fine without the Ethernet.

Thank you!


SurferTim

Try the shields again with the SD card removed and the abbreviated statup code. Does the startup code return the correct IP?

davidreeves20

Retested all but in short, SD card in or out ALL return incorrect IP with abbreviated startup code. 

The Redboard Module (not shield) however does work fine ONLY when SD is not powered but if the SD module is powered fails whether the card is in or out.


SurferTim

What IP does the shield return? Is it consistent or random?

davidreeves20

They return consistent IPs
Red W5100 module 255.255.255.255
W5100 Shield 255.255.255.255
W5200 Shield 255.255.255.255
W5500 0.143.143.143

RayLivingston

The W5100 boards work fine with the Due - I've been using lots of them for the last year with no problems.  Not sure if all W5100 boards are 3.3V compatible though.

Doesn't an IP of 255.255.255.255 indicate there is no active connection?

Regards,
Ray L.

SurferTim

That looks like something is holding the MISO line HIGH.

davidreeves20

Tim,
Not sure what could be causing the MISO high but I'll look into it.  How did you know that?  Maybe something is shorted?  I do have the described voltage divider on the MISO for the Red Board but none of the shields. Oddly that is the one that works but only when the SD has no power.  Thank you for looking at this!


Ray,
No the 255.255.255.255 is what is being incorrectly returned after the begin when I was trying to assign a static IP address.  If it worked correctly it would return the static IP address that was assigned at Begin.  How can you tell which are 3.3v compatible?  All of these have the SCL/SDA pins etc so hoping they are.  Which W5100 boards have you gotten to work?   

The Raspberry Pi group has a web page where they list the specific parts like wifi adapters and usb hubs that individuals have had good luck with.  This seems like an area where that type of thing would  be helpful for the community.

SurferTim

#8
Jan 05, 2016, 04:08 am Last Edit: Jan 05, 2016, 04:12 am by SurferTim
I know that because I tested it when troubleshooting a problem with the SD card. The SPI bus will work, even if no device is connected. I used a 1K resistor from the MISO line alternately to +5v and GND. When connected to +5v, the SPI bus returns all 1's (255.255.255.255). When connected to GND, it returns all 0's (0.0.0.0).

AFAIK, all Wiznet W5X00 ICs are 3.3v devices with 5 volt tolerant inputs.

I have only the official Arduino ethernet shield. I think zoomkat has more experience with other types of ethernet shields.

edit: The major problem with ethernet shields I have seen here on the forum is poor assembly, resulting in solder bridges between pins. Check your IC for solder bridges.

davidreeves20

Tim,
I'm certainly not questioning you.  That is amazing that you knew that!  Sorry just always trying to figure it all out.  Still trying to catch up on some of this hardware stuff.

 Well I think we might have this problem on the run...I have one of the shields at least going through ethernet begin AND sd init correctly.  Its HUGE!

I'll test the others in the morning.  So I started off checking continuity between the mosi and the other spi pins but couldn't find anything wrong.  For some reason I questioned the continuity with the spi pin because it was not seated all the way down so removed my mega screw shield and tried the ethernet shield directly on the due  AND IT WORKED!

Now after a pretty serious look for anything whacked with the screw shield I haven't found anything yet but obviously something is...so are any other pins other than the six SPIs related to this?  Or is it definitely confined to the six SPIs?

Thank you!  Thank you!

SurferTim

#10
Jan 05, 2016, 02:26 pm Last Edit: Jan 05, 2016, 02:42 pm by SurferTim
The SPI pins are the SPI data, power, ground, and reset pins. Most other Arduinos label that connector as ICSP, and have other digital pins that duplicate the SPI data lines. I don't think any other pins are involved with the SPI data pins on the Due as on other models.

edit: Don't feel bad about questioning things you don't understand. I don't mind explaining at all. If you don't understand something with these boards, sometimes a simple test like I used for the SPI bus is the best way to learn.

And just for others wanting to duplicate the SPI bus test, bear in mind the Due is a 3.3v device, so use 3.3 volts instead of 5 volts on the MISO line. I was testing the SPI on a Mega 2560 for that test.

davidreeves20

Well I'm not sure if this update will be of any use but...

With the screw shield removed, the W5100 shield works with and without the SD card.  Just got my socket client to connect and transfer data.  So far so good.  Not bad for $7.  At this point I am only trying to do a one-to-one socket program initiated by the Due and now have that roughly working so I won't have multiple clients trying to reach the Arduino.

The Red W5100 module must have another problem now as it is no longer working.  Interestingly it still returns the same 255.255.255.255.

The W5200 is different and with or without the SD in it returns nonsense IP addresses that are different every time.  Before it was 255.255.255.255 every time.

The W5500 is responding the same with a 0.143.143.143 every time.  Perhaps this is software?

The screw shield problem continues to be a mystery but it must be the problem at least for the W5100.  It is a kit that I soldered and it looks pretty good.  I've repeatedly done continuity checks on the SPI pins and repeatedly inspected them with a magnifying glass.  I just don't believe that they are shorted between themselves.  There is nothing on the proto screw shield that could short the SPI pins either.  The only possibility that I see is that maybe the SPI pins could be longer to better connect into the W5100 shield.   

Is there a way in software to confirm the SPI connections other than the wierd IPs returned?  Maybe something in the SPI lib?  Like a NO REPLY?  ...or maybe a way to check with a multi-meter?

You've certainly pointed me in the right direction and this is great progress!  I still really have to figure out what is wrong with the screw shield and sure would like to identify the issue(s) with the other shields as well.  I'm beginning to think that the W5200 and W5500 problems may be software related.

I'm guessing that since you are still running the W5100 that you haven't been impacted by the buffer and other issues that seem to have plagued others? 

Thank you again!!!

SurferTim

#12
Jan 05, 2016, 08:42 pm Last Edit: Jan 05, 2016, 09:50 pm by SurferTim
The W5200 and W5500 require a different library than the w5100. If you have not imported a library for the W5200/W5500, you should download, unpack, and import this into your IDE.
https://github.com/Seeed-Studio/Ethernet_Shield_W5200
You can have both libraries in the IDE. This one for the W5200/W5500 has a different include file.
Code: [Select]
#include <EthernetV2_0.h>

edit: That library will not compile with the Due. It will throw a bunch of errors. I don't know if there is a Due compatible W5200 library.

davidreeves20

UPDATE:  The ethernet shield seems to be working well...except for one issue...it seems to change the DUE output from 3.3V to about 5.0V.  This is measured at the 3.3v and gnd pins on the Arduino as well as the same on the shield.  I'm not sure what type of problem this will cause but can't think it will be good.  I originally thought that it must be just one of the shields but tried the others and found the same thing.  I even removed my screw shield and all connections and get the same.  And if I remove the ethernet shield it is back to 3.3v.  Do you or anyone else have a similar issue? 

What problems if any could this cause?  Fortunately all of my external circuits are fine with 5.0V as I run them connected to a Uno as well but I'm not sure if digital output pins or i2c connections will not possibly cause damage to the Due.

I do have a TL431 voltage reference circuit that I use with my Uno to provide 3.3v voltage reference that I think I could use or modify to get things back in line.

Thanks!

davidreeves20

It seems that the W5100 has worked well for some time now but decided to try the W5200 and W5500 to see if either was any better.

Trying to use the EthernetV2_0.h from SEED but it won't compile on the DUE as mentioned above.  So I tried the WIZ Ethernet Library for Arduino IDE-1.6.4  from https://github.com/embeddist/WIZ_Ethernet_Library-IDE1.6.x.git which downloads a zip WIZ_Ethernet_Library-master.zip.  It installs over the standard Ethernet library and requires a change when going from W5100 to W5200 or W5500.

Using the above mentioned initialization of the SD and Ethernet - the Ethernet works fine and accepts the assigned IP address but the SD won't work - returns a 0.

Anyone have any ideas about using either the W5200 or W5500 with the DUE?

Thanks!

Go Up