Topic: Seeedstudio NFC Shield as UART target

I'm having trouble connecting my NFC Shield (1,2) to PC through UART. Basically I just want to make NFC Shield available to libnfc.

I resoldered SEL1 to GND to force PN532 into UART mode. Then I connected J8 (POWER) and J4 (PC1) to CP2102-based USB-to-UART converter like this:

GND -> J8-2 (GND)
GND -> J8-3 (GND)
+5V -> J8-4 (+5V)
RXD -> J4-5 (MOSI/SDA_)
TXD -> J4-6 (SCL/RX/SS_)

No luck. That's what nfc-list says in debug mode:

lt-nfc-list: DBG pn532_uart.c:97
lt-nfc-list:     Trying to find PN532 device on serial port: /dev/ttyUSB0 at 115200 bauds.
lt-nfc-list: DBG uart_posix.c:106
lt-nfc-list:     Serial port speed requested to be set to 115200 bauds (86 µs).
TX: 55  55  00  00  00  00  00  00  00  00  00  00  00  00  00  00  ff  03  fd  d4  14  01  17  00  
lt-nfc-list: DBG uart_posix.c:219
lt-nfc-list:     iExpectedByteCount == 6
lt-nfc-list: ERROR: No ACK.
lt-nfc-list: DBG uart_posix.c:219
lt-nfc-list:     iExpectedByteCount == 9
lt-nfc-list: ERROR: Unable to wakeup the PN532.
TX: 00  00  ff  09  f7  d4  00  00  6c  69  62  6e  66  63  be  00  
lt-nfc-list: DBG uart_posix.c:219
lt-nfc-list:     iExpectedByteCount == 22
lt-nfc-list: ERROR: Unable to receive data. (RX)

Tried 1.4.x and 1.5.x. Did I miss something?

http://www.seeedstudio.com/forum/download/file.php?id=822

Last edited by Sergey Kovalev (2011-10-19 18:22:54)

Re: Seeedstudio NFC Shield as UART target

Hello,

I do own myself this NFC Shield but I use a PN532 UART Breakboard from microbuilder.eu (now available at adafruit.com¹) which made my software setup similar as yours.

On software side, you should use 1.5.x series as the UART driver have been completly rewritten, fixing many uart issues we had with 1.4.x.
Using 1.5.1 means installing log4c as dependency for debug purpose but provide a very more powerful debug than 1.4.x series did.

On hardware side, I seen on seeedstudio:

seeedstudio wrote:

Hardware Installation
Set Seeeduino power selection slide-switch to 3.3V.

Here, I have a 3.3v power plugged on my breakout bard.
PN532's datasheet says that typical PVDD values are between 1.8 and 3.3 V.

You could check you have a 5v -> 3.3v on shield or you maybe need to plug 3.3V pin from the NFC Shield (do it have one?) to 3.3V on your dongle.

I hope that helps.

[1] http://www.adafruit.com/products/364

Romuald Conty

Re: Seeedstudio NFC Shield as UART target

rconty wrote:

Hello,

I do own myself this NFC Shield but I use a PN532 UART Breakboard from microbuilder.eu (now available at adafruit.com¹) which made my software setup similar as yours.

