Skip to main content
Visitor II
February 24, 2020
Solved

ST25R3916 Wake-up mode

  • February 24, 2020
  • 34 replies
  • 13686 views

Hello,

i have been trying to put the st25r3916 in wake-up mode but i detect high power consumptions (around 900 uA). I am using a very basic code just to test current consumtion, i2c communication seems to work, but maybe i am missing some parts.

int main(){
 rfalAnalogConfigInitialize();
 
	if(rfalInitialize() != ERR_NONE)
	{
 
	}
	else
	{
		rfalWakeUpModeStart(NULL);
 }
}

Am i missing some api calls?

Thanks,

Regards

    This topic has been closed for replies.
    Best answer by Grégoire Poulain

    Hi,

    Looking into the I2C trace provided before it seems that the external IRQ handling on your setup is not properly set.

    DateTime: 2020-02-21T11:11:14.583
    Start, hA0 [ h50 | WR ], hC1, Stop
    Start, hA0 [ h50 | WR ], h7F, 
    Restart, hA1 [ h50 | RD ], h2A NAK, 
    Restart, hA0 [ h50 | WR ], hFC, h44, 
    Restart, hA1 [ h50 | RD ], h00 NAK, Stop
    Start, hA0 [ h50 | WR ], hFC, h04, h10, Stop
    Start, hA0 [ h50 | WR ], h42, 
    Restart, hA1 [ h50 | RD ], h00 NAK, 
    Restart, hA0 [ h50 | WR ], h42, 
    Restart, hA1 [ h50 | RD ], h00 NAK, Stop
    Start, hA0 [ h50 | WR ], h02, h80, Stop
    /* ==> IRQ Status Registers should have been read here triggered by IRQ pin (register h1A) */
    Start, hA0 [ h50 | WR ], h16, h80, Stop

    Please ensure that the ISR and external Interrupt source is functional on your platform.

    If the ISR is not serviced (interrupt status Registers read) the IRQ pin will remain high at startup and you will not be able to see any transition when setting the Wake-up mode.

    Best regards

    GP

    34 replies

    ST Employee
    February 25, 2020

    Hi,

    The initialization process is not handled correctly, the Wake-up is set only if the RFAL initialization failed.

    In order to initialize the RFAL you must initialize the Analog Configs and the RFAL itself.

    If the rfalInitialize() returns an error it is due to some system issue and communication with the ST25R3916 were not successful.

    Can you confirm that the rfalInitialize() is OK?

    The code should be changed to something like:

    int main()
    {
     
     /* Configure and initialize all required peripherals */
     /* ... */
     
     rfalAnalogConfigInitialize(); 
     if( rfalInitialize() != ERR_NONE )
     {
     /* System error - unable to initialize ST25R3916 */
     
     /* Block MCU / signal error / return error */
     }
     
     
     /* RFAL initilization OK, continue with application */
     
     /* Set ST25R3916 in Wake-up mode */
     rfalWakeUpModeStart(NULL);
     
     /* ... */
    }

    Kind regards

    GP

    MPeli.1Author
    Visitor II
    February 25, 2020

    Yes, rfalInitialize() returns ERR_NONE, so it is OK. The problem is that rfalWakeUpModeStart(NULL); seems to have no effect, because power consumption stays at 900uA.

    ST Employee
    February 25, 2020

    Hi,

    Could you please provide more details on your setup?

    • Which RFAL version are you using ? (RFAL_VERSION in rfal.h)
    • Which HW setup are you using ? X-NUCLEO-NFC06A1 / ST25R3916-DISCO / other ?
    • How are you measuring the current?
      • How/Where are you supplying and monitoring the ST25R3916 consumption?
      • How are you excluding consumption of other components on the board (MCUs, LEDs, etc) ?
      • The WU mode performs actions periodically (every few ms), instant currents can be misleading.

    This Application Note provides further details on the Wake-up mode of the ST25R3916 and might be helpful.

    Best regards

    GP

    MPeli.1Author
    Visitor II
    February 25, 2020

    Hello,

    I am using latest rfal downloaded by st website, 2.1.2, as stated in rfal_rf.h.

    I bought st25r3916-disco but i am only using the daughterboard, i detached the daughterboard (the green one), and i am using the i2c communication (i made the modifications states in the reference manual to enable i2c) with a nrf microcontroller.

    I am powering the daughterboard with 3,3 volts, connecting positive to pin 8 of the J101 connector of the daughterboard (3V3) and ground to pin 7 (GND)

    For current measuring, i am using a current ranger (https://lowpowerlab.com/guide/currentranger/) in series with the positive pin mentioned above, it performs an average measurement.

    For communication, i am using DCL and SDA pins on cn100 connector on the daughterboard.

    It seems that the i2c communications can get clunky when performing function st25r3916AdjustRegulators in st25r3916.c, at line 250 when executing st25r3916ExecuteCommandAndGetResult, i include a log of the i2c communication.

    Thanks,

    Regards

    MPeli.1Author
    Visitor II
    February 26, 2020

    Hello,

    what are the parasite components that i can eliminate to obtain the least power consumption? i eliminated the r101 resistor that is in series with the LED101, that was draining about 900uA.

    Thank you very much,

    Regards

    ST Employee
    February 28, 2020

    Hello,

    Is the power consumption after removing the LED101 (3.3V Power OK LED) in line with your expectations?

    The Supply current in Power-down mode should be between 0.8 and 2.5µA (static at 25°C and 3.3V Supply)

    The Supply current in Wake-up mode should be between 3.0 and 6.3µA (static at 25°C and 3.3V Supply)

    The Supply current all active should be between 16 and 23mA (static at 25°C and 3.3V Supply)

    The power consumption in wake-up mode can then be calculated as in the AN5320.

    Besides the power ok LEDs, there are no other components which can be removed to save power.

    "It seems that the i2c communications can get clunky ...."

    What is your pull up resistor configuration on the DCL and SDA lines at your MCU? The ST25R3916-Discovery board already has some pull up resistors (R201 and R202) populated.

    It could also be, that the current ranger causes a voltage drop on pin 8 of j101 when executing the AdjustRegulator command. Please check i2c communication without the current ranger.

    Br Travis

    MPeli.1Author
    Visitor II
    March 3, 2020

    Hi, i shorted j202 and j203 and removed r201 and r202, i am using mcu internal pullups for communication.

    I also have enabled wto bit for cyclic interrupt every 100ms over intr/irq pin on cn100 connector, but i am not getting any interrupt. What can i check to make sure the configuration for cyclic interrupt is correct?

    Thank you very much,

    Regards

    ST Employee
    March 3, 2020

    Hi,

    Looking into the I2C trace provided before it seems that the external IRQ handling on your setup is not properly set.

    DateTime: 2020-02-21T11:11:14.583
    Start, hA0 [ h50 | WR ], hC1, Stop
    Start, hA0 [ h50 | WR ], h7F, 
    Restart, hA1 [ h50 | RD ], h2A NAK, 
    Restart, hA0 [ h50 | WR ], hFC, h44, 
    Restart, hA1 [ h50 | RD ], h00 NAK, Stop
    Start, hA0 [ h50 | WR ], hFC, h04, h10, Stop
    Start, hA0 [ h50 | WR ], h42, 
    Restart, hA1 [ h50 | RD ], h00 NAK, 
    Restart, hA0 [ h50 | WR ], h42, 
    Restart, hA1 [ h50 | RD ], h00 NAK, Stop
    Start, hA0 [ h50 | WR ], h02, h80, Stop
    /* ==> IRQ Status Registers should have been read here triggered by IRQ pin (register h1A) */
    Start, hA0 [ h50 | WR ], h16, h80, Stop

    Please ensure that the ISR and external Interrupt source is functional on your platform.

    If the ISR is not serviced (interrupt status Registers read) the IRQ pin will remain high at startup and you will not be able to see any transition when setting the Wake-up mode.

    Best regards

    GP

    MPeli.1Author
    Visitor II
    March 3, 2020

    Hello, seems that interrupts were not set correctly on my platform, now it is correct.

    Now, during execution of rfalWakeUpModeStart(NULL), after rfalInitialize() completes with no errors , mcu enters branch

    1)

    if( st25r3916CheckReg( ST25R3916_REG_IO_CONF2, ST25R3916_REG_IO_CONF2_aat_en, ST25R3916_REG_IO_CONF2_aat_en ) )
     {
     gRFAL.wum.cfg.swTagDetect = true;
     gRFAL.wum.cfg.indAmp.autoAvg = true;
     gRFAL.wum.cfg.indAmp.aaWeight = RFAL_WUM_AA_WEIGHT_16;
     }

    Because bit aat_en is set in register ST25R3916_REG_IO_CONF2. I don't want to use swtag detect, i just want the st25r3916 to wake up my cpu as soon as it detects a tag nearby. So, i put a "dummy" fix above these lines, this is the code:

    2)

    rfalChipChangeRegBits(ST25R3916_REG_IO_CONF2, ST25R3916_REG_IO_CONF2_aat_en, 0);
     
     if( config == NULL )
     {
     gRFAL.wum.cfg.period = RFAL_WUM_PERIOD_200MS;
     gRFAL.wum.cfg.irqTout = false;
     gRFAL.wum.cfg.indAmp.enabled = true;
     gRFAL.wum.cfg.indPha.enabled = false;
     gRFAL.wum.cfg.cap.enabled = false;
     gRFAL.wum.cfg.indAmp.delta = 2U;
     gRFAL.wum.cfg.indAmp.reference = RFAL_WUM_REFERENCE_AUTO;
     gRFAL.wum.cfg.indAmp.autoAvg = false;
     
     
     
     /*******************************************************************************/
     /* Check if AAT is enabled and if so make use of the SW Tag Detection */
     if( st25r3916CheckReg( ST25R3916_REG_IO_CONF2, ST25R3916_REG_IO_CONF2_aat_en, ST25R3916_REG_IO_CONF2_aat_en ) )
     {
     gRFAL.wum.cfg.swTagDetect = true;
     gRFAL.wum.cfg.indAmp.autoAvg = true;
     gRFAL.wum.cfg.indAmp.aaWeight = RFAL_WUM_AA_WEIGHT_16;
     }
     }
     else
     {
     gRFAL.wum.cfg = *config;
     }

    Instruction in line 1 of the code snipped attached resets the aat_en bit, and the cpu does not enter in branch 1). I correctly detect, after the completion of the startwakeup function, that an interrupt is raised if i get the tag included with the discovery board (i am using the big one, that is an ISO 15693 tag). So, is it correct to reset the aat_en bit "manually" in this case?

    Thank you very much,

    Regards

    Technical Moderator
    March 5, 2020

    Hi,

    if you are not using AAT then I recommend disabling aat in the analog configs. Create your own analog config file - can be done by using the GUI: Load the file, change the aat_en in CHIP_INIT from "0001| 20 | 20" to "0001| 20 | 00" and generate a new custom file which you can include in your project. In our default analog config it is enabled by this statement:

    , ST25R3916_REG_IO_CONF2, ST25R3916_REG_IO_CONF2_aat_en, ST25R3916_REG_IO_CONF2_aat_en /* Enable AAT */

    If you continue to use MB1414 from ST25R3916-DISCO, then please also remove the VCCs and change the MLCs to compensate for the removed VCCs. Otherwise you may/will experience unwanted effects on the wake-up system.

    Regards, Ulysses

    ST Employee
    March 3, 2020

    Hi,

    Good to know that the interrupt and Wake-up is now working for you.

    In case you do not want to use the default configuration, you should pass in the WU configuration you would like to be used.

    For example:

     rfalWakeUpConfig wuCfg;
     
     wuCfg.period = RFAL_WUM_PERIOD_200MS;
     wuCfg.irqTout = false;
     wuCfg.indAmp.enabled = true;
     wuCfg.indPha.enabled = false;
     wuCfg.cap.enabled = false;
     wuCfg.indAmp.delta = 2U;
     wuCfg.indAmp.reference = RFAL_WUM_REFERENCE_AUTO;
     wuCfg.indAmp.autoAvg = false;
     wuCfg.swTagDetect = false;
     
     rfalWakeUpModeStart( &wuCfg );

    Best regards

    GP