2023-05-23 12:55 AM
Hi sir, I am working with I2C in x-nucleo-nfc07a1 where ST25DV IC incorporated interfaced with Nucleo-WB55 board, what is the slave address(device address) for this?
I am firmware engineer, I have I2C Scanning program where
Previously, I work with Temp sensor, the scanning code gives me slave address as 0x4a,
I also work the following,
Heart rate sensor in which it is 0x57
PN532 NFC reader in which it shows 0x24
And right now I work with X-Nucleo-NFC07A1 in which ST25DV64KC is incorporated, here the scanning code shows none. I want to know, why it is not? and how to deal with i2c communication to store data in EEPROM? HAL_I2c functions deals with 5 parameters, DevAddr, TargetAddr, No.of.Bytes req, delay, out of which DevAddr what we can use?
Solved! Go to Solution.
2023-05-23 03:03 AM - edited 2023-11-20 04:50 AM
Hello @BT.2 ,
Could you please check the datasheet : Datasheet - ST25DV04K ST25DV16K ST25DV64K - Dynamic NFC/RFID tag IC with 4-, 16-, or 64-Kbit EEPROM, and fast transfer mode capability
In section 6.3. : The ST25DV is one device but responds to THREE I2C addresses: 0x2D, 0x53 (user memory) and 0x57 (system memory)
Hope I helped you!
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-23 03:03 AM - edited 2023-11-20 04:50 AM
Hello @BT.2 ,
Could you please check the datasheet : Datasheet - ST25DV04K ST25DV16K ST25DV64K - Dynamic NFC/RFID tag IC with 4-, 16-, or 64-Kbit EEPROM, and fast transfer mode capability
In section 6.3. : The ST25DV is one device but responds to THREE I2C addresses: 0x2D, 0x53 (user memory) and 0x57 (system memory)
Hope I helped you!
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-23 04:13 AM
Thank you !
I want to read the Revision ID, IC Ref reg or UID reg
could you please tell the following code I wrote is correct or not?
/** @brief ST25DVxxKC ICref register address. */
#define ST25DVXXKC_ICREF_REG (uint16_t)0x0017
/** @brief ST25DVxxKC UID register address. */
#define ST25DVXXKC_UID_REG (uint16_t)0x0018
/** @brief ST25DVxxKC IC revision register address. */
#define ST25DVXXKC_ICREV_REG (uint16_t)0x0020
uint8_t Buff[8];
#define command ST25DVXXKC_ICREF_REG
uint8_t command_buffer = {(command & 0xff ) >> 8, command & 0xff};
HAL_I2C_Master_Transmit(&hi2c1, (0x57<<1), command_buffer,1,100);
HAL_I2C_Master_Receive(&hi2c1,((0x57<<1) | 0x01), Buff,1, 100);
And also I tried the following,
uint8_t ret;
ret = HAL_I2C_IsDeviceReady(&hi2c1,(uint16_t)0x57<<1, 3 , 5);
if(ret == HAL_OK)
{
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_10);
}
Here the if condition fails, I also tried with 0x53 and 0x57 also, so how to set the device address inorder to make the if condition true
2023-05-23 06:13 AM
Hello
I recommend you use :
HAL_I2C_Mem_Write (I2C_HandleTypeDef * hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t * pData, uint16_t Size, uint32_t Timeout);
HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-23 06:20 AM
The if condition satisfied true for all the addresses(0x2D<<1), (0x53<<1), (0x57<<1) in debug mode step over the code, The LED toggles.
But the same code in debug mode click the play button instead of step over key, it won't get inside the if condition
2023-05-23 06:29 AM
If the error is :
If you are facing some erratic behavior on STM32, do not forget to check Errata sheet of the device. There are few points related to I2C interface.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.