Tero's Arduino Blog

Using Arduino with Ada

AVR-Ada and PN532, part 2: Mifare Classic, Yubikey NEO, I2C support

I continued tweaking my PN532 code and during the past few months I have added support for I2C interface, Mifare Classic tags (read-only), and Yubikey NEO keys (NFC Forum Type 4 interface).

PN532 and Arduino

I2C support means that you can use Adafruit PN532 Arduino Shield and normal Arduino UNO to run my code.

I also added read support for NXP Mifare Classic tags since they are pretty common. Likewise, Yubikey NEO support was added, because I had one NEO and I was interested to see can I read it. Yubikey NEO supports Mifare Classic and NFC Forum Type 4 protocols and I went with type 4, since that is better supported in my PN532 code.

Example output when reading NEO is below:

Yubikey NEO key read using PN532, AVR-Ada, and Arduino

Yubikey NEO basically returns https URL which has the changing key part at the end of the url.

As before, my code is available at https://bitbucket.org/tkoskine/arduino-pn532 and generated hex files at https://bitbucket.org/tkoskine/arduino-blog as nfc_i2c.hex and nfc_spi.hex.

nfc_i2c.hex works with Adafruit PN532 Arduino Shield while the SPI version expects the PN532 breakout board and Olimexino-328 (16MHz/3.3V, yes that is overclocked) with same pin configuration as before:

  • MISO = PB4 (digital pin 12)
  • MOSI = PB3 (digital pin 11)
  • SS = PD7 (digital pin 7)
  • Clock = PB5 (digital pin 13)

Final note:

For I2C, I used slightly modified (bigger buffers) version of Rolf's AVR.I2C package. Earlier, I had made my own I2C routines also, but Rolf's package is more polished.

Copyright © 2012, 2013 Tero Koskinen - Theme Skeleton; Blogging engine Pelican; Powered by Python