【 E-Lock NXP LPC55 】 NFC Reader Library initialization & LPCD parameter

一. 概觀

  1. 介紹
  • 本文介紹 E-lock 使用 NFC frontend IC “ PN5180 ”讀取卡片資訊的 software stack NFC Reader Library V5.22 及低功耗技術 LPCD 介紹與參數設定。



二. NFC Reader Library

  • 1. NFC Reader Library initialization concept

The NFC Frontend PN5180 can be used with the NXP reader Library. The NXP reader library is written in C. This Library API is organized in independent layers which helps a lot software engineers to build up own NFC application starting from bottom physical layers (digital interfaces connection between MCU and NFC frontend) until upper Application layers.


圖 2.1 NFC Reader Library initialization concept

  1. Enable modules

The application requirements define which modules need to be enabled.
By default, the projects are preconfigured to be run on the PNEV5180B development board. This is defined by preprocessor directive PHDRIVER_LPC1769PN5180_BOARD (properties-> settings->preprocessor) and by macro in “../intfs/ph_NxpBuild_App.h”.

~\NfcrdlibEx1_BasicDiscoveryLoop\intfs\ph_NxpBuild_App.h

#   define NXPBUILD__PHHAL_HW_PN5180


圖 2.2 modules be enabled

 

  1. Main Flow & Layers Model


Host interface initialization generates a data context used to initialize and configure the upper layer ( HAL )

~\NfcrdlibEx1_BasicDiscoveryLoop\NfcrdlibEx1_BasicDiscoveryLoop.c

/*******************************************************************************

**   Main Function

*******************************************************************************/

int main (void)

{

status = phbalReg_Init(&sBalParams, sizeof(phbalReg_Type_t));

~\NfcrdlibEx1_BasicDiscoveryLoop\NfcrdlibEx1_BasicDiscoveryLoop.c

/*******************************************************************************

**   Main Function

*******************************************************************************/

int main (void)

{

        AppContext.pBalDataparams = &sBalParams;

        dwStatus = phNfcLib_SetContext(&AppContext);

 

NFC Reader IC initialization generates a data context used to initialize PAL and Discovery Loop components

~\NfcrdlibEx1_BasicDiscoveryLoop\NfcrdlibEx1_BasicDiscoveryLoop.c

 /*******************************************************************************

**   Main Function

*******************************************************************************/

int main (void)

{

       /* Initialize library */

        dwStatus = phNfcLib_Init();

~\NfcrdlibEx1_BasicDiscoveryLoop\NfcrdlibEx1_BasicDiscoveryLoop.c

/*******************************************************************************

**   Main Function

*******************************************************************************/

int main (void)

{

        /* Set the generic pointer */

        pHal = phNfcLib_GetDataParams(PH_COMP_HAL);

        pDiscLoop = phNfcLib_GetDataParams(PH_COMP_AC_DISCLOOP);

圖 2.3 Basic Discovery Loop


 三.  LPCD ( Low Power Card Detection )

  1. Low Power Card Detection concept

The contactless readers periodically activates the RF field to poll for the cards.
The LPCD reduces the average current consumption by providing a much shorter RF_ON interval for the card detection.

For Example 1 – Basic Discovery Loop, Low Power Card Detection ( LPCD ) is enabled in passive poll mode.


圖 3.1 LPCD concept

  1. LPCD parameters

The low-power card detection ( LPCD ) is an energy saving configuration option for the PN5180.  

圖 3.2 Overview

 

  1. Field On Time

LPCD parameter “Field On Time” defines the RF-ON time for the AGC measurement. The minimum RF-ON time depends on the antenna configuration and the connected matching network. It needs to be chosen in such a way that a stable condition for the AGC measurement is given at the end of the time.  



For NXP NFC IC PN5180 :

EEPROM address

0x36

Name

LPCD_FIELD_ON_TIME

Description

Field On Time : Defines the ping length in multiple of 8µs + a fix time of 62µs.

Example: 0x10 -> 16 x 8µs + 62 µs = 190µs


圖 3.3 Field On Time 102µs

  1. Standby time

LPCD parameter “Standby time”. This value defines the time between two pings in ms.
Field On Current: This value is the 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 or performance as such, but simply is used to estimate the overall average current consumption. This current estimation is calculated, when the LPCD is started.

~\NxpNfcRdLib\intfs\phhalHw_Pn5180_Instr.h

#define PHHAL_HW_CONFIG_SET_LPCD_WAKEUPTIME_MS  0x0070U    

/**< Used value for wakeup counter in msecs, i.e. after this amount of time IC will wakes up from standby. */

#define PHHAL_HW_CONFIG_LPCD_MODE               0x0071U    

/**< Used to set options  PHHAL_HW_PN5180_LPCD_MODE_DEFAULT or PHHAL_HW_PN5180_LPCD_MODE_POWERDOWN */



圖 3.4  Stanby Time ≈ 5mS


Set PHHAL_HW_CONFIG_LPCD_MODE → PHHAL_HW_PN5180_LPCD_MODE_POWERDOWN and set the value of PHHAL_HW_CONFIG_SET_LPCD_WAKEUPTIME_MS for LPCD parameter “Standby time”.

~\NfcrdlibEx1_BasicDiscoveryLoop\src\phApp_Init.c

wValue = PHHAL_HW_PN5180_LPCD_MODE_POWERDOWN;

wConfig = PHHAL_HW_CONFIG_LPCD_MODE;

status = phhalHw_Pn5180_Int_LPCD_SetConfig( pHal, wConfig, wValue );

 

wConfig =  PHHAL_HW_CONFIG_SET_LPCD_WAKEUPTIME_MS;

wValue = 300;

status = phhalHw_Pn5180_Int_LPCD_SetConfig( pHal, wConfig, wValue );

NXP NFC Reader Library v05.22.00 Hardware Abstraction Layer » component : Pn5180 Instruction Functions :

§ phhalHw_Pn5180_Int_LPCD_SetConfig()

Set config for LFCD which is IC specific.

This function can be used to set configuration parameters of LPCD.

 

 

  1. Threshold Value

LPCD parameter “Threshold Value” defines the AGC threshold value. This value is used to compare against the current AGC value during the lowpower card detection phase. if the difference between AGC reference value and current AGC value is greater than LPCD_THRESHOLD, the IC wakes up from LPCD.

For NXP NFC IC PN5180 :

EEPROM address

0x37

Name

LPCD_THRESHOLD

Description

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.

 

★博文內容均由個人提供,與平台無關,如有違法或侵權,請與網站管理員聯繫。

★文明上網,請理性發言。內容一周內被舉報5次,發文人進小黑屋喔~

評論