Dear all,
I need your help regarding how to use the wiznet shield on mega 2560 board. Story started here: http://arduino.cc/forum/index.php/topic,131757.0.html.
Then I changed to Mega and shield is this one: TavIR - Mikrokontroller világ
This shield worked well with Atmega328 board.
I have created the wiring hack what can be found here: http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/
I have messages from Tim regarding I should do the 3 wire hack, and leave pin 10 in place.
So what should I have to do?
I'm using Arduino1.0.1.
After the 3 wiring hack done what to do?
Do I have to modify any library? Do I have to define the pins in the sketch (if yes, how? ) Do I have to turn on and of the devices what would like to use SPI bus ( Put them to LOW or HIGH, if yes please tell me ). Is it neccesary to define the SS pin what is 10 as an output?
Pins are : digit8 - SD card, digit10-wiznet
Many thanks for your help!
I don't know about the jumpers, but digital pin 10 should be the slave select for the ethernet shield if you want to use the Arduino ethernet library.
Here is a test sketch for you. I would try it until I get an IP.
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
void setup() {
Serial.begin(9600);
// disable SD SPI while starting w5100
pinMode(8,OUTPUT);
digitalWrite(8,HIGH);
Serial.print("Starting w5100...");
if(!Ethernet.begin(mac)) Serial.println("failed");
else Serial.println("ok");
Serial.println(Ethernet.localIP());
}
void loop() {
}
Does this get an ip?
Tim,
thanks for the fast reply. By default on this shield pin 10 is the SS for the wiznet module. At this moment I'm away from the board unfortunately, but I'll will report as soon as I can!
OK. Remember to leave digital pin 10 at pin 10 on the shield. Do not bend and jumper that pin. Pins 11-13 should be bent and jumpered as on the hack page.
edit: This pin hack is needed only on old models of the ethernet shield. The new shields have a 6 pin socket that connects to the ICSP connector on the Arduino main board. That handles the SPI lines for both the Uno and the Mega.
Tim,
I have older model of shield I guess, because it dois not have the icsp connection.
Good news after the test sketch!
Serial monitor said:
Starting w5100...ok
and after the IP address!!!
update: I have tried to run my thingspeak sketch, and it is working!!
Tim! I'm sohappy about this, I was searching a lot! Many thanks to you!!!
I'd like to use wiznet and SD too... in this I have to switch on and swith off the sd and the wiznet when I want to use them. Is that right?
As you did it in the sketch:
// disable SD SPI while starting w5100
pinMode(8,OUTPUT);
digitalWrite(8,HIGH);
You are now in business!!
Start adding the rest of your stuff. If you need an example of wiznet client code, try this:
http://www.arduino.cc/playground/Code/WebClient
Server code here:
http://www.arduino.cc/playground/Code/WebServerST
Ohh you are the man Tim!
Feeding Thingspeak API is working at this moment. I'll test it for at least a day.
Can I get back to you if I'll have questions regarding the sketch about SD+ wiznet?
Can I get back to you if I'll have questions regarding the sketch about SD+ wiznet?
Sure! I'm here at least a few times a day.
If you have lots of aspirin, take a look at this code.
http://www.arduino.cc/playground/Code/FTP
This has the SD and two sockets on the w5100 working together.
This is how I upload my files to the micrSD card.
Oh, very useful!I have just started Arduino fever 2 weeks ago..
Thanks! I will remain the topic as SOLVED thanks to you.