Solved
About I2C communication of STM32C031
- April 21, 2025
- 5 replies
- 1560 views
Hello.
I am trying to implement RFID using NXP's NT3H2211W0FT1. The microcontroller I am using is the STM32C031F6.
After powering on the board, the first thing I do is read the data from the NT3H2211W0FT1 via I2C, but sometimes I can read it and sometimes I can't.
I tried leaving a wait of more than one second after powering it on, but that didn't change the situation.
The program for the I2C part is below.
while(icdata_flg==0){
HAL_GPIO_WritePin(GPIOA, ANNTENA_SW_Pin,GPIO_PIN_SET);
HAL_Delay(10);
tdata[0]=0x01;//Read
HAL_I2C_Master_Transmit(&hi2c1,0xaa,tdata,1,100);
HAL_Delay(10);
HAL_I2C_Master_Receive(&hi2c1,0xab,rdata,8,100);
HAL_Delay(10);
HAL_GPIO_WritePin(GPIOA, ANNTENA_SW_Pin,GPIO_PIN_RESET);
}I would appreciate any advice you could give me regarding I2C communication.
