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

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

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 :)

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

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.

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

thank you for this really quick answer :)

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

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!

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

Is it one of the MiFare cards from the Adafruit store?

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

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?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

Yes, the busy led is always on. It typically flickers a bit as it is reading the card.

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

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?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

When you tested it with the Android, did you write anything back to the card?

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

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?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

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.

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

ok, thanks a lot!

User avatar
ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

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

Post by ktownsend »

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

zinedine
 
Posts: 13
Joined: Sat Mar 16, 2013 12:38 pm

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

Post by zinedine »

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

User avatar
ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

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

Post by ktownsend »

Do you have the IRQ line hooked up as well? You also need to hook this line up when using I2C.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”