Yes, they are quite similar - basically just breakout board for PN532. And I know that microbuider's board works. Sadly, microbuilder.eu and adafruit don't provide Eagle files for v1.3 (v1.0 didn't have dedicated UART connector), so I couldn't take a look at how it's done on adafruit's board sad

rconty wrote:

On software side, you should use 1.5.x series as the UART driver have been completly rewritten, fixing many uart issues we had with 1.4.x.
Using 1.5.1 means installing log4c as dependency for debug purpose but provide a very more powerful debug than 1.4.x series did.

That's what I've used from the beginning. Compiled libnfc from trunk.

# aptitude install liblog4cpp5-dev liblog4cxx10-dev liblog4c-dev
# ./configure --enable-debug --enable-serial-autoprobe --with-drivers=pn532_uart

That's what I've got:

# ./nfc-list
/usr/src/libnfc-read-only/utils/.libs/lt-nfc-list uses libnfc 1.5.1 (r1177)
pn53x_check_communication: Operation timed-out
pn53x_check_communication: Operation timed-out
No NFC device found.

Does that mean that my debugging isn't working?

rconty wrote:

On hardware side, I seen on seeedstudio:

seeedstudio wrote:

Hardware Installation
Set Seeeduino power selection slide-switch to 3.3V.

Here, I have a 3.3v power plugged on my breakout bard.
PN532's datasheet says that typical PVDD values are between 1.8 and 3.3 V.

You could check you have a 5v -> 3.3v on shield or you maybe need to plug 3.3V pin from the NFC Shield (do it have one?) to 3.3V on your dongle.

That was probably the very first thing that I verified. I triple checked it. NFC Shield does indeed have voltage regulator. It works fine, I have my +3.3V (actually around +3.15V) all over the board (can be measured, for example, on C3 or C4).

NFC Shield also has level shifter (TXB0104PWR). DAMN IT! I knew I've missed something. You have to connect VCC of the level translator (J1-6) to +5V. I wish I just had basic board without that Arduino crap.

rconty wrote:

I hope that helps.

[1] http://www.adafruit.com/products/364

Works now smile

# ./nfc-list
/usr/src/libnfc-read-only/utils/.libs/lt-nfc-list uses libnfc 1.5.1 (r1177)
pn53x_check_communication: Operation timed-out
Connected to NFC device: PN532 (/dev/ttyUSB0) - PN532 v1.4 (0x07)

Re: Seeedstudio NFC Shield as UART target

Sergey -

Can you be more specific on switching the seeedstudio nfc shield to UART mode? Not sure I'm following you, I'm trying to use it on an arduino but not over SPI (its conflicting with other components)

Re: Seeedstudio NFC Shield as UART target

esoterik wrote:

Sergey -

Can you be more specific on switching the seeedstudio nfc shield to UART mode? Not sure I'm following you, I'm trying to use it on an arduino but not over SPI (its conflicting with other components)

Just resolder SEL1 and SEL2 to the ground. That'll put PN532 in UART mode.

Re: Seeedstudio NFC Shield as UART target

Sergey:

I've updated the files on the website (my bad) but the UART connection is nothing fancy.  TXD goes to RXD and RXD to TXD on the FTDI chip.  You just need to make sure that the bus select pins are correct ... but it seems you've already figured this out.

A note on the SEEED board, though, that you can take with a grain of salt given my own bias.  The antenna range is pretty poor because the antenna isn't tuned.  The libnfc team did quite a bit of work to tune the antenna on the breakout on microbuilder.eu and you get close to the maximum range possible from them.  This may or may not be an issue, but there was definately a bit more work put into those boards to get them working well, and the range is definately a lot better.

Kevin

Re: Seeedstudio NFC Shield as UART target

Hello Guys,

I also have the NFC Shield from Seeed Studio and i would really like to be able to use it with libnfc.
I tried to follow your instructions, but i am confused and i have some questions for you:

After i solder the SEL0 and SEL1 pins to GND which pins become RX, TX and ground - for the UART communication?
If i solder the pins i mentioned above to GND, will i still have to mount the shield on the arduino board or is there another way of powering it?
Also, after soldering the pins into UART mode will the arduino libraries still work (i know they are built around SPI)?

I would really appreciate your help, as i am new to NFC in general. I received the shield today:)
Thank you!

PS: a photo or a schematic would do wonders:D.

Re: Seeedstudio NFC Shield as UART target

I would second a photo/schematic!

I also tried to use the libnfc library on the Seeedstudio NFC Shield but without luck. 'nfc-list' would not recognise any connected devices.

Furthermore, I do not really understand the UART mode. When I connect the NFC Shield mounted on an Arduino Duemilanove board over USB, I see that my computer recognises an UART device. From what I read, I needed the FDTI driver in order to send UART communication data over USB.

Do I still need to solder anything?

I would appreciate your contribution.