PN532 Breakout Board

Hi everyone,

I hope you could help me. I have a PN532 and an Arduino FIO board. My question is How can I connect it? I saw in adafruit web page a tutorial, and a library. But I do not understand. I saw this: http://www.adafruit.com/products/364A a few minutes ago. It seems that there is an intermediaty between the fio and the PN532, and they develop a library to arduino. But it seems to complicated to me. What I mean is, if there is a easiest way to connect both of them. My PN532 has sel0 and sel1 off, the uart mode is selected. Can I use this mode to connect to the fio directly? Is there any sketch example to do it? Because it must work with a baudrate of 115200 8N1 .... but I do not know how to choose this parameters.

I tried the next:

#include "NewSoftSerial.h"
#define SS   5
#define MOSI 4
#define VCC  2
#define GND  3
NewSoftSerial cardSerial(5,4);

void setup() {
  cardSerial.begin(115200);
  Serial.begin(115200);
  Serial.print("probando lector de tarjeta\n");
  digitalWrite(VCC, HIGH);
  digitalWrite(GND, LOW);
}
void loop() {
  cardSerial.print(0x55, BYTE);
  cardSerial.print(0x55, BYTE);
  cardSerial.print(0x00, BYTE);
  cardSerial.print(0xFF, BYTE);
  cardSerial.print(0x03, BYTE);
  cardSerial.print(0xFD, BYTE);
  cardSerial.print(0xD4, BYTE);
  cardSerial.print(0x14, BYTE); 
  cardSerial.print(0x01, BYTE);
  cardSerial.print(0x17, BYTE);
  cardSerial.print(0x55, BYTE);

  if (cardSerial.available()>0){
    Serial.print(cardSerial.read(), HEX);
    Serial.print("\nleo\n");
  }
  delay(1000);
 
}

Evidentely it doesn´t work. I´ve tried to read the datasheet but ... Also I´ve read the library from adafruit to understand how it could work but sadly I am pretty lost.

So I hope you could help me, give me some tips or clues to figure out how make this work.

Thank you for your time

greetings!

Because it must work with a baudrate of 115200 8N1

That is a very difficult rate for software serial to deal with. Only hardware serial seems capable of that rate.

What are you intending to do with the information you get from the card?

Hi PaulS,

I read it on the datasheet. Besides my teacher told me. He told me to try some commands and watch the results. So my first step is trying to send a command and just read the answer. On the adafruit library I saw that you must send some byte before sending a commad as a sensor. But like I said it seems that it´s necessary an intermediate... Maybe one of you know a web page where I can find a tutorial ... o some clue to solve my problem.

anyway, thank you for your time!!

greetings!

I read it on the datasheet. Besides my teacher told me.

The data sheet, and your teacher, may says that the baud rate of the device is 115200. But, if either one said that SoftwareSerial absolutely, positively could hand that baud rate, they were wrong. Sometimes it can. Sometimes it can't.

I saw in adafruit web page a tutorial, and a library. But I do not understand.

Then, perhaps you need to try harder. What don't you understand?