fredericplante / beta-lib

Automatically exported from code.google.com/p/beta-lib
0 stars 0 forks source link

Helpful information for users of Arduino Ethernet Shield v5 #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When working with an Arduino Ethernet Shield v5 and using, for example, the 
eventlog sketch included in the download the call to sd.init() returns a card 
init error = 1

This error results from the Arduino shield sharing the SPI bus b/n the ethernet 
chip and sd card.  It uses pin 4 as the CS pin for the SD card.  Modifying the 
call to sd.init as below allows the code to work.

Replace this block -
  // Initialize SdFat - print detailed message for failure
  if (!sd.init()) sd.initErrorHalt();

With this -

  // Initialize SdFat - print detailed message for failure
  pinMode(10, OUTPUT); // set the SS pin as an output
  digitalWrite(10, HIGH); 
  if (!sd.init(SPI_FULL_SPEED,4)) sd.initErrorHalt();

I expect this will work with the other examples too

Original issue reported on code.google.com by daviespg...@gmail.com on 10 Apr 2011 at 3:50

GoogleCodeExporter commented 8 years ago
I added more information in the readme.txt file.

Original comment by Bill.Gre...@gmail.com on 16 Apr 2011 at 9:16