NFC Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NFC Knowledge Base

Discussions

Sort by:
Based on NFC reader library porting guide for LPC11u37h(Ver 5.12) ,We have a partial ported NFC reader library like below: Now, it is time to port other demos in this project. You may choose any demo, but here NfcrdlibEx2_AdvancedDiscoveryLoop is selected. and similar with before, the first step is creating a new build configuration: then in the project references, choose the LPCopen library for LPC11u37 instead. Change the MCU settings: Change the build settings: Change FreeRTOS portable to cortex M0: Search "PHDRIVER_LPC1769RC663_BOARD" in the source code of "NfcrdlibEx2_AdvancedDiscoveryLoop" project, and you may simply replace it with "PHDRIVER_LPC11U37RC663_BOARD", and there are only two places needs to be fixed. Search "PHDRIVER_LPC1769" in the source code of "NfcrdlibEx2_AdvancedDiscoveryLoop" project, and you may simply replace it with "PHDRIVER_LPC11U37". Most changes are in phApp_Init.c. Also please don't forget to enable optimization for size. Building result: Demo testing result:
View full article
This post contains step by step guide of how to use NTAG I²C plus with i.MX RT MCUs. The goal of this post is to enable developers to start developing their NFC Applications using NTAG I²C plus and i.MX RT MCUs quickly and easily. Attached with this post are two ready to use packages: ‘evkbimxrt1060_ntagI2C’ is to be used with MIMXRT1060-EVK and NTAG I²C plus kit for Arduino pinout. ‘evkbimxrt1050_ntagI2C’ is to be used with MIMXRT1050-EVK and NTAG I²C plus kit for Arduino pinout. Both packages contain the same example code but are configured for the two different boards. The example code demonstrates the following basic operations: Reading the EEPROM of NTAG I²C plus. Writing NTAG messages to NTAG I²C plus. Reading SRAM of NTAG I²C plus. Writing to SRAM of NTAG I²C plus. Using Field detect pin as interrupt to turn on an LED when an RF field is detected by the NTAG I²C board. The document has been structured as follows: NTAG I²C plus kit for Arduino pinout The NTAG I²C plus Arduino kit consist of two PCBs stacked together: The upper PCB is the antenna board with the connected tag The lower PCB is an interface adaptor board to the Arduino pinout This kit can be used to connect and evaluate the NTAG I²C plus  into many popular MCUs with Arduino compliant headers, for example:  Kinetis (e.g. KW41Z, i.MX (e.g. UDOO Neo, i.MX 6UL, i.MX 6 ULL, i.MX 7D), LPC MCUs (e.g. LPCXpresso MAX, V2 and V3 boards) and i.MX RT boards (e.g. i.MX RT1050, i.MX RT1060) The kit support package includes several software examples. The OM29110ARD is a generic interface board which offers support for connection to any PCB implementing Arduino connectors. It exposes: 3.3V and 5V power supply pins. I2C, SPI and UART host interfaces. Generic GPIOs (e.g. to be used for field detect, interrupts, reset pins or others) As such, it allows the NTAG I²C plus to be plugged into Arduino devices seamlessly. Hardware Requirements EVKB-IMXRT1050 board or EVKB-IMXRT1060 board. NTAG I²C plus kit for Arduino pinout (OM23221ARD) Cables: Micro USB cable 6 jumper wires Male to Female (Only required if using EVKB-IMXRT1050 board) Using NTAG I²C plus kit for Arduino pinout with EVKB-IMXRT1060 Hardware Connections The hardware connections are simple. Both the EVKB-IMXRT1060 board and OM23221ARD (NTAG I²C plus) board have Arduino interface. So simply connect both as shown in figure:  Running the Demo Follow the below mentioned steps to run the demo: Download the ‘evkbimxrt1060_ntagI2C’ package which you will find attached to this post.  Drag and drop the downloaded package to your MCUXpresso IDE workspace (If you don’t have MCUXpresso, it can be downloaded for free from here: https://www.nxp.com/support/developer-resources/software-development-tools/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE Now that the package has been imported to the MCUXpresso IDE, click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started click on the run icon to run the code:                                 Note:  If this is your first time using IMXRT1060EVK board, it is recommended to follow the getting started guide first ( i.MX RT1060 Evaluation Kit | NXP  ) To see the output, you need to have a terminal application installed (like Tera term or PuTTY). The output looks like this:                                                    Using NTAG I²C plus kit for Arduino pinout with EVKB-IMXRT1050 Hardware Connections In case of EVKB-IMXRT1050, the I2C pins on the Arduino interface’s J24 pin 9 and 10 are only connected to the i.MX RT slave I²C port, not to a master I²C port. So, we cannot just plug in the NTAG I²C plus kit, instead we need to connect two boards with the help of jumper wires. The connections required are show in figure below.                                Running the Demo Download the ‘evkbimxrt1050_ntagI2C’ package which you will find attached to this post. Drag and drop the downloaded package to your MCUXpresso IDE workspace (If you don’t have MCUXpresso, it can be downloaded for free from here: https://www.nxp.com/support/developer-resources/software-development-tools/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE Now that the package has been imported to the MCUXpresso IDE, click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started click on the run icon to run the code:                                Note:  If this is your first time using IMXRT1050EVK board, it is recommended to follow the getting started guide first ( i.MX RT1050 Evaluation Kit | NXP  ) To see the output, you need to have a terminal application installed (like Tera term or PuTTY). The output looks like this:                                            Porting the Package to any other i.MX RT Boards    If you want to use NTAG I²C plus with i.MX RT boards other than the i.MX RT1050 or the i.MX RT1060, then you’ve       to port the example package. This is fairly straightforward and the procedure is described below: Import the ‘hello world’ project from the SDK of the board to which you want to port the package. (SDKs for every board are freely available for download from the MCUXpresso SDK Builder website).We will modify this ‘hello world’ project adding code from attached packages, to make it work on the desired board.                                     Copy the following folders from the attached ‘evkbimxrt1060_ntagI2C’ or ‘evkbimxrt1050_ntagI2C’ package to the ‘hello world’ project imported in step 1:                               Copy the two files to the ‘drivers’ folder of ‘hello world’ project: Delete the ‘hello_world.c’ file from the source folder: Now copy the following preprocessor micros from ‘evkbimxrt1060_ntagI2C’ or ‘evkbimxrt1050_ntagI2C’ package to ‘hello world’ project:      Preprocessor settings can be found by right clicking Project-Properties>C++Build > Settings  Now we need to change the project configuration:        a.  Add the newly copied folders to source location; Right click on Project->Properties and add the following        folders:    b.  Include paths to the added libraries in the project. These can be copied from the from ‘evkbimxrt1060_ntagI2C’ or ‘evkbimxrt1050_ntagI2C’ package. Open project->properties and copy the following in the respective places as shown in the images:  Change pin configurations according to the board pins you are using:             a. For changing field detect pin, the code can be found in the source file:                   b. For I2C instance, the lines of code are in app_ntag->app_ntag.h:              c. These pins also need to be initialized which can be done through the pin initialization tool of MCUXpresso or code can be added to the ‘board.c’ file in ‘board’ folder. Once these changes are done, porting is complete. Build the project, it should build without any errors. Available resources BLE pairing with NFC on KW41 and NTAG I²C plus source code www.nxp.com/downloads/en/snippets-boot-code-headers-monitors/SW4223.zip NTAG I²C plus kit for Arduino pinout www.nxp.com/demoboard/OM23221ARD    
View full article
As NFC reader library 5.12 also supports PN5180, switching the NFC frontend from CLRC663 to PN5180 is quite easy based on previous porting. The porting also includes the hardware settings and software modification. Hardware Setup for porting: a) Remove resistors on PNEV5180B to disconnect the onboard lpc1769 from PN5180, following steps on page 16 of https://www.nxp.com/docs/en/application-note/AN11908.pdf  b) Connect LPCXpresso board for LPC11U37 with PNEV5180 as below: Software Modification for porting: 1. Make a copy of Board_Lpc11u37Rc663.h , and change its name to "Board_Lpc11u37Pn5180.h", and import it into the DAL/boards folder. 2.Change the source code in the header file as below: 3. Add two more pins' definition and configuration for BUSY and DWL pins of PN5180, and new configuration for reset pin. and modify the reset logic: 4.Change the IRQ interrupt trigger type to rising edge. 5.Include this header file in BoardSelection.h 6.Add this new configuration in ph_NxpBuild_App.h 7.Add this new configuration in phApp_Init.h 8.Add this new configuration in ph_NxpBuild_Platform.h 9.Add this new configuration in Settings. 10.Building result: Testing result:
View full article
Hello NFC community, MIFARE® Ultralight-based tickets offer an ideal solution for low-cost, high-volume applications such as public transport, loyalty cards and event ticketing. They serve as a perfect contactless replacement for magnetic stripe, barcode, or QR-code systems. The introduction of the contactless MIFARE Ultralight® ICs for limited-use applications can lead to reduced system installation and maintenance costs. As you may know the MIFARE family has the Ultralight C tag which is a contactless IC supporting 3DES cryptography is mostly used in limited use applications such smart ticketing, this tag complies with ISO 14443-3 type A and it is defined as type 2 tag, in this document I want to show you the procedure to change the default key to a custom key also to protect certain areas in the tag so the authentication is needed to perform a read or write operation. --------------------------------------------------------------------------------------------------- For this document I used : MFEV710: PEGODA Contactless Smart Card Reader RFIDDiscover Software Lite version  Full Version Available in Docstore Mifare Ultralight c --------------------------------------------------------------------------------------------------- Information Old Key : 49454D4B41455242214E4143554F5946 New Key : 88776655443322117766554433221199 Data sheet ---------------------------------------------------------------------------------------------------- First we start with the procedure to activate the tag and the anticollision procedure explained in the ISO/IEC 14443-3. Command Direction    ">" this direction is command send from PCD (Reader) to PICC(Ultralight c)    "<" this direction is command send from PICC (Ultralight c) to PCD (Reader)    "=" Prepare this command before sending Command   Data message REQA =  Request Command, Type A >  26 ATQA = Answer To Request, Type A  <  4400 SEL + NVB = SEL (Select code for cascade level ) 93, NVB (Number of Valid bits) 20 >  9320 ANTICOLLISION START <  8804598356   >  93708804598356 SAK (Select Acknowledge) = indicates additional cascade level <  x04   >  9520   <  E1ED2580A9   >  9570E1ED2580A9   <  x00 UID = 045983E1ED2580  ** the following procedure is explained in section 7.5.5 from the datasheet** Command   Data message Authenticate Part 1  (command 1A) >  1A00   <  AFA1ED1D682E5101422CC7 Authenticate Part 2 (command AF) >  AF2970D895F186D0302970D895F186D030188AAF4DAF68C5B9   <  006BD027CEC3E04EBC6919 [AUTHENTICATED] Then according to  section 7.5.7 of the datasheet the sections  where the 3DES key are saved are the 2C (Page 44) to the 2F (Page 47). We proceed to  write our new key using the A2 (WRITE command) Command   Data message DATA = byte 07,06,05,04 = 11223344 WRITE to page 44 (2C) >  A22C11223344 Positive acknowledge (ACK) <  0A DATA = byte 03,02,01,00 = 55667788 WRITE to page 45 (2D) >  A22D55667788  Positive acknowledge (ACK) <  0A DATA = byte 0F,0E,0D,0C = 99112233 WRITE to page 46 (2E) >  A22E99112233  Positive acknowledge (ACK) <  0A DATA = byte 0B,0A,09,08 = 44556677 WRITE to page 47 (2F) >  A22F44556677  Positive acknowledge (ACK) <  0A [RESET FIELD] [Authenticate with new key] Command   Data message Authenticate Part 1  (command 1A >  1A00   <  AFFAE2EFF17FAAD69862E7 Authenticate Part 2 (command AF) >  AFFD5794F2D4EA1B19FD5794F2D4EA1B196CF420CD4D9E8104   <  0030922228601939B8FA18 [AUTENTICATED WITH NEW KEY] we proceed to define from which sector the authentication is needed in order to read or write, to do this we use a write command to the AUTH0 (AUTH0 defines the page address from which the authentication is required. Valid address values for byte AUTH0 are from 03h to 30h.) the AUTH0 is located on the section 2A please check table 5 from #datasheet. **for this example we will define that from page 6 (06) we will need authentication to perform a read or write operation** Command   Data message WRITE command (A2) to AUTH0 (2A) from page 6 (06) >  A22A06000000 Positive acknowledge (ACK) <  0A Now the Read capabilities from page 06  require an Authentication in order to be read or written. Hope you find this document useful to get a better understanding of the behavior of the Ultralight C and how its security features can help you in your applications. Have a great day! BR Jonathan
View full article
This post contains a guide of how to use the NFC Reader Library with LPC55S69. A ready to use package for using the “Basic Discovery Loop” example from the NFC Reader Library with LPC55S69 and CLRC663 plus frontend is attached with this document. This document is structured as follows: Overview of LPC55S69: The LPCXpresso55S69 development board provides the ideal platform for evaluation of and development with the LPC55S6x MCU based on the Arm® Cortex®-M33 architecture. The board includes a high performance onboard debug probe, audio subsystem and accelerometer, with several options for adding off-the-shelf add-on boards for networking, sensors, displays and other interfaces. The LPCXpresso55S69 is fully supported by the MCUXpresso suite of tools, which provides device drivers, middleware and examples to allow rapid development, plus configuration tools and an optional free IDE. MCUXpresso software is compatible with tools from popular tool vendors such as Arm and IAR, and the LPCXpresso55S69 may also be used with the popular debug probes available from SEGGER and P&E Micro. Hardware Requirements: Following hardware is required to run the project: LPC55S69-EVK development board. CLEV6630B board or BLE-NFC-V2 board. BLE-NFC-V2: It is easier to use the BLE-NFC-V2 board since it can be just plugged on top of the arduino interface available on the LPCXpresso55S69 board. The following figure shows the pin mapping between the two boards. CLEV6630B board: The CLEV6630B board consists of CLRC663 plus (NFC frontend) connected by default to an LPC1769 µC via SPI. However, the board is made in such a way that the LPC1769 MCU can be bypassed to connect to an external MCU (in our case the LPC55S69) easily. For doing so: Six resistors from the board need to be removed. These are highlighted in red in the Figure 1: Use the SPI pin connectors available on the left-hand side, on the board edge to connect to external MCU (LPC55S69 in this case) Solder jumper wires onto the following pins of CLEV6630B Board:  GND IRQ CLRC_NRST SSEL MOSI MISO SCK IF0 IF1      The CLEV6630B is shown in Figure 2 after the required changes have been made to it (Removal of resistors and soldering of wires).   Now connect the two boards as follows:   Running Basic Discovery Loop on LPC55S69:   If this is the first time you’re using LPC55S69-EVK board, follow the getting started guide first à  LPC55S69-EVK | NXP . Make sure to install the SDK package for LPC55S69-EVKboard which is required for the project below to run. Download either‘lpcxpresso55s69_BasicDiscoveryLoop_CLEV6630b' or 'lpcxpresso55s69_BasicDiscoveryLoop_BLE-NFC' package which you will find attached to this post. Drag and drop the downloaded package to the “Project Explorer” tab of your MCUXpresso IDE workspace (If you don’t have MCUXpresso, it can be downloaded for free from here: https://www.nxp.com/support/developer-resources/software-development-tools/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE Now that the package has been imported to the MCUXpresso IDE (via drag and drop), click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started, click on the run icon to run the code: The project should be running now. The project contains basic discovery loop functionality. Here is how the output looks like in the terminal. Bring any NFC card near the frontend’s antenna and the output console will show the detection and type of the card. For example, in the picture below, we can see that type 4A card was detected:     Running other NFC Reader Library examples on LPC55S69: Once the “lpcxpresso55s69_BasicDiscoveryLoop” project is running on the LPC55S69. Running other examples from is simple. First step is to install the NFC Reader Library : Installing the NFC Reader Library: Go to www.nxp.com/pages/:NFC-READER-LIBRARY Go to the Downloads tab and click on the download button Click download on the NFC Reader Library for Kinetis K82F package. Import the library package in the workspace. The easiest way is to use the Quick Start Panel on the left-hand side: Click on Import project from file system Then, browse the library package in your file system. Click Finish to import it all to your workspace. After completing the import wizard, all projects are listed in the “Project Explorer” window. As can be seen in the screenshot, it contains different folders: API documentation folder Driver Abstraction Layer FreeRTOS support The platform support (in the screenshot, corresponding to the LPC support) The software examples  The Reader Library implementation And the OS abstraction layer   Running "NfcrdlibEx9_NTagI2C" on LPC55S69: Here we use the “NfcrdlibEx9_NTagI2C” example from the reader library to describe the method. The same method can be used to run other examples from the NFC Reader Library.  To run "NfcrdlibEx9_NTagI2C" on LPC55S69, we look at "lpcxpresso55s69_BasicDiscoveryLoop" project (available as a download below) and "NfcrdlibEx9_NTagI2C" project (from the Reader Library). We make changes to the following folders: In “intfs” folder remove everything except the “phaApp_Init.h” file. Then go to the “intfs” folder of the NFC Reader Library example you want to run (“NfcrdlibEx9_NTagI2C” in this case), and copy all the files except “phaApp_Init.h” and paste them in the original “intfs” folder. In line 57 of the “ph_NxpBuild_App.h” file in “intfs” folder, replace #if defined(PHDRIVER_LPC1769RC663_BOARD) \     || defined(PHDRIVER_FRDM_K82FRC663_BOARD)\ #   define NXPBUILD__PHHAL_HW_RC663 #endif with #if defined(PHDRIVER_LPC1769RC663_BOARD) \     || defined(PHDRIVER_FRDM_K82FRC663_BOARD)\     || defined(PHDRIVER_LPC55S69RC663_BOARD) #   define NXPBUILD__PHHAL_HW_RC663 #endif Go to “source” folder and remove every file except “phApp_Init.c“ and “semihost_hardfault.c” files. Then go to “src” folder of the example you want to run (“NfcrdlibEx9_NTagI2C” in this case) and copy all the files except “phaApp_Init.c” and paste them into the “source” folder. Finally, copy the main file of the example you want to run (NfcrdlibEx9_NTagI2C in this case) and paste it into the “source” folder as well. The project is ready to build and run on LPC55S69.       Available Resources: Porting NFC Reader Library to i.MX RT1050. (Detailed Description of porting) https://community.nxp.com/docs/DOC-341843 LPC55S69 https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK BLE-NFC-V2 https://www.nxp.com/products/identification-security/rfid/nfc-hf/nfc-readers/clrc663-iplus-i-and-qn902x-nfc-bluetooth-low-energy-solution-for-consumer-applications:BLE-NFC
View full article
Hello NFC Community! This document demonstrates that multiple records can be also read from a Tag with TagXplorer. Please follow the steps below. Let's begin... Please make sure that you have written more than on record with NXP TagWriter app. For a more detailed explanation on this, please refer to the following document: Writing multiple NDEF text records with TagWrite app  The app can be found and downloaded from the Play Store: NFC TagWriter by NXP - Apps on Google Play  -> Connect the reader in TagXplorer -> Place the card on the reader and press Connect Tag -> Check for NDEF (1) and then, read NDEF (2). The Text Records can be visualized in the NDEF Payload Info below: I hope this is of great help! Ivan R.
View full article
SPIM module is one of the master interfaces provided by PN7462 , which is a 32-bit ARM Cortex-M0-based NFC microcontroller, and users may use this interface to connect with up to two SPI slave devices. The NFC reader library provides SPIM driver code in phHal/phhalSPIM, and users may directly use the following APIs in their application to implement simple SPI transaction, just like what is done  in the demo of "PN7462AU_ex_phExHif". While this demo has limitation with some SPI nor flash devices, which need a write-read operation in one NSS session, for example, the SPI nor flash device on OM27462 as below: Please note to solder R202 and connect it to 3V3 to make sure nHold pin has pull-up out of POR. The following is one of the command sets this device supports: This command contains 1 write(9F) followed by 3 read operations in one NSS session, but if you implement it with phhalSPIM_Transmit() and phhalSPIM_Receive() as below: status = phhalSPIM_Transmit(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_APPEND_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 2, cmd_buf, PH_EXHIF_HW_SPIM_CRC_OFFSET);    status = phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, data_length, dst, PH_EXHIF_HW_SPIM_CRC_OFFSET);" You will have the following result: expected: NSS   \__________________________/ MOSI     CMD A7-A0 MISO                            DATA       actual:                         NSS   \____________||______________/ MOSI     CMD A7-A0 MISO                           DATA so the pulse between the write and read is the problem, and here we have to handle the NSS line manually, with the help of NSS_VAL and NSS_CONTROL bits in SPIM_CONFIG_REG. so the code should be like this:   Assert NSS   status = phhalSPIM_Transmit(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_APPEND_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 2, cmd_buf, PH_EXHIF_HW_SPIM_CRC_OFFSET);    status = phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, data_length, dst, PH_EXHIF_HW_SPIM_CRC_OFFSET);"   De-assert NSS The NSS line assert and de-assert function can be implemented with register bit level APIs, just like below:             PH_REG_SET_BIT(SPIM_CONFIG_REG, NSS_VAL);//de-assert NSS             PH_REG_SET_BIT(SPIM_CONFIG_REG, NSS_CTRL);             PH_REG_CLEAR_BIT(SPIM_CONFIG_REG, NSS_VAL);//assert NSS Please also include the following header files in your application code. #include "ph_Reg.h" #include "PN7462AU/PN7462AU_spim.h" Please notice that phhalSPIM_Transmit() and phhalSPIM_Receive() are Rom based function, which clear NSS_CTRL bit by default. We can not change ROM API's behave but fortunately we have phhalSPIM_TransmitContinue() and phhalSPIM_ReceiveContinue() instead. so the final solution will be like below: Assert NSS   status = phhalSPIM_TransmitContinue(1, cmd_buf);    status = phhalSPIM_ReceiveContinue(3, dst);   De-assert NSS This doesn't mean phhalSPIM_Transmit() and phhalSPIM_Receive() are useless, because they can also help up to configure the SPI master interface, if you don't want to use register bit level API to initial the SPIM module manually. Please note to use 1 byte for write/read length to make these two functions work properly. so the whole pseudo code is like below: phhalSPIM_Init(PH_HW_SPIM_TIMEOUT) ; phhalSPIM_Configure(PH_HW_SPIM_SLAVE, PH_HW_SPIM_MSB_FIRST,                 \                                     PH_HW_SPIM_MODE, PH_HW_SPIM_BAUDRATE,  \                                     PH_HW_SPIM_NSSPULSE, PH_HW_SPIM_NSSPOL) ; status = phhalSPIM_Transmit(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_APPEND_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 1, cmd_buf, PH_EXHIF_HW_SPIM_CRC_OFFSET);    status = phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 1, dst, PH_EXHIF_HW_SPIM_CRC_OFFSET);" Assert NSS   status = phhalSPIM_TransmitContinue(1, cmd_buf);    status = phhalSPIM_ReceiveContinue(3, dst);   De-assert NSS The following steps show how to create a new project based on NFC reader library, please refer to https://www.nxp.com/docs/en/user-guide/UM10883.pdf  on how to import the NFC reader library. 1. Create a new project after importing the NFC reader library. 2. if you installed PN7462 support package, you will see this: 3. add a link to NFC reader lib: 4. add path and enable NFC reader lib in the project: 5. delete cr_startup.c and create the main code as well as the header file: 6. Build result: 7.Debug result: To fetch the ready demo, please submit a private ticket via the guide of https://community.nxp.com/docs/DOC-329745 . Hope that helps, Best regards, Kan
View full article
Introduction NTAG5 offers a powerful energy harvesting feature (up to 30mW). One useful application can be charging the supercapacitor which then might be used as the supply of customer MCU, Sensor, etc.   See the typical schematic below:  C1 and C1P are used for the impedance tuning. The antenna is typically tuned at 13.56 MHz-14MHz.  R1 is used to limit the charging current of the supercapacitor. Its value depends on the selected VOUT voltage, keep in mind that the maximum output current is 12.5 mA.  E.g. VOUT=2.4V, Icharging=10mA -> R1=240 Ohm Keep in mind, that if the charging current is too high and/or the amount of the received magnetic field is not high enough, the VOUT may drop.  D1 should be a low-drop diode e.g. RB520CS30L Used super cap: CPX3225A752D Antenna size  Generally, it is best to attempt to match the tag and the reader antenna geometries for maximum efficiency. A significant difference between the reader and tag antenna dimensions result in bad communication and energy harvesting performance because of the small coupling factor. As smartphone NFC antennas can have different dimensions. It might be challenging to design one NFC Tag antenna that will deliver the best performance for multiple smartphones.  The phone's NFC Antenna dimensions are typically between approximately 25 mm vs 20 mm (NFC Forum Poller Class 6) -- 50 mm vs 30 mm (NFC Forum Poller Class 3). Note: But this might be different e.g., iPhones  So customers can consider the following form factors of NFC antennas for their NTAG5 Link design:  For bigger designs (NFC Forum Listener Class 3):    For circle NFC Antenna ->Outer diameter is approx. 44 mm    For smaller designs (NFC Forum Listener Class 6):  For circle NFC Antenna ->Outer diameter is approx. 25 mm     Tomas Parizek  Customer Application Support 
View full article
There is a basic GUI for PN7160 RF Settings available.
View full article
How to set the RF Settings can be found in -> https://www.nxp.com/docs/en/application-note/AN13218.pdf The list of the default values + values which shall not be changed is available in the attachment.  Tomas Parizek  Customer Application Support 
View full article
  NXP offers FW update code as part of the SW6705.   PN7160 is typically delivered with the initial FW 12.50.05. To ensure full reliable functionality, it is highly recommended to update the FW on 12.50.09 (or latest). The FW update might be also helpful if you need to restore the default EEPROM settings.  The FW source data are inside the sFWudpate folder.  phDnldNfc_UpdateSeq.c -> FW Version 12.50.05 phDnldNfc_UpdateSeq_12_50_09.c -> FW Version 12.50.09 The phDnldNfc_UpdateSeq.c is executed, which means what is inside of this "C" file is pushed to the PN7160 EEPROM.  So, if you want to update from 12.50.05 to 12.50.09. You need to copy content from phDnldNfc_UpdateSeq_12_50_09.c to The phDnldNfc_UpdateSeq.c.  Also, make sure that the content in phDnldNfc_UpdateSeq_12_50_09.c is commended.   Once that's done, you can debug the code.  Then you can check the progress in "Terminal"    Tomas Parizek  Customer Application Support 
View full article
Extended NFC Factory Test Application includes:  Get Current value (current measurement in mA) DPC Check (Available from FW. Version 12.50.06) Get AGC Value  Get AGC Value NFCLD (AGC value reading with fixed NFC Level Detector level)   How to get it:  Just download the app from Github. Replace the "NfcFactoryTestApp.c" with the file which is here in the attachment.  Run the application as described in ->AN13287.   Tomas Parizek  Customer Application Support 
View full article
NXP Reader Library is a software written in C language enabling the customers to create their own software stack for their contactless reader. The reader library supports the reader frontend ICs namely PN5180, CLRC663, PN5190 and reader NFC controllers namely PN7462AU, PN7640.   This document describes the structure on NFC reader library. After that, two examples are given on how to modify the software to match read and write NDEF messages. The description is based on NXP NFC Reader Library version 07.09.00, on PNEV7642A board.   1  NFC reader library introduction   NXP Reader Library is classified into following layer, each layer is independent from the other layers, each layer is used as an entry point for immediate upper layer.   Application layer (AL) Protocol abstraction layer (PAL) Hardware abstraction layer (HAL) Bus abstraction layer (BAL)      Below is a full picture of the NFC reader library      The reader library source code structure is as below picture shows,     Comps – components, source files of all included components (abstraction layers) Intfs  - interfaces .  header files of all included components. Types  - Types.   Global macros for general use as well as configuration.    1.1 Application layer (AL) This layer contains application specific implementations for various contactless cards, includes MIFARE DESFire, MIFARE DESFIRE EV2, MIFARE Plus, MIFARE Plus EV1, MIFARE Classic etc.       The application layer contains four main packages: -Card command sets and the NFC Forum Tag Type Operations ---MIFARE Classic Ultralight, DESFire, Felica, Jewel, ICode ---phalTop provides an API to complete NDEF related operations on top of the four NFC Forum Type Tags -NFC Activity: ---Discovery Loop -Host Card Emulation: ---Type 4A Tag -P2P Package: ---LLCP ---SNEP   1.2 Protocol abstraction layer (PAL) The protocol abstraction layer implements the activation and exchange operations regarding the protocol of the contactless communication. The NXP Reader Library supports following ISO standards protocols ISO/IEC14443-3A, ISO/IEC1443-3B, ISO/IEC14443-4, ISO/IEC14443-4A, MIFARE, ISO/IEC15693, ISO18000-3M1, ISO/IEC18000-3M3, ISO/IEC18092, Felica,     1.3 Hardware abstraction layer (HAL) The hardware abstraction layer implements the hardware specific elements of the reader chip, and abstract them to a generic interface.       1.4 Bus abstraction layer (BAL) The bus abstraction layer ensures correct communication interface between the master device and the reader chip, includes SPI, I2C, I3C, UART…   2 Reader Library customization   2.1  port to other MCU Layer structure of the NXP Reader Library is modular and multi-layered architecture.  If you want to port the reader library to other MCU, what you need to do is change the phDriver. phDriver is the abstraction of the board, of the MCU.     phDriver includes GPIO, Timer Abstraction Layer and BAL (Bus Abstraction Layer).   GPIO: it is for IRQ, Reset or other control signals. Timer: it is crucial for any timing relevant tasks, RTOS user timers, they care about everything, so porting timers is very important. BAL: interface between MCU and NFC Front-End (SPI, I2C, I3C, UART…),  we have to initialize SPI or I2C.     2.2 Read NDEF handling Exercise 1: Read the NDEF message of your ICODE DNA tag Process: check if the found Tag is technology V config the TOP AL to T5T check if a NDEF container is present check if I can read the message read the NDEF message please see the attached source code for more details   2.3 write NDEF handling Exercise 2: Write the same message onto one MIFARE DESFire tag. Process: 1 check if the found tag is Type-A 2 check if it is a T4AT by masking the SAK 3 set TOP AL config to T4T 4 check if it is NDEF formatted 5 write NDEF message      
View full article
The PN5180 offers a low-power card detection (LPCD) feature, which allows to power down the reader for a certain period of time to safe the energy. After this time the reader must become active again to poll for the cards. If no card has been detected, the reader can go back to the power down state. PN5180 LPCD cycle time includes standby time and VBAT time. In a normal case, standby time is 200ms (user can define it),   standby current is 15uA, VBATON current is 7500uA, FieldON current: 200mA.  Average current is about 200uA, it depends on your settings and application.   This article describes how to configure PN5180 LPCD using NXP Cockpit Tool and using NXP NFC Reader library.   1  PN5190 LPCD Overview PN5180 LPCD operates in two modes: auto calibration mode and self-calibration mode. Auto calibration mode:  everything done automatically Self-calibration mode:   calibration must be done manually before starting the LPCD.   1.1  Auto Calibration Mode ( 00b) The LPCD calibration is done automatically when the LPCD is started, using the gear and threshold as defined in the EEPROM. This mode always uses the same gear for the LPCD, and is the fast and easiest way to start the LPCD.  It is recommended to choose a gear, which always keeps the ITVDD and field strength limits, so normally, the highest gear number. Auto calibration mode is most commonly used, it is a standard use case. Below parameters need to be configured correctly in EEPROM   LPCD_REFERENCE_VALUE       LPCD_REFVAL_GPO_CONTROL      LPCD_THRESHHOLD  ( 0x37) LPCD wakes up, if current AGC during “ping” > AGC Reference + LPCD_THRESHOLD or< AGC Reference -LPCD_THRESHOLD Minimum LPCD_THRESHOLD = 03…08 (very sensitive) Maximum LPCD_THRESHOLD = 40 … 50 (very robust)    LPCD_FIELD_ON_TIME  (0x36) RF on time in 8µs, excluding the fix time .   Fix time = 62µs 01 => RF on = 70µs 02 => RF on = 78µs 03 => RF on = 86µs 10 => RF on = 190µs   1.2  Self Calibration Mode (01b) The LPCD calibration must be manually triggered, with reading or writing into the AGCREF_CONFIG register.   Reading from this register - without prior writing - starts an LPCD calibration. The calibration is executed using the gear which is resulting from the actual DPC setting under the actual antenna detuning condition. AGC_GEAR is used in the LPCD self-calibration.   Reading from this register - without prior writing - delivers in addition to the AGC_GEAR value the AGC_VALUE. The AGC_VALUE is used in the LPCD self-calibration. Writing to this register: Writing data to this register is required before starting the LPCD in Self-calibration mode. Either the previously read AGC_GEAR or a user-defined gear can be chosen. The previously read AGC_VALUE has to be written in any case. Writing data to this register defines the values for AGC_GEAR without taking the actual detuning condition into account. The value of AGC_GEAR to perform an LPCD calibration which derives the AGC_VALUE. This AGC_VALUE and the AGC_GEAR are used in the LPCD self-calibration.   Self-calibration mode always requires a Read AGC_REF_CONFIG, followed by a write AGC_REF_CONFIG, using the previously read AGC_VALUE.   The LPCD calibration can be done in two different options: Option 1:  Read AGC_REF_CONFIG register:  This command executes a standard RF Field on. So depending on the load condition the DPC adjusts the output power. The final gear is take as gear for the LPCD.  This option guarantees that the maximum output power is taken for the LPCD.   Option 2: Write AGC_REF_CONFIG register: This command executes a LPCD calibration ping with the gear number, as defined in the AGC_REF_CONFIG, bit 10:13. This option allows a flexible use of any of the defined gears for the LPCD.   PN5180 LPCD self-calibrate is executed, using Gear -> AGC_REF_CONFIG (Register) Threshold -> LPCD_THRESHOLD (EEPROM) RF on time-> LPCD_FIELD_ON_TIME (EEPROM)   2  How to configure PN5180 LPCD with Cockpit The NFC Cockpit allows the configuration and test of the low power card detection of the PN5180 as shown in below picture. The LPCD parameter, which are stored in the EEPROM, can be changed and the LPCD can be started. The LPCD tab allows to directly define and write the related EEPROM addresses:   LPCD Gear #: Defines the gear number, which is used for the LPCD in auto calibration mode, stored in addr. 0x34, bit 0:3 Threshold Value: Defines the threshold window, As soon as the AGC value during the LPCD ping exceeds the AGC reference value + threshold window, the IRQ will be raised and the PN5180 wakes up. Field On Time:  Defines the ping length Standby time :  This value defines the time between two pings in ms. FieldOn Current: This value is ITVDD under the loading condition, when RF field is on with the used gear. This value does not have any influence on the LPCD execution, but simply is used to estimate the overall  average current consumption. This current estimation is calculated, when the LPCD is started.         3   How to configure PN5180 LPCD with NXP NFC reader library. The LPCD works in two phases: First the standby phase is controlled by the wake-up counter (timing defined in the instruction), which defines the duration of the standby of the PN5180. Second phase is the detection-phase. The RF field is switched on for a defined time (EEPROM configuration) and then the AGC value is compared to a reference value.   Below is the flow chart for PN5180 LPCD          
View full article
DISCLAIMER APPLICABLE TO THIS DOCUMENT CONTENTS:   PN5190-NTAG 5 boost High Speed Communication Demo This article describes the unique feature of these two chips when interacting with each other at contactless interface: Passthrough demonstrator at high bit rates for ISO 15693 between PN5190 and NTAG5 Boost. Scope of demonstrator: ▪ Demonstrating a unique feature of NXP Semiconductors. High bit rates for ISO15693 communication (212 kbps) between a PN5190 reader IC and an NTAG5 boost plus LPC55S69 host MCU, when implementing passthrough mode using the SRAM of the NTAG5 boost. ▪ Through MCUXpresso console, the user can configure the contactless bit rate (26.4kbps or 212kbps options) as well as the amount of data to exchange using passthrough mode. ▪ Passthrough mode is implemented from NFC reader to LPC side only. ▪ The PN5190 prints on the MCUXpresso console the outcome of the transaction and baud rate achieved. ▪ In order to handle passthrough communication, we are using GPIO interrupt handlers on the NTAG 5 boost + LPC55S69 side and hard coded timeout on the PN5190 + MCU side. Required hardware and software material: Hardware ▪ PNEV5190BP development board ▪ LPCXpresso55S69 Development Board ▪ OM2NTA5332 - NTAG5 boost development kit ▪ 3 x USB micro cables Software ▪ Firmware Source Code for PN5190is attached to this article, containing keywork pn5190: mobileknowledge-nxp-connected-tags-pn5190-2cfb4c59b56e_v1.0.zip ▪ SDK_2.x_FRDM-K82F is already included in bundle mentioned above. ▪ Firmware Source Code for LPCXpresso55S69 is attached to this article, containing keyword lpc55s69: mobileknowledge-nxp-connected-tags-lpc55s69-5f2f9667cc60_v1.1.zip ▪ MCUXpresso IDE recent version (v11.6.0 or newer) Demonstrator bring up: Hardware assembly for LPCXpresso55S69: • Connect NTAG5 Boost board to LPCXpresso55S69 • Make sure SW6 is on position 2-3 to enable 5V power on tag side. • Connect LPCXpresso55S69 board to your computer (Debug Link Input). • No additional power source is needed. Hardware assembly for PNEV5190B: • Connect two USB micro cables to PNEV5190B board for power, flashing firmware and UART connection • Red LED indicates power is enabled • Green LED debugging/UART status Software loading on LPC55S69: Import “lpcxpresso55s69_ntag5_passthrough_nolib” project to MCUXpresso IDE • Install SDK_2_12_0_LPCXpresso55S69. SDK can be downloaded from • https://www.nxp.com/security/login?service=https%3A%2F%2Fmcuxpresso.nxp.com%2Flogin%2F  • Build project and flash a binary file using GUI Flash Tool. After flashing, reboot your board. Blue LED must be enabled which means tag is waiting for field to be detected. Under MCUXpresso: 1. Import project from file system 2. Select lpcxpresso55s69 project 3. Uncheck copy projects into workspace Software loading on PNEV5190B: • Unzip the “PN5190_NTAG5boost_Passthrough.zip” folder. • Import all projects inside “PN5190_NTAG5boost_Passthrough” to MCUXpresso IDE • Install SDK_2.x_FRDM-K82F. Such SDK is included in project file tree: • nxp-connected-tags-pn5190\Platform\SDK_2.x_FRDM-K82F • Build project and flash a binary file using GUI Flash Tool. After flashing, reboot your board. Blue LED must be enabled which means reader is waiting for NTAG5 to be detected. • Start Debug session to see available bitrate options on the console. Under MCUXpresso: 1. Import project from file system 2. Select all the projects 3. Uncheck copy projects into workspace LED User Interface Specifications (same for LPCXpresso55S69 an PNEV5190B) • Steady blue - waiting for Tag - discovery loop, • Blinking green - passthrough transfer ongoing • Steady green - all data transferred successfully. • Steady red - error - tag lost during transfer. Menu options when two boards have NFC antennas facing each other: Two options of bitrate are available for transfer amount of data from host to NTAG5 Boost: ▪  standard 26.4 kbps or ▪  highest bit rate 212 kbps It is possible to configure amount of data to be exchanged between PN5190 and NTAG 5 boost: ▪1KByte ▪2KBytes ▪10KBytes Demonstration flow: Once one of these option is selected, reader is ready to detect a tag. ▪ When tag is detected, reader configures selected bitrate and starts data exchange. ▪ Blinking green LED indicates transfer ongoing and the console shows a progress. Here are some results of transaction at the different bit rates and data sizes offered by this demonstrator: Data Size (Bytes) Selected bitrate (kbps) Result Bitrate (kbps) Transfer time (ms) 1024 26.4 2.8 357 1024 212 12.35 81 2048 26.4 2.8 714 2048 212 12.42 161 10240 26.4 2.7 3569 10240 212 12.41 806   High speed demo user manual can be also find attached to this article: 22-10-11 NXP - Connected Tags demonstrator User Manual.pdf Conclusions: This demonstrator HW & SW can show that high speed interaction can be achieved between PN5190 (NFC Front end) and NTAG 5 boost, making use of available commands described in product support package. Disclaimer: All SW available here is aimed only for evaluation purposes and NXP disclaims any direct or indirect liability damages, since referred SW bundles are not official part of PN5190/NTAG 5 boost standard product support packages available in nxp.com.  
View full article
AN13189 provides guidelines for the integration of PN7160 NXP NCI-based NFC controller to an Android platform from software perspective. But some developers found some compile issues when integrating PN7160 NFC package into Android 11.   This article describes how to fix the build error when you integrating PN7160 NXP NCI-based NFC controller to Android 11 system.  You need to follow the AN13189 (PN7160 Android porting guide ) first.  After you run the installation script install_NFC.sh, the following modification should be added to the source code. 1) Open package/apps/Nfc/nci/jni/Android.bp Add  "-DNXP_EXTNS=TRUE",   2 )  open system/nfc/src/Android.bp Add   "-DNXP_EXTNS=TRUE",     3 )   open packages/apps/Nfc/src/com/android/nfc/NfcService.java And add this: between isNfcSecureEnabled and setNfcSecure methods:             @Override         public IBinder getNfcAdapterVendorInterface(String vendor) {             if(vendor.equalsIgnoreCase("nxp")){                     return (IBinder) mNfcAdapter;             } else {                    return null;             }         }     Next, follow AN13189, complete the following steps in section 4.2. Then you can build the package successfully.  Thanks  @andraz_skupek .      
View full article
Using an alternative clock source to set up PN7462's contact interface clock , so that we have more options of the clock frequency.
View full article
The code is based on the application note https://www.nxp.com.cn/docs/en/application-note/AN12657.pdf. It mostly shows how to communicate between LPC1769 and RC663 via SPI based on board CLEV6630B without library and which Register have to be set to send a REQA (NTAG21x).
View full article
Demo for Originality Signature Verification(AN11350)
View full article
--The document consists of the following: Step 1. Connections And Firmware Version Step 2. Updating FW On PC Windows 10 Step 3. Updating FW On VMplayer16.0 + Ubuntu 20.04 Step 4. Updating FW On i.MX8MN-EVK With Embedded L5.4.70_2.3.0 BSP Step 5. Confirming whether update is successful using cockpit4.8 --About Cockpit There are several different versions of cockpit, and each version can only recognize the same version of firmware. --Reference Materials 1.https://community.nxp.com/t5/NFC/Mounting-the-PN7462AU-in-the-USB-downloader-mode-under-Linux/m-p/800939 2.https://community.nxp.com/t5/NFC/PN7462-updating-EEPROM-on-linux/m-p/739808/highlight/true#M3144       NXP CAS-TIC team Weidong Sun 04-15-2021  
View full article