Arduino + Ethernet Shield + NFC shield

Hi !

I’m pretty new to Arduino programming and I’m a bit stuck right now. I hope one of you will be able to help me out.

I have an Arduino Uno (http://arduino.cc/en/Main/arduinoBoardUno), an Ethernet Shield (http://arduino.cc/en/Main/ArduinoEthernetShield) and a NFC shield v2.0 (http://www.seeedstudio.com/depot/nfc-shield-v20-p-1370.html?cPath=132_134).

I’m trying to stack all three of them. I’ve read that Ethernet shields and NFC shields were using the same pin (10) and it prevents them from working together. In the seeedstudio wiki for their NFC Shield v2.0, they provide a library which is allowing the NFC shield to work properly on pin 9.

Here’s what I’m doing :

Arduino → NFC Shield → Ethernet Shield

I’m using the example provided in the seeedstudio wiki :

//This example reads all MIFARE memory block from 0x00 to 0x63.
//It is tested with a new MIFARE 1K cards. Uses default keys for authenication.
//Contributed by Seeed Technology Inc (www.seeedstudio.com)

#include <PN532.h>
#include <SPI.h>

/Chip select pin can be connected to D10 or D9 which is hareware optional/
/if you the version of NFC Shield from SeeedStudio is v2.0./
#define PN532_CS 10

PN532 nfc(PN532_CS);

#define NFC_DEMO_DEBUG 1

void setup(void) {
#ifdef NFC_DEMO_DEBUG
Serial.begin(9600);
Serial.println(“Hello!”);
#endif
nfc.begin();

uint32_t versiondata = nfc.getFirmwareVersion();
if (! versiondata) {
#ifdef NFC_DEMO_DEBUG
Serial.print(“Didn’t find PN53x board”);
#endif
while (1); // halt
}
#ifdef NFC_DEMO_DEBUG
// Got ok data, print it out!
Serial.print(“Found chip PN5”);
Serial.println((versiondata>>24) & 0xFF, HEX);
Serial.print("Firmware ver. ");
Serial.print((versiondata>>16) & 0xFF, DEC);
Serial.print(’.’);
Serial.println((versiondata>>8) & 0xFF, DEC);
Serial.print("Supports ");
Serial.println(versiondata & 0xFF, HEX);
#endif
// configure board to read RFID tags and cards
nfc.SAMConfig();
}

void loop(void) {
uint32_t id;
// look for MiFare type cards
id = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A);

if (id != 0)
{
#ifdef NFC_DEMO_DEBUG
Serial.print(“Read card #”);
Serial.println(id);
Serial.println();
#endif
uint8_t keys= { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF };// default key of a fresh card
for(uint8_t blockn=0;blockn<64;blockn++)
{
if(nfc.authenticateBlock(1, id ,blockn,KEY_A,keys)) //authenticate block blockn
{
//if authentication successful
uint8_t block[16];
//read memory block blockn
if(nfc.readMemoryBlock(1,blockn,block))
{
#ifdef NFC_DEMO_DEBUG
//if read operation is successful
for(uint8_t i=0;i<16;i++)
{
//print memory block
Serial.print(block*,HEX);*
_ if(block <= 0xF) //Data arrangement / beautify_
* {*
* Serial.print(" ");*
* }*
* else*
* {*
* Serial.print(" ");*
* }*
* }*

* Serial.print("| Block ");*
* if(blockn <= 9) //Data arrangement / beautify*
* {*
* Serial.print(" ");*
* }*
* Serial.print(blockn,DEC);*
* Serial.print(" | ");*

* if(blockn == 0)*
* {*
* Serial.println(“Manufacturer Block”);*
* }*
* else*
* {*
* if(((blockn + 1) % 4) == 0)*
* {*
* Serial.println(“Sector Trailer”);*
* }*
* else*
* {*
* Serial.println(“Data Block”);*
* }*
* }*
#endif
* }*
* }*
* }*
* }*
* delay(2000);*
}[/quote]
When the pin is set to 10, the NFC shield doesn’t work if the Ethernet shield is plugged (which is logical).
When the pin is set to 10 and the Ethernet shield isn’t plugged, the NFC shield works fine.
When the pin is set to 9, the NFC shield doesn’t work, even if the Ethernet is plugged or not.
What am I doing wrong?

I'm trying to stack all three of them. I've read that Ethernet shields and NFC shields were using the same pin (10) and it prevents them from working together. In the seeedstudio wiki for their NFC Shield v2.0, they provide a library which is allowing the NFC shield to work properly on pin 9.

Did you re-route the SS pin of the shield to pin 9 of the Arduino? There is a solder bridge you have to cut and solder the other two pads. Unfortunately these solder pads seem to be under the plastic cover of the shield so you have to remove that temporarily to make this change. It should be marked with D10 | SS | D9 in the silk layer of the board.