Hello!
For this example we are using the PN532 RFID/NFC shield from Adafruit. This this design writes a MiFare classic RFID card with the URL http://www.cypress.com/?id=4749 . This design reads the contents of a MiFare classic RFID card and prints them to a terminal using the USB-UART on the Pioneer kit.
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Project Images
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- I2C
- UART
- CyClock
- CyPin
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
The main.c firmware is included in the example project. Please review the commented sections for more details.
As part of this design we include two design files, Adafruit_NFCShield.h and Adafruit_NFCShield.c that provide the user an interface to the shield using I2C. These two files were adapted from the .h and .cpp files provided on the shield web page. The modifications included porting the C++ code to C and porting the I2C code to use the SCB in PSoC 4. So when performing any MiFare designs it will be helpful to include these files in your design.
The main loop waits until a MiFare Card comes within range. Once a card is detected each sector is authenticated and the contents are printed to a terminal through the UART.
Hardware Connections:
The shield needs to soldered with the standard headers, as instructed on the Adafruit webpage.
Be sure to include the SCL and SDA connections on the top-left corner of the board. This is how the SCB I2C will communicate with the board.
To connect the UART, connect P3[0] (Digital 11) to P12[7] of the PSoC 5LP (J11) and P3[1] (Digital 12) to P12[6] as shown in the picture.
Test Your Project:
Connect your NFC shield to the pioneer board and program the board. Launch Putty to begin printing outputs from the Pioneer board. Bring an RFID card near the reader and see the RFID contents displayed on the Putty output window.
I hope this example can help you in your design.
Best,
Matt