General

NFC Module returns wrong bytes

userHead sebastianskejoe 2013-12-06 04:03:49 4718 Views4 Replies
Hi,

This is (mostly) a repost from another thread (http://www.dfrobot.com/forum/index.php? ... 99#msg4599)

I have an Arduino Uno and the NFC module (http://www.dfrobot.com/wiki/index.php/N ... U:DFR0231)).
It is connected like this:
[img]http://www.pasteall.org/pic/show.php?id=63592[/img]
I have downloaded the zip containing the example code and added the following two lines in the beginnning of the file since the UNO only has one serial
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial Serial1(10,11);
Everything is connected etc., but when I run it, I get the following response for a wake up request and a firmware version request:
Code: Select all
00 80 00 00 00 80 02 FF 75 45 11 F8 FF FF FF 
00 80 00 00 00 80 06 FD 75 20 53 90 E8 08 07 FC FF FF FF 
while the expected response, according to the documentation, is
Code: Select all
00 00 FF 00 FF 00 00 00 FF 02 FE D5 15 16 00
00 00 FF 00 FF 00 00 00 FF 06 FA D5 03 32 01 06 07 E8 00
I have bought two modules and both gives me these responses. I have attached the code I use.

Any ideas what is wrong?
2013-12-06 21:42:28 If I put a NFC tag close to the module send the InListPassiveTarget command to the module, it does seem to recognize that there is a tag, but I cannot decode the response:
Code: Select all
0 80 0 0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  // No tag
0 80 0 0 0 80 C FA 75 A9 50 10 88 8 4C D4 19 F8 E4 21 F0 FF FF FF FF // With a tag
I suppose it could be a different firmware version although I don't think so since it obviously understands the commands I send, which are constructed according to the 1.6 version.
userHeadPic sebastianskejoe
2013-12-06 18:14:34 card/ tags..

http://www.dfrobot.com/index.php?route= ... r_name=nfc

I was just wondering if you have used any of these. I gave it a quick attempt with my android and it reads tags fine, however have not tried to try printing anything from android to the module. How are you doing this?

Is it possible the firmware is just different version?
Seems that the block format is right

I
userHeadPic Jose
2013-12-06 18:08:04 Hi Jose,

Thanks for the response.
Right now I am just trying to get something understandable from the NFC module. Later on I will try to get it to communicate with my android phone.
According to the data sheet all responses from the PN532 should have the following structure (page 65):
Code: Select all
preamble 0x00 0xFF LEN LCS D5 commandcode [data] dcs postamble
which for the GetFirmwareVersion request should give the following response
Code: Select all
00 00 FF 06 FA D5 03 XX XX XX XX XX 00
Looking at what I get, I cannot find a 0x00 0xFF sequence, but it looks like at least the start of this
Code: Select all
00 00 80 06 FD 75 20 XX XX XX XX XX FC FF FF FF
could be somewhat similar to the expected response if 0xFF == 0x80 and 0xD5 == 0x75.
Not sure what you mean with "Did you manage to get any readings from a NFC card?".
userHeadPic sebastianskejoe
2013-12-06 16:08:23 Hello Sebas

Did you manage to get any readings from a NFC card?

I suppose the expected return on the wiki for general cases is wrong, since the example code is not checking, could be a difference on the firmware during the coding.
Check the GetFirmwareVersion on the datasheet for more information datasheet download link

What are you trying to do with these functions?
userHeadPic Jose