Pages: [1]   Go Down
Author Topic: [SOLVED]Mega 2560 board with wiznet shield (MISO,MOSI,SCK wiring hack,...)  (Read 659 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://avr.tavir.hu/modules/Asers_Shop/images/productimages/avrduino-wiznet-sd.jpg
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!



 
« Last Edit: November 14, 2012, 02:14:02 pm by vespapierre » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5860
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Code:
#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?
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5860
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: November 14, 2012, 08:15:04 am by SurferTim » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!! smiley

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);




« Last Edit: November 14, 2012, 01:49:44 pm by vespapierre » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5860
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are now in business!!  smiley

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
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ohh you are the man Tim! smiley-grin
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?

Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5860
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, very useful!I have just started Arduino fever 2 weeks ago.. smiley
Thanks! I will remain the topic as SOLVED thanks to you.
Logged

Pages: [1]   Go Up
Jump to: