Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sat Mar 16, 2013 11:40 am

Hello,

I just bought the Adafruit NFC shield, and I have a question.
I have an Arduino Mega 2560 Board and a BLE shield. I don't want to stack the NFC shield to the board and the BLE shield.

It is possible to wire them together (but not stack)? Or do I need getting the NFC Breakout board?

Thank you for your help :)
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by adafruit_support_bill on Sat Mar 16, 2013 12:54 pm

You will need to connect, power, ground, SDA and SCL.

If your Mega is an R3 or later, SDA and SCL are the two pins closest to the USB port. On older Megas, they are on pins 20 and 21.
User avatar
adafruit_support_bill
 
Posts: 25416
Joined: Sat Feb 07, 2009 9:11 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sat Mar 16, 2013 2:02 pm

thank you for this really quick answer :)
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sun Mar 24, 2013 11:13 am

so, I soldered the 5V, GND, SDA and SCL pins on my NFC Shield.

Both lights (busy & power) are on.

I tested the readMifare example, and get:

Code: Select all
Hello!
Found chip PN532
Firmware ver. 1.6
Waiting for an ISO14443A Card ...


But I can't get the datas from the NFC card.
I never get any information.

Thank you for your help!
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by adafruit_support_bill on Sun Mar 24, 2013 11:23 am

Is it one of the MiFare cards from the Adafruit store?
User avatar
adafruit_support_bill
 
Posts: 25416
Joined: Sat Feb 07, 2009 9:11 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sun Mar 24, 2013 11:28 am

It's the card which was with the NFC Shield.

I test it yesterday with an Android phone, and the card worked.

Is it normal that the busy LED is always on?
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by adafruit_support_bill on Sun Mar 24, 2013 11:33 am

Yes, the busy led is always on. It typically flickers a bit as it is reading the card.
User avatar
adafruit_support_bill
 
Posts: 25416
Joined: Sat Feb 07, 2009 9:11 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sun Mar 24, 2013 12:04 pm

The busy LED is on, and when approching the card it flickers. But no informations are shown in the monitor.

Did you have an Idea what can be wrong?
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by adafruit_support_bill on Sun Mar 24, 2013 12:07 pm

When you tested it with the Android, did you write anything back to the card?
User avatar
adafruit_support_bill
 
Posts: 25416
Joined: Sat Feb 07, 2009 9:11 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sun Mar 24, 2013 12:10 pm

I've already think about it, I guess no because I just read the card, but I have to check it when I found another Android phone.

Is there an example the write something of the card?
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by adafruit_support_bill on Sun Mar 24, 2013 12:26 pm

Don't write anything to the card yet. The shield should be able to identify the card as is. I'm going to refer this to the designer of the board to see if he has any suggestions.
User avatar
adafruit_support_bill
 
Posts: 25416
Joined: Sat Feb 07, 2009 9:11 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sun Mar 24, 2013 1:01 pm

ok, thanks a lot!
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by ktownsend on Sun Mar 24, 2013 2:02 pm

Can you uncomment the two 'debug' defines in Adafruit_NfcShield_I2C.cpp and then run the example again, insert your card, and paste the results from the serial monitor here just to see if there's anything helpful?

This is the file ...

https://github.com/adafruit/Adafruit_NF ... ld_I2C.cpp

Try uncommenting these two defines:

// Uncomment these lines to enable debug output for PN532(I2C) and/or MIFARE related code
// #define PN532DEBUG
// #define MIFAREDEBUG
User avatar
ktownsend
 
Posts: 277
Joined: Thu Nov 05, 2009 1:18 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by zinedine on Sun Mar 24, 2013 3:20 pm

I become this:


Code: Select all
Hello!

Sending:  0x0 0x0 0xFF 0x2 0xFFFFFFFE 0xD4 0x2 0xFFFFFF2A 0x0
IRQ received
Reading:  0x0 0x0 0xFF 0x0 0xFF 0x0
Reading:  0x0 0x0 0xFF 0x6 0xFA 0xD5 0x3 0x32 0x1 0x6 0x7 0xE8
Found chip PN532
Firmware ver. 1.6

Sending:  0x0 0x0 0xFF 0x5 0xFFFFFFFB 0xD4 0x14 0x1 0x14 0x1 0xFFFFFF02 0x0
IRQ received
Reading:  0x0 0x0 0xFF 0x0 0xFF 0x0
Reading:  0x0 0x0 0xFF 0x2 0xFE 0xD5 0x15 0x16
Waiting for an ISO14443A Card ...

Sending:  0x0 0x0 0xFF 0x4 0xFFFFFFFC 0xD4 0x4A 0x1 0x0 0xFFFFFFE1 0x0
IRQ received
Reading:  0x0 0x0 0xFF 0x0 0xFF 0x0
Waiting for IRQ (indicates card presence)
Found a card
Reading:  0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
Found 128 tags



With or withour card on the shield, I become for each iteration of loop() this:

Code: Select all
Sending:  0x0 0x0 0xFF 0x4 0xFFFFFFFC 0xD4 0x4A 0x1 0x0 0xFFFFFFE1 0x0
IRQ received
Reading:  0x0 0x0 0xFF 0x0 0xFF 0x0
Waiting for IRQ (indicates card presence)
Found a card
Reading:  0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
Found 128 tags
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 11:38 am

Re: Connect NFC Shield to Arduino Mega 2560 (but not stack)

by ktownsend on Mon Mar 25, 2013 5:34 am

Do you have the IRQ line hooked up as well? You also need to hook this line up when using I2C.
User avatar
ktownsend
 
Posts: 277
Joined: Thu Nov 05, 2009 1:18 am