Regarding reading data from NT3H2111

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Regarding reading data from NT3H2111

720 次查看
shank
Contributor I

 

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.

HAL_GPIO_WritePin(GPIOA,SW_Pin,GPIO_PIN_SET);
HAL_Delay(10);
tdata[0]=0x01;
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,SW_Pin,GPIO_PIN_RESET);

I would appreciate any advice you could give me regarding I2C communication.

0 项奖励
回复
3 回复数

701 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @shank 

Could you provide the  I2C sequence diagram? As shown in the following picture, let us see if the I2C communication works fine.

KaiLi_0-1745241411609.png

Or you can refer SW3647 to debug your code. SW3647 canbe downloaded from the below:

OM5569-NT322E | NTAG I2C plus Explorer Kit | NFC | NXP Semiconductors

0 项奖励
回复

678 次查看
shank
Contributor I
Thank you for your advice, kaiLi.
Unfortunately, the board that is not working for me is covered in resin, so I cannot see the waveform on an oscilloscope.
I am debugging with software, and when something is not working properly, HAL_ERROR is returned, so I decided to do a software reset (HAL_NVIC_SystemReset();) when HAL_ERROR is returned. Is this a bad way to deal with the problem when running a program?
0 项奖励
回复

649 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @shank 

You can also try software reset, but it may not solve the problem. You still need to know the cause of HAL_ERROR.

0 项奖励
回复