[PN532_NFC + CATALEX SD READER]

Hello,

I’m currently developing a project with NFC and I need to connect it to a micro SD card.
I’m using an arduino UNO. I connect the SCK of both NFC and micro SD Reader at 13, MISO 12, MOSI 11 NFC CS at 10 and micro SD Reader at 4. The problem is “Didn’t find PN53x board” when everything is plugged. When i take the MISO from SD Reader the initialization of NFC is fine.
I’m using PN532 library and SDFat.
Can someone help me?

#include <PN532.h>
#include <SPI.h>
#include "SdFat.h"
SdFat SD;
#define PN532_CS 9
PN532 nfc(PN532_CS);

void setup(void) {

  Serial.begin(9600);
  Serial.println("Hello!");
  nfc.begin();

uint32_t versiondata = nfc.getFirmwareVersion();
  if (! versiondata) {
    Serial.print("Didn't find PN53x board");
    while (1); // halt
  }

if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }


  
}

void loop(void) {
}

You should declare them both chip selects as Outputs in setup() and write them HIGH to get both devices off the bus to start, Where are you controlling the two chip select pins? I'm not seeing that. As in, take one of them low, do some transfers, take it back high. Take the other low, do some transfers, take it back high.

About chip selects as Output, NFC the library already does that. About SD i forgot, but the problem is before that…
How can i control it if i can’t detect them?
I just need to connect to the MISO to stop detecting nfc.

Some SD cards tie up MISO when selected, and even when Not selected. So bring the SD CS high when it's not selected to start, and you may even need to buffer it with a 74HC125 type of gate where you can disable the output with the SD chip select to make sure it is off the MISO line.

#include <PN532.h>
#include <SPI.h>
#include "SdFat.h"
SdFat SD;
#define PN532_CS 9
PN532 nfc(PN532_CS);

void setup(void) {
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);
  pinMode(PN532_CS,OUTPUT);
  digitalWrite(PN532_CS,HIGH);
  
  Serial.begin(9600);
  Serial.println("Hello!");

  
  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
  if (! versiondata) {
    Serial.print("Didn't find PN53x board");
    while (1); // halt
  }




  
}

void loop(void) {
}

Even doing this Didn’t find PN53x board shows.