cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L010 and NXP NT3H2211 (I2C question)

JZida.1
Associate II

Greetings everyone, I am trying to communicate with NT3H2211.

My specific problem is marked red on the picture (everything else I manage to successfully send/receive). When reading data NT3H2211 wants to get " 7 bits SA and '1' " and then it will send data. How can I make the transition from write to read like that? 

I am using STM32L010 and NXP NT3H2211 transponder. 

So far I have used HAL_I2C_Master_Transmit and HAL_I2C_Master_Receive functions for I2C communication with NT3H2211.

But both Transmit and Recieve functions are sending START/RESTART, and STOP after all data is sent/received (I2C_AUTOEND_MODE). So the scenario marked on the picture never happens and I can't read data.

Would I have to manually write register by register of I2C to make such a function that firstly sends data, and then immediately receives data?

Or is there any solution for that, which I haven't heard of?

Thanks

1 REPLY 1
Amel NASRI
ST Employee

Hello @JZida.1​ ,

If I understand you well, you want to manage properly the repeated start conditions using HAL driver.

In that case, you have to use the dedicated functions for sequential transfer with relevant options (XferOptions).

The available functions in the I2C HAL driver are (for master mode):

  • HAL_I2C_Master_Seq_Transmit_IT
  • HAL_I2C_Master_Seq_Transmit_DMA
  • HAL_I2C_Master_Seq_Receive_IT
  • HAL_I2C_Master_Seq_Receive_DMA

You need to look to the comments of each API in order to know more about the possible XferOptions.

Does this answer your request?

-Amel

PS: Once your question is answered, please click on "Select as Best" for the comment containing the answer to your initial request.

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.