Hi
Can someone detail the right sequence of commands for enabling the AGC control loop on a PN7150 please? And do I send that before reset/init? The problem we're having is that in RF test mode we're seeing correct regulation in terms of the peak to peak voltage on the receive path but for our normal card scanning operation the input voltages do not seem to be correct and approach the 2.5V maximum on the input which suggests we're missing some appropriate sprinkling of magic hex incantations to coerce the chip into regulating the receive path in normal operation.
I've stumbled across various references that disagree with each other about the command sequence to send and the user manual is not super helpful as much of the terminology in the CLIF_AGC_CONFIG0_REG section is entirely self referential with no proper guidance as to how to set certain values or, for example, what the reserved values should be set to or what a "CM" or a "RM" value is. Sure I can guess at some of this stuff but some references swap bytes (0x80, 0x86) relative to other references and hint at bricking the chip with incorrect values which I'd rather not do. See the link below for example:
( note the referenced github issue in the article above is not accessible so I can't really get a proper explanation of the problem there )
Are there other references I should be looking at beyond the UM and antenna tuning guide btw. that explains this properly or can someone point me at the right command that is guaranteed not to brick the chip please?
Thank you!
Hi Tomas
Thanks for the reply! I have used the test mode and in test mode things seem fine - the AGC loop seems to regulate correctly and we see the expected 1.6V pk-pk signal. However during normal card scanning, we see 2.5V pk on the RX pin and that suggests the loop is not regulating or speculating here, perhaps not enabled (which I assume test mode probably does automatically). So that's why I'm trying to figure out what to write to CLIF_AGC_CONFIG0_REG to correctly enable the AGC loop. However the fields there are not clearly described and AN11755 differs from some example code and even in the example code we see differences such as swapping the first two bytes between the different transition ID examples: 0x80, 0x86 vs 0x86, 0x80 - one of those is probably wrong. And AN11755 is saying 0x0F, 0x01 for the first two parameters. I was hoping there was an example that directly targets the pn7150 that sets this up correctly.
Thank you!
Hello,
Try the following configuration, please.
uint8_t NxpNci_RF_CONF_2ndGen[]={0x20, 0x02, 0x94, 0x11,
0xA0, 0x0D, 0x06, 0x04, 0x35, 0x90, 0x01, 0xF4, 0x01, /* RF_CLIF_CFG_INITIATOR CLIF_AGC_INPUT_REG */
0xA0, 0x0D, 0x06, 0x06, 0x30, 0xB0, 0x01, 0x10, 0x00, /* RF_CLIF_CFG_TARGET CLIF_SIGPRO_ADCBCM_THRESHOLD_REG */
0xA0, 0x0D, 0x06, 0x06, 0x42, 0x02, 0x00, 0xFF, 0xFF, /* RF_CLIF_CFG_TARGET CLIF_ANA_TX_AMPLITUDE_REG */
0xA0, 0x0D, 0x06, 0x20, 0x42, 0x88, 0x00, 0xFF, 0xFF, /* RF_CLIF_CFG_TECHNO_I_TX15693 CLIF_ANA_TX_AMPLITUDE_REG */
0xA0, 0x0D, 0x04, 0x22, 0x44, 0x22, 0x00, /* RF_CLIF_CFG_TECHNO_I_RX15693 CLIF_ANA_RX_REG */
0xA0, 0x0D, 0x06, 0x22, 0x2D, 0x50, 0x34, 0x0C, 0x00, /* RF_CLIF_CFG_TECHNO_I_RX15693 CLIF_SIGPRO_RM_CONFIG1_REG */
0xA0, 0x0D, 0x06, 0x32, 0x42, 0xF8, 0x00, 0xFF, 0xFF, /* RF_CLIF_CFG_BR_106_I_TXA CLIF_ANA_TX_AMPLITUDE_REG */
0xA0, 0x0D, 0x06, 0x34, 0x2D, 0x24, 0x37, 0x0C, 0x00, /* RF_CLIF_CFG_BR_106_I_RXA_P CLIF_SIGPRO_RM_CONFIG1_REG */
0xA0, 0x0D, 0x06, 0x34, 0x33, 0x80, 0x86, 0x00, 0x70, /* RF_CLIF_CFG_BR_106_I_RXA_P CLIF_AGC_CONFIG0_REG */
0xA0, 0x0D, 0x04, 0x34, 0x44, 0x22, 0x00, /* RF_CLIF_CFG_BR_106_I_RXA_P CLIF_ANA_RX_REG */
0xA0, 0x0D, 0x06, 0x42, 0x2D, 0x15, 0x45, 0x0D, 0x00, /* RF_CLIF_CFG_BR_848_I_RXA CLIF_SIGPRO_RM_CONFIG1_REG */
0xA0, 0x0D, 0x04, 0x46, 0x44, 0x22, 0x00, /* RF_CLIF_CFG_BR_106_I_RXB CLIF_ANA_RX_REG */
0xA0, 0x0D, 0x06, 0x46, 0x2D, 0x05, 0x59, 0x0E, 0x00, /* RF_CLIF_CFG_BR_106_I_RXB CLIF_SIGPRO_RM_CONFIG1_REG */
0xA0, 0x0D, 0x06, 0x44, 0x42, 0x88, 0x00, 0xFF, 0xFF, /* RF_CLIF_CFG_BR_106_I_TXB CLIF_ANA_TX_AMPLITUDE_REG */
0xA0, 0x0D, 0x06, 0x56, 0x2D, 0x05, 0x9F, 0x0C, 0x00, /* RF_CLIF_CFG_BR_212_I_RXF_P CLIF_SIGPRO_RM_CONFIG1_REG */
0xA0, 0x0D, 0x06, 0x54, 0x42, 0x88, 0x00, 0xFF, 0xFF, /* RF_CLIF_CFG_BR_212_I_TXF CLIF_ANA_TX_AMPLITUDE_REG */
0xA0, 0x0D, 0x06, 0x0A, 0x33, 0x80, 0x86, 0x00, 0x70 /* RF_CLIF_CFG_I_ACTIVE CLIF_AGC_CONFIG0_REG */
};
Then the regulation should work properly. See the RX voltage measurement done for the PN7160 Dev. kit.
If not, you have to increase/decrease the RX resistor
BR
Tomas
Hello,
I typically do it with the help of the Raspberry Pi.
The corresponding command
Here is the code I use:
static void AGC (int handle)
{
char get[] = {0x2F, 0x3D, 0x04, 0x02, 0xC8, 0x60, 0x03};
char Answer[255];
printf("Get AGC value (enter 'ff' during tag ID selection step to leave):\n");
while (1)
{
printf("\n");
tml_transceive(handle, get, sizeof(get), Answer, sizeof(Answer));
if ((Answer[0] != 0x4F) || (Answer[1] != 0x3D) || (Answer[3] != 0x00)) {
printf("Error, cannot get parameter value\n");
}
else {
printf("\n");
printf("Measured AGC Value (LSB)= %.2Xh" , Answer[4]);
printf("\n");
printf("Measured AGC Value (MSB)= %.2Xh", Answer[5]);
printf("\n");
}
}
}
This is the output data I get (for PN7160 but for PN7150 it should be the same):
Would this help somehow?
BR
Tomas