2023-05-22 6:56 PM - edited 2023-11-20 4:52 AM
I want to know how to show how to use the energy harvesting feature based on the ST25DV-I2C-04K in combination with an STM32L476 MCU.I have noticed that there is a code named EH energy collection, can you power L476 to make it run normally?
void MX_NFC7_EH_Init(void)
{
ST25DVxxKC_EN_STATUS_E value_eh_dyn;
ST25DVxxKC_EH_MODE_STATUS_E value_eh_mode;
/* Configuration of X-NUCLEO-NFC07A1 */
/******************************************************************************/
/* Init of the Leds on X-NUCLEO-NFC07A1 board */
NFC07A1_LED_Init(GREEN_LED );
NFC07A1_LED_Init(BLUE_LED );
NFC07A1_LED_Init(YELLOW_LED );
NFC07A1_LED_On( GREEN_LED );
HAL_Delay( 300 );
NFC07A1_LED_On( BLUE_LED );
HAL_Delay( 300 );
NFC07A1_LED_On( YELLOW_LED );
HAL_Delay( 300 );
/* Init ST25DVxxKC driver */
while( NFC07A1_NFCTAG_Init(NFC07A1_NFCTAG_INSTANCE) != NFCTAG_OK );
/* Init User button to allow user to change EH configuration */
BSP_PB_Init( BUTTON_KEY, BUTTON_MODE_GPIO );
/* Init done */
NFC07A1_LED_Off( GREEN_LED );
HAL_Delay( 300 );
NFC07A1_LED_Off( BLUE_LED );
HAL_Delay( 300 );
NFC07A1_LED_Off( YELLOW_LED );
HAL_Delay( 300 );
/* Check status of Energy Harvesting static configuration */
NFC07A1_NFCTAG_ReadEHMode(NFC07A1_NFCTAG_INSTANCE, &value_eh_mode );
if( value_eh_mode == ST25DVXXKC_EH_ACTIVE_AFTER_BOOT )
{
/* Energy Harvesting is set after each boot, LED 1 is on */
NFC07A1_LED_On( GREEN_LED );
}
else
{
/* Energy Harvesting is reset after each boot, LED 1 is off */
NFC07A1_LED_Off( GREEN_LED );
}
/* Check status of Energy Harvesting static configuration */
NFC07A1_NFCTAG_GetEHENMode_Dyn(NFC07A1_NFCTAG_INSTANCE, &value_eh_dyn );
if( value_eh_dyn == ST25DVXXKC_DISABLE )
{
/* Energy Harvesting is disabled, LED 2 is on */
NFC07A1_LED_Off( BLUE_LED );
}
else
{
/* Energy Harvesting is activated, LED 2 is on */
NFC07A1_LED_On( BLUE_LED );
}
}
/**
* @brief Process of the NFC7 EH application
* @retval None
*/
void MX_NFC7_EH_Process(void)
{
ST25DVxxKC_PASSWD_t passwd;
ST25DVxxKC_EN_STATUS_E value_eh_dyn;
ST25DVxxKC_EH_MODE_STATUS_E value_eh_mode;
ST25DVxxKC_I2CSSO_STATUS_E i2csso;
uint32_t tick_start;
uint32_t tick_end;
/*Detect button press*/
if(BSP_PB_GetState( BUTTON_KEY ) == BUTTON_PRESSED)
{
tick_start = HAL_GetTick();
/* Debouncing */
HAL_Delay(50);
do
{
tick_end = HAL_GetTick();
} while ((BSP_PB_GetState( BUTTON_KEY ) == BUTTON_PRESSED) && (tick_end - tick_start) <= 1000);
if((tick_end - tick_start) > 1000)
{
/* Long Button press */
/* Wait until the button is released */
while ((BSP_PB_GetState( BUTTON_KEY ) == BUTTON_PRESSED));
/* Debouncing */
HAL_Delay(50);
/* When user button is released after 1s, toggle Energy Harvesting static configuration */
/* You need to present password to change static configuration */
NFC07A1_NFCTAG_ReadI2CSecuritySession_Dyn(NFC07A1_NFCTAG_INSTANCE, &i2csso );
if( i2csso == ST25DVXXKC_SESSION_CLOSED )
{
/* if I2C session is closed, present password to open session */
passwd.MsbPasswd = 0;
passwd.LsbPasswd = 0;
NFC07A1_NFCTAG_PresentI2CPassword(NFC07A1_NFCTAG_INSTANCE, passwd );
}
/* Toggle static configuration */
NFC07A1_NFCTAG_ReadEHMode(NFC07A1_NFCTAG_INSTANCE, &value_eh_mode );
if( value_eh_mode == ST25DVXXKC_EH_ACTIVE_AFTER_BOOT )
{
/* Let the user activate energy harvesting */
value_eh_mode = ST25DVXXKC_EH_ON_DEMAND;
NFC07A1_NFCTAG_WriteEHMode(NFC07A1_NFCTAG_INSTANCE, value_eh_mode );
NFC07A1_LED_Off( GREEN_LED );
}
else
{
/* Energy harvesting activated after Power On Reset */
value_eh_mode = ST25DVXXKC_EH_ACTIVE_AFTER_BOOT;
NFC07A1_NFCTAG_WriteEHMode(NFC07A1_NFCTAG_INSTANCE, value_eh_mode );
NFC07A1_LED_On( GREEN_LED );
}
}
else
{
/* Short Button press */
/* Button already released */
/* Debouncing */
HAL_Delay(50);
/* When user button is pressed, toggle Energy Harvesting dynamic configuration */
NFC07A1_NFCTAG_GetEHENMode_Dyn(NFC07A1_NFCTAG_INSTANCE, &value_eh_dyn );
if( value_eh_dyn == ST25DVXXKC_DISABLE )
{
/* Enable energy harvesting */
NFC07A1_NFCTAG_SetEHENMode_Dyn(NFC07A1_NFCTAG_INSTANCE);
NFC07A1_LED_On( BLUE_LED );
}
else
{
/* Disable energy harvesting */
NFC07A1_NFCTAG_ResetEHENMode_Dyn(NFC07A1_NFCTAG_INSTANCE);
NFC07A1_LED_Off( BLUE_LED );
}
}
}
}
#ifdef __cplusplus
}
#endif
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Solved! Go to Solution.
2023-05-31 5:07 AM
Hi @帅 罗,
Connecting the ST1 EH pin to the ST1 VCC will only power the ST25DV64KC chip. It is not possible, with ST1, to directly power supply the STM32L476 Nucleo board. If you want to use the EH feature to power supply other function, use the ST1 pin 3 to wired it to another power input (be careful the current provided by this pin is limited and depends on the strength of the field).
Please read documentations provided on st.com with the X-NUCLEO-NFC07 board to have more information about it.
kind Regards.
2023-05-31 5:15 AM
Hi,@Rene Lenerve
I need to use RF to make ST25 power stm32, so as to achieve the purpose of MCU working normally,and I have noticed that the official explanation has this case, as shown in the picture below. So what should I do to make st25 power MCU?Is there any way or suggestion?
Kind Regards.
2023-05-31 5:18 AM - edited 2023-11-20 4:52 AM
2023-06-04 5:57 AM
Hi,@Rene Lenerve
I need your help,I made the blue LED of ST25 light up through EH, which means active mode has been started. So can I disconnect the power supply and measure the voltage of the EH pin only with RF? Or how can I use EH pin energy to power other low power chips?
kind Regards.
2023-06-05 12:04 AM
Hi @帅 罗,
If the blue Led is turned on, it means that the EH is available only for the current connection and will be off if you remove the field.
So, you need to press the button during 2 seconds and wait the Green and Blue Led are on. Then you can remove the power supply. Now when you approach an RF reader, the EH pin will deliver power that you can measure.
Hope this will help you.
Kind Regards.
2023-06-05 12:11 AM
Hi,@Rene Lenerve
OK. If I let the Green and Blue Led are on, and then remove the power supply. when I approach an RF reader, will the led on? And if I want to use EH power to power small MCUS, are there any references? What should I do?
Kind Regards.
2023-06-05 1:23 AM - edited 2023-11-20 4:52 AM
Hi @Schuyler (Community Member),
The Leds on the NFC07 expansion board are not wired to work with EH. To use the EH feature with other component you need to wired the ST1 pin 3 to another component to see this feature in live.
In other terms you need to design your own board for that.
But if you just want to make a try, one possible solution would be to connect the ST1 pin3 (EH pin) to the Arduino connector CN9#6 (as the picture below). and when you approach the RF field it will turn on the Green Led. (without STM32L476 Nucleo board connected).
If you allow me to give you one advice, I think you should read the documentation more thoroughly to understand how this feature works.
I hope this will help you.
Kind Regards.
2023-06-05 6:41 PM
Hi,@Rene Lenerve
Thank you for your reply. According to your tips, I have successfully lit the LED through RF, but is the reason for the blinking all the time because of the AC output? Moreover, I have measured the output of the pin. In the case of AC, the voltage is about 0.2V. Is this normal?
Kind Regards.
2023-06-06 2:21 AM
Hi @Schuyler (Community Member),
What could explain the blinking Led is that the field is continuously turned off and on, for example a smartphone can enter a sequence of discovering tags which will have this kind of behavior.
You need to have an Application that keep the field on or a Reader on which you keep the field on.
If you measure the EH pin with the field continuously turned on and off it would explain your measurement, you probably get the average value. Keep the field on to do your measurement.
if you want more specific help, please describe your manipulations in more detail, otherwise it is very difficult to know what is wrong.
Please read this documentation for more information on Energy Harvesting measurements:
AN4913: Energy harvesting delivery impact on ST25DV-I2C Series
Kind Regards.
2023-06-06 6:06 PM
Hi,@Rene Lenerve
I would like to ask whether the energy output of EH is DC or AC, and how I can make it become a stable power supply for other low-power MCUS. My purpose is to make the energy collected by EH pin enable STM32L476RG to operate normally, and then transmit data without power supply. Is this plan feasible?
Kind Regards.