clrc663 lpcd i and q value i getting 0x00 i am using clrc663 for card reader i implement lpcd mode there i am facing issue there lpcd calibration function i run i getting i and q value is 0x00 i am getting from antenna what is the issue how to i solve this this function i am using /* Perform LPCD Calibration */ phStatus_t Calibrate_LPCD(uint32_t dwLPCDDemo, uint32_t *pdwLPCDRefValue) { phStatus_t wStatus; uint8_t bValueI = 0; uint8_t bValueQ = 0; uint8_t bVersion = 0; uint8_t bDigitalFilter = PH_ON; uint16_t wDetectionOption = PHHAL_HW_RC663_FILTER_OPTION1; uint16_t wPowerDownTimeMs = LPCD_POWERDOWN_TIME; uint16_t wDetectionTimeUs = LPCD_FIELD_ON_DURATION; DEBUG_PRINTF("\nLPCD Calibration Starts. "); phhalHw_FieldOn(pHal); phhalHw_Wait(pHal, PHHAL_HW_TIME_MILLISECONDS, 5); /* Configure the LPCD Mode Default to perform LPCD Calibration cycle. * Provide Input Reference I and Q value of Zero and provide the Detection time to * turn ON RF for this duration to measure the Load change using I and Q Channel Values. * Configure suitable Power Down time to save power consumed by RC663 Reader IC. */ wStatus = phhalHw_Rc663_Cmd_Lpcd_SetConfig(pHal, PHHAL_HW_RC663_CMD_LPCD_MODE_DEFAULT, bValueI, bValueQ, wPowerDownTimeMs, wDetectionTimeUs); CHECK_STATUS(wStatus); DEBUG_PRINTF("\nphhalHw_Rc663_Cmd_Lpcd_SetConfig. "); /* Read the Version register to differentiate between RC663 Old(RC66301, RC66302) and RC663 Plus (RC66303). */ wStatus = phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_VERSION, &bVersion); DEBUG_PRINTF("\nphhalHw_Rc663_ReadRegister. "); CHECK_STATUS(wStatus); if (bVersion == PHHAL_HW_CLRC663PLUS_VERSION) { /* Configure the Charge Pump to have high detection range. * Enabling the charge pump increases the power level during the detection phase increasing * the detection range. This leads to increase in average current consumption. */ wStatus = phhalHw_SetConfig(pHal, PHHAL_HW_RC663_CONFIG_LPCD_CHARGEPUMP, PH_ON); CHECK_STATUS(wStatus); DEBUG_PRINTF("\nphhalHw_SetConfig. "); /* Configuring the Digital Filter triggers the RC663 Plus algorithm to get average of multiple * samples to detect change in I and Q values. This increases the RF ON time duration in turn * increasing the average current consumption. */ wStatus = phhalHw_SetConfig(pHal, PHHAL_HW_RC663_CONFIG_LPCD_FILTER, ((uint16_t)(bDigitalFilter) | wDetectionOption)); CHECK_STATUS(wStatus); } /* Perform LPCD Calibration cycle and get the LPCD reference I and Q Values. */ wStatus = phhalHw_Rc663_Cmd_Lpcd_GetConfig(pHal, &bValueI, &bValueQ); DEBUG_PRINTF("\nphhalHw_Rc663_Cmd_Lpcd_GetConfig. "); CHECK_STATUS(wStatus); *pdwLPCDRefValue = ((bValueI) | (bValueQ << 0x8)); DEBUG_PRINTF("\npdwLPCDRefValue. "); DEBUG_PRINTF("\nLPCD Calibration Successful. "); return PH_ERR_SUCCESS; } then i called in main while loop /* ------------------------------------------------------------------ * Run LPCD calibration once after power-up * ------------------------------------------------------------------ */ phStatus_t LPCD_Calibrate(void) { phStatus_t status; uint32_t refVal; char dbg_buf[64]; // Ensure RF ON before calibration phhalHw_FieldOn(pHal); phhalHw_Wait(pHal, PHHAL_HW_TIME_MILLISECONDS, 5); status = Calibrate_LPCD(LPCD_DEMO_MODE_DEFAULT, &refVal); // Turn RF off after calibration phhalHw_FieldOff(pHal); if (status == PH_ERR_SUCCESS) { gLpcdValueI = (uint8_t)(refVal & 0xFF); gLpcdValueQ = (uint8_t)((refVal >> 😎 & 0xFF); gLpcdCalibrated = 1; sprintf(dbg_buf, "LPCD Calibration OK (I=0x%02X, Q=0x%02X)\r\n", gLpcdValueI, gLpcdValueQ); DEBUG_UART2((unsigned char*)dbg_buf, strlen(dbg_buf)); } else { DEBUG_UART2((unsigned char*)"LPCD Calibration FAILED\r\n", 28); } return status; } if (!lpcdCalibrated) { if (LPCD_Calibrate() == PH_ERR_SUCCESS) { lpcdCalibrated = 1; // mark as done DEBUG_UART2((unsigned char*)"LPCD Calibration OK\r\n", 23); } else { DEBUG_UART2((unsigned char*)"LPCD Calibration FAILED\r\n", 28); } } Re: clrc663 lpcd i and q value i getting 0x00
Hello sir,
Thank you very much for sharing your Schematics with us. Still, I have to ask for the Smith Chart of your antenna. We do have an Application Note that shows the steps to perform these measurements using a cheap Nano-VNA. Re: clrc663 lpcd i and q value i getting 0x00 here i attached my hardware testing and my schematic in normal mode i getting uid thats not issue in lpcd mode i and q value i am getting 0x00,0x00. check my testing document here. Re: clrc663 lpcd i and q value i getting 0x00 Sorry, but the support for custom boards is very limited.
For me to provide any specifics would need to have your hardware since there are a lot of differences between the configurations that work for the antenna setup from the Evaluation kit and yours.
Still, do you mind please sharing the Smith Chart of your antenna and schematic, this could be a great starting point for us to provide a good recommendation.
As mentioned in my last post, there are some steps we recommend to follow from the beginning. One of these are the use of our EVK with your new antenna and a new matching circuit. All of this is shown across a lot of our documentation. Please take a look at NFC Antenna Design | NXP Semiconductors video 2.
The I and Q values should show a different value than 0x0 after RF On command is sent.
Re: clrc663 lpcd i and q value i getting 0x00 i am using custom pcb clrc663 with stm32 hardware antenna tunning is correct only in software i used libraries nfcrdlibEx6_rc663_LPCD_Demo.c for calibration demo code there available that only i used but i getting 0x00 for i and q values then i used error register for identify what error i getting in printf debug i getting === EEPROM / LPCD Check Start === VERSION(0x7F)=0x1A ERROR(before)=0x00 ERROR(after LOADREG)=0x80 >>> EEPROM error (0x80) still present. LPCD may not calibrate correctly! === EEPROM / LPCD Check Done === // this is the code phStatus_t Rc663_EepromInitAndCalibrateLPCD( phhalHw_Rc663_DataParams_t *pHal, uint32_t *pdwLPCDRefValue) { phStatus_t status; uint8_t bVersion, bIrq1, bErr; uint8_t bValueI = 0, bValueQ = 0; char dbg[64]; uint8_t eepromVal; uint8_t addr; sprintf(dbg, "\r\n=== EEPROM + LPCD Init ===\r\n"); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); /* 1. Read chip version */ status = phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_VERSION, &bVersion); CHECK_STATUS(status); sprintf(dbg, "VERSION(0x7F)=0x%02X\r\n", bVersion); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); /* 2. Clear any existing errors */ phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_ERROR, &bErr); sprintf(dbg, "ERROR(before)=0x%02X\r\n", bErr); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); /* 3. Force LOADREG from EEPROM into registers */ status = phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_COMMAND, PHHAL_HW_RC663_CMD_LOADREG); CHECK_STATUS(status); /* Small delay for EEPROM load */ phhalHw_Wait(pHal, PHHAL_HW_TIME_MILLISECONDS, 5); /* 4. Check error register again */ phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_ERROR, &bErr); sprintf(dbg, "ERROR(after LOADREG)=0x%02X\r\n", bErr); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); if (bErr & PHHAL_HW_RC663_BIT_EE_ERR) { sprintf(dbg, ">>> EEPROM error (0x%02X) detected!\r\n", bErr); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); /* --- EEPROM Dump (first 16 bytes for debug) --- */ for (addr = 0; addr < 0x10; addr++) { phhalHw_Rc663_Cmd_ReadE2(pHal, addr, 1, &eepromVal); sprintf(dbg, "EEPROM[0x%02X] = 0x%02X\r\n", addr, eepromVal); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); } /* --- Bypass EEPROM and continue with manual init --- */ sprintf(dbg, "Bypassing EEPROM, using manual RF settings...\r\n"); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_DRVMODE, 0x89); phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_TXAMP, 0x1F); phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_DRVCON, 0x18); } else { sprintf(dbg, "EEPROM LOADREG OK.\r\n"); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); } /* 5. Clear IRQ flags */ phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_IRQ0, 0x7F); phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_IRQ1, 0x7F); /* 6. Enable calibration mode */ phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_LPCD_OPTIONS, 0x02); /* 7. Start LPCD_CALIBRATE (0x37 is the hidden calibrate command) */ phhalHw_Rc663_WriteRegister(pHal, PHHAL_HW_RC663_REG_COMMAND, 0x37); /* 8. Wait for LPCDIRQ */ do { phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_IRQ1, &bIrq1); } while (!(bIrq1 & PHHAL_HW_RC663_BIT_LPCDIRQ)); /* 9. Read I/Q results */ phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_LPCD_RESULT_I, &bValueI); phhalHw_Rc663_ReadRegister(pHal, PHHAL_HW_RC663_REG_LPCD_RESULT_Q, &bValueQ); /* 10. Store */ *pdwLPCDRefValue = (uint32_t)bValueI | ((uint32_t)bValueQ << 8); sprintf(dbg, "[LPCD] Calibration done: I=0x%02X Q=0x%02X Ref=0x%08X\r\n", bValueI, bValueQ, *pdwLPCDRefValue); DEBUG_UART2((uint8_t*)dbg, strlen(dbg)); return PH_ERR_SUCCESS; } Re: clrc663 lpcd i and q value i getting 0x00 Hello sir,
In order to calibrate the CLRC663 for LPCD, we highly recommend to please use NFC Cockpit.
This is a GUI tool that allows the user to graphically fine-tune the antenna along with LPCD calibration (Section 4.5) . We encourage you to please use this method since the calibration has to be done depending of your own design. There is no manual to do this procedure in a step-by-step manner.
NFC Cockpit allows the user to calibrate, while the reader is unloaded and then, loaded in real time.
Please explore the possibility of checking the 4th video for the following antenna design video series: NFC Antenna Design | NXP Semiconductors
View full article